19declare(strict_types=1);
25use Psr\Http\Message\RequestInterface;
80 public function __construct(
int $a_context,
int $a_ref_id, ?
string $a_obj_type =
null, $a_sub_type =
null)
84 $this->
ctrl = $DIC->ctrl();
85 $this->
lng = $DIC->language();
86 $this->
lng->loadLanguageModule(
'meta');
87 $this->tpl =
$DIC->ui()->mainTemplate();
88 $this->tabs_gui =
$DIC->tabs();
91 $this->
toolbar = $DIC->toolbar();
92 $this->ui_factory =
$DIC->ui()->factory();
93 $this->ui_renderer =
$DIC->ui()->renderer();
94 $this->request =
$DIC->http()->request();
95 $this->
http = $DIC->http();
96 $this->db =
$DIC->database();
97 $this->
user = $DIC->user();
100 $this->
logger = $DIC->logger()->amet();
102 $this->context = $a_context;
116 if ($this->
http->wrapper()->query()->has(
'record_id')) {
117 return $this->
http->wrapper()->query()->retrieve(
127 if ($this->
http->wrapper()->post()->has(
'record_id')) {
128 return SplFixedArray::fromArray(
129 $this->
http->wrapper()->post()->retrieve(
131 $this->refinery->kindlyTo()->listOf(
132 $this->refinery->kindlyTo()->int()
137 return new SplFixedArray(0);
142 if ($this->
http->wrapper()->query()->has(
'field_id')) {
143 return $this->
http->wrapper()->query()->retrieve(
153 if ($this->
http->wrapper()->post()->has(
'field_id')) {
154 return SplFixedArray::fromArray(
155 $this->
http->wrapper()->post()->retrieve(
157 $this->refinery->kindlyTo()->listOf(
158 $this->refinery->kindlyTo()->int()
163 return new SplFixedArray(0);
168 if ($this->
http->wrapper()->post()->has(
'file_id')) {
169 return SplFixedArray::fromArray(
170 $this->
http->wrapper()->post()->retrieve(
172 $this->refinery->kindlyTo()->dictOf(
173 $this->refinery->kindlyTo()->string()
178 return new SplFixedArray(0);
183 if ($this->
http->wrapper()->query()->has(
'ftype')) {
184 return $this->
http->wrapper()->query()->retrieve(
194 if ($this->
http->wrapper()->post()->has(
'ftype')) {
195 return $this->
http->wrapper()->post()->retrieve(
205 if ($this->
http->wrapper()->query()->has(
'oid')) {
206 return $this->
http->wrapper()->query()->retrieve(
208 $this->
refinery->kindlyTo()->string()
219 if ($this->
http->wrapper()->post()->has(
'position')) {
220 return $this->
http->wrapper()->post()->retrieve(
222 $this->
refinery->kindlyTo()->dictOf(
223 $this->refinery->byTrying([
224 $this->refinery->kindlyTo()->float(),
225 $this->refinery->always(0)
252 $this->obj_id =
null;
253 $this->obj_type =
null;
254 $this->sub_type =
null;
265 $next_class = $this->
ctrl->getNextClass($this);
266 $cmd = $this->
ctrl->getCmd();
267 switch ($next_class) {
268 case strtolower(ilAdvancedMDRecordTranslationGUI::class):
269 $record = $this->initRecordObject();
270 $this->setRecordSubTabs(1,
true);
271 $int_gui = new \ilAdvancedMDRecordTranslationGUI($record);
272 $this->
ctrl->forwardCommand($int_gui);
275 case "ilpropertyformgui":
276 $this->initRecordObject();
278 $this->record->getRecordId() > 0 ?
'edit' :
'create'
285 $cmd =
'showRecords';
295 $ilToolbar =
$DIC[
'ilToolbar'];
296 $ilAccess =
$DIC[
'ilAccess'];
298 $this->setSubTabs($this->context);
300 $perm = $this->getPermissions()->hasPermissions(
302 (
string) $this->ref_id,
310 $button = $this->ui_factory->button()->standard(
311 $this->
lng->txt(
'add'),
312 $this->ctrl->getLinkTargetByClass(strtolower(self::class),
"createRecord")
314 $ilToolbar->addComponent($button);
317 $ilToolbar->addSeparator();
322 $button = $this->ui_factory->button()->standard(
323 $this->
lng->txt(
'import'),
324 $this->ctrl->getLinkTargetByClass(strtolower(self::class),
"importRecords")
326 $ilToolbar->addComponent($button);
329 $obj_type_context = ($this->obj_id > 0)
335 $this->getPermissions(),
338 $table_gui->setTitle($this->
lng->txt(
"md_record_list_table"));
339 $table_gui->setData($this->getParsedRecordObjects());
343 $table_gui->addMultiCommand(
"exportRecords", $this->
lng->txt(
'export'));
344 $table_gui->setSelectAllCheckbox(
"record_id");
346 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
347 $table_gui->addMultiCommand(
"confirmDeleteRecords", $this->
lng->txt(
"delete"));
348 $table_gui->addCommandButton(
"updateRecords", $this->
lng->txt(
"save"));
351 $DIC->ui()->mainTemplate()->setContent($table_gui->getHTML());
356 $this->setSubTabs($this->context);
357 $form = $this->initFormSubstitutions();
359 $this->tabs_gui->setSubTabActive(
'md_adv_presentation');
360 $this->tpl->setContent($this->
form->getHTML());
363 $this->showRecords();
374 $ilAccess =
$DIC[
'ilAccess'];
376 if (!$ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
377 $this->
ctrl->redirect($this,
"showPresentation");
380 $form = $this->initFormSubstitutions();
382 $this->
ctrl->redirect($this,
'showPresentation');
385 if (!$form->checkInput()) {
386 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'),
true);
387 $this->
ctrl->redirect($this,
"showPresentation");
394 foreach ($visible_records as $obj_type => $record) {
397 if (in_array($obj_type, $this->permissions->getAllowedObjectTypes())) {
398 $perm = $this->getPermissions()->hasPermissions(
412 $sub->enableDescription((
bool) $form->getInput(
'enabled_desc_' . $obj_type));
416 $sub->enableFieldNames((
bool) $form->getInput(
'enabled_field_names_' . $obj_type));
420 $definitions = $sub->sortDefinitions($definitions);
425 foreach ($definitions as $def) {
426 $field_id = $def->getFieldId();
427 $old_sub[$field_id] = array(
428 "active" => $sub->isSubstituted($field_id),
430 "bold" => $sub->isBold($field_id),
431 "newline" => $sub->hasNewline($field_id)
435 $sub->resetSubstitutions();
438 foreach ($definitions as $def) {
439 $field_id = $def->getFieldId();
440 $old = $old_sub[$field_id];
442 $perm_def = $this->getSubstitutionFieldPermissions($obj_type, $field_id);
443 if ($perm_def[
"show"] ??
false) {
444 $active = (bool) $form->getInput(
'show_' . $obj_type .
'_' . $field_id);
446 $active = $old[
"active"] ??
false;
449 $new_sub[$field_id] = $old;
451 $new_sub[$field_id][
'pos'] = (
int) $form->getInput(
'position_' . $obj_type .
'_' . $field_id);
453 if ($perm_def[
"bold"] ??
false) {
454 $new_sub[$field_id][
'bold'] = (bool) $form->getInput(
'bold_' . $obj_type .
'_' . $field_id);
456 if ($perm_def[
"newline"] ??
false) {
457 $new_sub[$field_id][
'newline'] = (bool) $form->getInput(
'newline_' . $obj_type .
'_' . $field_id);
462 if (
sizeof($new_sub)) {
464 foreach ($new_sub as $field_id => $field) {
465 $sub->appendSubstitution($field_id, (
bool) $field[
"bold"], (
bool) $field[
"newline"]);
471 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
472 $this->
ctrl->redirect($this,
"showPresentation");
481 $record_ids = $this->getRecordIdsFromPost();
482 if (!count($record_ids)) {
483 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
484 $this->showRecords();
490 foreach ($record_ids as $record_id) {
491 if (!$this->getPermissions()->hasPermission(
497 $fail[] = $record->getTitle();
501 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_copy') .
" " . implode(
", ", $fail),
true);
502 $this->
ctrl->redirect($this,
"showRecords");
506 $xml_writer->write();
509 $this->
user->getId(),
510 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
512 $export_files->create($xml_writer->xmlDumpMem(
false));
514 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_records_exported'));
523 $this->setSubTabs($this->context);
524 $this->tabs_gui->setSubTabActive(
'md_adv_file_list');
527 $this->
user->getId(),
528 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
530 $file_data = $files->readFilesInfo();
533 $table_gui->setTitle($this->
lng->txt(
"md_record_export_table"));
534 $table_gui->parseFiles($file_data);
535 $table_gui->addMultiCommand(
"downloadFile", $this->
lng->txt(
'download'));
537 if (
$GLOBALS[
'DIC']->
access()->checkAccess(
'write',
'', $this->ref_id)) {
538 $table_gui->addMultiCommand(
"confirmDeleteFiles", $this->
lng->txt(
"delete"));
540 $table_gui->setSelectAllCheckbox(
"file_id");
542 $this->tpl->setContent($table_gui->getHTML());
552 $file_ids = $this->getFileIdsFromPost();
553 if (count($file_ids) !== 1) {
554 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'md_adv_select_one_file'));
559 $this->
user->getId(),
560 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
562 $files->download($file_ids[0],
'ilias_meta_data_record.xml');
571 $file_ids = $this->getFileIdsFromPost();
572 if (count($file_ids) !== 1) {
573 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
579 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteFiles"));
580 $c_gui->setHeaderText($this->
lng->txt(
"md_adv_delete_files_sure"));
581 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"showFiles");
582 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteFiles");
585 $this->
user->getId(),
586 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
588 $file_data = $files->readFilesInfo();
591 foreach ($file_ids as $file_id) {
592 $info = $file_data[$file_id];
596 is_array(
$info[
'name'] ??
false) ? implode(
',',
$info[
'name']) :
'No Records'
599 $this->tpl->setContent($c_gui->getHTML());
609 $file_ids = $this->getFileIdsFromPost();
610 if (count($file_ids) === 0) {
611 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
616 if (!
$GLOBALS[
'DIC']->
access()->checkAccess(
'write',
'', $this->ref_id)) {
617 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'permission_denied'),
true);
618 $GLOBALS[
'DIC']->ctrl()->redirect($this,
'showFiles');
622 $this->
user->getId(),
623 $this->context === self::CONTEXT_ADMINISTRATION ?
null :
new ObjectId($this->obj_id)
625 foreach ($file_ids as $file_id) {
626 $files->deleteByFileId(
627 $this->
user->getId(),
631 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_deleted_files'));
641 $this->initRecordObject();
642 $this->setRecordSubTabs();
644 $record_ids = $this->getRecordIdsFromPost();
645 if (!count($record_ids)) {
646 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
647 $this->showRecords();
654 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteRecords"));
655 $c_gui->setHeaderText($this->
lng->txt(
"md_adv_delete_record_sure"));
656 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"showRecords");
657 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteRecords");
660 foreach ($record_ids as $record_id) {
662 $c_gui->addItem(
"record_id[]", (
string) $record_id, $record->getTitle() ?:
'No Title');
664 $this->tpl->setContent($c_gui->getHTML());
673 $record_ids = $this->getRecordIdsFromPost();
674 if (!count($record_ids)) {
675 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
676 $this->showRecords();
682 foreach ($record_ids as $record_id) {
684 if ($this->context == self::CONTEXT_OBJECT) {
686 if (!$record->getParentObject()) {
687 $fail[] = $record->getTitle();
691 if (!$this->getPermissions()->hasPermission(
697 $fail[] = $record->getTitle();
701 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_delete') .
" " . implode(
", ", $fail),
true);
702 $this->
ctrl->redirect($this,
"showRecords");
705 foreach ($record_ids as $record_id) {
709 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_deleted_records'),
true);
710 $this->
ctrl->redirect($this,
"showRecords");
721 $positions = $this->getPositionsFromPost();
722 $records = $this->getParsedRecordObjects();
724 $all_positions = $positions;
725 foreach ($records as $record) {
726 if (!array_key_exists($record[
'id'], $all_positions)) {
727 $all_positions[$record[
'id']] = $record[
'position'];
730 asort($all_positions, SORT_NUMERIC);
732 $sorted_positions = [];
734 foreach ($all_positions as $record_id => $pos) {
735 $sorted_positions[(
int) $record_id] = $i++;
737 $selected_global = [];
739 $post_active = (array) ($this->
http->request()->getParsedBody()[
'active'] ?? []);
740 if ($this->obj_id > 0) {
743 foreach ($records as $item) {
745 $is_on_page = array_key_exists($item[
'id'], $positions);
747 $perm = $this->getPermissions()->hasPermissions(
749 (
string) $item[
'id'],
765 $obj_types = array();
766 $post_object_types = (array) ($this->
http->request()->getParsedBody()[
'obj_types'] ?? []);
767 if (is_array($post_object_types[$record_obj->getRecordId()] ??
false)) {
768 foreach ($post_object_types[$record_obj->getRecordId()] as $type => $status) {
770 $type = explode(
":", $type);
771 $obj_types[] = array(
774 "optional" => ((
int) $status == 2)
781 if (!$item[
'readonly']) {
783 $record_obj->setAssignedObjectTypes($obj_types);
785 foreach ($obj_types as $t) {
792 if ($this->context == self::CONTEXT_ADMINISTRATION) {
797 $record_obj->setActive(isset($post_active[$record_obj->getRecordId()]));
800 $record_obj->setGlobalPosition((
int) $sorted_positions[$record_obj->getRecordId()]);
801 $record_obj->update();
807 if ($item[
'readonly'] &&
809 ($post_active[$item[
'id']] ??
false)) {
810 $selected_global[] = $item[
'id'];
811 } elseif ($item[
'local']) {
813 $record_obj->setActive((
bool) ($post_active[$item[
'id']] ??
false));
814 $record_obj->update();
819 if ($this->context == self::CONTEXT_OBJECT) {
820 $local_position = new \ilAdvancedMDRecordObjectOrdering(
825 $local_position->setPosition((
int) $sorted_positions[$item[
'id']]);
826 $local_position->save();
830 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
831 $this->
ctrl->redirect($this,
"showRecords");
836 $field_ids = $this->getFieldIdsFromPost();
837 if (!count($field_ids)) {
838 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
843 $this->initRecordObject();
844 $this->setRecordSubTabs(2);
849 $c_gui->setFormAction($this->
ctrl->getFormAction($this,
"deleteFields"));
850 $c_gui->setHeaderText($this->
lng->txt(
"md_adv_delete_fields_sure"));
851 $c_gui->setCancel($this->
lng->txt(
"cancel"),
"editFields");
852 $c_gui->setConfirm($this->
lng->txt(
"confirm"),
"deleteFields");
855 foreach ($field_ids as $field_id) {
857 $c_gui->addItem(
"field_id[]", (
string) $field_id, $field->getTitle() ?:
'No Title');
859 $this->tpl->setContent($c_gui->getHTML());
864 $this->
ctrl->saveParameter($this,
'record_id');
866 $field_ids = $this->getFieldIdsFromPost();
867 if (!count($field_ids)) {
868 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
875 foreach ($field_ids as $field_id) {
876 if (!$this->getPermissions()->hasPermission(
882 $fail[] = $field->getTitle();
886 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_delete') .
" " . implode(
", ", $fail),
true);
887 $this->
ctrl->redirect($this,
"editFields");
890 foreach ($field_ids as $field_id) {
894 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_deleted_fields'),
true);
895 $this->
ctrl->redirect($this,
"editFields");
900 $record_id = $this->getRecordIdFromQuery();
902 $this->
ctrl->redirect($this,
'showRecords');
904 $this->initRecordObject();
905 $this->setRecordSubTabs(1,
true);
906 $this->tabs_gui->activateTab(self::TAB_RECORD_SETTINGS);
909 $this->initLanguage($record_id);
910 $this->showLanguageSwitch($record_id,
'editRecord');
911 $this->initForm(
'edit');
913 $this->tpl->setContent($this->
form->getHTML());
920 $record_id = $this->getRecordIdFromQuery();
922 $this->
ctrl->redirect($this,
'showRecords');
924 $this->
ctrl->saveParameter($this,
'record_id');
925 $this->initRecordObject();
926 $this->setRecordSubTabs();
927 $this->initLanguage($record_id);
928 $this->showLanguageSwitch($record_id,
'editFields');
930 $perm = $this->getPermissions()->hasPermissions(
932 (
string) $this->record->getRecordId(),
947 $this->
ctrl->setParameter($this,
'ftype', $type);
948 $create_link = $this->
ctrl->getLinkTarget($this,
'createField');
949 $this->
ctrl->clearParameterByClass(strtolower(self::class),
'ftype');
951 $field_buttons[] = $this->ui_factory->button()->shy(
952 $this->
lng->txt($field->getTypeTitle()),
956 if (!$field->isFilterSupported()) {
957 $filter_warn[] = $this->
lng->txt($field->getTypeTitle());
961 if (count($this->
toolbar->getItems())) {
962 $this->
toolbar->addSeparator();
965 $dropdown = $this->ui_factory->dropdown()
966 ->standard($field_buttons)
967 ->withLabel($this->
lng->txt(
'meta_advmd_add_field'));
968 $this->
toolbar->addComponent($dropdown);
972 if (
sizeof($filter_warn)) {
973 $this->tpl->setOnScreenMessage(
'info', sprintf($this->
lng->txt(
"md_adv_field_filter_warning"), implode(
", ", $filter_warn)));
978 $this->record->getRecordId(),
980 $this->active_language
986 $this->getPermissions(),
988 $this->record->getDefaultLanguage()
990 $table_gui->setTitle($this->
lng->txt(
"md_adv_field_table"));
991 $table_gui->parseDefinitions($fields);
992 if (
sizeof($fields)) {
993 $table_gui->addCommandButton(
"updateFields", $this->
lng->txt(
"save"));
995 $table_gui->addCommandButton(
"showRecords", $this->
lng->txt(
'cancel'));
996 $table_gui->addMultiCommand(
"confirmDeleteFields", $this->
lng->txt(
"delete"));
997 $table_gui->setSelectAllCheckbox(
"field_id");
999 $this->tpl->setContent($table_gui->getHTML());
1008 $this->
ctrl->saveParameter($this,
'record_id');
1009 $positions = $this->getPositionsFromPost();
1010 asort($positions, SORT_NUMERIC);
1011 $record_id = $this->getRecordIdFromQuery();
1013 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'select_one'));
1014 $this->editFields();
1020 if ($this->getPermissions()->hasPermission(
1022 (
string) $record_id,
1025 $positions_flipped = array_flip(array_keys($positions));
1026 foreach ($fields as $field) {
1027 $field->setPosition((
int) $positions_flipped[$field->getFieldId()]);
1032 foreach ($fields as $field) {
1033 if ($this->getPermissions()->hasPermission(
1035 (
string) $field->getFieldId(),
1039 $post_searchable = (array) ($this->
http->request()->getParsedBody()[
'searchable'] ?? []);
1040 $field->setSearchable((
bool) ($post_searchable[$field->getFieldId()] ??
false));
1045 $language = $this->request->getQueryParams()[
'mdlang'] ??
false;
1047 $this->
ctrl->setParameter($this,
'mdlang', $this->request->getQueryParams()[
'mdlang']);
1049 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1050 $this->
ctrl->redirect($this,
"editFields");
1060 $record_id = $this->getRecordIdFromQuery();
1062 $this->
ctrl->redirect($this,
'showRecords');
1064 $this->initRecordObject();
1065 $this->initLanguage($record_id);
1066 $this->showLanguageSwitch($record_id,
'editRecord');
1068 $form = $this->initForm(
'edit');
1069 if (!$this->
form->checkInput()) {
1070 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
1071 $this->
form->setValuesByPost();
1072 $this->editRecord($this->
form);
1076 $this->loadRecordFormData($form);
1077 $this->record->update();
1080 $translations->updateTranslations(
1081 $this->active_language,
1082 $this->
form->getInput(
'title'),
1083 $this->form->getInput(
'desc')
1086 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1087 $this->
ctrl->redirect($this,
'editRecord');
1097 $this->initRecordObject();
1098 $this->setRecordSubTabs();
1100 $this->initForm(
'create');
1102 $this->tpl->setContent($this->
form->getHTML());
1107 $this->initRecordObject();
1108 $this->setRecordSubTabs();
1111 $this->initImportForm();
1112 $this->tpl->setContent($this->import_form->getHTML());
1120 $this->tabs_gui->clearTargets();
1121 $this->tabs_gui->clearSubTabs();
1124 $this->tabs_gui->setBackTarget(
1125 $this->
lng->txt(
'md_adv_record_list'),
1126 $this->ctrl->getLinkTarget($this,
'showRecords')
1129 if ($show_settings) {
1130 $this->tabs_gui->addTab(
1131 self::TAB_RECORD_SETTINGS,
1132 $this->
lng->txt(
'settings'),
1133 $this->ctrl->getLinkTarget($this, self::TAB_RECORD_SETTINGS)
1135 $this->
ctrl->setParameterByClass(
1136 strtolower(\ilAdvancedMDRecordTranslationGUI::class),
1138 $this->record->getRecordId()
1140 $this->
lng->loadLanguageModule(
'obj');
1141 $this->tabs_gui->addTab(
1142 self::TAB_TRANSLATION,
1143 $this->
lng->txt(
'obj_multilinguality'),
1144 $this->ctrl->getLinkTargetByClass(
1145 strtolower(\ilAdvancedMDRecordTranslationGUI::class),
1152 $this->tabs_gui->setBack2Target(
1153 $this->
lng->txt(
'md_adv_record_list'),
1154 $this->ctrl->getLinkTarget($this,
'showRecords')
1156 $this->tabs_gui->setBackTarget(
1157 $this->
lng->txt(
'md_adv_field_list'),
1158 $this->ctrl->getLinkTarget($this,
'editFields')
1165 if (is_object($this->import_form)) {
1170 $this->import_form->setMultipart(
true);
1171 $this->import_form->setFormAction($this->
ctrl->getFormAction($this));
1175 $file->setSuffixes(array(
'xml'));
1176 $file->setRequired(
true);
1177 $this->import_form->addItem($file);
1179 $this->import_form->setTitle($this->
lng->txt(
'md_adv_import_record'));
1180 $this->import_form->addCommandButton(
'importRecord', $this->
lng->txt(
'import'));
1181 $this->import_form->addCommandButton(
'showRecords', $this->
lng->txt(
'cancel'));
1186 $this->initImportForm();
1187 if (!$this->import_form->checkInput()) {
1188 $this->import_form->setValuesByPost();
1189 $this->importRecords();
1194 if (!$create_time = $import_files->moveUploadedFile($_FILES[
'file'][
'tmp_name'])) {
1195 $this->createRecord();
1203 if ($this->context === self::CONTEXT_OBJECT) {
1204 $parser->setContext($this->obj_id, $this->obj_type, $this->sub_type);
1209 $parser->startParsing();
1213 $parser->startParsing();
1214 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_added_new_record'),
true);
1215 $this->
ctrl->redirect($this,
"showRecords");
1217 $this->tpl->setOnScreenMessage(
'failure', $exc->getMessage(),
true);
1218 $this->
ctrl->redirect($this,
"importRecords");
1222 $import_files->deleteFileByCreationDate($create_time);
1232 $this->initRecordObject();
1233 $form = $this->initForm(
'create');
1234 if (!$this->
form->checkInput()) {
1235 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_check_input'));
1236 $this->createRecord($this->
form);
1240 $record = $this->loadRecordFormData($form);
1241 if ($this->obj_type) {
1242 $sub_types = (!is_array($this->sub_type))
1245 $assigned_object_types = array_map(
function ($sub_type) {
1247 "obj_type" => $this->obj_type,
1248 "sub_type" => $sub_type,
1252 $this->record->setAssignedObjectTypes($assigned_object_types);
1255 $record->setDefaultLanguage($this->
lng->getDefaultLanguage());
1259 $translations->addTranslationEntry($record->getDefaultLanguage(),
true);
1260 $translations->updateTranslations(
1261 $record->getDefaultLanguage(),
1262 $this->form->getInput(
'title'),
1263 $this->form->getInput(
'desc')
1265 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'md_adv_added_new_record'),
true);
1266 $this->
ctrl->redirect($this,
'showRecords');
1275 $record_id = $this->getRecordIdFromQuery();
1276 $field_id = $this->getFieldIdFromQuery();
1277 if (!$record_id || !$field_id) {
1278 $this->editFields();
1281 $this->
ctrl->saveParameter($this,
'field_id');
1282 $this->
ctrl->saveParameter($this,
'record_id');
1283 $this->initRecordObject();
1284 $this->setRecordSubTabs(2);
1289 $this->initLanguage($this->record->getRecordId());
1290 $this->showLanguageSwitch($this->record->getRecordId(),
'editField');
1291 $a_form = $this->initFieldForm($field_definition);
1294 if ($field_definition->hasComplexOptions()) {
1295 $table = $field_definition->getComplexOptionsOverview($this,
"editField");
1297 $this->tpl->setContent($a_form->getHTML() . $table);
1306 $record_id = $this->getRecordIdFromQuery();
1307 $field_id = $this->getFieldIdFromQuery();
1308 $this->
ctrl->saveParameter($this,
'record_id');
1309 $this->
ctrl->saveParameter($this,
'field_id');
1311 if (!$record_id || !$field_id) {
1312 $this->editFields();
1316 $this->initRecordObject();
1317 $this->initLanguage($record_id);
1318 $this->showLanguageSwitch($record_id,
'editField');
1322 $form = $this->initFieldForm($field_definition);
1323 if ($form->checkInput()) {
1324 $field_definition->importDefinitionFormPostValues($form, $this->getPermissions(), $this->active_language);
1325 if (!$field_definition->importDefinitionFormPostValuesNeedsConfirmation()) {
1326 $field_definition->update();
1328 $translations->updateFromForm($field_id, $this->active_language, $form);
1330 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'settings_saved'),
true);
1331 $this->
ctrl->redirect($this,
'editField');
1337 $form->setValuesByPost();
1341 $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"md_adv_confirm_definition"));
1342 $field_definition->prepareDefinitionFormConfirmation($form);
1345 $this->editField($form);
1354 $record_id = $this->getRecordIdFromQuery();
1355 $field_type = $this->getFieldTypeFromPost();
1357 $field_type = $this->getFieldTypeFromQuery();
1360 $this->initRecordObject();
1361 $this->
ctrl->setParameter($this,
'ftype', $field_type);
1362 $this->setRecordSubTabs(2);
1363 if (!$record_id || !$field_type) {
1364 $this->editFields();
1370 $field_definition->setRecordId($record_id);
1371 $a_form = $this->initFieldForm($field_definition);
1373 $this->tpl->setContent($a_form->getHTML());
1378 $record_id = $this->getRecordIdFromQuery();
1379 $ftype = $this->getFieldTypeFromQuery();
1381 if (!$record_id || !$ftype) {
1382 $this->editFields();
1386 $this->initRecordObject();
1387 $this->initLanguage($record_id);
1388 $this->
ctrl->saveParameter($this,
'ftype');
1394 $field_definition->setRecordId($record_id);
1395 $form = $this->initFieldForm($field_definition);
1397 if ($form->checkInput()) {
1398 $field_definition->importDefinitionFormPostValues($form, $this->getPermissions(), $this->active_language);
1399 $field_definition->save();
1402 $translations->read();
1403 $translations->updateFromForm($field_definition->getFieldId(), $this->active_language, $form);
1405 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'save_settings'),
true);
1406 $this->
ctrl->redirect($this,
"editFields");
1409 $form->setValuesByPost();
1410 $this->createField($form);
1415 $is_creation_mode = $a_definition->
getFieldId() ? false :
true;
1418 $form->setFormAction($this->
ctrl->getFormAction($this));
1421 if ($is_creation_mode) {
1424 $form->setDescription($translations->getFormTranslationInfo(
1426 $this->active_language
1431 $form->addItem($type);
1434 if ($is_creation_mode) {
1435 $form->setTitle($this->
lng->txt(
'md_adv_create_field'));
1436 $form->addCommandButton(
'saveField', $this->
lng->txt(
'create'));
1438 $form->setTitle($this->
lng->txt(
'md_adv_edit_field'));
1439 $form->addCommandButton(
'updateField', $this->
lng->txt(
'save'));
1442 $form->addCommandButton(
'editFields', $this->
lng->txt(
'cancel'));
1452 $perm = $this->getPermissions()->hasPermissions(
1454 (
string) $this->record->getRecordId(),
1472 $this->
form =
new ilPropertyFormGUI();
1475 $this->
form->setDescription($translations->getFormTranslationInfo($this->active_language));
1476 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1480 $title->setValue($this->record->getTitle());
1481 $title->setSize(20);
1482 $title->setMaxLength(70);
1483 $title->setRequired(
true);
1486 $title->setDisabled(
true);
1488 $this->
form->addItem($title);
1489 $translations->modifyTranslationInfoForTitle($this->
form, $title, $this->active_language);
1493 $desc->setValue($this->record->getDescription());
1497 $desc->setDisabled(
true);
1499 $this->
form->addItem($desc);
1500 $translations->modifyTranslationInfoForDescription($this->
form, $desc, $this->active_language);
1504 $check->setChecked($this->record->isActive());
1509 $check->setDisabled(
true);
1512 if (!$this->obj_type) {
1515 $scope->setInfo($this->
lng->txt(
'md_adv_scope_info'));
1516 $scope->setChecked($this->record->enabledScope());
1520 $this->
lng->txt(
'md_adv_scope_objects'),
1525 $subitems->setValue($this->record->getScopeRefIds());
1526 $exp = $subitems->getExplorerGUI();
1528 $definition =
$GLOBALS[
'DIC'][
'objDefinition'];
1530 foreach ($definition->getAllRepositoryTypes() as $type) {
1531 if ($definition->isContainer($type)) {
1532 $white_list[] = $type;
1536 $exp->setTypeWhiteList($white_list);
1537 $exp->setSkipRootNode(
false);
1539 $scope->addSubItem($subitems);
1542 if (!$this->obj_type) {
1544 $section->setTitle($this->
lng->txt(
'md_obj_types'));
1545 $this->
form->addItem($section);
1549 0 => $this->
lng->txt(
"meta_obj_type_inactive"),
1550 1 => $this->lng->txt(
"meta_obj_type_mandatory"),
1551 2 => $this->lng->txt(
"meta_obj_type_optional")
1555 $t = $type[
"obj_type"] .
":" . $type[
"sub_type"];
1556 $this->
lng->loadLanguageModule($type[
"obj_type"]);
1563 if ($type[
"obj_type"] ==
"prtf" && $type[
"sub_type"] ==
"pfpg") {
1567 if ($type[
"obj_type"] ==
"tals" && $type[
"sub_type"] ==
"etal") {
1572 $type_options = $options;
1573 switch ($type[
"obj_type"]) {
1576 unset($type_options[1]);
1580 unset($type_options[1]);
1584 unset($type_options[2]);
1589 if ($a_mode ==
"edit") {
1590 foreach ($this->record->getAssignedObjectTypes() as $item) {
1591 if ($item[
"obj_type"] == $type[
"obj_type"] &&
1592 $item[
"sub_type"] == $type[
"sub_type"]) {
1593 $value = $item[
"optional"]
1600 $sel_name =
'obj_types__' . $t;
1604 $hidden->setValue((
string) $value);
1605 $this->
form->addItem($hidden);
1611 $check->setOptions($type_options);
1612 $check->setValue($value);
1616 $check->setDisabled(
true);
1623 $this->
form->setTitle($this->
lng->txt(
'md_adv_create_record'));
1624 $this->
form->addCommandButton(
'saveRecord', $this->
lng->txt(
'add'));
1625 $this->
form->addCommandButton(
'showRecords', $this->
lng->txt(
'cancel'));
1629 $this->
form->setTitle($this->
lng->txt(
'md_adv_edit_record'));
1630 $this->
form->addCommandButton(
'updateRecord', $this->
lng->txt(
'save'));
1631 $this->
form->addCommandButton(
'showRecords', $this->
lng->txt(
'cancel'));
1638 if ($a_obj_type ==
"crs") {
1639 $perm = $this->getPermissions()->hasPermissions(
1641 (
string) $a_field_id,
1661 } elseif ($a_obj_type ==
"cat") {
1662 $perm = $this->getPermissions()->hasPermissions(
1664 (
string) $a_field_id,
1684 } elseif ($a_obj_type ==
"sess") {
1685 $perm = $this->getPermissions()->hasPermissions(
1687 (
string) $a_field_id,
1707 } elseif ($a_obj_type ==
"grp") {
1708 $perm = $this->getPermissions()->hasPermissions(
1710 (
string) $a_field_id,
1730 } elseif ($a_obj_type ==
"iass") {
1731 $perm = $this->getPermissions()->hasPermissions(
1733 (
string) $a_field_id,
1753 } elseif ($a_obj_type ==
"exc") {
1754 $perm = $this->getPermissions()->hasPermissions(
1756 (
string) $a_field_id,
1776 } elseif ($a_obj_type ==
"file") {
1777 $perm = $this->getPermissions()->hasPermissions(
1779 (
string) $a_field_id,
1799 } elseif ($a_obj_type ==
"prg") {
1800 $perm = $this->getPermissions()->hasPermissions(
1802 (
string) $a_field_id,
1822 } elseif ($a_obj_type ==
"orgu") {
1823 $perm = $this->getPermissions()->hasPermissions(
1825 (
string) $a_field_id,
1859 $ilAccess =
$DIC[
'ilAccess'];
1866 $this->
form->setFormAction($this->
ctrl->getFormAction($this));
1867 #$this->form->setTableWidth('100%');
1870 foreach ($visible_records as $obj_type => $records) {
1873 if (in_array($obj_type, $this->permissions->getAllowedObjectTypes())) {
1874 $perm = $this->getPermissions()->hasPermissions(
1891 $section->setTitle($this->
lng->txt(
'objs_' . $obj_type));
1892 $this->
form->addItem($section);
1896 $check->setOptionTitle($this->
lng->txt(
'md_adv_desc_show'));
1897 $check->setChecked($sub->isDescriptionEnabled());
1901 $check->setDisabled(
true);
1906 $check->setOptionTitle($this->
lng->txt(
'md_adv_fields_show'));
1907 $check->setChecked($sub->enabledFieldNames());
1911 $check->setDisabled(
true);
1920 $definitions = $sub->sortDefinitions($definitions);
1923 foreach ($definitions as $def) {
1924 $definition_id = $def->getFieldId();
1926 $perm = $this->getSubstitutionFieldPermissions($obj_type, $definition_id);
1929 $title = $def->getTitle() .
' (' . $title .
')';
1933 $check->setOptionTitle($this->
lng->txt(
'md_adv_show'));
1934 $check->setChecked($sub->isSubstituted($definition_id));
1936 if ($perm && !$perm[
"show"]) {
1937 $check->setDisabled(
true);
1941 $this->
lng->txt(
'position'),
1942 'position_' . $obj_type .
'_' . $definition_id
1945 $pos->setMaxLength(4);
1946 $pos->allowDecimals(
true);
1947 $pos->setValue(sprintf(
'%.1f',
$counter++));
1948 $check->addSubItem($pos);
1950 if ($perm && !$perm_pos) {
1951 $pos->setDisabled(
true);
1955 $this->
lng->txt(
'bold'),
1956 'bold_' . $obj_type .
'_' . $definition_id
1958 $bold->setValue(
"1");
1959 $bold->setChecked($sub->isBold($definition_id));
1960 $check->addSubItem($bold);
1962 if ($perm && !$perm[
"bold"]) {
1963 $bold->setDisabled(
true);
1967 $this->
lng->txt(
'newline'),
1968 'newline_' . $obj_type .
'_' . $definition_id
1970 $bold->setValue(
"1");
1971 $bold->setChecked($sub->hasNewline($definition_id));
1972 $check->addSubItem($bold);
1974 if ($perm && !$perm[
"newline"]) {
1975 $bold->setDisabled(
true);
1981 $this->
form->setTitle($this->
lng->txt(
'md_adv_substitution_table'));
1983 if ($ilAccess->checkAccess(
'write',
'', $this->ref_id)) {
1984 $this->
form->addCommandButton(
'updateSubstitutions', $this->
lng->txt(
'save'));
1993 $perm = $this->getPermissions()->hasPermissions(
1995 (
string) $this->record->getRecordId(),
2014 $this->record->setActive((
bool) $form->
getInput(
'active'));
2018 $translations->getDefaultTranslation() ==
null ||
2019 $translations->getDefaultTranslation()->getLangKey() == $this->active_language
2021 $this->record->setTitle((
string) $form->
getInput(
'title'));
2026 $translations->getDefaultTranslation() ==
null ||
2027 $translations->getDefaultTranslation()->getLangKey() == $this->active_language) {
2028 $this->record->setDescription($form->
getInput(
'desc'));
2032 if (!$this->obj_type) {
2036 $t = $type[
"obj_type"] .
":" . $type[
"sub_type"];
2037 $value = $form->
getInput(
'obj_types__' . $t);
2042 'obj_type' => $type[
'obj_type'],
2043 'sub_type' => $type[
'sub_type'],
2044 'optional' => ($value > 1)
2047 $this->record->setAssignedObjectTypes($obj_types);
2052 $scopes_selection = $form->
getInput(
'scope_containers');
2053 if (
$scopes && is_array($scopes_selection)) {
2054 $this->record->enableScope(
true);
2055 $this->record->setScopes(
2057 function (
string $scope_ref_id) {
2059 $scope->setRefId((
int) $scope_ref_id);
2066 $this->record->enableScope(
false);
2067 $this->record->setScopes([]);
2069 return $this->record;
2078 $record_id = $this->getRecordIdFromQuery();
2080 $this->
ctrl->saveParameter($this,
'record_id');
2083 if (!$record_id && $this->obj_id) {
2084 $this->record->setParentObject($this->obj_id);
2087 return $this->record;
2096 if (
$context == self::CONTEXT_OBJECT) {
2100 $this->tabs_gui->clearSubTabs();
2102 $this->tabs_gui->addSubTabTarget(
2103 "md_adv_record_list",
2104 $this->
ctrl->getLinkTarget($this,
"showRecords"),
2112 $this->tabs_gui->addSubTabTarget(
2113 "md_adv_presentation",
2114 $this->
ctrl->getLinkTarget($this,
"showPresentation")
2118 $this->tabs_gui->addSubTabTarget(
2120 $this->
ctrl->getLinkTarget($this,
"showFiles"),
2133 $sub_type = (!is_array($this->sub_type))
2137 if ($this->context === self::CONTEXT_OBJECT) {
2139 foreach ($sub_type as $st) {
2146 $records = $orderings->sortRecords($records, $this->obj_id);
2151 foreach ($records as $record) {
2152 $parent_id = $record->getParentObject();
2154 if ($this->context == self::CONTEXT_ADMINISTRATION) {
2160 if ($parent_id && $parent_id != $this->obj_id) {
2165 if (!$parent_id && !$record->isActive()) {
2172 $record->getScopes()
2180 $tmp_arr[
'readonly'] =
null;
2181 $tmp_arr[
'local'] =
null;
2182 $tmp_arr[
'optional'] =
null;
2183 $tmp_arr[
'id'] = $record->getRecordId();
2184 $tmp_arr[
'active'] = $record->isActive();
2185 $tmp_arr[
'title'] = $record->getTitle();
2186 $tmp_arr[
'description'] = $record->getDescription();
2187 $tmp_arr[
'fields'] = [];
2194 $tmp_arr[
'obj_types'] = $record->getAssignedObjectTypes();
2195 foreach ($record->getAssignedObjectTypes() as $idx => $item) {
2196 $tmp_arr[
'obj_types'][$idx][
'context'] =
null;
2199 $tmp_arr[
'position'] = $position;
2201 $tmp_arr[
'perm'] = $this->permissions->hasPermissions(
2203 (
string) $record->getRecordId(),
2217 if ($this->obj_type) {
2218 $tmp_arr[
"readonly"] = !(bool) $parent_id;
2219 $tmp_arr[
"local"] = $parent_id;
2222 $assigned = (bool) $parent_id;
2224 foreach ($tmp_arr[
'obj_types'] as $idx => $item) {
2225 if ($item[
"obj_type"] == $this->obj_type &&
2226 in_array($item[
"sub_type"], $sub_type)) {
2228 $optional = $item[
"optional"];
2229 $tmp_arr[
'obj_types'][$idx][
'context'] =
true;
2231 unset($tmp_arr[
'obj_types'][$idx]);
2234 $tmp_arr[
'optional'] = $optional;
2238 $tmp_arr[
'local_selected'] = [];
2239 foreach ($selected as $key => $records) {
2240 if (in_array($record->getRecordId(), $records)) {
2241 $tmp_arr[
'local_selected'][$this->obj_type][] = $key;
2247 if ($assigned ??
true) {
2261 $field_id = $this->getFieldIdFromQuery();
2263 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'err_select_one'));
2264 $this->
ctrl->redirect($this,
'showRecords');
2268 if (!$field_definition->hasComplexOptions()) {
2269 $this->
ctrl->redirect($this,
"editField");
2273 $a_form = $this->initComplexOptionForm($field_definition);
2276 $this->tpl->setContent($a_form->getHTML());
2281 $this->
ctrl->saveParameter($this,
"record_id");
2282 $this->
ctrl->saveParameter($this,
"field_id");
2283 $this->
ctrl->saveParameter($this,
"oid");
2286 $form->setTitle($this->
lng->txt(
"md_adv_edit_complex_option"));
2287 $form->setFormAction($this->
ctrl->getFormAction($this,
"updateComplexOption"));
2289 $oid = $this->getOidFromQuery();
2290 $a_def->initOptionForm($form, $oid);
2292 $form->addCommandButton(
"updateComplexOption", $this->
lng->txt(
"save"));
2293 $form->addCommandButton(
"editField", $this->
lng->txt(
"cancel"));
2300 $field_id = $this->getFieldIdFromQuery();
2302 $oid = $this->getOidFromQuery();
2304 if ($field_definition->hasComplexOptions()) {
2305 $form = $this->initComplexOptionForm($field_definition);
2306 if ($form->checkInput() &&
2307 $field_definition->updateComplexOption($form, $oid)) {
2308 $field_definition->update();
2309 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"settings_saved"),
true);
2313 $this->
ctrl->redirect($this,
"editField");
2321 foreach ($translations->getTranslations() as $translation) {
2322 if ($translation->getLangKey() == $translations->getDefaultLanguage()) {
2323 $default = $translation->getLangKey();
2326 $active = $this->request->getQueryParams()[
'mdlang'] ?? $default;
2327 $this->active_language = $active;
2334 if (count($translations->getTranslations()) <= 1) {
2338 foreach ($translations->getTranslations() as $translation) {
2339 $this->
ctrl->setParameter($this,
'mdlang', $translation->getLangKey());
2340 $actions[$translation->getLangKey()] = $this->
ctrl->getLinkTarget(
2345 $this->
ctrl->setParameter($this,
'mdlang', $this->active_language);
2346 $view_control = $this->ui_factory->viewControl()->mode(
2348 $this->
lng->txt(
'meta_aria_language_selection')
2349 )->withActive($this->active_language);
2350 $this->
toolbar->addComponent($view_control);
Builds a Color from either hex- or rgb values.
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 ACTION_SUBSTITUTION_COURSE_SHOW_FIELD
const SUBACTION_FIELD_SEARCHABLE
const CONTEXT_SUBSTITUTION_SESSION
const CONTEXT_SUBSTITUTION_FILE
const ACTION_RECORD_EXPORT
const ACTION_SUBSTITUTION_SHOW_FIELDNAMES
const SUBACTION_RECORD_DESCRIPTION
const ACTION_SUBSTITUTION_FIELD_POSITIONS
const CONTEXT_SUBSTITUTION_PRG
const ACTION_SUBSTITUTION_GROUP_SHOW_FIELD
const ACTION_SUBSTITUTION_CATEGORY_EDIT_FIELD_PROPERTY
const ACTION_RECORD_CREATE_FIELD
const ACTION_SUBSTITUTION_GROUP_EDIT_FIELD_PROPERTY
const CONTEXT_SUBSTITUTION_COURSE
const CONTEXT_SUBSTITUTION_CATEGORY
const ACTION_SUBSTITUTION_PRG_SHOW_FIELD
const ACTION_SUBSTITUTION_EXERCISE_EDIT_FIELD_PROPERTY
const ACTION_SUBSTITUTION_ORG_UNIT_EDIT_FIELD_PROPERTY
const ACTION_RECORD_EDIT_FIELDS
const ACTION_RECORD_FIELD_POSITIONS
const SUBACTION_RECORD_TITLE
const ACTION_SUBSTITUTION_SHOW_DESCRIPTION
const SUBACTION_SUBSTITUTION_BOLD
const ACTION_FIELD_EDIT_PROPERTY
const ACTION_SUBSTITUTION_COURSE_EDIT_FIELD_PROPERTY
const CONTEXT_SUBSTITUTION_IASS
const ACTION_SUBSTITUTION_FILE_SHOW_FIELD
const ACTION_RECORD_TOGGLE_ACTIVATION
const SUBACTION_SUBSTITUTION_NEWLINE
const ACTION_SUBSTITUTION_CATEGORY_SHOW_FIELD
const ACTION_SUBSTITUTION_IASS_SHOW_FIELD
const ACTION_MD_CREATE_RECORD
const ACTION_SUBSTITUTION_EXERCISE_SHOW_FIELD
const CONTEXT_SUBSTITUTION
const ACTION_RECORD_EDIT_PROPERTY
const ACTION_SUBSTITUTION_SESSION_SHOW_FIELD
const ACTION_MD_IMPORT_RECORDS
const SUBACTION_RECORD_OBJECT_TYPES
const ACTION_SUBSTITUTION_FILE_EDIT_FIELD_PROPERTY
const ACTION_SUBSTITUTION_SESSION_EDIT_FIELD_PROPERTY
const CONTEXT_SUBSTITUTION_EXERCISE
const ACTION_SUBSTITUTION_IASS_EDIT_FIELD_PROPERTY
const ACTION_SUBSTITUTION_ORG_UNIT_SHOW_FIELD
const ACTION_RECORD_DELETE
const ACTION_SUBSTITUTION_PRG_EDIT_FIELD_PROPERTY
const CONTEXT_SUBSTITUTION_ORG_UNIT
const CONTEXT_SUBSTITUTION_GROUP
const ACTION_FIELD_DELETE
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.
getSubstitutionFieldPermissions(string $a_obj_type, int $a_field_id)
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
initComplexOptionForm(ilAdvancedMDFieldDefinition $a_def)
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.
static http()
Fetches the global http state from ILIAS.
form( $class_path, string $cmd, string $submit_caption="")
if(!file_exists('../ilias.ini.php'))