ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilCloudPluginSettingsGUI Class Reference

Class ilCloudPluginSettingsGUI. More...

+ Inheritance diagram for ilCloudPluginSettingsGUI:
+ Collaboration diagram for ilCloudPluginSettingsGUI:

Public Member Functions

 setCloudObject (ilObjCloud $object)
 
 editSettings ()
 Edit Settings. More...
 
 initSettingsForm ()
 
 getSettingsValues ()
 Get values for edit Settings form. More...
 
 updateSettings ()
 Update Settings. More...
 
- Public Member Functions inherited from ilCloudPluginGUI
 __construct ($plugin_service_class)
 
 getPluginObject ()
 
 getPluginHookObject ()
 
 getAdminConfigObject ()
 
 getService ()
 
 txt ($var="")
 
 executeCommand ()
 

Protected Member Functions

 createPluginSection ()
 
 initPluginSettings ()
 
 getMakeOwnPluginSection ()
 
 getPluginSettingsValues (&$values)
 
 updatePluginSettings ()
 

Protected Attributes

 $cloud_object
 
 $form
 
- Protected Attributes inherited from ilCloudPluginGUI
 $service = null
 

Detailed Description

Class ilCloudPluginSettingsGUI.

Base class for the settings. Needs to be overwritten if the plugin needs custom settings.

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id:

Definition at line 18 of file class.ilCloudPluginSettingsGUI.php.

Member Function Documentation

◆ createPluginSection()

ilCloudPluginSettingsGUI::createPluginSection ( )
protected

Definition at line 96 of file class.ilCloudPluginSettingsGUI.php.

97 {
98 if (get_class($this) != "ilCloudPluginSettingsGUI" && $this->getMakeOwnPluginSection()) {
99 global $DIC;
100 $lng = $DIC['lng'];
102 $section->setTitle($this->cloud_object->getServiceName() . " " . $lng->txt("cld_service_specific_settings"));
103 $this->form->addItem($section);
104 }
105 }
$section
Definition: Utf8Test.php:83
This class represents a section header in a property form.
global $lng
Definition: privfeed.php:17
global $DIC
Definition: saml.php:7

References $DIC, $lng, $section, and getMakeOwnPluginSection().

Referenced by initSettingsForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ editSettings()

ilCloudPluginSettingsGUI::editSettings ( )

Edit Settings.

This commands uses the form class to display an input form.

Definition at line 39 of file class.ilCloudPluginSettingsGUI.php.

40 {
41 global $DIC;
42 $tpl = $DIC['tpl'];
43 $ilTabs = $DIC['ilTabs'];
44 $lng = $DIC['lng'];
45
46 $ilTabs->activateTab("settings");
47
48 try {
49 $this->initSettingsForm();
50 $this->getSettingsValues();
51 $tpl->setContent($this->form->getHTML());
52 } catch (Exception $e) {
53 ilUtil::sendFailure($e->getMessage());
54 }
55 }
$tpl
Definition: ilias.php:10
getSettingsValues()
Get values for edit Settings form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.

