ILIAS  release_4-4 Revision
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 $tpl, getValues(), and initConfigurationForm().

85  {
86  global $tpl;
87 
88  $this->initConfigurationForm();
89  $this->getValues();
90  $tpl->setContent($this->form->getHTML());
91  }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ 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 93 of file class.ilCloudPluginConfigGUI.php.

References fields.

Referenced by configure().

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

◆ initConfigurationForm()

ilCloudPluginConfigGUI::initConfigurationForm ( )
Returns
ilPropertyFormGUI

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

References $ilCtrl, $lng, and fields.

Referenced by configure(), and save().

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

◆ save()

ilCloudPluginConfigGUI::save ( )

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

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

148  {
149  global $tpl, $ilCtrl;
150 
151  $this->initConfigurationForm();
152  if ($this->form->checkInput())
153  {
154 
155  // Save Checkbox Values
156  foreach ($this->fields as $key => $item)
157  {
158 
159  $this->object->setValue($key, $this->form->getInput($key));
160  if (is_array($item["subelements"]))
161  {
162  foreach ($item["subelements"] as $subkey => $subitem)
163  {
164  $this->object->setValue($key . "_" . $subkey, $this->form->getInput($key . "_" . $subkey));
165  }
166  }
167 
168  }
169 
170  $ilCtrl->redirect($this, "configure");
171  } else
172  {
173  $this->form->setValuesByPost();
174  $tpl->setContent($this->form->getHtml());
175  }
176  }
global $ilCtrl
Definition: ilias.php:18
$errors fields
Definition: imgupload.php:47
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ 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: