ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
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

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

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

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  }
__construct(Container $dic, ilPlugin $plugin)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

Member Function Documentation

◆ createPluginSection()

ilCloudPluginSettingsGUI::createPluginSection ( )
protected

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

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

Referenced by initSettingsForm().

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  }
This class represents a section header in a property form.
$section
Definition: Utf8Test.php:83
$lng
$DIC
Definition: xapitoken.php:46
+ 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.

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

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  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
getSettingsValues()
Get values for edit Settings form.
+ Here is the call graph for this function:

◆ getMakeOwnPluginSection()

ilCloudPluginSettingsGUI::getMakeOwnPluginSection ( )
protected
Returns
bool

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

Referenced by createPluginSection().

161  {
162  return true;
163  }
+ Here is the caller graph for this function:

◆ getPluginSettingsValues()

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

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

Referenced by getSettingsValues().

184  {
185  }
+ 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.

References getPluginSettingsValues().

Referenced by editSettings().

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  }
+ 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.

Referenced by initSettingsForm().

140  {
141  }
+ Here is the caller graph for this function:

◆ initPresentationSection()

ilCloudPluginSettingsGUI::initPresentationSection ( )
protected

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

References $DIC.

Referenced by initSettingsForm(), and updateSettings().

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  }
This class represents a section header in a property form.
$DIC
Definition: xapitoken.php:46
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilCloudPluginSettingsGUI::initSettingsForm ( )

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

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

Referenced by editSettings(), and updateSettings().

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 
112  $this->initPresentationSection();
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 property form user interface.
This class represents a checkbox property in a property form.
global $ilCtrl
Definition: ilias.php:18
$lng
This class represents a text area property in a property form.
$DIC
Definition: xapitoken.php:46
+ 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.

Referenced by updateSettings().

234  {
235  }
+ Here is the caller graph for this function:

◆ updateSettings()

ilCloudPluginSettingsGUI::updateSettings ( )

Update Settings.

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

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

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();
203  $this->initPresentationSection();
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  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $ilCtrl
Definition: ilias.php:18
$lng
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
static normalizePath($path)
+ 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: