ILIAS  release_7 Revision v7.30-3-g800a261c036
ilCloudPluginSettingsGUI Class Reference

Class ilCloudPluginSettingsGUI. More...

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

Public Member Functions

 __construct ($plugin_service_class)
 ilCloudPluginSettingsGUI constructor. More...
 
 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 ()
 
 initPresentationSection ()
 
 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 16 of file class.ilCloudPluginSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilCloudPluginSettingsGUI::__construct (   $plugin_service_class)

ilCloudPluginSettingsGUI constructor.

Parameters
$plugin_service_class

Reimplemented from ilCloudPluginGUI.

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

35 {
36 global $DIC;
37 parent::__construct($plugin_service_class);
38
39 $DIC->language()->loadLanguageModule('content');
40 $DIC->language()->loadLanguageModule('obj');
41 $DIC->language()->loadLanguageModule('cntr');
42 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ createPluginSection()

ilCloudPluginSettingsGUI::createPluginSection ( )
protected

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

125 {
126 if (get_class($this) != "ilCloudPluginSettingsGUI" && $this->getMakeOwnPluginSection()) {
127 global $DIC;
128 $lng = $DIC['lng'];
130 $section->setTitle($this->cloud_object->getServiceName() . " " . $lng->txt("cld_service_specific_settings"));
131 $this->form->addItem($section);
132 }
133 }
$section
Definition: Utf8Test.php:83
This class represents a section header in a property form.
$lng

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

58 {
59 global $DIC;
60 $tpl = $DIC['tpl'];
61 $ilTabs = $DIC['ilTabs'];
62
63 $ilTabs->activateTab("settings");
64
65 try {
66 $this->initSettingsForm();
67 $this->getSettingsValues();
68 $tpl->setContent($this->form->getHTML());
69 } catch (Exception $e) {
70 ilUtil::sendFailure($e->getMessage());
71 }
72 }
getSettingsValues()
Get values for edit Settings form.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41

References $DIC, Vendor\Package\$e, $tpl, getSettingsValues(), initSettingsForm(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ getMakeOwnPluginSection()

ilCloudPluginSettingsGUI::getMakeOwnPluginSection ( )
protected
Returns
bool

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

161 {
162 return true;
163 }

Referenced by createPluginSection().

+ Here is the caller graph for this function:

◆ getPluginSettingsValues()

ilCloudPluginSettingsGUI::getPluginSettingsValues ( $values)
protected
Parameters
$values

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

184 {
185 }

Referenced by getSettingsValues().

+ Here is the caller graph for this function:

◆ getSettingsValues()

ilCloudPluginSettingsGUI::getSettingsValues ( )

Get values for edit Settings form.

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

170 {
171 $values["title"] = $this->cloud_object->getTitle();
172 $values["desc"] = $this->cloud_object->getDescription();
173 $values["online"] = $this->cloud_object->getOnline();
174 $values["root_folder"] = $this->cloud_object->getRootFolder();
175 $this->getPluginSettingsValues($values);
176 $this->form->setValuesByArray($values, true);
177 }

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

140 {
141 }

Referenced by initSettingsForm().

+ Here is the caller graph for this function:

◆ initPresentationSection()

ilCloudPluginSettingsGUI::initPresentationSection ( )
protected

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

148 {
149 global $DIC;
150 $section_appearance = new ilFormSectionHeaderGUI();
151 $section_appearance->setTitle($DIC->language()->txt('cont_presentation'));
152 $this->form->addItem($section_appearance);
153 $DIC->object()->commonSettings()->legacyForm($this->form, $this->cloud_object)->addTileImage();
154 }

References $DIC.

Referenced by initSettingsForm(), and updateSettings().

+ Here is the caller graph for this function:

◆ initSettingsForm()

ilCloudPluginSettingsGUI::initSettingsForm ( )

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

79 {
80 global $DIC;
81 $ilCtrl = $DIC['ilCtrl'];
82 $lng = $DIC['lng'];
83
84 $this->form = new ilPropertyFormGUI();
85
86 // title
87 $ti = new ilTextInputGUI($lng->txt("title"), "title");
88 $ti->setRequired(true);
89 $this->form->addItem($ti);
90
91 // description
92 $ta = new ilTextAreaInputGUI($lng->txt("description"), "desc");
93 $this->form->addItem($ta);
94
95 // online
96 $cb = new ilCheckboxInputGUI($lng->txt("online"), "online");
97 $this->form->addItem($cb);
98
99 $folder = new ilTextInputGUI($lng->txt("cld_root_folder"), "root_folder");
100 if (!$this->cloud_object->currentUserIsOwner()) {
101 $folder->setDisabled(true);
102 $folder->setInfo($lng->txt("cld_only_owner_has_permission_to_change_root_path"));
103 }
104
105 $folder->setMaxLength(255);
106 $folder->setSize(50);
107 $this->form->addItem($folder);
108
109 $this->createPluginSection();
110 $this->initPluginSettings();
111
113
114 $this->form->addCommandButton("updateSettings", $lng->txt("save"));
115
116 $this->form->setTitle($lng->txt("cld_edit_Settings"));
117 $this->form->setFormAction($ilCtrl->getFormActionByClass("ilCloudPluginSettingsGUI"));
118 }
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.

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

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)
Parameters
ilObjCloud$object

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

49 {
50 $this->cloud_object = $object;
51 }

◆ updatePluginSettings()

ilCloudPluginSettingsGUI::updatePluginSettings ( )
protected

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

234 {
235 }

Referenced by updateSettings().

+ Here is the caller graph for this function:

◆ updateSettings()

ilCloudPluginSettingsGUI::updateSettings ( )

Update Settings.

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

192 {
193 global $DIC;
194 $tpl = $DIC['tpl'];
195 $lng = $DIC['lng'];
196 $ilCtrl = $DIC['ilCtrl'];
197 $ilTabs = $DIC['ilTabs'];
198
199 $ilTabs->activateTab("settings");
200
201 try {
202 $this->initSettingsForm();
204 if ($this->form->checkInput()) {
205 $this->cloud_object->setTitle($this->form->getInput("title"));
206 $this->cloud_object->setDescription($this->form->getInput("desc"));
207 $this->updatePluginSettings();
208 if (ilCloudUtil::normalizePath($this->form->getInput("root_folder")) != $this->cloud_object->getRootFolder()) {
209 $this->cloud_object->setRootFolder($this->form->getInput("root_folder"));
210 $this->cloud_object->setRootId($this->getService()->getRootId($this->cloud_object->getRootFolder()));
211 }
212
213 $this->cloud_object->setOnline($this->form->getInput("online"));
214 $this->cloud_object->update();
215
216 $DIC->object()->commonSettings()->legacyForm($this->form, $this->cloud_object)->saveTileImage();
217
218 ilUtil::sendSuccess($lng->txt("msg_obj_modified"), true);
219 $ilCtrl->redirect($this, 'editSettings');
220 }
221 } catch (Exception $e) {
222 ilUtil::sendFailure($e->getMessage());
223 }
224
225 $this->form->setValuesByPost();
226 $tpl->setContent($this->form->getHtml());
227 }
static normalizePath($path)

References $DIC, Vendor\Package\$e, $lng, $tpl, ilCloudPluginGUI\getService(), initPresentationSection(), initSettingsForm(), ilCloudUtil\normalizePath(), ilUtil\sendFailure(), and updatePluginSettings().

+ Here is the call graph for this function:

Field Documentation

◆ $cloud_object

ilCloudPluginSettingsGUI::$cloud_object
protected

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

◆ $form

ilCloudPluginSettingsGUI::$form
protected

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


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