19 declare(strict_types=1);
71 protected static function initObjectMap(): void
76 $tree = $DIC->repositoryTree();
80 $map[$obj[
"type"]] = (
int) $obj[
"ref_id"];
83 self::$OBJ_MAP = $map;
88 if (!isset(self::$OBJ_MAP)) {
89 self::initObjectMap();
91 return self::$OBJ_MAP[$a_obj_type] ?? 0;
98 $objDefinition = $DIC[
"objDefinition"];
100 $ref_id = self::getRefId($a_settings_obj_type);
103 $class_name = $objDefinition->getClassName($obj_type);
104 $class_name =
"ilObj" . $class_name .
"GUI";
105 if (is_subclass_of($class_name,
"ilObject2GUI")) {
108 $gui_obj =
new $class_name([],
$ref_id,
true,
false);
111 $gui_obj->setCreationMode(
true);
121 switch ($a_form_id) {
122 case self::FORM_SECURITY:
123 $types = array(self::SETTINGS_USER, self::SETTINGS_FILE, self::SETTINGS_ROLE);
126 case self::FORM_PRIVACY:
127 $types = array(self::SETTINGS_ROLE, self::SETTINGS_FORUM, self::SETTINGS_LRES, self::SETTINGS_COMMENTS);
130 case self::FORM_TAGGING:
132 $types = array(self::SETTINGS_REPOSITORY);
135 case self::FORM_ACCESSIBILITY:
136 $types = array(self::SETTINGS_FORUM, self::SETTINGS_AUTH, self::SETTINGS_WIKI);
139 case self::FORM_MAIL:
140 $types = array(self::SETTINGS_COURSE, self::SETTINGS_GROUP, self::SETTINGS_LEARNINGSEQUENCE);
143 case self::FORM_COURSE:
144 $types = array(self::SETTINGS_PRIVACY_SECURITY, self::SETTINGS_CALENDAR, self::SETTINGS_GENERAL);
147 case self::FORM_GROUP:
148 $types = array(self::SETTINGS_PRIVACY_SECURITY, self::SETTINGS_CALENDAR, self::SETTINGS_GENERAL, self::SETTINGS_COURSE);
152 $types = array(self::SETTINGS_PORTFOLIO);
155 case self::FORM_CERTIFICATE:
156 $types = array(self::SETTINGS_LP_COMPLETION_STATUS);
160 $types = array(self::SETTINGS_PRIVACY_SECURITY);
168 if (is_array($types)) {
169 foreach ($types as $type) {
170 $gui = self::getSettingsGUIInstance($type);
171 if ($gui && method_exists($gui,
"addToExternalSettingsForm")) {
172 $data = $gui->addToExternalSettingsForm($a_form_id);
173 if (is_array(
$data)) {
174 self::parseFieldDefinition($type, $a_form, $gui,
$data);
183 $parent_gui->setCreationMode(
true);
186 $data = $gui->addToExternalSettingsForm($a_form_id);
188 self::parseFieldDefinition(
"cron", $a_form, $parent_gui,
$data);
197 ?
string $a_field_type,
202 $lng = $DIC->language();
204 switch ($a_field_type) {
205 case self::VALUE_BOOL:
206 $a_field_value = $a_field_value ?
207 $lng->txt(
"enabled") :
208 $lng->txt(
"disabled");
209 return $a_field_value;
212 if (!is_numeric($a_field_value) &&
213 $a_field_value !==
null && !trim($a_field_value)) {
214 $a_field_value =
"-";
217 return is_numeric($a_field_value) || $a_field_value !==
"";
220 protected static function parseFieldDefinition(
229 $request = new \ILIAS\Administration\AdminGUIRequest(
235 $lng = $DIC->language();
236 $rbacsystem = $DIC->rbac()->system();
237 $ilCtrl = $DIC->ctrl();
238 $ilAccess = $DIC->access();
240 if (!is_array($a_data)) {
247 $has_write = $ilAccess->checkAccess(
253 foreach ($a_data as $area_caption => $fields) {
254 if (is_numeric($area_caption) || !trim($area_caption)) {
255 $area_caption =
"obj_" . $a_type;
258 if (is_array($fields) && count($fields) === 2) {
260 $fields = $fields[1];
261 if (is_array($fields)) {
262 $ftpl =
new ilTemplate(
"tpl.external_settings.html",
true,
true,
"components/ILIAS/Administration");
266 foreach ($fields as $field_caption_id => $field_value) {
269 $field_type = $subitems =
null;
270 if (is_array($field_value)) {
271 $field_type = $field_value[1];
272 $subitems = $field_value[2] ?? [];
273 $field_value = $field_value[0];
276 if (self::parseFieldValue($field_type, $field_value)) {
277 $ftpl->setCurrentBlock(
"value_bl");
278 $ftpl->setVariable(
"VALUE", $field_value);
279 $ftpl->parseCurrentBlock();
282 if (is_array($subitems)) {
283 $ftpl->setCurrentBlock(
"subitem_bl");
284 foreach ($subitems as $sub_caption_id => $sub_value) {
286 if (is_array($sub_value)) {
287 $sub_type = $sub_value[1];
288 $sub_value = $sub_value[0];
290 self::parseFieldValue($sub_type, $sub_value);
292 $ftpl->setVariable(
"SUBKEY", $lng->txt($sub_caption_id));
293 $ftpl->setVariable(
"SUBVALUE", $sub_value);
294 $ftpl->parseCurrentBlock();
298 $ftpl->setCurrentBlock(
"row_bl");
299 $ftpl->setVariable(
"KEY", $lng->txt($field_caption_id));
300 $ftpl->parseCurrentBlock();
304 $rbacsystem->checkAccess(
"visible,read", $a_gui->
getObject()->getRefId())) {
308 $ilCtrl->setParameter($a_gui,
"ref_id", $a_gui->
getObject()->getRefId());
310 $ftpl->setCurrentBlock(
"edit_bl");
311 $ftpl->setVariable(
"URL_EDIT", $ilCtrl->getLinkTargetByClass(array(
"ilAdministrationGUI", get_class($a_gui)), $cmd));
312 $ftpl->setVariable(
"TXT_EDIT", $lng->txt(
"adm_external_setting_edit"));
313 $ftpl->parseCurrentBlock();
317 $ext->setHtml($ftpl->get());
static getLogger(string $a_component_id)
Get component logger.
Class ilObjSystemFolderGUI.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
Class ilObjectGUI Basic methods of all Output classes.
ilCronManagerGUI: ilPropertyFormGUI ilCronManagerGUI: ilAdministrationGUI
static _lookupType(int $id, bool $reference=false)