ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
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 25 of file class.ilCloudPluginConfigGUI.php.

Member Function Documentation

◆ configure()

ilCloudPluginConfigGUI::configure ( )

Configure screen.

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

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

86  {
87  global $DIC;
88  $tpl = $DIC['tpl'];
89 
90  $this->initConfigurationForm();
91  $this->getValues();
92  $tpl->setContent($this->form->getHTML());
93  }
global $DIC
Definition: goto.php:24
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ 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 59 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 96 of file class.ilCloudPluginConfigGUI.php.

References fields.

Referenced by configure().

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

◆ initConfigurationForm()

ilCloudPluginConfigGUI::initConfigurationForm ( )
Returns
ilPropertyFormGUI

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

References $DIC, $lng, and fields.

Referenced by configure(), and save().

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

◆ performCommand()

ilCloudPluginConfigGUI::performCommand (   $cmd)

Handles all commmands, default is "configure".

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

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

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

◆ save()

ilCloudPluginConfigGUI::save ( )

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

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

147  {
148  global $DIC;
149  $tpl = $DIC['tpl'];
150  $ilCtrl = $DIC['ilCtrl'];
151 
152  $this->initConfigurationForm();
153  if ($this->form->checkInput()) {
154 
155  // Save Checkbox Values
156  foreach ($this->fields as $key => $item) {
157  $this->object->setValue($key, $this->form->getInput($key));
158  if (is_array($item["subelements"])) {
159  foreach ($item["subelements"] as $subkey => $subitem) {
160  $this->object->setValue($key . "_" . $subkey, $this->form->getInput($key . "_" . $subkey));
161  }
162  }
163  }
164 
165  $ilCtrl->redirect($this, "configure");
166  } else {
167  $this->form->setValuesByPost();
168  $tpl->setContent($this->form->getHtml());
169  }
170  }
$errors fields
Definition: imgupload.php:51
global $DIC
Definition: goto.php:24
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:

Field Documentation

◆ $fields

ilCloudPluginConfigGUI::$fields = array()
protected

Definition at line 35 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: