57 $tree =
$DIC->repositoryTree();
61 $map[$obj[
"type"]] = $obj[
"ref_id"];
64 self::$OBJ_MAP = $map;
67 protected static function getRefId($a_obj_type)
69 if (!is_array(self::$OBJ_MAP)) {
72 return self::$OBJ_MAP[$a_obj_type];
79 $objDefinition =
$DIC[
"objDefinition"];
80 $ilCtrl =
$DIC->ctrl();
85 $class_name = $objDefinition->getClassName($obj_type);
86 $class_name =
"ilObj" . $class_name .
"GUI";
87 $class_path = $ilCtrl->lookupClassPath($class_name);
88 if (is_subclass_of($class_name,
"ilObject2GUI")) {
91 $gui_obj =
new $class_name(
"", $ref_id,
true,
false);
94 $gui_obj->setCreationMode(
true);
101 switch ($a_form_id) {
103 $types = array(self::SETTINGS_USER, self::SETTINGS_FILE, self::SETTINGS_ROLE);
107 $types = array(self::SETTINGS_ROLE, self::SETTINGS_FORUM, self::SETTINGS_LRES, self::SETTINGS_COMMENTS);
111 $types = array(self::SETTINGS_REPOSITORY);
115 $types = array(self::SETTINGS_FORUM, self::SETTINGS_AUTH, self::SETTINGS_WIKI);
119 $types = array(self::SETTINGS_COURSE, self::SETTINGS_GROUP, self::SETTINGS_LEARNINGSEQUENCE);
123 $types = array(self::SETTINGS_PRIVACY_SECURITY, self::SETTINGS_CALENDAR, self::SETTINGS_GENERAL);
127 $types = array(self::SETTINGS_PRIVACY_SECURITY, self::SETTINGS_CALENDAR, self::SETTINGS_GENERAL, self::SETTINGS_COURSE);
131 $types = array(self::SETTINGS_PORTFOLIO);
135 $types = array(self::SETTINGS_REPOSITORY);
139 $types = array(self::SETTINGS_LP_COMPLETION_STATUS);
151 if (is_array($types)) {
152 foreach ($types as
$type) {
154 if ($gui && method_exists($gui,
"addToExternalSettingsForm")) {
155 $data = $gui->addToExternalSettingsForm($a_form_id);
156 if (is_array(
$data)) {
165 include_once
"Modules/SystemFolder/classes/class.ilObjSystemFolderGUI.php";
167 $parent_gui->setCreationMode(
true);
169 include_once
"Services/Cron/classes/class.ilCronManagerGUI.php";
171 $data = $gui->addToExternalSettingsForm($a_form_id);
183 switch ($a_field_type) {
185 $a_field_value = (bool) $a_field_value ?
186 $lng->txt(
"enabled") :
187 $lng->txt(
"disabled");
188 return $a_field_value;
191 if (!is_numeric($a_field_value) &&
192 $a_field_value !==
null && !trim($a_field_value)) {
193 $a_field_value =
"-";
196 if (is_numeric($a_field_value) || $a_field_value !==
"") {
207 $rbacsystem =
$DIC->rbac()->system();
208 $ilCtrl =
$DIC->ctrl();
209 $ilAccess =
$DIC->access();
211 if (!is_array($a_data)) {
216 $has_write = $ilAccess->checkAccess(
"write",
"", (
int) $_REQUEST[
"ref_id"]);
218 foreach ($a_data as $area_caption => $fields) {
219 if (is_numeric($area_caption) || !trim($area_caption)) {
220 $area_caption =
"obj_" . $a_type;
223 if (is_array($fields) &&
sizeof($fields) == 2) {
225 $fields = $fields[1];
226 if (is_array($fields)) {
227 $ftpl =
new ilTemplate(
"tpl.external_settings.html",
true,
true,
"Services/Administration");
231 foreach ($fields as $field_caption_id => $field_value) {
232 $field_type = $subitems =
null;
233 if (is_array($field_value)) {
234 $field_type = $field_value[1];
235 $subitems = $field_value[2];
236 $field_value = $field_value[0];
239 if (self::parseFieldValue($field_type, $field_value)) {
240 $ftpl->setCurrentBlock(
"value_bl");
241 $ftpl->setVariable(
"VALUE", $field_value);
242 $ftpl->parseCurrentBlock();
245 if (is_array($subitems)) {
246 $ftpl->setCurrentBlock(
"subitem_bl");
247 foreach ($subitems as $sub_caption_id => $sub_value) {
249 if (is_array($sub_value)) {
250 $sub_type = $sub_value[1];
251 $sub_value = $sub_value[0];
255 $ftpl->setVariable(
"SUBKEY",
$lng->txt($sub_caption_id));
256 $ftpl->setVariable(
"SUBVALUE", $sub_value);
257 $ftpl->parseCurrentBlock();
261 $ftpl->setCurrentBlock(
"row_bl");
262 $ftpl->setVariable(
"KEY",
$lng->txt($field_caption_id));
263 $ftpl->parseCurrentBlock();
267 $rbacsystem->checkAccess(
"visible,read", $a_gui->object->getRefId())) {
271 $ilCtrl->setParameter($a_gui,
"ref_id", $a_gui->object->getRefId());
273 $ftpl->setCurrentBlock(
"edit_bl");
274 $ftpl->setVariable(
"URL_EDIT", $ilCtrl->getLinkTargetByClass(array(
"ilAdministrationGUI", get_class($a_gui)), $cmd));
275 $ftpl->setVariable(
"TXT_EDIT",
$lng->txt(
"adm_external_setting_edit"));
276 $ftpl->parseCurrentBlock();
280 $ext->setHtml($ftpl->get());
An exception for terminatinating execution or to throw for unit testing.
Class ilObjSystemFolderGUI.
Class ilObjectGUI Basic methods of all Output classes.
static _lookupType($a_id, $a_reference=false)
lookup object type
special template class to simplify handling of ITX/PEAR