19declare(strict_types=1);
25use Psr\Http\Message\RequestInterface;
81 public function __construct(
int $a_context,
int $a_ref_id, ?
string $a_obj_type =
null, $a_sub_type =
null)
85 $this->
ctrl = $DIC->ctrl();
86 $this->
lng = $DIC->language();
87 $this->
lng->loadLanguageModule(
'meta');
88 $this->tpl =
$DIC->ui()->mainTemplate();
89 $this->tabs_gui =
$DIC->tabs();
92 $this->
toolbar = $DIC->toolbar();
93 $this->ui_factory =
$DIC->ui()->factory();
94 $this->ui_renderer =
$DIC->ui()->renderer();
95 $this->request =
$DIC->http()->request();
96 $this->
http = $DIC->http();
97 $this->db =
$DIC->database();
98 $this->
user = $DIC->user();
99 $this->
access = $DIC->access();
102 $this->
logger = $DIC->logger()->amet();
104 $this->context = $a_context;
118 if ($this->
http->wrapper()->query()->has(
'record_id')) {
119 return $this->
http->wrapper()->query()->retrieve(
129 if ($this->
http->wrapper()->post()->has(
'record_id')) {
130 return SplFixedArray::fromArray(
131 $this->
http->wrapper()->post()->retrieve(
133 $this->refinery->kindlyTo()->listOf(
134 $this->refinery->kindlyTo()->int()
139 return new SplFixedArray(0);
144 if ($this->
http->wrapper()->query()->has(
'field_id')) {
145 return $this->
http->wrapper()->query()->retrieve(
155 if ($this->
http->wrapper()->post()->has(
'field_id')) {
156 return SplFixedArray::fromArray(
157 $this->
http->wrapper()->post()->retrieve(
159 $this->refinery->kindlyTo()->listOf(
160 $this->refinery->kindlyTo()->int()
165 return new SplFixedArray(0);
170 if ($this->
http->wrapper()->post()->has(
'file_id')) {
171 return SplFixedArray::fromArray(
172 $this->
http->wrapper()->post()->retrieve(
174 $this->refinery->kindlyTo()->dictOf(
175 $this->refinery->kindlyTo()->string()
180 return new SplFixedArray(0);
185 if ($this->
http->wrapper()->query()->has(
'ftype')) {
186 return $this->
http->wrapper()->query()->retrieve(
196 if ($this->
http->wrapper()->post()->has(
'ftype')) {
197 return $this->
http->wrapper()->post()->retrieve(
208 if ($this->
http->wrapper()->query()->has($name)) {
209 return $this->
http->wrapper()->query()->retrieve(
211 $this->
refinery->kindlyTo()->string()
220 $name =
'advmd_oid_table';
221 if ($this->
http->wrapper()->query()->has($name)) {
222 $oids = $this->
http->wrapper()->query()->retrieve(
224 $this->
refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string())
226 return (
string) ($oids[0] ??
'');
237 if ($this->
http->wrapper()->post()->has(
'position')) {
238 return $this->
http->wrapper()->post()->retrieve(
240 $this->
refinery->kindlyTo()->dictOf(
241 $this->refinery->byTrying([
242 $this->refinery->kindlyTo()->float(),
243 $this->refinery->always(0)
270 $this->obj_id =
null;
271 $this->obj_type =
null;
272 $this->sub_type =
null;
283 $next_class = $this->
ctrl->getNextClass($this);
284 $cmd = $this->
ctrl->getCmd();
285 switch ($next_class) {
286 case strtolower(ilAdvancedMDRecordTranslationGUI::class):
287 $record = $this->initRecordObject();
288 $this->setRecordSubTabs(1,
true);
289 $int_gui = new \ilAdvancedMDRecordTranslationGUI($record);
290 $this->
ctrl->forwardCommand($int_gui);
293 case "ilpropertyformgui":
294 $this->initRecordObject();
296 $this->record->getRecordId() > 0 ?
'edit' :
'create'
303 $cmd =
'showRecords';
311 $this->setSubTabs($this->context);
313 $perm = $this->getPermissions()->hasPermissions(
323 $button = $this->ui_factory->button()->standard(
324 $this->
lng->txt(
'add'),
325 $this->ctrl->getLinkTargetByClass(strtolower(self::class),
"createRecord")
327 $this->
toolbar->addComponent($button);
330 $this->
toolbar->addSeparator();
335 $button = $this->ui_factory->button()->standard(
336 $this->
lng->txt(
'import'),
337 $this->ctrl->getLinkTargetByClass(strtolower(self::class),
"importRecords")
339 $this->
toolbar->addComponent($button);
342 $obj_type_context = ($this->obj_id > 0)
348 $this->getPermissions(),
351 $table_gui->setTitle($this->
lng->txt(
"md_record_list_table"));
352 $table_gui->setData($this->getParsedRecordObjects());
356 $table_gui->addMultiCommand(
"exportRecords", $this->
lng->txt(
'export'));
357 $table_gui->setSelectAllCheckbox(
"record_id");
359 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
360 $table_gui->addMultiCommand(
"confirmDeleteRecords", $this->
lng->txt(
"delete"));
361 $table_gui->addCommandButton(
"updateRecords", $this->
lng->txt(
"save"));
364 $this->tpl->setContent($table_gui->getHTML());
369 $this->setSubTabs($this->context);
370 $form = $this->initFormSubstitutions();
372 $this->tabs_gui->setSubTabActive(
'md_adv_presentation');
373 $this->tpl->setContent($this->
form->getHTML());
376 $this->showRecords();
385 if (!$this->
access->checkAccess(
'write',
'', $this->ref_id)) {
386 $this->
ctrl->redirect($this,
"showPresentation");
389 $form = $this->initFormSubstitutions();
391 $this->
ctrl->redirect($this,
'showPresentation');
394 if (!$form->checkInput()) {
395 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'),
true);
396 $this->
ctrl->redirect($this,
"showPresentation");
403 foreach ($visible_records as $obj_type => $record) {
405 $sub->enableDescription((
bool) $form->getInput(
'enabled_desc_' . $obj_type));
406 $sub->enableFieldNames((
bool) $form->getInput(
'enabled_field_names_' . $obj_type));
409 $definitions = $sub->sortDefinitions($definitions);
414 foreach ($definitions as $def) {
415 $field_id = $def->getFieldId();
416 $old_sub[$field_id] = array(
417 "active" => $sub->isSubstituted($field_id),
419 "bold" => $sub->isBold($field_id),
420 "newline" => $sub->hasNewline($field_id)
424 $sub->resetSubstitutions();
427 foreach ($definitions as $def) {
428 $field_id = $def->getFieldId();
429 $old = $old_sub[$field_id];
431 $active = (bool) $form->getInput(
'show_' . $obj_type .
'_' . $field_id);
434 $new_sub[$field_id] = $old;
435 $new_sub[$field_id][
'pos'] = (
int) $form->getInput(
'position_' . $obj_type .
'_' . $field_id);
436 $new_sub[$field_id][
'bold'] = (bool) $form->getInput(
'bold_' . $obj_type .
'_' . $field_id);
437 $new_sub[$field_id][
'newline'] = (bool) $form->getInput(
'newline_' . $obj_type .
'_' . $field_id);
441 if (
sizeof($new_sub)) {
443 foreach ($new_sub as $field_id => $field) {
444 $sub->appendSubstitution($field_id, (
bool) $field[
"bold"], (
bool) $field[
"newline"]);
450 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
451 $this->
ctrl->redirect($this,
"showPresentation");
460 $record_ids = $this->getRecordIdsFromPost();
461 if (!count($record_ids)) {
462 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
463 $this->showRecords();
469 foreach ($record_ids as $record_id) {
470 if (!$this->getPermissions()->hasPermission(
476 $fail[] = $record->getTitle();
480 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_copy') .
" " . implode(
", ",
$fail),
true);
481 $this->
ctrl->redirect($this,
"showRecords");
485 $xml_writer->write();
488 $this->
user->getId(),
489 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
491 $export_files->create($xml_writer->xmlDumpMem(
false));
493 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_records_exported'));
502 $this->setSubTabs($this->context);
503 $this->tabs_gui->setSubTabActive(
'md_adv_file_list');
506 $this->
user->getId(),
507 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
509 $file_data =
$files->readFilesInfo();
512 $table_gui->setTitle($this->
lng->txt(
"md_record_export_table"));
513 $table_gui->parseFiles($file_data);
514 $table_gui->addMultiCommand(
"downloadFile", $this->
lng->txt(
'download'));
516 if (
$GLOBALS[
'DIC']->
access()->checkAccess(
'write',
'', $this->ref_id)) {
517 $table_gui->addMultiCommand(
"confirmDeleteFiles", $this->
lng->txt(
"delete"));
519 $table_gui->setSelectAllCheckbox(
"file_id");
521 $this->tpl->setContent($table_gui->getHTML());
531 $file_ids = $this->getFileIdsFromPost();
532 if (count($file_ids) !== 1) {
533 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'md_adv_select_one_file'));
538 $this->
user->getId(),
539 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
541 $files->download($file_ids[0],
'ilias_meta_data_record.xml');
550 $file_ids = $this->getFileIdsFromPost();
551 if (count($file_ids) !== 1) {
552 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
558 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteFiles"));
559 $c_gui->setHeaderText($this->
lng->txt(
"md_adv_delete_files_sure"));
560 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"showFiles");
561 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteFiles");
564 $this->
user->getId(),
565 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
567 $file_data =
$files->readFilesInfo();
570 foreach ($file_ids as $file_id) {
571 $info = $file_data[$file_id];
575 is_array(
$info[
'name'] ??
false) ? implode(
',',
$info[
'name']) :
'No Records'
578 $this->tpl->setContent($c_gui->getHTML());
588 $file_ids = $this->getFileIdsFromPost();
589 if (count($file_ids) === 0) {
590 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
595 if (!
$GLOBALS[
'DIC']->
access()->checkAccess(
'write',
'', $this->ref_id)) {
596 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
597 $GLOBALS[
'DIC']->ctrl()->redirect($this,
'showFiles');
601 $this->
user->getId(),
602 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
604 foreach ($file_ids as $file_id) {
606 $this->
user->getId(),
610 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_deleted_files'));
620 $this->initRecordObject();
621 $this->setRecordSubTabs();
623 $record_ids = $this->getRecordIdsFromPost();
624 if (!count($record_ids)) {
625 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
626 $this->showRecords();
633 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteRecords"));
634 $c_gui->setHeaderText($this->
lng->txt(
"md_adv_delete_record_sure"));
635 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"showRecords");
636 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteRecords");
639 foreach ($record_ids as $record_id) {
641 $c_gui->addItem(
"record_id[]", (
string) $record_id, $record->getTitle() ?:
'No Title');
643 $this->tpl->setContent($c_gui->getHTML());
652 $record_ids = $this->getRecordIdsFromPost();
653 if (!count($record_ids)) {
654 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
655 $this->showRecords();
661 foreach ($record_ids as $record_id) {
663 if ($this->context == self::CONTEXT_OBJECT) {
665 if (!$record->getParentObject()) {
666 $fail[] = $record->getTitle();
670 if (!$this->getPermissions()->hasPermission(
676 $fail[] = $record->getTitle();
680 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_delete') .
" " . implode(
", ",
$fail),
true);
681 $this->
ctrl->redirect($this,
"showRecords");
684 foreach ($record_ids as $record_id) {
688 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_deleted_records'),
true);
689 $this->
ctrl->redirect($this,
"showRecords");
700 $positions = $this->getPositionsFromPost();
701 $records = $this->getParsedRecordObjects();
703 $all_positions = $positions;
704 foreach ($records as $record) {
705 if (!array_key_exists($record[
'id'], $all_positions)) {
706 $all_positions[$record[
'id']] = $record[
'position'];
709 asort($all_positions, SORT_NUMERIC);
711 $sorted_positions = [];
713 foreach ($all_positions as $record_id => $pos) {
714 $sorted_positions[(
int) $record_id] = $i++;
716 $selected_global = [];
718 $post_active = (array) ($this->
http->request()->getParsedBody()[
'active'] ?? []);
719 if ($this->obj_id > 0) {
722 foreach ($records as $item) {
724 $is_on_page = array_key_exists($item[
'id'], $positions);
726 $perm = $this->getPermissions()->hasPermissions(
744 $obj_types = array();
745 $post_object_types = (array) ($this->
http->request()->getParsedBody()[
'obj_types'] ?? []);
746 if (is_array($post_object_types[$record_obj->getRecordId()] ??
false)) {
747 foreach ($post_object_types[$record_obj->getRecordId()] as $type => $status) {
749 $type = explode(
":", $type);
750 $obj_types[] = array(
753 "optional" => ((
int) $status == 2)
760 if (!$item[
'readonly']) {
762 $record_obj->setAssignedObjectTypes($obj_types);
764 foreach ($obj_types as $t) {
771 if ($this->context == self::CONTEXT_ADMINISTRATION) {
776 $record_obj->setActive(isset($post_active[$record_obj->getRecordId()]));
779 $record_obj->setGlobalPosition((
int) $sorted_positions[$record_obj->getRecordId()]);
780 $record_obj->update();
786 if ($item[
'readonly'] &&
788 ($post_active[$item[
'id']] ??
false)) {
789 $selected_global[] = $item[
'id'];
790 } elseif ($item[
'local']) {
792 $record_obj->setActive((
bool) ($post_active[$item[
'id']] ??
false));
793 $record_obj->update();
798 if ($this->context == self::CONTEXT_OBJECT) {
799 $local_position = new \ilAdvancedMDRecordObjectOrdering(
804 $local_position->setPosition((
int) $sorted_positions[$item[
'id']]);
805 $local_position->save();
809 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
810 $this->
ctrl->redirect($this,
"showRecords");
815 $field_ids = $this->getFieldIdsFromPost();
816 if (!count($field_ids)) {
817 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
822 $this->initRecordObject();
823 $this->setRecordSubTabs(2);
828 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteFields"));
829 $c_gui->setHeaderText($this->
lng->txt(
"md_adv_delete_fields_sure"));
830 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"editFields");
831 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteFields");
834 foreach ($field_ids as $field_id) {
836 $c_gui->addItem(
"field_id[]", (
string) $field_id, $field->getTitle() ?:
'No Title');
838 $this->tpl->setContent($c_gui->getHTML());
843 $this->
ctrl->saveParameter($this,
'record_id');
845 $field_ids = $this->getFieldIdsFromPost();
846 if (!count($field_ids)) {
847 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
854 foreach ($field_ids as $field_id) {
855 if (!$this->getPermissions()->hasPermission(
861 $fail[] = $field->getTitle();
865 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_delete') .
" " . implode(
", ",
$fail),
true);
866 $this->
ctrl->redirect($this,
"editFields");
869 foreach ($field_ids as $field_id) {
873 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_deleted_fields'),
true);
874 $this->
ctrl->redirect($this,
"editFields");
879 $record_id = $this->getRecordIdFromQuery();
881 $this->
ctrl->redirect($this,
'showRecords');
883 $this->initRecordObject();
884 $this->setRecordSubTabs(1,
true);
885 $this->tabs_gui->activateTab(self::TAB_RECORD_SETTINGS);
888 $this->initLanguage($record_id);
889 $this->showLanguageSwitch($record_id,
'editRecord');
890 $this->initForm(
'edit');
892 $this->tpl->setContent($this->
form->getHTML());
897 $record_id = $this->getRecordIdFromQuery();
899 $this->
ctrl->redirect($this,
'showRecords');
901 $this->
ctrl->saveParameter($this,
'record_id');
902 $this->initRecordObject();
903 $this->setRecordSubTabs();
904 $this->initLanguage($record_id);
905 $this->showLanguageSwitch($record_id,
'editFields');
907 $perm = $this->getPermissions()->hasPermissions(
909 (
int) $this->record->getRecordId(),
924 $this->
ctrl->setParameter($this,
'ftype', $type);
925 $create_link = $this->
ctrl->getLinkTarget($this,
'createField');
926 $this->
ctrl->clearParameterByClass(strtolower(self::class),
'ftype');
928 $field_buttons[] = $this->ui_factory->button()->shy(
929 $this->
lng->txt($field->getTypeTitle()),
933 if (!$field->isFilterSupported()) {
934 $filter_warn[] = $this->
lng->txt($field->getTypeTitle());
938 if (count($this->
toolbar->getItems())) {
939 $this->
toolbar->addSeparator();
942 $dropdown = $this->ui_factory->dropdown()
943 ->standard($field_buttons)
944 ->withLabel($this->
lng->txt(
'meta_advmd_add_field'));
945 $this->
toolbar->addComponent($dropdown);
949 if (
sizeof($filter_warn)) {
950 $this->tpl->setOnScreenMessage(
'info', sprintf($this->
lng->txt(
"md_adv_field_filter_warning"), implode(
", ", $filter_warn)));
955 $this->record->getRecordId(),
957 $this->active_language
963 $this->getPermissions(),
965 $this->record->getDefaultLanguage()
967 $table_gui->setTitle($this->
lng->txt(
"md_adv_field_table"));
968 $table_gui->parseDefinitions($fields);
969 if (
sizeof($fields)) {
970 $table_gui->addCommandButton(
"updateFields", $this->
lng->txt(
"save"));
972 $table_gui->addCommandButton(
"showRecords", $this->
lng->txt(
'cancel'));
973 $table_gui->addMultiCommand(
"confirmDeleteFields", $this->
lng->txt(
"delete"));
974 $table_gui->setSelectAllCheckbox(
"field_id");
976 $this->tpl->setContent($table_gui->getHTML());
985 $this->
ctrl->saveParameter($this,
'record_id');
986 $positions = $this->getPositionsFromPost();
987 asort($positions, SORT_NUMERIC);
988 $record_id = $this->getRecordIdFromQuery();
990 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
997 if ($this->getPermissions()->hasPermission(
1002 $positions_flipped = array_flip(array_keys($positions));
1003 foreach ($fields as $field) {
1004 $field->setPosition((
int) $positions_flipped[$field->getFieldId()]);
1009 foreach ($fields as $field) {
1010 if ($this->getPermissions()->hasPermission(
1012 (
int) $field->getFieldId(),
1016 $post_searchable = (array) ($this->
http->request()->getParsedBody()[
'searchable'] ?? []);
1017 $field->setSearchable((
bool) ($post_searchable[$field->getFieldId()] ??
false));
1022 $language = $this->request->getQueryParams()[
'mdlang'] ??
false;
1024 $this->
ctrl->setParameter($this,
'mdlang', $this->request->getQueryParams()[
'mdlang']);
1026 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1027 $this->
ctrl->redirect($this,
"editFields");
1037 $record_id = $this->getRecordIdFromQuery();
1039 $this->
ctrl->redirect($this,
'showRecords');
1041 $this->initRecordObject();
1042 $this->initLanguage($record_id);
1043 $this->showLanguageSwitch($record_id,
'editRecord');
1045 $form = $this->initForm(
'edit');
1046 if (!$this->
form->checkInput()) {
1047 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
1048 $this->
form->setValuesByPost();
1049 $this->editRecord($this->
form);
1053 $this->loadRecordFormData($form);
1054 $this->record->update();
1057 $translations->updateTranslations(
1058 $this->active_language,
1059 $this->
form->getInput(
'title'),
1060 $this->form->getInput(
'desc')
1063 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1064 $this->
ctrl->redirect($this,
'editRecord');
1074 $this->initRecordObject();
1075 $this->setRecordSubTabs();
1077 $this->initForm(
'create');
1079 $this->tpl->setContent($this->
form->getHTML());
1084 $this->initRecordObject();
1085 $this->setRecordSubTabs();
1088 $this->initImportForm();
1089 $this->tpl->setContent($this->import_form->getHTML());
1097 $this->tabs_gui->clearTargets();
1098 $this->tabs_gui->clearSubTabs();
1101 $this->tabs_gui->setBackTarget(
1102 $this->
lng->txt(
'md_adv_record_list'),
1103 $this->ctrl->getLinkTarget($this,
'showRecords')
1106 if ($show_settings) {
1107 $this->tabs_gui->addTab(
1108 self::TAB_RECORD_SETTINGS,
1109 $this->
lng->txt(
'settings'),
1110 $this->ctrl->getLinkTarget($this, self::TAB_RECORD_SETTINGS)
1112 $this->
ctrl->setParameterByClass(
1113 strtolower(\ilAdvancedMDRecordTranslationGUI::class),
1115 $this->record->getRecordId()
1117 $this->
lng->loadLanguageModule(
'obj');
1118 $this->tabs_gui->addTab(
1119 self::TAB_TRANSLATION,
1120 $this->
lng->txt(
'obj_multilinguality'),
1121 $this->ctrl->getLinkTargetByClass(
1122 strtolower(\ilAdvancedMDRecordTranslationGUI::class),
1129 $this->tabs_gui->setBack2Target(
1130 $this->
lng->txt(
'md_adv_record_list'),
1131 $this->ctrl->getLinkTarget($this,
'showRecords')
1133 $this->tabs_gui->setBackTarget(
1134 $this->
lng->txt(
'md_adv_field_list'),
1135 $this->ctrl->getLinkTarget($this,
'editFields')
1142 if (is_object($this->import_form)) {
1147 $this->import_form->setMultipart(
true);
1148 $this->import_form->setFormAction($this->
ctrl->getFormAction($this));
1152 $file->setSuffixes(array(
'xml'));
1153 $file->setRequired(
true);
1154 $this->import_form->addItem($file);
1156 $this->import_form->setTitle($this->
lng->txt(
'md_adv_import_record'));
1157 $this->import_form->addCommandButton(
'importRecord', $this->
lng->txt(
'import'));
1158 $this->import_form->addCommandButton(
'showRecords', $this->
lng->txt(
'cancel'));
1163 $this->initImportForm();
1164 if (!$this->import_form->checkInput()) {
1165 $this->import_form->setValuesByPost();
1166 $this->importRecords();
1171 if (!$create_time = $import_files->moveUploadedFile($_FILES[
'file'][
'tmp_name'])) {
1172 $this->createRecord();
1180 if ($this->context === self::CONTEXT_OBJECT) {
1181 $parser->setContext($this->obj_id, $this->obj_type, $this->sub_type);
1191 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_added_new_record'),
true);
1192 $this->
ctrl->redirect($this,
"showRecords");
1194 $this->tpl->setOnScreenMessage(
'failure', $exc->getMessage(),
true);
1195 $this->
ctrl->redirect($this,
"importRecords");
1199 $import_files->deleteFileByCreationDate($create_time);
1209 $this->initRecordObject();
1210 $form = $this->initForm(
'create');
1211 if (!$this->
form->checkInput()) {
1212 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
1213 $this->createRecord($this->
form);
1217 $record = $this->loadRecordFormData($form);
1218 if ($this->obj_type) {
1219 $sub_types = (!is_array($this->sub_type))
1222 $assigned_object_types = array_map(
function ($sub_type) {
1224 "obj_type" => $this->obj_type,
1225 "sub_type" => $sub_type,
1229 $this->record->setAssignedObjectTypes($assigned_object_types);
1232 $record->setDefaultLanguage($this->
lng->getDefaultLanguage());
1236 $translations->addTranslationEntry($record->getDefaultLanguage(),
true);
1237 $translations->updateTranslations(
1238 $record->getDefaultLanguage(),
1239 $this->form->getInput(
'title'),
1240 $this->form->getInput(
'desc')
1242 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_added_new_record'),
true);
1243 $this->
ctrl->redirect($this,
'showRecords');
1252 $record_id = $this->getRecordIdFromQuery();
1253 $field_id = $this->getFieldIdFromQuery();
1254 if (!$record_id || !$field_id) {
1255 $this->editFields();
1258 $this->
ctrl->saveParameter($this,
'field_id');
1259 $this->
ctrl->saveParameter($this,
'record_id');
1260 $this->initRecordObject();
1261 $this->setRecordSubTabs(2);
1266 $this->initLanguage($this->record->getRecordId());
1267 $this->showLanguageSwitch($this->record->getRecordId(),
'editField');
1268 $a_form = $this->initFieldForm($field_definition);
1271 if ($field_definition->hasComplexOptions()) {
1272 $table_obj = $field_definition->getComplexOptionsOverview();
1273 if ($table_obj !==
null) {
1274 $table = $this->ui_renderer->render($table_obj);
1277 $this->tpl->setContent($a_form->getHTML() . $table);
1286 $record_id = $this->getRecordIdFromQuery();
1287 $field_id = $this->getFieldIdFromQuery();
1288 $this->
ctrl->saveParameter($this,
'record_id');
1289 $this->
ctrl->saveParameter($this,
'field_id');
1291 if (!$record_id || !$field_id) {
1292 $this->editFields();
1296 $this->initRecordObject();
1297 $this->initLanguage($record_id);
1298 $this->showLanguageSwitch($record_id,
'editField');
1302 $form = $this->initFieldForm($field_definition);
1303 if ($form->checkInput()) {
1304 $field_definition->importDefinitionFormPostValues($form, $this->getPermissions(), $this->active_language);
1305 if (!$field_definition->importDefinitionFormPostValuesNeedsConfirmation()) {
1306 $field_definition->update();
1308 $translations->updateFromForm($field_id, $this->active_language, $form);
1310 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1311 $this->
ctrl->redirect($this,
'editField');
1317 $form->setValuesByPost();
1321 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"md_adv_confirm_definition"));
1322 $field_definition->prepareDefinitionFormConfirmation($form);
1325 $this->editField($form);
1334 $record_id = $this->getRecordIdFromQuery();
1335 $field_type = $this->getFieldTypeFromPost();
1337 $field_type = $this->getFieldTypeFromQuery();
1340 $this->initRecordObject();
1341 $this->
ctrl->setParameter($this,
'ftype', $field_type);
1342 $this->setRecordSubTabs(2);
1343 if (!$record_id || !$field_type) {
1344 $this->editFields();
1350 $field_definition->setRecordId($record_id);
1351 $a_form = $this->initFieldForm($field_definition);
1353 $this->tpl->setContent($a_form->getHTML());
1358 $record_id = $this->getRecordIdFromQuery();
1359 $ftype = $this->getFieldTypeFromQuery();
1361 if (!$record_id || !$ftype) {
1362 $this->editFields();
1366 $this->initRecordObject();
1367 $this->initLanguage($record_id);
1368 $this->
ctrl->saveParameter($this,
'ftype');
1374 $field_definition->setRecordId($record_id);
1375 $form = $this->initFieldForm($field_definition);
1377 if ($form->checkInput()) {
1378 $field_definition->importDefinitionFormPostValues($form, $this->getPermissions(), $this->active_language);
1379 $field_definition->save();
1382 $translations->read();
1383 $translations->updateFromForm($field_definition->getFieldId(), $this->active_language, $form);
1385 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1386 $this->
ctrl->redirect($this,
"editFields");
1389 $form->setValuesByPost();
1390 $this->createField($form);
1395 $is_creation_mode = $a_definition->
getFieldId() ? false :
true;
1398 $form->setFormAction($this->
ctrl->getFormAction($this));
1401 if ($is_creation_mode) {
1404 $form->setDescription($translations->getFormTranslationInfo(
1406 $this->active_language
1411 $form->addItem($type);
1414 if ($is_creation_mode) {
1415 $form->setTitle($this->
lng->txt(
'md_adv_create_field'));
1416 $form->addCommandButton(
'saveField', $this->
lng->txt(
'create'));
1418 $form->setTitle($this->
lng->txt(
'md_adv_edit_field'));
1419 $form->addCommandButton(
'updateField', $this->
lng->txt(
'save'));
1422 $form->addCommandButton(
'editFields', $this->
lng->txt(
'cancel'));
1432 $perm = $this->getPermissions()->hasPermissions(
1434 $this->record->getRecordId(),
1452 $this->
form =
new ilPropertyFormGUI();
1455 $this->
form->setDescription($translations->getFormTranslationInfo($this->active_language));
1456 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1460 $title->setValue($this->record->getTitle());
1461 $title->setSize(20);
1462 $title->setMaxLength(70);
1463 $title->setRequired(
true);
1466 $title->setDisabled(
true);
1468 $this->
form->addItem($title);
1469 $translations->modifyTranslationInfoForTitle($this->
form, $title, $this->active_language);
1473 $desc->setValue($this->record->getDescription());
1477 $desc->setDisabled(
true);
1479 $this->
form->addItem($desc);
1480 $translations->modifyTranslationInfoForDescription($this->
form, $desc, $this->active_language);
1484 $check->setChecked($this->record->isActive());
1489 $check->setDisabled(
true);
1492 if (!$this->obj_type) {
1495 $scope->setInfo($this->
lng->txt(
'md_adv_scope_info'));
1496 $scope->setChecked($this->record->enabledScope());
1497 $scope->setValue(
"1");
1498 $this->
form->addItem($scope);
1500 $this->
lng->txt(
'md_adv_scope_objects'),
1505 $subitems->setValue($this->record->getScopeRefIds());
1506 $exp = $subitems->getExplorerGUI();
1508 $definition =
$GLOBALS[
'DIC'][
'objDefinition'];
1510 foreach ($definition->getAllRepositoryTypes() as $type) {
1511 if ($definition->isContainer($type)) {
1512 $white_list[] = $type;
1516 $exp->setTypeWhiteList($white_list);
1517 $exp->setSkipRootNode(
false);
1519 $scope->addSubItem($subitems);
1522 if (!$this->obj_type) {
1524 $section->setTitle($this->
lng->txt(
'md_obj_types'));
1525 $this->
form->addItem($section);
1529 0 => $this->
lng->txt(
"meta_obj_type_inactive"),
1530 1 => $this->lng->txt(
"meta_obj_type_mandatory"),
1531 2 => $this->lng->txt(
"meta_obj_type_optional")
1535 $t = $type[
"obj_type"] .
":" . $type[
"sub_type"];
1536 $this->
lng->loadLanguageModule($type[
"obj_type"]);
1543 if ($type[
"obj_type"] ==
"prtf" && $type[
"sub_type"] ==
"pfpg") {
1547 if ($type[
"obj_type"] ==
"tals" && $type[
"sub_type"] ==
"etal") {
1553 switch ($type[
"obj_type"]) {
1556 unset($type_options[1]);
1560 unset($type_options[1]);
1564 unset($type_options[2]);
1569 if ($a_mode ==
"edit") {
1570 foreach ($this->record->getAssignedObjectTypes() as $item) {
1571 if ($item[
"obj_type"] == $type[
"obj_type"] &&
1572 $item[
"sub_type"] == $type[
"sub_type"]) {
1573 $value = $item[
"optional"]
1580 $sel_name =
'obj_types__' . $t;
1584 $hidden->setValue((
string) $value);
1585 $this->
form->addItem($hidden);
1591 $check->setOptions($type_options);
1592 $check->setValue($value);
1596 $check->setDisabled(
true);
1603 $this->
form->setTitle($this->
lng->txt(
'md_adv_create_record'));
1604 $this->
form->addCommandButton(
'saveRecord', $this->
lng->txt(
'add'));
1605 $this->
form->addCommandButton(
'showRecords', $this->
lng->txt(
'cancel'));
1609 $this->
form->setTitle($this->
lng->txt(
'md_adv_edit_record'));
1610 $this->
form->addCommandButton(
'updateRecord', $this->
lng->txt(
'save'));
1611 $this->
form->addCommandButton(
'showRecords', $this->
lng->txt(
'cancel'));
1627 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1628 #$this->form->setTableWidth('100%');
1631 foreach ($visible_records as $obj_type => $records) {
1632 $read_only = !$this->
access->checkAccess(
'write',
'', $this->ref_id);
1639 $section->setTitle($this->
lng->txt(
'objs_' . $obj_type));
1640 $this->
form->addItem($section);
1644 $check->setOptionTitle($this->
lng->txt(
'md_adv_desc_show'));
1645 $check->setChecked($sub->isDescriptionEnabled());
1649 $check->setDisabled(
true);
1654 $check->setOptionTitle($this->
lng->txt(
'md_adv_fields_show'));
1655 $check->setChecked($sub->enabledFieldNames());
1659 $check->setDisabled(
true);
1663 $definitions = $sub->sortDefinitions($definitions);
1666 foreach ($definitions as $def) {
1667 $definition_id = $def->getFieldId();
1670 $title = $def->getTitle() .
' (' . $title .
')';
1674 $check->setOptionTitle($this->
lng->txt(
'md_adv_show'));
1675 $check->setChecked($sub->isSubstituted($definition_id));
1678 $check->setDisabled(
true);
1682 $this->
lng->txt(
'position'),
1683 'position_' . $obj_type .
'_' . $definition_id
1686 $pos->setMaxLength(4);
1687 $pos->allowDecimals(
true);
1688 $pos->setValue(sprintf(
'%.1f', $counter++));
1689 $check->addSubItem($pos);
1692 $pos->setDisabled(
true);
1696 $this->
lng->txt(
'bold'),
1697 'bold_' . $obj_type .
'_' . $definition_id
1699 $bold->setValue(
"1");
1700 $bold->setChecked($sub->isBold($definition_id));
1701 $check->addSubItem($bold);
1704 $bold->setDisabled(
true);
1708 $this->
lng->txt(
'newline'),
1709 'newline_' . $obj_type .
'_' . $definition_id
1711 $bold->setValue(
"1");
1712 $bold->setChecked($sub->hasNewline($definition_id));
1713 $check->addSubItem($bold);
1716 $bold->setDisabled(
true);
1722 $this->
form->setTitle($this->
lng->txt(
'md_adv_substitution_table'));
1724 if ($this->
access->checkAccess(
'write',
'', $this->ref_id)) {
1725 $this->
form->addCommandButton(
'updateSubstitutions', $this->
lng->txt(
'save'));
1734 $perm = $this->getPermissions()->hasPermissions(
1736 $this->record->getRecordId(),
1755 $this->record->setActive((
bool) $form->
getInput(
'active'));
1759 $translations->getDefaultTranslation() ==
null ||
1760 $translations->getDefaultTranslation()->getLangKey() == $this->active_language
1762 $this->record->setTitle((
string) $form->
getInput(
'title'));
1767 $translations->getDefaultTranslation() ==
null ||
1768 $translations->getDefaultTranslation()->getLangKey() == $this->active_language) {
1769 $this->record->setDescription($form->
getInput(
'desc'));
1773 if (!$this->obj_type) {
1777 $t = $type[
"obj_type"] .
":" . $type[
"sub_type"];
1778 $value = $form->
getInput(
'obj_types__' . $t);
1783 'obj_type' => $type[
'obj_type'],
1784 'sub_type' => $type[
'sub_type'],
1785 'optional' => ($value > 1)
1788 $this->record->setAssignedObjectTypes($obj_types);
1793 $scopes_selection = $form->
getInput(
'scope_containers');
1794 if (
$scopes && is_array($scopes_selection)) {
1795 $this->record->enableScope(
true);
1796 $this->record->setScopes(
1798 function (
string $scope_ref_id) {
1800 $scope->setRefId((
int) $scope_ref_id);
1807 $this->record->enableScope(
false);
1808 $this->record->setScopes([]);
1810 return $this->record;
1819 $record_id = $this->getRecordIdFromQuery();
1821 $this->
ctrl->saveParameter($this,
'record_id');
1824 if (!$record_id && $this->obj_id) {
1825 $this->record->setParentObject($this->obj_id);
1828 return $this->record;
1837 if ($context == self::CONTEXT_OBJECT) {
1841 $this->tabs_gui->clearSubTabs();
1843 $this->tabs_gui->addSubTabTarget(
1844 "md_adv_record_list",
1845 $this->
ctrl->getLinkTarget($this,
"showRecords"),
1853 $this->tabs_gui->addSubTabTarget(
1854 "md_adv_presentation",
1855 $this->
ctrl->getLinkTarget($this,
"showPresentation")
1859 $this->tabs_gui->addSubTabTarget(
1861 $this->
ctrl->getLinkTarget($this,
"showFiles"),
1874 $sub_type = (!is_array($this->sub_type))
1878 if ($this->context === self::CONTEXT_OBJECT) {
1880 foreach ($sub_type as $st) {
1887 $records = $orderings->sortRecords($records, $this->obj_id);
1892 foreach ($records as $record) {
1893 $parent_id = $record->getParentObject();
1895 if ($this->context == self::CONTEXT_ADMINISTRATION) {
1901 if ($parent_id && $parent_id != $this->obj_id) {
1906 if (!$parent_id && !$record->isActive()) {
1913 $record->getScopes()
1921 $tmp_arr[
'readonly'] =
null;
1922 $tmp_arr[
'local'] =
null;
1923 $tmp_arr[
'optional'] =
null;
1924 $tmp_arr[
'id'] = $record->getRecordId();
1925 $tmp_arr[
'active'] = $record->isActive();
1926 $tmp_arr[
'title'] = $record->getTitle();
1927 $tmp_arr[
'description'] = $record->getDescription();
1928 $tmp_arr[
'fields'] = [];
1935 $tmp_arr[
'obj_types'] = $record->getAssignedObjectTypes();
1936 foreach ($record->getAssignedObjectTypes() as $idx => $item) {
1937 $tmp_arr[
'obj_types'][$idx][
'context'] =
null;
1940 $tmp_arr[
'position'] = $position;
1942 $tmp_arr[
'perm'] = $this->permissions->hasPermissions(
1944 $record->getRecordId(),
1958 if ($this->obj_type) {
1959 $tmp_arr[
"readonly"] = !(bool) $parent_id;
1960 $tmp_arr[
"local"] = $parent_id;
1963 $assigned = (bool) $parent_id;
1965 foreach ($tmp_arr[
'obj_types'] as $idx => $item) {
1966 if ($item[
"obj_type"] == $this->obj_type &&
1967 in_array($item[
"sub_type"], $sub_type)) {
1969 $optional = $item[
"optional"];
1970 $tmp_arr[
'obj_types'][$idx][
'context'] =
true;
1972 unset($tmp_arr[
'obj_types'][$idx]);
1975 $tmp_arr[
'optional'] = $optional;
1979 $tmp_arr[
'local_selected'] = [];
1980 foreach ($selected as $key => $records) {
1981 if (in_array($record->getRecordId(), $records)) {
1982 $tmp_arr[
'local_selected'][$this->obj_type][] = $key;
1988 if ($assigned ??
true) {
2002 $field_id = $this->getFieldIdFromQuery();
2004 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_select_one'));
2005 $this->
ctrl->redirect($this,
'showRecords');
2009 if (!$field_definition->hasComplexOptions()) {
2010 $this->
ctrl->redirect($this,
"editField");
2014 $oid = $this->getOidFromTable();
2015 $a_form = $this->initComplexOptionForm($field_definition, $oid);
2018 $this->tpl->setContent($a_form->getHTML());
2023 $this->
ctrl->saveParameter($this,
"record_id");
2024 $this->
ctrl->saveParameter($this,
"field_id");
2026 if ($oid !==
null) {
2027 $this->
ctrl->setParameter($this,
"advmd_oid", $oid);
2031 $form->setTitle($this->
lng->txt(
"md_adv_edit_complex_option"));
2032 $form->setFormAction($this->
ctrl->getFormAction($this,
"updateComplexOption"));
2034 $a_def->initOptionForm($form, $oid);
2036 $form->addCommandButton(
"updateComplexOption", $this->
lng->txt(
"save"));
2037 $form->addCommandButton(
"editField", $this->
lng->txt(
"cancel"));
2044 $field_id = $this->getFieldIdFromQuery();
2046 $oid = $this->getOidFromQuery();
2048 if ($field_definition->hasComplexOptions()) {
2049 $form = $this->initComplexOptionForm($field_definition, $oid);
2050 if ($form->checkInput() &&
2051 $field_definition->updateComplexOption($form, $oid)) {
2052 $field_definition->update();
2053 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2057 $this->
ctrl->redirect($this,
"editField");
2065 foreach ($translations->getTranslations() as $translation) {
2066 if ($translation->getLangKey() == $translations->getDefaultLanguage()) {
2067 $default = $translation->getLangKey();
2070 $active = $this->request->getQueryParams()[
'mdlang'] ?? $default;
2071 $this->active_language = $active;
2078 if (count($translations->getTranslations()) <= 1) {
2082 foreach ($translations->getTranslations() as $translation) {
2083 $this->
ctrl->setParameter($this,
'mdlang', $translation->getLangKey());
2084 $actions[$translation->getLangKey()] = $this->
ctrl->getLinkTarget(
2089 $this->
ctrl->setParameter($this,
'mdlang', $this->active_language);
2090 $view_control = $this->ui_factory->viewControl()->mode(
2092 $this->
lng->txt(
'meta_aria_language_selection')
2093 )->withActive($this->active_language);
2094 $this->
toolbar->addComponent($view_control);
Builds a Color from either hex- or rgb values.
Checks access for ILIAS objects.
AMD field abstract base class.
static getInstancesByRecordId( $a_record_id, $a_only_searchable=false, string $language='')
Get definitions by record id.
static getInstancesByObjType($a_obj_type, $a_active_only=true)
getFieldId()
Get field_id.
getDescription()
Get description.
static getValidTypes()
Get all valid types.
addToFieldDefinitionForm(ilPropertyFormGUI $a_form, ilAdvancedMDPermissionHelper $a_permissions, string $language='')
Add input elements to definition form.
static getInstance(?int $a_field_id, ?int $a_type=null, string $language='')
static getInstanceByRecordId(int $record_id)
Advanced metadata permission helper.
const int SUBACTION_FIELD_SEARCHABLE
const int ACTION_FIELD_DELETE
const int ACTION_RECORD_EDIT
const int SUBACTION_RECORD_OBJECT_TYPES
const int ACTION_RECORD_EXPORT
const int SUBACTION_RECORD_TITLE
const int ACTION_MD_IMPORT_RECORDS
const int ACTION_RECORD_EDIT_PROPERTY
const int ACTION_RECORD_EDIT_FIELDS
const int ACTION_FIELD_EDIT_PROPERTY
const int ACTION_RECORD_FIELD_POSITIONS
const int ACTION_RECORD_DELETE
const int ACTION_RECORD_TOGGLE_ACTIVATION
const int SUBACTION_RECORD_DESCRIPTION
const int ACTION_MD_CREATE_RECORD
const int ACTION_RECORD_CREATE_FIELD
SAX based XML parser for record import files.
const MODE_INSERT_VALIDATION
Scope restrictions for advanced md records.
static getInstanceByRecordId(int $record_id)
static _lookupTitle(int $a_record_id)
static deleteObjRecSelection(int $a_obj_id)
Delete repository object record selection.
static _getAllRecordsByObjectType()
Get records by obj_type Note: this returns only records with no sub types!
static _getInstanceByRecordId(int $a_record_id)
static _getAssignableObjectTypes(bool $a_include_text=false)
Get assignable object type @access public.
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
static _getRecords()
Get records @access public.
static saveObjRecSelection(int $a_obj_id, string $a_sub_type="", ?array $a_records=null, bool $a_delete_before=true)
Save repository object record selection.
static isFilteredByScope($a_ref_id, array $scopes)
Check if a given ref id is not filtered by scope restriction.
loadRecordFormData(ilPropertyFormGUI $form)
initLanguage(int $record_id)
updateSubstitutions()
Update substitution @access public.
initComplexOptionForm(ilAdvancedMDFieldDefinition $a_def, string $oid)
showFiles()
Show export files.
createField(?ilPropertyFormGUI $a_form=null)
Show field type selection @access public.
editField(?ilPropertyFormGUI $a_form=null)
Edit field @access public.
updateRecord()
Update record @access public.
const CONTEXT_ADMINISTRATION
RefineryFactory $refinery
updateRecords()
Save records (assigned object typed) @access public.
initContextParameters(int $context, int $ref_id, ?string $obj_type, $sub_type)
ilGlobalTemplateInterface $tpl
editComplexOption(?ilPropertyFormGUI $a_form=null)
setSubTabs(int $context)
Set sub tabs @access protected.
__construct(int $a_context, int $a_ref_id, ?string $a_obj_type=null, $a_sub_type=null)
Constructor @access public.
ilAdvancedMDRecord $record
saveRecord()
Save record @access public.
confirmDeleteFiles()
confirm delete files @access public
initFieldForm(ilAdvancedMDFieldDefinition $a_definition)
initFormSubstitutions()
init form table 'substitutions' @access protected
deleteRecords()
Permanently delete records @access public.
exportRecords()
Export records @access public.
updateFields()
Update fields @access public.
const TAB_RECORD_SETTINGS
ilAdvancedMDPermissionHelper $permissions
confirmDeleteRecords()
Confirm delete @access public.
RequestInterface $request
showLanguageSwitch(int $record_id, string $target)
createRecord(?ilPropertyFormGUI $form=null)
Show @access public.
downloadFile()
Download XML file @access public.
editRecord(?ilPropertyFormGUI $form=null)
ilPropertyFormGUI $import_form
updateField()
Update field @access public.
setRecordSubTabs(int $level=1, bool $show_settings=false)
Set subtabs for record editing/creation.
deleteFiles()
Delete files @access public.
static _getInstanceByObjectType(string $a_type)
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
static getInstance(int $a_user_id, int $a_ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilCtrl provides processing control methods.
Component logger with individual log levels by component id.
This class represents a non editable value in a property form.
static _lookupType(int $id, bool $reference=false)
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a text area property in a property form.
This class represents a text property in a property form.
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
Interface GlobalHttpState.
An entity that renders components to a string output.
if(strtoupper($request->getMethod()) !=='POST') if(( $body[ 'grant_type'] ?? '') !=='client_credentials') if(($body['client_assertion_type'] ?? '') !=='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'||!is_string($body['client_assertion'] ?? null)) $scopes
static http()
Fetches the global http state from ILIAS.
form(?array $class_path, string $cmd, string $submit_caption="")
foreach(array_slice( $argv, 1) as $argument) if(!is_dir($target)) $parser
foreach($_POST as $key=> $value) $res
if(!file_exists('../ilias.ini.php'))