ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilCloudPluginConfigGUI Class Reference

Class ilCloudPluginConfigGUI. More...

+ Inheritance diagram for ilCloudPluginConfigGUI:
+ Collaboration diagram for ilCloudPluginConfigGUI:

Public Member Functions

 getFields ()
 
 getTableName ()
 
 getObject ()
 
 performCommand ($cmd)
 Handles all commmands, default is "configure". More...
 
 configure ()
 Configure screen. More...
 
 getValues ()
 
 initConfigurationForm ()
 
 save ()
 
- Public Member Functions inherited from ilPluginConfigGUI
 setPluginObject ($a_val)
 Set plugin object. More...
 
 getPluginObject ()
 Get plugin object. More...
 
 executeCommand ()
 Execute command. More...
 
 performCommand ($cmd)
 

Protected Attributes

 $object
 
 $fields = array()
 
- Protected Attributes inherited from ilPluginConfigGUI
 $plugin_object = null
 

Detailed Description

Class ilCloudPluginConfigGUI.

GUI class for the administration settings. Plugin classes can extend this method and override getFields to declare the fields needed for the input of the settings.

public function getFields() { return array( "app_name" => array("type" => "ilTextInputGUI", "info" => "config_info_app_name", "subelements" => null), ); }

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 26 of file class.ilCloudPluginConfigGUI.php.

Member Function Documentation

◆ configure()

ilCloudPluginConfigGUI::configure ( )

Configure screen.

Definition at line 84 of file class.ilCloudPluginConfigGUI.php.

References $DIC, $tpl, getValues(), and initConfigurationForm().

85  {
86  global $DIC;
87  $tpl = $DIC['tpl'];
88 
89  $this->initConfigurationForm();
90  $this->getValues();
91  $tpl->setContent($this->form->getHTML());
92  }
global $tpl
Definition: ilias.php:8
global $DIC
+ Here is the call graph for this function:

◆ getFields()

ilCloudPluginConfigGUI::getFields ( )
Returns
array

Definition at line 41 of file class.ilCloudPluginConfigGUI.php.

Referenced by performCommand().

42  {
43  return null;
44  }
+ Here is the caller graph for this function:

◆ getObject()

ilCloudPluginConfigGUI::getObject ( )
Returns
ilCloudPluginConfig

Definition at line 58 of file class.ilCloudPluginConfigGUI.php.

References $object.

◆ getTableName()

ilCloudPluginConfigGUI::getTableName ( )
Returns
string

Definition at line 50 of file class.ilCloudPluginConfigGUI.php.

References ilPluginConfigGUI\getPluginObject().

Referenced by performCommand().

51  {
52  return $this->getPluginObject()->getPrefix() . "_config";
53  }
getPluginObject()
Get plugin object.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getValues()

ilCloudPluginConfigGUI::getValues ( )

Definition at line 94 of file class.ilCloudPluginConfigGUI.php.

References fields.

Referenced by configure().

95  {
96  foreach ($this->fields as $key => $item)
97  {
98 
99  $values[$key] = $this->object->getValue($key);
100  if (is_array($item["subelements"]))
101  {
102  foreach ($item["subelements"] as $subkey => $subitem)
103  {
104  $values[$key . "_" . $subkey] = $this->object->getValue($key . "_" . $subkey);
105  }
106  }
107 
108  }
109 
110  $this->form->setValuesByArray($values);
111  }
$errors fields
Definition: imgupload.php:52
+ Here is the caller graph for this function:

◆ initConfigurationForm()

ilCloudPluginConfigGUI::initConfigurationForm ( )
Returns
ilPropertyFormGUI

Definition at line 116 of file class.ilCloudPluginConfigGUI.php.

References $DIC, $ilCtrl, $lng, and fields.

Referenced by configure(), and save().

117  {
118  global $DIC;
119  $lng = $DIC['lng'];
120  $ilCtrl = $DIC['ilCtrl'];
121 
122  include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
123  $this->form = new ilPropertyFormGUI();
124 
125  foreach ($this->fields as $key => $item)
126  {
127  $field = new $item["type"]($this->plugin_object->txt($key), $key);
128  $field->setInfo($this->plugin_object->txt($item["info"]));
129  if (is_array($item["subelements"]))
130  {
131  foreach ($item["subelements"] as $subkey => $subitem)
132  {
133  $subfield = new $subitem["type"]($this->plugin_object->txt($key . "_" . $subkey), $key . "_" . $subkey);
134  $subfield->setInfo($this->plugin_object->txt($subitem["info"]));
135  $field->addSubItem($subfield);
136  }
137  }
138 
139  $this->form->addItem($field);
140  }
141 
142  $this->form->addCommandButton("save", $lng->txt("save"));
143 
144  $this->form->setTitle($this->plugin_object->txt("configuration"));
145  $this->form->setFormAction($ilCtrl->getFormAction($this));
146 
147  return $this->form;
148  }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
$errors fields
Definition: imgupload.php:52
global $lng
Definition: privfeed.php:17
global $DIC
+ Here is the caller graph for this function:

◆ performCommand()

ilCloudPluginConfigGUI::performCommand (   $cmd)

Handles all commmands, default is "configure".

Definition at line 66 of file class.ilCloudPluginConfigGUI.php.

References $cmd, fields, getFields(), and getTableName().

67  {
68  include_once("class.ilCloudPluginConfig.php");
69  $this->object = new ilCloudPluginConfig($this->getTableName());
70  $this->fields = $this->getFields();
71  switch ($cmd)
72  {
73  case "configure":
74  case "save":
75  $this->$cmd();
76  break;
77 
78  }
79  }
$cmd
Definition: sahs_server.php:35
$errors fields
Definition: imgupload.php:52
Class ilCloudPluginConfig.
+ Here is the call graph for this function:

◆ save()

ilCloudPluginConfigGUI::save ( )

Definition at line 150 of file class.ilCloudPluginConfigGUI.php.

References $DIC, $ilCtrl, $tpl, fields, and initConfigurationForm().

151  {
152  global $DIC;
153  $tpl = $DIC['tpl'];
154  $ilCtrl = $DIC['ilCtrl'];
155 
156  $this->initConfigurationForm();
157  if ($this->form->checkInput())
158  {
159 
160  // Save Checkbox Values
161  foreach ($this->fields as $key => $item)
162  {
163 
164  $this->object->setValue($key, $this->form->getInput($key));
165  if (is_array($item["subelements"]))
166  {
167  foreach ($item["subelements"] as $subkey => $subitem)
168  {
169  $this->object->setValue($key . "_" . $subkey, $this->form->getInput($key . "_" . $subkey));
170  }
171  }
172 
173  }
174 
175  $ilCtrl->redirect($this, "configure");
176  } else
177  {
178  $this->form->setValuesByPost();
179  $tpl->setContent($this->form->getHtml());
180  }
181  }
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
$errors fields
Definition: imgupload.php:52
global $DIC
+ Here is the call graph for this function:

Field Documentation

◆ $fields

ilCloudPluginConfigGUI::$fields = array()
protected

Definition at line 36 of file class.ilCloudPluginConfigGUI.php.

◆ $object

ilCloudPluginConfigGUI::$object
protected

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

Referenced by getObject().


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