ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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 83 of file class.ilCloudPluginConfigGUI.php.

84 {
85 global $DIC;
86 $tpl = $DIC['tpl'];
87
88 $this->initConfigurationForm();
89 $this->getValues();
90 $tpl->setContent($this->form->getHTML());
91 }
$tpl
Definition: ilias.php:10
global $DIC
Definition: saml.php:7

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

+ Here is the call graph for this function:

◆ getFields()

ilCloudPluginConfigGUI::getFields ( )
Returns
array

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

42 {
43 return null;
44 }

Referenced by performCommand().

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

51 {
52 return $this->getPluginObject()->getPrefix() . "_config";
53 }
getPluginObject()
Get plugin object.

References ilPluginConfigGUI\getPluginObject().

Referenced by performCommand().

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

94 {
95 foreach ($this->fields as $key => $item) {
96 $values[$key] = $this->object->getValue($key);
97 if (is_array($item["subelements"])) {
98 foreach ($item["subelements"] as $subkey => $subitem) {
99 $values[$key . "_" . $subkey] = $this->object->getValue($key . "_" . $subkey);
100 }
101 }
102 }
103
104 $this->form->setValuesByArray($values);
105 }
$key
Definition: croninfo.php:18
$errors fields
Definition: imgupload.php:51

References $key, and fields.

Referenced by configure().

+ Here is the caller graph for this function:

◆ initConfigurationForm()

ilCloudPluginConfigGUI::initConfigurationForm ( )
Returns
ilPropertyFormGUI

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

111 {
112 global $DIC;
113 $lng = $DIC['lng'];
114 $ilCtrl = $DIC['ilCtrl'];
115
116 include_once("./Services/Form/classes/class.ilPropertyFormGUI.php");
117 $this->form = new ilPropertyFormGUI();
118
119 foreach ($this->fields as $key => $item) {
120 $field = new $item["type"]($this->plugin_object->txt($key), $key);
121 $field->setInfo($this->plugin_object->txt($item["info"]));
122 if (is_array($item["subelements"])) {
123 foreach ($item["subelements"] as $subkey => $subitem) {
124 $subfield = new $subitem["type"]($this->plugin_object->txt($key . "_" . $subkey), $key . "_" . $subkey);
125 $subfield->setInfo($this->plugin_object->txt($subitem["info"]));
126 $field->addSubItem($subfield);
127 }
128 }
129
130 $this->form->addItem($field);
131 }
132
133 $this->form->addCommandButton("save", $lng->txt("save"));
134
135 $this->form->setTitle($this->plugin_object->txt("configuration"));
136 $this->form->setFormAction($ilCtrl->getFormAction($this));
137
138 return $this->form;
139 }
This class represents a property form user interface.
global $ilCtrl
Definition: ilias.php:18
global $lng
Definition: privfeed.php:17
if(isset($_POST['submit'])) $form

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

Referenced by configure(), and save().

+ Here is the caller graph for this function:

◆ performCommand()

ilCloudPluginConfigGUI::performCommand (   $cmd)

Handles all commmands, default is "configure".

Reimplemented from ilPluginConfigGUI.

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

67 {
68 include_once("class.ilCloudPluginConfig.php");
69 $this->object = new ilCloudPluginConfig($this->getTableName());
70 $this->fields = $this->getFields();
71 switch ($cmd) {
72 case "configure":
73 case "save":
74 $this->$cmd();
75 break;
76
77 }
78 }
Class ilCloudPluginConfig.

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

+ Here is the call graph for this function:

◆ save()

ilCloudPluginConfigGUI::save ( )

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

142 {
143 global $DIC;
144 $tpl = $DIC['tpl'];
145 $ilCtrl = $DIC['ilCtrl'];
146
147 $this->initConfigurationForm();
148 if ($this->form->checkInput()) {
149
150 // Save Checkbox Values
151 foreach ($this->fields as $key => $item) {
152 $this->object->setValue($key, $this->form->getInput($key));
153 if (is_array($item["subelements"])) {
154 foreach ($item["subelements"] as $subkey => $subitem) {
155 $this->object->setValue($key . "_" . $subkey, $this->form->getInput($key . "_" . $subkey));
156 }
157 }
158 }
159
160 $ilCtrl->redirect($this, "configure");
161 } else {
162 $this->form->setValuesByPost();
163 $tpl->setContent($this->form->getHtml());
164 }
165 }

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

+ 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: