ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 FORM_CERTIFICATE = 14
 
const FORM_META_COPYRIGHT = 15
 
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 SETTINGS_LP_COMPLETION_STATUS = "trac"
 
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 99 of file class.ilAdministrationSettingsFormHandler.php.

References $data, and $type.

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

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

◆ getRefId()

static ilAdministrationSettingsFormHandler::getRefId (   $a_obj_type)
staticprotected

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

65  {
66  if (!is_array(self::$OBJ_MAP)) {
67  self::initObjectMap();
68  }
69  return self::$OBJ_MAP[$a_obj_type];
70  }

◆ getSettingsGUIInstance()

static ilAdministrationSettingsFormHandler::getSettingsGUIInstance (   $a_settings_obj_type)
static

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

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

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

73  {
74  global $DIC;
75 
76  $objDefinition = $DIC["objDefinition"];
77  $ilCtrl = $DIC->ctrl();
78 
79  $ref_id = self::getRefId($a_settings_obj_type);
80  $obj_type = ilObject::_lookupType($ref_id, true);
81 
82  $class_name = $objDefinition->getClassName($obj_type);
83  $class_name = "ilObj" . $class_name . "GUI";
84 
85  $class_path = $ilCtrl->lookupClassPath($class_name);
86  include_once($class_path);
87 
88  if (is_subclass_of($class_name, "ilObject2GUI")) {
89  $gui_obj = new $class_name($ref_id, ilObject2GUI::REPOSITORY_NODE_ID);
90  } else {
91  $gui_obj = new $class_name("", $ref_id, true, false);
92  }
93 
94  $gui_obj->setCreationMode(true);
95 
96  return $gui_obj;
97  }
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 50 of file class.ilAdministrationSettingsFormHandler.php.

References $DIC, $map, and $tree.

51  {
52  global $DIC;
53 
54  $tree = $DIC->repositoryTree();
55 
56  $map = array("adm" => SYSTEM_FOLDER_ID);
57  foreach ($tree->getChilds(SYSTEM_FOLDER_ID) as $obj) {
58  $map[$obj["type"]] = $obj["ref_id"];
59  }
60 
61  self::$OBJ_MAP = $map;
62  }
global $DIC
Definition: saml.php:7

◆ parseFieldDefinition()

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

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

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

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

◆ parseFieldValue()

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

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

References $DIC, and $lng.

175  {
176  global $DIC;
177 
178  $lng = $DIC->language();
179 
180  switch ($a_field_type) {
181  case self::VALUE_BOOL:
182  $a_field_value = (bool) $a_field_value ?
183  $lng->txt("enabled") :
184  $lng->txt("disabled");
185  return $a_field_value;
186  }
187 
188  if (!is_numeric($a_field_value) &&
189  $a_field_value !== null && !trim($a_field_value)) {
190  $a_field_value = "-";
191  }
192 
193  if (is_numeric($a_field_value) || $a_field_value !== "") {
194  return true;
195  }
196  return false;
197  }
global $DIC
Definition: saml.php:7
$lng

Field Documentation

◆ $OBJ_MAP

ilAdministrationSettingsFormHandler::$OBJ_MAP
staticprotected

◆ FORM_ACCESSIBILITY

◆ FORM_CERTIFICATE

const ilAdministrationSettingsFormHandler::FORM_CERTIFICATE = 14

◆ 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_META_COPYRIGHT

const ilAdministrationSettingsFormHandler::FORM_META_COPYRIGHT = 15

◆ 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_LP_COMPLETION_STATUS

const ilAdministrationSettingsFormHandler::SETTINGS_LP_COMPLETION_STATUS = "trac"

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