ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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 94 of file class.ilCloudPluginSettingsGUI.php.

95 {
96 if(get_class($this) != "ilCloudPluginSettingsGUI" && $this->getMakeOwnPluginSection())
97 {
98 global $lng;
100 $section->setTitle($this->cloud_object->getServiceName()." ".$lng->txt("cld_service_specific_settings"));
101 $this->form->addItem($section);
102 }
103 }
$section
Definition: Utf8Test.php:84
This class represents a section header in a property form.
global $lng
Definition: privfeed.php:40

References $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 $tpl, $ilTabs, $lng;
42
43 $ilTabs->activateTab("settings");
44
45 try
46 {
47 $this->initSettingsForm();
48 $this->getSettingsValues();
49 $tpl->setContent($this->form->getHTML());
50 } catch (Exception $e)
51 {
52 ilUtil::sendFailure($e->getMessage());
53 }
54 }
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 $lng, $tpl, getSettingsValues(), initSettingsForm(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ getMakeOwnPluginSection()

ilCloudPluginSettingsGUI::getMakeOwnPluginSection ( )
protected

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

108 {
109 return true;
110 }

Referenced by createPluginSection().

+ Here is the caller graph for this function:

◆ getPluginSettingsValues()

ilCloudPluginSettingsGUI::getPluginSettingsValues ( $values)
protected

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

126{}

Referenced by getSettingsValues().

+ Here is the caller graph for this function:

◆ getSettingsValues()

ilCloudPluginSettingsGUI::getSettingsValues ( )

Get values for edit Settings form.

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

116 {
117 $values["title"] = $this->cloud_object->getTitle();
118 $values["desc"] = $this->cloud_object->getDescription();
119 $values["online"] = $this->cloud_object->getOnline();
120 $values["root_folder"] = $this->cloud_object->getRootFolder();
121 $this->getPluginSettingsValues($values);
122 $this->form->setValuesByArray($values);
123 }

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

105{}

Referenced by initSettingsForm().

+ Here is the caller graph for this function:

◆ initSettingsForm()

ilCloudPluginSettingsGUI::initSettingsForm ( )

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

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

163{}

Referenced by updateSettings().

+ Here is the caller graph for this function:

◆ updateSettings()

ilCloudPluginSettingsGUI::updateSettings ( )

Update Settings.

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

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

References $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: