ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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.

86 {
87 global $DIC;
88 $tpl = $DIC['tpl'];
89
90 $this->initConfigurationForm();
91 $this->getValues();
92 $tpl->setContent($this->form->getHTML());
93 }
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$DIC
Definition: xapitoken.php:46

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

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

References fields.

Referenced by configure().

+ Here is the caller graph for this function:

◆ initConfigurationForm()

ilCloudPluginConfigGUI::initConfigurationForm ( )
Returns
ilPropertyFormGUI

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

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.
global $ilCtrl
Definition: ilias.php:18
$lng

References $DIC, $ilCtrl, $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 68 of file class.ilCloudPluginConfigGUI.php.

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 }
Class ilCloudPluginConfig.

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

+ Here is the call graph for this function:

◆ save()

ilCloudPluginConfigGUI::save ( )

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

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 }

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

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