ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 99 of file class.ilCloudPluginSettingsGUI.php.

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

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 {
50 $this->initSettingsForm();
51 $this->getSettingsValues();
52 $tpl->setContent($this->form->getHTML());
53 } catch (Exception $e)
54 {
55 ilUtil::sendFailure($e->getMessage());
56 }
57 }
global $tpl
Definition: ilias.php:8
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 113 of file class.ilCloudPluginSettingsGUI.php.

114 {
115 return true;
116 }

Referenced by createPluginSection().

+ Here is the caller graph for this function:

◆ getPluginSettingsValues()

ilCloudPluginSettingsGUI::getPluginSettingsValues ( $values)
protected

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

132{}

Referenced by getSettingsValues().

+ Here is the caller graph for this function:

◆ getSettingsValues()

ilCloudPluginSettingsGUI::getSettingsValues ( )

Get values for edit Settings form.

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

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

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 111 of file class.ilCloudPluginSettingsGUI.php.

111{}

Referenced by initSettingsForm().

+ Here is the caller graph for this function:

◆ initSettingsForm()

ilCloudPluginSettingsGUI::initSettingsForm ( )

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

60 {
61 global $DIC;
62 $ilCtrl = $DIC['ilCtrl'];
63 $lng = $DIC['lng'];
64
65 $this->form = new ilPropertyFormGUI();
66
67 // title
68 $ti = new ilTextInputGUI($lng->txt("title"), "title");
69 $ti->setRequired(true);
70 $this->form->addItem($ti);
71
72 // description
73 $ta = new ilTextAreaInputGUI($lng->txt("description"), "desc");
74 $this->form->addItem($ta);
75
76 // online
77 $cb = new ilCheckboxInputGUI($lng->txt("online"), "online");
78 $this->form->addItem($cb);
79
80 $folder = new ilTextInputGUI($lng->txt("cld_root_folder"), "root_folder");
81 if(!$this->cloud_object->currentUserIsOwner())
82 {
83 $folder->setDisabled(true);
84 $folder->setInfo($lng->txt("cld_only_owner_has_permission_to_change_root_path"));
85 }
86
87 $folder->setMaxLength(255);
88 $folder->setSize(50);
89 $this->form->addItem($folder);
90
91 $this->createPluginSection();
92 $this->initPluginSettings();
93
94 $this->form->addCommandButton("updateSettings", $lng->txt("save"));
95
96 $this->form->setTitle($lng->txt("cld_edit_Settings"));
97 $this->form->setFormAction($ilCtrl->getFormActionByClass("ilCloudPluginSettingsGUI"));
98 }
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 173 of file class.ilCloudPluginSettingsGUI.php.

173{}

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 {
148 $this->initSettingsForm();
149 if ($this->form->checkInput())
150 {
151 $this->cloud_object->setTitle($this->form->getInput("title"));
152 $this->cloud_object->setDescription($this->form->getInput("desc"));
153 $this->updatePluginSettings();
154 if (ilCloudUtil::normalizePath($this->form->getInput("root_folder")) != $this->cloud_object->getRootFolder())
155 {
156 $this->cloud_object->setRootFolder($this->form->getInput("root_folder"));
157 $this->cloud_object->setRootId($this->getService()->getRootId($this->cloud_object->getRootFolder()));
158 }
159
160 $this->cloud_object->setOnline($this->form->getInput("online"));
161 $this->cloud_object->update();
162 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
163 $ilCtrl->redirect($this, 'editSettings');
164 }
165 } catch (Exception $e)
166 {
167 ilUtil::sendFailure($e->getMessage());
168 }
169
170 $this->form->setValuesByPost();
171 $tpl->setContent($this->form->getHtml());
172 }
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: