ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilAdministrationSettingsFormHandler Class Reference

Administration settings form handler. More...

+ Collaboration diagram for ilAdministrationSettingsFormHandler:

Static Public Member Functions

static getSettingsGUIInstance ($a_settings_obj_type)
 
static addFieldsToForm ($a_form_id, ilPropertyFormGUI $a_form, ilObjectGUI $a_parent_gui)
 

Data Fields

const FORM_PRIVACY = 1
 
const FORM_SECURITY = 2
 
const FORM_FILES_QUOTA = 3
 
const FORM_LP = 4
 
const FORM_MAIL = 5
 
const FORM_COURSE = 6
 
const FORM_GROUP = 7
 
const FORM_REPOSITORY = 8
 
const FORM_LDAP = 9
 
const FORM_FORUM = 10
 
const FORM_ACCESSIBILITY = 11
 
const FORM_WSP = 12
 
const FORM_TAGGING = 13
 
const SETTINGS_USER = "usrf"
 
const SETTINGS_GENERAL = "adm"
 
const SETTINGS_FILE = "facs"
 
const SETTINGS_ROLE = "rolf"
 
const SETTINGS_FORUM = "frma"
 
const SETTINGS_LRES = "lrss"
 
const SETTINGS_REPOSITORY = "reps"
 
const SETTINGS_PD = "pdts"
 
const SETTINGS_COURSE = "crss"
 
const SETTINGS_GROUP = "grps"
 
const SETTINGS_PRIVACY_SECURITY = "ps"
 
const SETTINGS_CALENDAR = "cals"
 
const SETTINGS_AUTH = "auth"
 
const SETTINGS_WIKI = "wiks"
 
const SETTINGS_PORTFOLIO = "prfa"
 
const VALUE_BOOL = "bool"
 

Static Protected Member Functions

static initObjectMap ()
 
static getRefId ($a_obj_type)
 
static parseFieldValue ($a_field_type, &$a_field_value)
 
static parseFieldDefinition ($a_type, ilPropertyFormGUI $a_form, ilObjectGUI $a_gui, $a_data)
 

Static Protected Attributes

static $OBJ_MAP
 

Detailed Description

Administration settings form handler.

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
Id
class.ilAdministrationGUI.php 43022 2013-06-26 13:32:48Z tamstutz

Definition at line 10 of file class.ilAdministrationSettingsFormHandler.php.

Member Function Documentation

◆ addFieldsToForm()

static ilAdministrationSettingsFormHandler::addFieldsToForm (   $a_form_id,
ilPropertyFormGUI  $a_form,
ilObjectGUI  $a_parent_gui 
)
static

Definition at line 95 of file class.ilAdministrationSettingsFormHandler.php.

References $data, $type, and array.

Referenced by ilObjFileAccessSettingsGUI\editDiskQuotaSettings(), ilObjPersonalDesktopSettingsGUI\editWsp(), ilObjMailGUI\getGeneralSettingsForm(), ilObjAccessibilitySettingsGUI\getSettingsForm(), ilObjForumAdministrationGUI\getSettingsForm(), ilLDAPSettingsGUI\initForm(), ilMembershipAdministrationGUI\initFormSettings(), ilObjTaggingSettingsGUI\initFormSettings(), ilObjRepositorySettingsGUI\initSettingsForm(), ilObjUserTrackingGUI\initSettingsForm(), ilObjPrivacySecurityGUI\showPrivacy(), and ilObjPrivacySecurityGUI\showSecurity().

96  {
97  switch ($a_form_id) {
98  case self::FORM_SECURITY:
99  $types = array(self::SETTINGS_GENERAL, self::SETTINGS_USER, self::SETTINGS_FILE, self::SETTINGS_ROLE);
100  break;
101 
102  case self::FORM_PRIVACY:
103  $types = array(self::SETTINGS_ROLE, self::SETTINGS_FORUM, self::SETTINGS_LRES);
104  break;
105 
106  case self::FORM_FILES_QUOTA:
107  $types = array(self::SETTINGS_PD);
108  break;
109 
110  case self::FORM_LP:
111  $types = array(self::SETTINGS_REPOSITORY);
112  break;
113 
114  case self::FORM_ACCESSIBILITY:
115  $types = array(self::SETTINGS_FORUM, self::SETTINGS_AUTH, self::SETTINGS_WIKI);
116  break;
117 
118  case self::FORM_MAIL:
119  $types = array(self::SETTINGS_COURSE, self::SETTINGS_GROUP);
120  break;
121 
122  case self::FORM_COURSE:
123  case self::FORM_GROUP:
124  $types = array(self::SETTINGS_PRIVACY_SECURITY, self::SETTINGS_CALENDAR, self::SETTINGS_GENERAL);
125  break;
126 
127  case self::FORM_WSP:
128  $types = array(self::SETTINGS_PORTFOLIO);
129  break;
130 
131  case self::FORM_TAGGING:
132  $types = array(self::SETTINGS_REPOSITORY);
133  break;
134 
135  default:
136  $types = null;
137  break;
138  }
139 
140  if (is_array($types)) {
141  foreach ($types as $type) {
142  $gui = self::getSettingsGUIInstance($type);
143  if ($gui && method_exists($gui, "addToExternalSettingsForm")) {
144  $data = $gui->addToExternalSettingsForm($a_form_id);
145  if (is_array($data)) {
146  self::parseFieldDefinition($type, $a_form, $gui, $data);
147  }
148  }
149  }
150  }
151 
152  // cron jobs - special handling
153 
154  include_once "Modules/SystemFolder/classes/class.ilObjSystemFolderGUI.php";
155  $parent_gui = new ilObjSystemFolderGUI(null, SYSTEM_FOLDER_ID, true);
156  $parent_gui->setCreationMode(true);
157 
158  include_once "Services/Cron/classes/class.ilCronManagerGUI.php";
159  $gui = new ilCronManagerGUI();
160  $data = $gui->addToExternalSettingsForm($a_form_id);
161  if (is_array($data) && sizeof($data)) {
162  self::parseFieldDefinition("cron", $a_form, $parent_gui, $data);
163  }
164  }
$type
Class ilObjSystemFolderGUI.
Create styles array
The data for the language used.
Class ilCronManagerGUI.
+ Here is the caller graph for this function:

◆ getRefId()

static ilAdministrationSettingsFormHandler::getRefId (   $a_obj_type)
staticprotected

Definition at line 60 of file class.ilAdministrationSettingsFormHandler.php.

61  {
62  if (!is_array(self::$OBJ_MAP)) {
63  self::initObjectMap();
64  }
65  return self::$OBJ_MAP[$a_obj_type];
66  }

◆ getSettingsGUIInstance()

static ilAdministrationSettingsFormHandler::getSettingsGUIInstance (   $a_settings_obj_type)
static

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

References $DIC, $ilCtrl, ilObject\_lookupType(), and ilObject2GUI\REPOSITORY_NODE_ID.

Referenced by ilLDAPSettingsGUI\initForm(), ilObjBlogAdministrationGUI\initFormSettings(), and ilObjPortfolioAdministrationGUI\initFormSettings().