References $DIC, $lng, $tpl, getSettingsValues(), initSettingsForm(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ getMakeOwnPluginSection()

ilCloudPluginSettingsGUI::getMakeOwnPluginSection ( )
protected

Definition at line 111 of file class.ilCloudPluginSettingsGUI.php.

112 {
113 return true;
114 }

Referenced by createPluginSection().

+ Here is the caller graph for this function:

◆ getPluginSettingsValues()

ilCloudPluginSettingsGUI::getPluginSettingsValues ( $values)
protected

Definition at line 130 of file class.ilCloudPluginSettingsGUI.php.

131 {
132 }

Referenced by getSettingsValues().

+ Here is the caller graph for this function:

◆ getSettingsValues()

ilCloudPluginSettingsGUI::getSettingsValues ( )

Get values for edit Settings form.

Definition at line 119 of file class.ilCloudPluginSettingsGUI.php.

120 {
121 $values["title"] = $this->cloud_object->getTitle();
122 $values["desc"] = $this->cloud_object->getDescription();
123 $values["online"] = $this->cloud_object->getOnline();
124 $values["root_folder"] = $this->cloud_object->getRootFolder();
125 $this->getPluginSettingsValues($values);
126 $this->form->setValuesByArray($values);
127 }

References getPluginSettingsValues().

Referenced by editSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initPluginSettings()

ilCloudPluginSettingsGUI::initPluginSettings ( )
protected

Definition at line 107 of file class.ilCloudPluginSettingsGUI.php.

108 {
109 }

Referenced by initSettingsForm().

+ Here is the caller graph for this function:

◆ initSettingsForm()

ilCloudPluginSettingsGUI::initSettingsForm ( )

Definition at line 57 of file class.ilCloudPluginSettingsGUI.php.

58 {
59 global $DIC;
60 $ilCtrl = $DIC['ilCtrl'];
61 $lng = $DIC['lng'];
62
63 $this->form = new ilPropertyFormGUI();
64
65 // title
66 $ti = new ilTextInputGUI($lng->txt("title"), "title");
67 $ti->setRequired(true);
68 $this->form->addItem($ti);
69
70 // description
71 $ta = new ilTextAreaInputGUI($lng->txt("description"), "desc");
72 $this->form->addItem($ta);
73
74 // online
75 $cb = new ilCheckboxInputGUI($lng->txt("online"), "online");
76 $this->form->addItem($cb);
77
78 $folder = new ilTextInputGUI($lng->txt("cld_root_folder"), "root_folder");
79 if (!$this->cloud_object->currentUserIsOwner()) {
80 $folder->setDisabled(true);
81 $folder->setInfo($lng->txt("cld_only_owner_has_permission_to_change_root_path"));
82 }
83
84 $folder->setMaxLength(255);
85 $folder->setSize(50);
86 $this->form->addItem($folder);
87
88 $this->createPluginSection();
89 $this->initPluginSettings();
90
91 $this->form->addCommandButton("updateSettings", $lng->txt("save"));
92
93 $this->form->setTitle($lng->txt("cld_edit_Settings"));
94 $this->form->setFormAction($ilCtrl->getFormActionByClass("ilCloudPluginSettingsGUI"));
95 }
This class represents a checkbox property in a property form.
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.
global $ilCtrl
Definition: ilias.php:18

References $DIC, $ilCtrl, $lng, createPluginSection(), and initPluginSettings().

Referenced by editSettings(), and updateSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setCloudObject()

ilCloudPluginSettingsGUI::setCloudObject ( ilObjCloud  $object)

Definition at line 31 of file class.ilCloudPluginSettingsGUI.php.

32 {
33 $this->cloud_object = $object;
34 }

◆ updatePluginSettings()

ilCloudPluginSettingsGUI::updatePluginSettings ( )
protected

Definition at line 169 of file class.ilCloudPluginSettingsGUI.php.

170 {
171 }

Referenced by updateSettings().

+ Here is the caller graph for this function:

◆ updateSettings()

ilCloudPluginSettingsGUI::updateSettings ( )

Update Settings.

Definition at line 136 of file class.ilCloudPluginSettingsGUI.php.

137 {
138 global $DIC;
139 $tpl = $DIC['tpl'];
140 $lng = $DIC['lng'];
141 $ilCtrl = $DIC['ilCtrl'];
142 $ilTabs = $DIC['ilTabs'];
143
144 $ilTabs->activateTab("settings");
145
146 try {
147 $this->initSettingsForm();
148 if ($this->form->checkInput()) {
149 $this->cloud_object->setTitle($this->form->getInput("title"));
150 $this->cloud_object->setDescription($this->form->getInput("desc"));
151 $this->updatePluginSettings();
152 if (ilCloudUtil::normalizePath($this->form->getInput("root_folder")) != $this->cloud_object->getRootFolder()) {
153 $this->cloud_object->setRootFolder($this->form->getInput("root_folder"));
154 $this->cloud_object->setRootId($this->getService()->getRootId($this->cloud_object->getRootFolder()));
155 }
156
157 $this->cloud_object->setOnline($this->form->getInput("online"));
158 $this->cloud_object->update();
159 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
160 $ilCtrl->redirect($this, 'editSettings');
161 }
162 } catch (Exception $e) {
163 ilUtil::sendFailure($e->getMessage());
164 }
165
166 $this->form->setValuesByPost();
167 $tpl->setContent($this->form->getHtml());
168 }
static normalizePath($path)
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References $DIC, $ilCtrl, $lng, $tpl, ilCloudPluginGUI\getService(), initSettingsForm(), ilCloudUtil\normalizePath(), ilUtil\sendFailure(), ilUtil\sendSuccess(), and updatePluginSettings().

+ Here is the call graph for this function:

Field Documentation

◆ $cloud_object

ilCloudPluginSettingsGUI::$cloud_object
protected

Definition at line 23 of file class.ilCloudPluginSettingsGUI.php.

◆ $form

ilCloudPluginSettingsGUI::$form
protected

Definition at line 28 of file class.ilCloudPluginSettingsGUI.php.


The documentation for this class was generated from the following file: