19 declare(strict_types=1);
122 public function __construct(
$data,
int $id = 0,
bool $call_by_reference =
true,
bool $prepare_output =
true)
126 $this->request = $DIC->http()->request();
127 $this->
locator = $DIC[
"ilLocator"];
128 $this->
user = $DIC->user();
129 $this->
access = $DIC->access();
131 $this->
toolbar = $DIC->toolbar();
132 $this->rbac_admin = $DIC->rbac()->admin();
133 $this->rbac_system = $DIC->rbac()->system();
134 $this->rbac_review = $DIC->rbac()->review();
135 $this->object_service = $DIC->object();
136 $this->obj_definition = $DIC[
"objDefinition"];
137 $this->tpl = $DIC[
"tpl"];
138 $this->tree = $DIC->repositoryTree();
139 $this->
ctrl = $DIC->ctrl();
140 $this->error = $DIC[
"ilErr"];
141 $this->
lng = $DIC->language();
142 $this->tabs_gui = $DIC->tabs();
143 $this->
ilias = $DIC[
"ilias"];
144 $this->post_wrapper = $DIC->http()->wrapper()->post();
145 $this->request_wrapper = $DIC->http()->wrapper()->query();
149 $this->custom_icon_factory = $DIC[
'object.customicons.factory'];
150 $this->ui_factory = $DIC[
'ui.factory'];
151 $this->ui_renderer = $DIC[
'ui.renderer'];
158 $this->
lng->loadLanguageModule(
'obj');
161 if (!$call_by_reference) {
166 if ($this->request_wrapper->has(
'ref_id')) {
167 $this->requested_ref_id = $this->request_wrapper->retrieve(
'ref_id', $this->
refinery->kindlyTo()->int());
173 if ($call_by_reference) {
176 if ($this->request_wrapper->has(
'obj_id')) {
177 $this->obj_id = $this->request_wrapper->retrieve(
'obj_id', $this->
refinery->kindlyTo()->int());
183 $this->requested_crtptrefid = $this->retriever->getMaybeInt(
'crtptrefid', 0);
184 $this->requested_crtcb = $this->retriever->getMaybeInt(
'crtcb', 0);
185 $this->requested_new_type = $this->retriever->getMaybeString(
'new_type',
'');
188 if ($this->
id != 0) {
194 if (is_object($this->
object)) {
195 if ($this->call_by_reference && $this->ref_id == $this->requested_ref_id) {
196 $this->
ctrl->setContextObject(
198 $this->
object->getType()
203 if ($prepare_output) {
207 $this->notes_service = $DIC->notes();
212 if (!isset($this->multi_object_manipulator)) {
213 $this->multi_object_manipulator = ilObjectDIC::dic()[
'multi_object_properties_manipulator'];
225 if (!in_array($mode, [
226 self::ADMIN_MODE_NONE,
227 self::ADMIN_MODE_REPOSITORY,
228 self::ADMIN_MODE_SETTINGS
232 $this->admin_mode = $mode;
252 $cmd = $this->
ctrl->getCmd();
277 $this->creation_mode = $mode;
288 if ($this->
id != 0) {
289 if ($this->call_by_reference) {
299 $this->tpl->loadStandardTemplate();
300 $base_class = $this->request_wrapper->retrieve(
"baseClass", $this->
refinery->kindlyTo()->string());
301 if (strtolower($base_class) ==
"iladministrationgui") {
303 $this->tpl->setLocator();
318 if ($this->call_by_reference) {
321 $class_name = $this->obj_definition->getClassName($obj_type);
322 $class = strtolower(
"ilObj" . $class_name .
"GUI");
323 $class_path = $this->
ctrl->lookupClassPath($class);
324 $class_name = $this->
ctrl->getClassForClasspath($class_path);
333 if ($file_upload_dropzone->isUploadAllowed($this->object->getType())) {
343 if (!is_object($this->
object)) {
344 if ($this->requested_crtptrefid > 0) {
346 $this->tpl->setTitle(
349 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
356 $this->tpl->setTitle(
358 $this->
object->getPresentationTitle(),
359 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
362 $this->tpl->setDescription(
364 $this->
object->getLongDescription(),
365 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
369 $base_class = $this->request_wrapper->retrieve(
"baseClass", $this->
refinery->kindlyTo()->string());
370 if (strtolower($base_class) ===
"iladministrationgui") {
374 $this->tpl->setTitleIcon(
376 $this->
lng->txt(
"obj_" . $this->object->getType())
379 if (!$this->obj_definition->isAdministrationObject($this->object->getType())) {
381 $lgui->initItem($this->
object->getRefId(), $this->
object->getId(), $this->
object->getType());
382 $this->tpl->setAlertProperties($lgui->getAlertProperties());
393 $this->
object->getId()
402 if (!$this->creation_mode && $this->
object) {
405 $dispatcher->setSubObject($sub_type, $sub_id);
408 $this->
ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
410 $this->
ctrl->getLinkTargetByClass([
"ilcommonactiondispatchergui",
"iltagginggui"],
"",
"",
true)
413 $lg = $dispatcher->initHeaderAction();
415 if (is_object($lg)) {
418 $lg->setContainerObject($this);
421 $lg->enableMultiDownload(
true);
426 $this->
access->checkAccess(
"write",
"", $this->ref_id) ||
427 $this->
access->checkAccess(
"edit_permissions",
"", $this->ref_id) ||
428 $this->notes_service->domain()->commentsActive($this->
object->getId())
430 $lg->enableComments(
true);
433 $lg->enableNotes(
true);
434 $lg->enableTags(
true);
448 !is_object($this->
object) ||
454 if (is_object($list_gui)) {
455 $this->tpl->setHeaderActionMenu($list_gui->getHeaderAction());
473 echo $lg->getHeaderAction();
476 echo $this->tpl->getOnLoadCodeForAsynch();
502 $this->tabs_gui->addTarget(
504 $this->
ctrl->getLinkTarget($this,
"view"),
511 $this->tabs_gui->addTarget(
513 $this->
ctrl->getLinkTargetByClass([get_class($this),
'ilpermissiongui'],
"perm"),
530 if ($this->omit_locator) {
535 if ($this->call_by_reference) {
540 if ($this->requested_ref_id === 0) {
541 $ref_id = $this->
object->getRefId();
543 $ilLocator->addRepositoryItems($ref_id);
546 if (!$this->creation_mode) {
563 $this->omit_locator = $omit;
572 if ($this->admin_mode == self::ADMIN_MODE_SETTINGS) {
573 $this->
ctrl->setParameterByClass(
574 "ilobjsystemfoldergui",
579 $this->
lng->txt(
"administration"),
580 $this->
ctrl->getLinkTargetByClass([
"iladministrationgui",
"ilobjsystemfoldergui"],
"")
584 $this->
object->getTitle(),
585 $this->
ctrl->getLinkTarget($this,
"view")
589 $this->
ctrl->setParameterByClass(
590 "iladministrationgui",
594 $this->
ctrl->setParameterByClass(
595 "iladministrationgui",
599 $this->
ctrl->clearParametersByClass(
"iladministrationgui");
600 $this->
locator->addAdministrationItems();
610 if (!$this->request_wrapper->has(
'id')) {
611 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
612 $this->
ctrl->returnToParent($this);
618 $this->request_wrapper->retrieve(
620 $this->refinery->kindlyTo()->string()
623 )->withRequest($this->request)->getData();
625 if (
$data === null) {
626 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
627 $this->
ctrl->returnToParent($this);
633 $this->
ctrl->redirectByClass(static::class);
640 function (array
$c, array|
int|null $v): array {
648 $this->
refinery->kindlyTo()->listOf($this->
refinery->kindlyTo()->int())->transform($v)
652 $c[] = $this->
refinery->kindlyTo()->int()->transform($v);
665 $this->
ctrl->returnToParent($this);
676 $this->
ctrl->saveParameter($this,
"crtptrefid");
678 $this->
ctrl->saveParameter($this,
"crtcb");
681 $this->error->raiseError($this->
lng->txt(
"permission_denied"), $this->error->MESSAGE);
683 $this->
lng->loadLanguageModule($new_type);
684 $this->
ctrl->setParameter($this,
"new_type", $new_type);
689 if ($this->request_wrapper->has(
"cpfl") && isset($forms[self::CFORM_CLONE])) {
690 $forms = [self::CFORM_CLONE => $forms[self::CFORM_CLONE]];
718 foreach ($forms as $id => $form) {
727 foreach ($forms as $form_type => $cf) {
728 $htpl =
new ilTemplate(
"tpl.creation_acc_head.html",
true,
true,
"Services/Object");
732 if (method_exists($this,
"getCreationFormTitle")) {
733 $form_title = $this->getCreationFormTitle($form_type);
736 $form_title = $cf->getTitle();
740 $htpl->setVariable(
"TITLE", $this->
lng->txt(
"option") .
" " . $cnt .
": " . $form_title);
742 $cf->setTitleIcon(
'');
743 $cf->setTableWidth(
"100%");
745 $acc->addItem($htpl->get(), $cf->getHTML());
750 return "<div class='ilCreationFormSection'>" . $acc->getHTML() .
"</div>";
756 $form->setTarget(
"_top");
757 $form->setFormAction($this->
ctrl->getFormAction($this,
"save"));
758 $form->setTitle($this->
lng->txt($new_type .
"_new"));
763 $ti->setRequired(
true);
774 $form->addCommandButton(
"save", $this->
lng->txt($new_type .
"_add"));
775 $form->addCommandButton(
"cancel", $this->
lng->txt(
"cancel"));
782 $this->
lng->loadLanguageModule(
'didactic');
783 $existing_exclusive =
false;
785 $options[
'dtpl_0'] = [
786 $this->
lng->txt(
'didactic_default_type'),
788 $this->
lng->txt(
'didactic_default_type_info'),
789 $this->
lng->txt(
'objs_' . $this->type)
795 foreach ($templates as $template) {
796 if ($template->isEffective((
int) $this->requested_ref_id)) {
797 $options[
"dtpl_" . $template->getId()] = [
798 $template->getPresentationTitle(),
799 $template->getPresentationDescription()
802 if ($template->isExclusive()) {
803 $existing_exclusive =
true;
811 if (
sizeof($options) > 1) {
813 $this->
lng->txt(
'type'),
820 $type->setValue($value);
822 if (!in_array($value, array_keys($options)) || ($existing_exclusive && $value ==
"dtpl_0")) {
824 $options[$value] = [$this->
lng->txt(
'not_available')];
827 if ($existing_exclusive) {
829 $keys = array_keys($options);
830 $type->setValue($keys[1]);
832 $type->setValue(
'dtpl_0');
837 foreach ($options as $id =>
$data) {
839 if ($existing_exclusive && $id ==
'dtpl_0') {
841 $option->setDisabled(
true);
844 $type->addOption($option);
861 $this->ui_factory->link()->standard(
862 $this->
lng->txt(
'cntr_adopt_content'),
863 $this->
ctrl->getLinkTargetByClass(
883 $item_ref_ids = $this->retriever->getSelectedIdsFromObjectList();
886 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_write'));
894 if ($availability_period_modal !== null) {
895 $this->tpl->setVariable(
897 $this->ui_renderer->render(
898 $availability_period_modal->withOnLoad(
899 $availability_period_modal->getShowSignal()
904 $this->renderObject();
914 if ($availability_period_modal ===
true) {
915 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
'availability_period_changed'));
916 } elseif ($availability_period_modal ===
false) {
917 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_write'));
919 $this->tpl->setVariable(
921 $this->ui_renderer->render(
922 $availability_period_modal->withOnLoad(
923 $availability_period_modal->getShowSignal()
928 $this->renderObject();
936 $this->
ctrl->redirectByClass(
"ilrepositorygui",
"");
943 $this->error->raiseError($this->
lng->txt(
"no_create_permission"), $this->error->MESSAGE);
946 $this->
lng->loadLanguageModule($this->requested_new_type);
947 $this->
ctrl->setParameter($this,
"new_type", $this->requested_new_type);
950 if ($form->checkInput()) {
951 $this->
ctrl->setParameter($this,
"new_type",
"");
953 $class_name =
"ilObj" . $this->obj_definition->getClassName($this->requested_new_type);
954 $newObj =
new $class_name();
955 $newObj->setType($this->requested_new_type);
956 $newObj->setTitle($form->getInput(
"title"));
957 $newObj->setDescription($form->getInput(
"desc"));
958 $newObj->processAutoRating();
965 $newObj->applyDidacticTemplate($dtpl);
971 $form->setValuesByPost();
972 $this->tpl->setContent($form->getHTML());
980 if (!$this->post_wrapper->has(
"didactic_type")) {
984 $tpl = $this->post_wrapper->retrieve(
"didactic_type", $this->
refinery->kindlyTo()->string());
985 if (substr($tpl, 0, strlen($type) + 1) != $type .
"_") {
989 return (
int) substr($tpl, strlen($type) + 1);
997 if (!$parent_node_id) {
1002 if ($this->requested_crtptrefid > 0) {
1010 $this->obj_id = $obj->
getId();
1018 $rbac_log_roles = $this->rbac_review->getParentRoleIds($this->ref_id,
false);
1031 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"object_added"),
true);
1032 $this->
ctrl->returnToParent($this);
1038 $this->error->raiseError($this->
lng->txt(
"msg_no_perm_write"), $this->error->MESSAGE);
1041 $this->tabs_gui->activateTab(
"settings");
1046 $form->setValuesByArray($values);
1051 $this->tpl->setContent($form->getHTML());
1066 $form->setFormAction($this->
ctrl->getFormAction($this,
"update"));
1067 $form->setTitle($this->
lng->txt($this->object->getType() .
"_edit"));
1072 $ti->setRequired(
true);
1073 $form->addItem($ti);
1079 $form->addItem($ta);
1083 $form->addCommandButton(
"update", $this->
lng->txt(
"save"));
1097 $values[
"title"] = $this->
object->getTitle();
1098 $values[
"desc"] = $this->
object->getLongDescription();
1116 $this->error->raiseError($this->
lng->txt(
"permission_denied"), $this->error->MESSAGE);
1122 $this->
object->setTitle($form->getInput(
'title'));
1123 $this->
object->setDescription($form->getInput(
'desc'));
1124 $this->
object->update();
1131 $this->tabs_gui->activateTab(
"settings");
1132 $form->setValuesByPost();
1133 $this->tpl->setContent($form->getHTML());
1156 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_obj_modified"),
true);
1157 $this->
ctrl->redirect($this,
"edit");
1164 $upload_files = $export_directory->getFilesFor($this->
user->getId(), $new_type);
1165 $has_upload_files =
false;
1166 if (count($upload_files)) {
1167 $has_upload_files =
true;
1171 $form->setTarget(
"_top");
1172 $form->setFormAction($this->
ctrl->getFormAction($this,
"importFile"));
1173 $form->setTitle($this->
lng->txt($new_type .
"_import"));
1177 $fi->setRequired(
true);
1178 if ($has_upload_files) {
1179 $this->
lng->loadLanguageModule(
'content');
1181 $this->
lng->txt(
'cont_choose_file_source'),
1184 $option->
setValue((
string) self::UPLOAD_TYPE_LOCAL);
1185 $form->addItem($option);
1187 $direct =
new ilRadioOption($this->
lng->txt(
'cont_choose_local'), (string) self::UPLOAD_TYPE_LOCAL);
1188 $option->addOption($direct);
1190 $direct->addSubItem($fi);
1192 $this->
lng->txt(
'cont_choose_upload_dir'),
1193 (string) self::UPLOAD_TYPE_UPLOAD_DIRECTORY
1195 $option->addOption($upload);
1197 $this->
lng->txt(
'cont_choose_upload_dir'),
1200 $upload_files[
''] = $this->
lng->txt(
'cont_select_from_upload_dir');
1201 $files->setOptions($upload_files);
1202 $files->setRequired(
true);
1203 $upload->addSubItem($files);
1206 if (!$has_upload_files) {
1207 $form->addItem($fi);
1210 $form->addCommandButton(
"importFile", $this->
lng->txt(
"import"));
1211 $form->addCommandButton(
"cancel", $this->
lng->txt(
"cancel"));
1222 $upload_type = self::UPLOAD_TYPE_LOCAL;
1223 if ($this->post_wrapper->has(
"upload_type")) {
1224 $upload_type = $this->post_wrapper->retrieve(
"upload_type", $this->
refinery->kindlyTo()->int());
1229 $this->error->raiseError($this->
lng->txt(
"no_create_permission"));
1232 $this->
lng->loadLanguageModule($new_type);
1233 $this->
ctrl->setParameter($this,
"new_type", $new_type);
1236 if ($form->checkInput()) {
1238 if ($this->obj_definition->isContainer($new_type)) {
1241 $imp =
new ilImport((
int) $parent_id);
1245 if ($upload_type == self::UPLOAD_TYPE_LOCAL) {
1246 $new_id = $imp->importObject(
1248 $_FILES[
"importfile"][
"tmp_name"],
1249 $_FILES[
"importfile"][
"name"],
1253 $hash = $this->request->getParsedBody()[
'uploadFile'] ??
'';
1256 $file = $export_upload->getAbsolutePathForHash($this->
user->getId(), $new_type, $hash);
1258 $new_id = $imp->importObject(
1268 $this->tmp_import_dir = $imp->getTemporaryImportDir();
1269 $this->
lng->loadLanguageModule(
'obj');
1271 $this->tpl->setOnScreenMessage(
1273 $this->
lng->txt(
"obj_import_file_error") .
" <br />" . $e->getMessage()
1275 $form->setValuesByPost();
1276 $this->tpl->setContent($form->getHTML());
1281 $this->
ctrl->setParameter($this,
"new_type",
"");
1285 if (!$this->obj_definition->isContainer($new_type)) {
1289 if (count($ref_ids) === 1) {
1290 $newObj->setRefId((
int) current($ref_ids));
1297 if ($this->obj_definition->isContainer($new_type)) {
1298 $this->tpl->setOnScreenMessage(
"failure", $this->
lng->txt(
"container_import_zip_file_invalid"));
1306 $form->setValuesByPost();
1307 $this->tpl->setContent($form->getHTML());
1315 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"object_added"),
true);
1316 $this->
ctrl->returnToParent($this);
1322 public function getFormAction(
string $cmd,
string $default_form_action =
""): string
1324 if ($this->form_action[$cmd] !=
"") {
1325 return $this->form_action[$cmd];
1328 return $default_form_action;
1341 if (($this->return_location[$cmd] ??
"") !==
"") {
1342 return $this->return_location[$cmd];
1344 return $default_location;
1353 $this->return_location[$cmd] =
$location;
1359 protected function getTargetFrame(
string $cmd,
string $default_target_frame =
""): string
1361 if (isset($this->target_frame[$cmd]) && $this->target_frame[$cmd] !=
"") {
1362 return $this->target_frame[$cmd];
1365 if (!empty($default_target_frame)) {
1366 return "target=\"" . $default_target_frame .
"\"";
1377 $this->target_frame[$cmd] =
"target=\"" . $target_frame .
"\"";
1384 if ($visible && $type ==
'crs') {
1391 if (!$tmp_obj->isActivated()) {
1409 $this->tabs_gui->activateTab(
'view');
1412 $this->
object->getType(),
1413 $this->
object->getRefId(),
1414 $this->
object->getId(),
1415 $this->
user->getId()
1419 $this->
ctrl->setParameter($this,
'obj_id', $this->obj_id);
1425 $this->requested_ref_id,
1429 $this->tpl->setContent($itab->getHTML());
1440 if ($this->post_wrapper->has(
'id')) {
1441 $request_ids = $this->post_wrapper->retrieve(
1448 $this->request_wrapper->has(
'item_ref_id')
1449 && $this->request_wrapper->retrieve(
'item_ref_id', $this->
refinery->kindlyTo()->string()) !==
"" 1451 $request_ids = [$this->request_wrapper->retrieve(
'item_ref_id', $this->
refinery->kindlyTo()->int())];
1454 if ($request_ids === []) {
1455 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'no_checkbox'),
true);
1456 $this->
ctrl->returnToParent($this);
1460 $this->tpl->setVariable(
1462 $this->ui_renderer->render(
1464 $modal->getShowSignal()
1468 $this->renderObject();
1475 $msg = $this->
lng->txt(
'info_delete_sure');
1476 if (!$this->
settings->get(
'enable_trash')) {
1477 $msg .=
"<br/>" . $this->
lng->txt(
'info_delete_warning_no_trash');
1481 $this->ui_factory->messageBox()->confirmation($msg),
1482 $this->ui_factory->listing()->unordered($listing_items)
1485 if ($has_additional_references) {
1486 $content[] = $this->ui_factory->messageBox()->confirmation(
1487 $this->
lng->txt(
'multiple_reference_deletion_info') .
' ' 1488 . $this->
lng->txt(
'rep_multiple_reference_deletion_instruction')
1492 $this->
ctrl->setParameterByClass(static::class,
'id', implode(
',', $request_ids));
1493 $target_url = $this->
ctrl->getFormActionByClass(static::class,
'confirmedDelete');
1494 $this->
ctrl->clearParameterByClass(static::class,
'id');
1496 return $this->ui_factory->modal()->roundtrip(
1497 $this->
lng->txt(
'confirm'),
1501 )->withSubmitLabel($this->
lng->txt(
'delete'));
1507 $path_gui->enableTextOnly(
true);
1508 $path_gui->enableHideLeaf(
false);
1509 return array_reduce(
1511 function (array
$c,
int $v) use ($path_gui): array {
1515 $c[1][] = $this->ui_factory->input()->field()->hidden()->withValue($v);
1518 if ($other_references !== []) {
1519 $c[1][] = $this->ui_factory->input()->field()->multiSelect(
1535 return array_reduce(
1537 function (array
$c,
int $v) use ($ref_id, $path_gui): array {
1539 && !$this->tree->isDeleted($v)
1540 && $this->
access->checkAccess(
'delete',
'', $v)) {
1554 if ($this->sub_objects ==
"") {
1555 $sub_objects = $this->obj_definition->getCreatableSubObjects(
1556 $this->
object->getType(),
1565 if (count($sub_objects) > 0) {
1566 foreach ($sub_objects as $row) {
1568 if ($row[
"max"] > 0) {
1570 for ($i = 0; $i < count($this->data[
"ctrl"]); $i++) {
1571 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"]) {
1577 if ($row[
"max"] ==
"" || $count < $row[
"max"]) {
1578 $subobj[] = $row[
"name"];
1583 if (count($subobj) > 0) {
1585 $this->tpl->setCurrentBlock(
"add_object");
1586 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1587 $this->tpl->setVariable(
"BTN_NAME",
"create");
1588 $this->tpl->setVariable(
"TXT_ADD", $this->
lng->txt(
"add"));
1589 $this->tpl->parseCurrentBlock();
1610 $class_name = $this->obj_definition->getClassName($obj_type);
1611 $class = strtolower(
"ilObj" . $class_name .
"GUI");
1612 $this->
ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $ref_id);
1613 $this->
ctrl->redirectByClass([
"ilrepositorygui", $class], $cmd);
1624 if ($this->
ctrl->getNextClass() !=
"ilcolumngui") {
1628 if (!$this->
ctrl->isAsynch()) {
1635 $this->
html = $this->
ctrl->forwardCommand($column_gui);
1641 $this->
html = $this->
ctrl->forwardCommand($column_gui);
1670 $this->
ctrl->getNextClass() ==
"ilcolumngui" &&
1674 return $this->
ctrl->forwardCommand($column_gui);
1677 if (!$this->
ctrl->isAsynch()) {
1678 return $this->
ctrl->getHTML($column_gui);
1693 protected function checkPermission(
string $perm,
string $cmd =
"",
string $type =
"", ?
int $ref_id = null): void
1696 if (!is_int(strpos(
$_SERVER[
"PHP_SELF"],
"goto.php"))) {
1697 if ($perm !=
"create" && !is_object($this->
object)) {
1703 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_read'),
true);
1704 $parent_ref_id = $this->tree->getParentNodeData($this->
object->getRefId())[
'ref_id'] ?? null;
1705 $this->
ctrl->redirectToURL(ilLink::_getLink($parent_ref_id));
1708 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'msg_no_perm_read'),
true);
1709 self::_gotoRepositoryRoot();
1713 protected function checkPermissionBool(
string $perm,
string $cmd =
"",
string $type =
"", ?
int $ref_id = null): bool
1715 if ($perm ==
"create") {
1719 return $this->
access->checkAccess($perm .
"_" . $type, $cmd, $ref_id);
1722 if (!is_object($this->
object)) {
1727 $ref_id = $this->
object->getRefId();
1730 return $this->
access->checkAccess($perm, $cmd, $ref_id);
1743 $ilAccess = $DIC->access();
1745 $lng = $DIC->language();
1746 $ctrl = $DIC->ctrl();
1762 $ctrl = $DIC->ctrl();
1771 $ctrl = $DIC->ctrl();
1781 $this->tpl->setFileUploadRefId($this->ref_id);
1790 $link = ilLink::_getLink($this->
object->getRefId());
1791 $this->
ctrl->redirectToURL($link);
1796 $this->favourites->add(
1797 $this->
user->getId(),
1798 $this->request_wrapper->retrieve(
"item_ref_id", $this->
refinery->kindlyTo()->int())
1800 $this->
lng->loadLanguageModule(
"rep");
1801 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"rep_added_to_favourites"),
true);
1802 $this->
ctrl->redirectToURL(ilLink::_getLink($this->requested_ref_id));
1807 $this->
lng->loadLanguageModule(
"rep");
1808 $item_ref_id = $this->request_wrapper->retrieve(
"item_ref_id", $this->
refinery->kindlyTo()->int());
1809 $this->favourites->remove($this->
user->getId(), $item_ref_id);
1810 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"rep_removed_from_favourites"),
true);
1811 $this->
ctrl->redirectToURL(ilLink::_getLink($this->requested_ref_id));
1816 foreach ($ref_ids as $ref_id) {
1817 if (!$this->
access->checkAccess(
'write',
'', $ref_id)) {
redrawHeaderActionObject()
Ajax call: redraw action header only.
ilObjectDefinition $obj_definition
Creates a path for a start and endnode.
saveAvailabilityPeriodObject()
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static gatherFaPa(int $a_ref_id, array $a_role_ids, bool $a_add_action=false)
omitLocator(bool $omit=true)
setAdminMode(string $mode)
const ADMIN_MODE_REPOSITORY
setLocator()
Insert locator.
ilRbacReview $rbac_review
getTargetFrame(string $cmd, string $default_target_frame="")
get target frame for command (command is method name without "Object", e.g.
static getCmdSide()
Get Column Side of Current Command.
ilRbacSystem $rbac_system
buildRefIdsFromData(array $data)
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
getTabs()
overwrite in derived GUI class of your object type
initImportForm(string $new_type)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
enableDragDropFileUpload()
Enables the file upload into this object by dropping files.
TableGUI class for sub items listed in repository administration.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
cancelCreation()
cancel create action and go back to repository parent
getFormAction(string $cmd, string $default_form_action="")
Get form action for command (command is method name without "Object", e.g.
cancelObject()
cancel action and go back to previous page
ilObjectRequestRetriever $retriever
__construct($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(! $DIC->user() ->getId()||!ilLTIConsumerAccess::hasCustomProviderCreationAccess()) $params
prepareOutput(bool $show_sub_objects=true)
insertHeaderAction(?ilObjectListGUI $list_gui=null)
Insert header action into main template.
Class ChatMainBarProvider .
static prepareJsLinks(string $redraw_url, string $notes_url, string $tags_url, ilGlobalTemplateInterface $tpl=null)
Insert js/ajax links into template.
buildInputsForAdditionalDeletionReferences(int $ref_id, ilPathGUI $path_gui)
static _getAllReferences(int $id)
get all reference ids for object ID
redirectToRefId(int $ref_id, string $cmd="")
redirects to (repository) view per ref id usually to a container and usually used at the end of a sav...
isVisible(int $ref_id, string $type)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getCreationFormsHTML(array $forms)
Get HTML for creation forms (accordion)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getDidacticTemplateVar(string $type)
Get didactic template setting from creation screen.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
setParameterByClass(string $a_class, string $a_parameter, $a_value)
setRepositoryMode(bool $a_repositorymode)
confirmedDeleteObject()
confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
loadLanguageModule(string $a_module)
Load language module.
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions" ...
createObject()
create new object form
deleteObject(bool $error=false)
Display deletion confirmation screen.
setPermissions(int $parent_ref_id)
Manages favourites, currently the interface for other components, needs discussion.
setEnableEdit(bool $a_enableedit)
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
setFormAction(string $cmd, string $form_action)
addExternalEditFormCustom(ilPropertyFormGUI $form)
static _lookupObjId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCreationMode(bool $mode=true)
If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode...
importFileObject(int $parent_id=null)
getCenterColumnHTML()
Get center column.
createReference()
creates reference for object
parses the objects.xml it handles the xml-description of all ilias objects
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
static lookupTemplateId(int $a_ref_id)
string $requested_new_type
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static add(int $a_action, int $a_ref_id, array $a_diff, bool $a_source_ref_id=false)
ilGlobalTemplateInterface $tpl
static _lookupTitle(int $obj_id)
ILIAS Notes Service $notes_service
checkWritePermissionOnRefIdArray(array $ref_ids)
initCreationForms(string $new_type)
Init creation forms.
Column user interface class.
ServerRequestInterface $request
const ADMIN_MODE_SETTINGS
initDidacticTemplate(ilPropertyFormGUI $form)
Class ilObjectGUI Basic methods of all Output classes.
Interface RequestWrapper.
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
static getInstanceByRefId(int $ref_id, bool $stop_on_error=true)
get an instance of an Ilias object by reference id
const UPLOAD_TYPE_UPLOAD_DIRECTORY
callCreationCallback(\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
Repository GUI Utilities.
static _recordWriteEvent(int $obj_id, int $usr_id, string $action, ?int $parent_obj_id=null)
Records a write event.
buildDeleletionModal(array $request_ids)
ilObjectService $object_service
header include for all ilias files.
afterSave(ilObject $new_object)
Post (successful) object creation hook.
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
afterImport(ilObject $new_object)
Post (successful) object import hook.
ilFavouritesManager $favourites
Base class for all sub item list gui's.
editAvailabilityPeriodObject()
MultiObjectPropertiesManipulator $multi_object_manipulator
ArrayBasedRequestWrapper $post_wrapper
getMultiObjectPropertiesManipulator()
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
createActionDispatcherGUI()
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
getPath(int $a_startnode, int $a_endnode)
get path
addDidacticTemplateOptions(array &$a_options)
Add custom templates.
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position.
addAdoptContentLinkToToolbar()
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
putInTree(int $parent_ref_id)
maybe this method should be in tree object!?
withReferences()
determines whether objects are referenced or not (got ref ids or not)
addAvailabilityPeriodButtonToToolbar(ilToolbarGUI $toolbar)
getRightColumnHTML()
Display right column.
Error Handling & global info handling.
showPossibleSubObjects()
show possible sub objects (pull down menu)
static getInstanceByObjectType(string $a_obj_type)
static _gotoSharedWorkspaceNode(int $wsp_id)
getReturnLocation(string $cmd, string $default_location="")
Get return location for command (command is method name without "Object", e.g.
initCreateForm(string $new_type)
This class represents a text area property in a property form.
setReturnLocation(string $cmd, string $location)
set specific return location for command
RequestWrapper $request_wrapper
int $requested_crtptrefid
validateCustom(ilPropertyFormGUI $form)
Validate custom values (if not possible with checkInput())
redirectAfterCreation()
Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen.
setColumnSettings(ilColumnGUI $column_gui)
updateObject()
updates object entry in object_data
setTargetFrame(string $cmd, string $target_frame)
Set specific target frame for command.
ilObjectCustomIconFactory $custom_icon_factory
Class ilRbacAdmin Core functions for role based access control.
initHeaderAction(?string $sub_type=null, ?int $sub_id=null)
Add header action menu.
addAdminLocatorItems(bool $do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded) ...
static _lookupType(int $id, bool $reference=false)
afterUpdate()
Post (successful) object update hook.
updateCustom(ilPropertyFormGUI $form)
Insert custom update form values into object.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addHeaderAction()
Add header action menu.
static clear(string $a_var)
getAdminTabs()
administration tabs show only permissions and trash folder
checkPermission(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setAdminTabs()
set admin tabs
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded) ...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
buildDeletionModalItems(array $ref_ids)