69  {
70  global $DIC;
71 
72  $objDefinition = $DIC["objDefinition"];
73  $ilCtrl = $DIC->ctrl();
74 
75  $ref_id = self::getRefId($a_settings_obj_type);
76  $obj_type = ilObject::_lookupType($ref_id, true);
77 
78  $class_name = $objDefinition->getClassName($obj_type);
79  $class_name = "ilObj" . $class_name . "GUI";
80 
81  $class_path = $ilCtrl->lookupClassPath($class_name);
82  include_once($class_path);
83 
84  if (is_subclass_of($class_name, "ilObject2GUI")) {
85  $gui_obj = new $class_name($ref_id, ilObject2GUI::REPOSITORY_NODE_ID);
86  } else {
87  $gui_obj = new $class_name("", $ref_id, true, false);
88  }
89 
90  $gui_obj->setCreationMode(true);
91 
92  return $gui_obj;
93  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
static _lookupType($a_id, $a_reference=false)
lookup object type
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initObjectMap()

static ilAdministrationSettingsFormHandler::initObjectMap ( )
staticprotected

Definition at line 46 of file class.ilAdministrationSettingsFormHandler.php.

References $DIC, and array.

47  {
48  global $DIC;
49 
50  $tree = $DIC->repositoryTree();
51 
52  $map = array("adm" => SYSTEM_FOLDER_ID);
53  foreach ($tree->getChilds(SYSTEM_FOLDER_ID) as $obj) {
54  $map[$obj["type"]] = $obj["ref_id"];
55  }
56 
57  self::$OBJ_MAP = $map;
58  }
global $DIC
Definition: saml.php:7
Create styles array
The data for the language used.

◆ parseFieldDefinition()

static ilAdministrationSettingsFormHandler::parseFieldDefinition (   $a_type,
ilPropertyFormGUI  $a_form,
ilObjectGUI  $a_gui,
  $a_data 
)
staticprotected

Definition at line 191 of file class.ilAdministrationSettingsFormHandler.php.

References $a_type, $DIC, $ilCtrl, $lng, ilPropertyFormGUI\addItem(), array, and ilCustomInputGUI\setHtml().

192  {
193  global $DIC;
194 
195  $lng = $DIC->language();
196  $rbacsystem = $DIC->rbac()->system();
197  $ilCtrl = $DIC->ctrl();
198  $ilAccess = $DIC->access();
199 
200  if (!is_array($a_data)) {
201  return;
202  }
203 
204  // write permission for current gui?
205  $has_write = $ilAccess->checkAccess("write", "", (int) $_REQUEST["ref_id"]);
206 
207  foreach ($a_data as $area_caption => $fields) {
208  if (is_numeric($area_caption) || !trim($area_caption)) {
209  $area_caption = "obj_" . $a_type;
210  }
211 
212  if (is_array($fields) && sizeof($fields) == 2) {
213  $cmd = $fields[0];
214  $fields = $fields[1];
215  if (is_array($fields)) {
216  $ftpl = new ilTemplate("tpl.external_settings.html", true, true, "Services/Administration");
217 
218 
219  $stack = array();
220  foreach ($fields as $field_caption_id => $field_value) {
221  $field_type = $subitems = null;
222  if (is_array($field_value)) {
223  $field_type = $field_value[1];
224  $subitems = $field_value[2];
225  $field_value = $field_value[0];
226  }
227 
228  if (self::parseFieldValue($field_type, $field_value)) {
229  $ftpl->setCurrentBlock("value_bl");
230  $ftpl->setVariable("VALUE", $field_value);
231  $ftpl->parseCurrentBlock();
232  }
233 
234  if (is_array($subitems)) {
235  $ftpl->setCurrentBlock("subitem_bl");
236  foreach ($subitems as $sub_caption_id => $sub_value) {
237  $sub_type = null;
238  if (is_array($sub_value)) {
239  $sub_type = $sub_value[1];
240  $sub_value = $sub_value[0];
241  }
242  self::parseFieldValue($sub_type, $sub_value);
243 
244  $ftpl->setVariable("SUBKEY", $lng->txt($sub_caption_id));
245  $ftpl->setVariable("SUBVALUE", $sub_value);
246  $ftpl->parseCurrentBlock();
247  }
248  }
249 
250  $ftpl->setCurrentBlock("row_bl");
251  $ftpl->setVariable("KEY", $lng->txt($field_caption_id));
252  $ftpl->parseCurrentBlock();
253  }
254 
255  if ($has_write &&
256  $rbacsystem->checkAccess("visible,read", $a_gui->object->getRefId())) {
257  if (!$cmd) {
258  $cmd = "view";
259  }
260  $ilCtrl->setParameter($a_gui, "ref_id", $a_gui->object->getRefId());
261 
262  $ftpl->setCurrentBlock("edit_bl");
263  $ftpl->setVariable("URL_EDIT", $ilCtrl->getLinkTargetByClass(array("ilAdministrationGUI", get_class($a_gui)), $cmd));
264  $ftpl->setVariable("TXT_EDIT", $lng->txt("adm_external_setting_edit"));
265  $ftpl->parseCurrentBlock();
266  }
267 
268  $ext = new ilCustomInputGUI($lng->txt($area_caption));
269  $ext->setHtml($ftpl->get());
270  $a_form->addItem($ext);
271  }
272  }
273  }
274  }
setHtml($a_html)
Set Html.
global $DIC
Definition: saml.php:7
addItem($a_item)
Add Item (Property, SectionHeader).
global $ilCtrl
Definition: ilias.php:18
$a_type
Definition: workflow.php:92
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
This class represents a custom property in a property form.
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

◆ parseFieldValue()

static ilAdministrationSettingsFormHandler::parseFieldValue (   $a_field_type,
$a_field_value 
)
staticprotected

Definition at line 166 of file class.ilAdministrationSettingsFormHandler.php.

References $DIC, and $lng.

167  {
168  global $DIC;
169 
170  $lng = $DIC->language();
171 
172  switch ($a_field_type) {
173  case self::VALUE_BOOL:
174  $a_field_value = (bool) $a_field_value ?
175  $lng->txt("enabled") :
176  $lng->txt("disabled");
177  return $a_field_value;
178  }
179 
180  if (!is_numeric($a_field_value) &&
181  $a_field_value !== null && !trim($a_field_value)) {
182  $a_field_value = "-";
183  }
184 
185  if (is_numeric($a_field_value) || $a_field_value !== "") {
186  return true;
187  }
188  return false;
189  }
global $DIC
Definition: saml.php:7
global $lng
Definition: privfeed.php:17

Field Documentation

◆ $OBJ_MAP

ilAdministrationSettingsFormHandler::$OBJ_MAP
staticprotected

◆ FORM_ACCESSIBILITY

◆ FORM_COURSE

◆ FORM_FILES_QUOTA

◆ FORM_FORUM

const ilAdministrationSettingsFormHandler::FORM_FORUM = 10

◆ FORM_GROUP

◆ FORM_LDAP

const ilAdministrationSettingsFormHandler::FORM_LDAP = 9

◆ FORM_LP

const ilAdministrationSettingsFormHandler::FORM_LP = 4

◆ FORM_MAIL

const ilAdministrationSettingsFormHandler::FORM_MAIL = 5

◆ FORM_PRIVACY

◆ FORM_REPOSITORY

const ilAdministrationSettingsFormHandler::FORM_REPOSITORY = 8

◆ FORM_SECURITY

◆ FORM_TAGGING

const ilAdministrationSettingsFormHandler::FORM_TAGGING = 13

◆ FORM_WSP

const ilAdministrationSettingsFormHandler::FORM_WSP = 12

◆ SETTINGS_AUTH

const ilAdministrationSettingsFormHandler::SETTINGS_AUTH = "auth"

◆ SETTINGS_CALENDAR

const ilAdministrationSettingsFormHandler::SETTINGS_CALENDAR = "cals"

◆ SETTINGS_COURSE

const ilAdministrationSettingsFormHandler::SETTINGS_COURSE = "crss"

◆ SETTINGS_FILE

const ilAdministrationSettingsFormHandler::SETTINGS_FILE = "facs"

◆ SETTINGS_FORUM

const ilAdministrationSettingsFormHandler::SETTINGS_FORUM = "frma"

◆ SETTINGS_GENERAL

const ilAdministrationSettingsFormHandler::SETTINGS_GENERAL = "adm"

◆ SETTINGS_GROUP

const ilAdministrationSettingsFormHandler::SETTINGS_GROUP = "grps"

◆ SETTINGS_LRES

const ilAdministrationSettingsFormHandler::SETTINGS_LRES = "lrss"

◆ SETTINGS_PD

const ilAdministrationSettingsFormHandler::SETTINGS_PD = "pdts"

◆ SETTINGS_PORTFOLIO

const ilAdministrationSettingsFormHandler::SETTINGS_PORTFOLIO = "prfa"

◆ SETTINGS_PRIVACY_SECURITY

const ilAdministrationSettingsFormHandler::SETTINGS_PRIVACY_SECURITY = "ps"

◆ SETTINGS_REPOSITORY

const ilAdministrationSettingsFormHandler::SETTINGS_REPOSITORY = "reps"

◆ SETTINGS_ROLE

const ilAdministrationSettingsFormHandler::SETTINGS_ROLE = "rolf"

◆ SETTINGS_USER

const ilAdministrationSettingsFormHandler::SETTINGS_USER = "usrf"

◆ SETTINGS_WIKI

const ilAdministrationSettingsFormHandler::SETTINGS_WIKI = "wiks"

◆ VALUE_BOOL


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