]> git.sur5r.net Git - bacula/bacula/blobdiff - gui/baculum/protected/Portlets/StorageConfiguration.php
baculum: Assign Baculum copyright to Kern Sibbald
[bacula/bacula] / gui / baculum / protected / Portlets / StorageConfiguration.php
index ae9eb7b6daa01b1c3449fe263bf13c22af1e33e8..02c50b7460eedbd653d57af59c5fb9e13ddc7540 100644 (file)
@@ -1,87 +1,84 @@
-<?php\r
-/**\r
- * Bacula® - The Network Backup Solution\r
- * Baculum - Bacula web interface\r
- *\r
- * Copyright (C) 2013-2014 Marcin Haba\r
- *\r
- * The main author of Baculum is Marcin Haba.\r
- * The main author of Bacula is Kern Sibbald, with contributions from many\r
- * others, a complete list can be found in the file AUTHORS.\r
- *\r
- * You may use this file and others of this release according to the\r
- * license defined in the LICENSE file, which includes the Affero General\r
- * Public License, v3.0 ("AGPLv3") and some additional permissions and\r
- * terms pursuant to its AGPLv3 Section 7.\r
- *\r
- * Bacula® is a registered trademark of Kern Sibbald.\r
- */\r
\r
-Prado::using('System.Web.UI.ActiveControls.TActiveCustomValidator');\r
-Prado::using('Application.Portlets.Portlets');\r
-\r
+<?php
+/*
+ * Bacula(R) - The Network Backup Solution
+ * Baculum   - Bacula web interface
+ *
+ * Copyright (C) 2013-2016 Kern Sibbald
+ *
+ * The main author of Baculum is Marcin Haba.
+ * The original author of Bacula is Kern Sibbald, with contributions
+ * from many others, a complete list can be found in the file AUTHORS.
+ *
+ * You may use this file and others of this release according to the
+ * license defined in the LICENSE file, which includes the Affero General
+ * Public License, v3.0 ("AGPLv3") and some additional permissions and
+ * terms pursuant to its AGPLv3 Section 7.
+ *
+ * This notice must be preserved when any source code is
+ * conveyed and/or propagated.
+ *
+ * Bacula(R) is a registered trademark of Kern Sibbald.
+ */
+
+Prado::using('System.Web.UI.ActiveControls.TActiveCustomValidator');
+Prado::using('Application.Portlets.Portlets');
+
 class StorageConfiguration extends Portlets {
-\r
-       public function onInit($param) {
-               parent::onInit($param);\r
-               $this->Mount->setActionClass($this);\r
-               $this->Release->setActionClass($this);\r
-               $this->Umount->setActionClass($this);\r
-               $this->Status->setActionClass($this);\r
-       }\r
-\r
-       public function configure($storageId) {\r
-               $storagedata = $this->Application->getModule('api')->get(array('storages', 'show', $storageId))->output;\r
-               $this->ShowStorage->Text = implode(PHP_EOL, $storagedata);\r
-               $storage = $this->Application->getModule('api')->get(array('storages', $storageId))->output;\r
-               $this->StorageName->Text = $storage->name;\r
-               $this->StorageID->Text = $storage->storageid;\r
-               $this->AutoChanger->Visible = (boolean)$storage->autochanger;\r
-       }\r
-\r
-       public function save($sender, $param) {\r
-               $isValid = $this->DriveValidator->IsValid === true && $this->SlotValidator->IsValid === true;\r
-               switch($sender->getParent()->ID) {\r
-                       case $this->Status->ID: {\r
-                               $status = $this->Application->getModule('api')->get(array('storages', 'status', $this->StorageID->Text))->output;\r
-                               $this->ShowStorage->Text = implode(PHP_EOL, $status);\r
-                               break;\r
-                       }\r
-                       case $this->Mount->ID: {\r
-                               if($isValid === false) {\r
-                                       return;\r
-                               }\r
-                               $drive = ($this->AutoChanger->Visible === true) ? intval($this->Drive->Text) : 0;\r
-                               $slot = ($this->AutoChanger->Visible === true) ? intval($this->Slot->Text) : 0;\r
-                               $mount = $this->Application->getModule('api')->get(array('storages', 'mount', $this->StorageID->Text, $drive, $slot))->output;\r
-                               $this->ShowStorage->Text = implode(PHP_EOL, $mount);\r
-                               break;\r
-                       }\r
-                       case $this->Umount->ID: {\r
-                               if($isValid === false) {\r
-                                       return;\r
-                               }\r
-                               $drive = ($this->AutoChanger->Visible === true) ? intval($this->Drive->Text) : 0;\r
-                               $umount = $this->Application->getModule('api')->get(array('storages', 'umount', $this->StorageID->Text, $drive))->output;\r
-                               $this->ShowStorage->Text = implode(PHP_EOL, $umount);\r
-                               break;\r
-                       }\r
-                       case $this->Release->ID: {\r
-                               $release = $this->Application->getModule('api')->get(array('storages', 'release', $this->StorageID->Text))->output;\r
-                               $this->ShowStorage->Text = implode(PHP_EOL, $release);\r
-                               break;\r
-                       }\r
-               }\r
-       }\r
-\r
-       public function driveValidator($sender, $param) {\r
+
+       public function configure($storageId) {
+               $storagedata = $this->Application->getModule('api')->get(array('storages', 'show', $storageId))->output;
+               $this->ShowStorage->Text = implode(PHP_EOL, $storagedata);
+               $storage = $this->Application->getModule('api')->get(array('storages', $storageId))->output;
+               $this->StorageName->Text = $storage->name;
+               $this->StorageID->Text = $storage->storageid;
+               $this->AutoChanger->Visible = (boolean)$storage->autochanger;
+       }
+
+       public function mount($sender, $param) {
+               $isValid = $this->DriveValidator->IsValid === true && $this->SlotValidator->IsValid === true;
+               if($isValid === false) {
+                       return;
+               }
+               $drive = ($this->AutoChanger->Visible === true) ? intval($this->Drive->Text) : 0;
+               $slot = ($this->AutoChanger->Visible === true) ? intval($this->Slot->Text) : 0;
+               $mount = $this->Application->getModule('api')->get(array('storages', 'mount', $this->StorageID->Text, $drive, $slot))->output;
+               $this->ShowStorage->Text = implode(PHP_EOL, $mount);
+       }
+
+       public function umount($sender, $param) {
+               $isValid = $this->DriveValidator->IsValid === true;
+               if($isValid === false) {
+                       return;
+               }
+               $drive = ($this->AutoChanger->Visible === true) ? intval($this->Drive->Text) : 0;
+               $umount = $this->Application->getModule('api')->get(array('storages', 'umount', $this->StorageID->Text, $drive))->output;
+               $this->ShowStorage->Text = implode(PHP_EOL, $umount);
+
+       }
+
+       public function release($sender, $param) {
+               $isValid = $this->DriveValidator->IsValid === true;
+               if($isValid === false) {
+                       return;
+               }
+               $drive = ($this->AutoChanger->Visible === true) ? intval($this->Drive->Text) : 0;
+               $release = $this->Application->getModule('api')->get(array('storages', 'release', $this->StorageID->Text, $drive))->output;
+               $this->ShowStorage->Text = implode(PHP_EOL, $release);
+       }
+
+       public function status($sender, $param) {
+               $status = $this->Application->getModule('api')->get(array('storages', 'status', $this->StorageID->Text))->output;
+               $this->ShowStorage->Text = implode(PHP_EOL, $status);
+       }
+
+       public function driveValidator($sender, $param) {
                $isValid = is_numeric($this->Drive->Text);
                $param->setIsValid($isValid);
-       }\r
-\r
-       public function slotValidator($sender, $param) {\r
-               $isValid = is_numeric($this->Slot->Text);\r
-               $param->setIsValid($isValid);\r
-       }\r
-}\r
-?>
\ No newline at end of file
+       }
+
+       public function slotValidator($sender, $param) {
+               $isValid = is_numeric($this->Slot->Text);
+               $param->setIsValid($isValid);
+       }
+}
+?>