167 public function __construct($a_data, $a_id = 0, $a_call_by_reference =
true, $a_prepare_output =
true)
171 $this->request = $DIC->http()->request();
172 $this->locator = $DIC[
"ilLocator"];
173 $this->
user = $DIC->user();
174 $this->access = $DIC->access();
176 $this->rbacreview = $DIC->rbac()->review();
177 $this->toolbar = $DIC->toolbar();
178 $this->rbacsystem = $DIC->rbac()->system();
179 $this->object_service = $DIC->object();
182 $tree = $DIC->repositoryTree();
183 $ilCtrl = $DIC->ctrl();
185 $lng = $DIC->language();
186 $ilTabs = $DIC->tabs();
190 $this->
ilias = $DIC[
"ilias"];
195 $this->tabs_gui = $ilTabs;
207 $this->ctrl = $ilCtrl;
209 $params = array(
"ref_id");
211 if (!$a_call_by_reference) {
212 $params = array(
"ref_id",
"obj_id");
215 $this->ctrl->saveParameter($this, $params);
219 $this->formaction = array();
220 $this->return_location = array();
221 $this->target_frame = array();
223 $this->sub_objects =
"";
225 $this->data = $a_data;
227 $this->call_by_reference = $a_call_by_reference;
228 $this->prepare_output = $a_prepare_output;
229 $this->creation_mode =
false;
231 $this->ref_id = ($this->call_by_reference) ? $this->
id :
$_GET[
"ref_id"];
232 $this->obj_id = ($this->call_by_reference) ?
$_GET[
"obj_id"] : $this->
id;
234 if ($this->
id != 0) {
242 if (is_object($this->
object)) {
243 if ($this->call_by_reference && $this->ref_id ==
$_GET[
"ref_id"]) {
244 $this->ctrl->setContext(
245 $this->object->getId(),
246 $this->
object->getType()
252 if ($a_prepare_output) {
272 $next_class = $this->ctrl->getNextClass($this);
273 $cmd = $this->ctrl->getCmd();
275 switch ($next_class) {
296 return $this->call_by_reference;
307 $this->creation_mode = $a_mode;
315 return $this->creation_mode;
322 if ($this->
id != 0) {
323 if ($this->call_by_reference) {
340 $this->tpl->loadStandardTemplate();
342 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui") {
367 if ($this->call_by_reference) {
370 $class_name = $this->objDefinition->getClassName($obj_type);
371 $class = strtolower(
"ilObj" . $class_name .
"GUI");
372 $class_path = $this->ctrl->lookupClassPath($class);
373 include_once($class_path);
374 $class_name = $this->ctrl->getClassForClasspath($class_path);
376 $this->parent_gui_obj =
new $class_name(
"",
$_GET[
"ref_id"],
true,
false);
378 $this->parent_gui_obj->setCreationMode(
true);
379 $this->parent_gui_obj->setTitleAndDescription();
390 require_once
'./Services/FileUpload/classes/class.ilFileUploadUtil.php';
404 if (!is_object($this->
object)) {
405 if ((
int) $_REQUEST[
"crtptrefid"] > 0) {
407 $this->tpl->setTitle(
410 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
417 $this->tpl->setTitle(
419 $this->object->getPresentationTitle(),
420 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
423 $this->tpl->setDescription(
425 $this->object->getLongDescription(),
426 self::ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
430 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui") {
434 $this->tpl->setTitleIcon(
436 $this->lng->txt(
"obj_" . $this->object->getType())
440 include_once
'./Services/Object/classes/class.ilObjectListGUIFactory.php';
442 $lgui->initItem($this->object->getRefId(), $this->
object->getId(), $this->
object->getType());
443 $this->tpl->setAlertProperties($lgui->getAlertProperties());
457 if (!$this->creation_mode && $this->
object) {
458 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
462 $this->object->getType(),
464 $this->
object->getId()
469 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
470 ilObjectListGUI::prepareJSLinks(
471 $this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
472 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
473 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false)
476 $lg = $dispatcher->initHeaderAction();
478 if (is_object($lg)) {
481 $lg->setContainerObject($this);
485 $lg->enableMultiDownload(
true);
489 include_once
"Services/Notes/classes/class.ilNote.php";
490 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) ||
491 $ilAccess->checkAccess(
"edit_permissions",
"", $this->ref_id) ||
493 $lg->enableComments(
true);
496 $lg->enableNotes(
true);
497 $lg->enableTags(
true);
515 if (is_object($a_list_gui)) {
516 $this->tpl->setHeaderActionMenu($a_list_gui->getHeaderAction());
536 echo $lg->getHeaderAction();
539 echo
$tpl->getOnLoadCodeForAsynch();
572 $this->tabs_gui->addTarget(
574 $this->ctrl->getLinkTarget($this,
"view"),
581 $this->tabs_gui->addTarget(
583 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
605 if (is_array($a_actions)) {
622 if (is_array($a_sub_objects)) {
623 foreach ($a_sub_objects as
$name => $options) {
624 $this->sub_objects[
$name] = array(
"name" =>
$name,
"max" => $options[
"max"]);
627 $this->sub_objects =
"";
644 if ($this->omit_locator) {
649 if ($this->call_by_reference) {
655 : $this->object->getRefId();
656 $ilLocator->addRepositoryItems(
$ref_id);
659 if (!$this->creation_mode) {
676 $this->omit_locator = $a_omit;
689 if (
$_GET[
"admin_mode"] ==
"settings") {
690 $this->ctrl->setParameterByClass(
691 "ilobjsystemfoldergui",
696 $this->lng->txt(
"administration"),
697 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
"")
699 if ($this->
object && ($this->object->getRefId() !=
SYSTEM_FOLDER_ID && !$a_do_not_add_object)) {
701 $this->object->getTitle(),
702 $this->ctrl->getLinkTarget($this,
"view")
706 $this->ctrl->setParameterByClass(
707 "iladministrationgui",
711 $this->ctrl->setParameterByClass(
712 "iladministrationgui",
719 $this->ctrl->clearParametersByClass(
"iladministrationgui");
720 $ilLocator->addAdministrationItems();
730 if (isset(
$_POST[
"mref_id"])) {
734 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
738 $this->ctrl->returnToParent($this);
749 $this->ctrl->returnToParent($this);
761 $this->ctrl->returnToParent($this);
774 $new_type = $_REQUEST[
"new_type"];
778 $this->ctrl->saveParameter($this,
"crtptrefid");
780 $this->ctrl->saveParameter($this,
"crtcb");
783 $ilErr->raiseError($this->lng->txt(
"permission_denied"),
$ilErr->MESSAGE);
785 $this->lng->loadLanguageModule($new_type);
786 $this->ctrl->setParameter($this,
"new_type", $new_type);
791 if (
$_GET[
"cpfl"] && isset($forms[self::CFORM_CLONE])) {
792 $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
827 foreach ($a_forms as $id => $form) {
829 unset($a_forms[$id]);
834 if (
sizeof($a_forms) == 1) {
835 $form_type = key($a_forms);
836 $a_forms = array_shift($a_forms);
839 if (method_exists($this,
"getCreationFormTitle")) {
840 $form_title = $this->getCreationFormTitle($form_type);
841 if ($form_title !=
"") {
842 $a_forms->setTitle($form_title);
845 return $a_forms->getHTML();
847 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
852 foreach ($a_forms as $form_type => $cf) {
853 $htpl =
new ilTemplate(
"tpl.creation_acc_head.html",
true,
true,
"Services/Object");
857 if (method_exists($this,
"getCreationFormTitle")) {
858 $form_title = $this->getCreationFormTitle($form_type);
861 $form_title = $cf->getTitle();
865 $htpl->setVariable(
"TITLE", $this->lng->txt(
"option") .
" " . $cnt .
": " .
868 $cf->setTitleIcon(null);
869 $cf->setTableWidth(
"100%");
871 $acc->addItem($htpl->get(), $cf->getHTML());
876 return "<div class='ilCreationFormSection'>" . $acc->getHTML() .
"</div>";
888 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
890 $form->setTarget(
"_top");
891 $form->setFormAction($this->ctrl->getFormAction($this,
"save"));
892 $form->setTitle($this->lng->txt($a_new_type .
"_new"));
898 $ti->setRequired(
true);
909 $form->addCommandButton(
"save", $this->lng->txt($a_new_type .
"_add"));
910 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
924 $lng->loadLanguageModule(
'didactic');
925 $existing_exclusive =
false;
927 $options[
'dtpl_0'] = array($this->lng->txt(
'didactic_default_type'),
929 $this->lng->txt(
'didactic_default_type_info'),
930 $this->lng->txt(
'objs_' . $this->type)
933 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSettings.php';
936 foreach ($templates as $template) {
937 if ($template->isEffective(
$_GET[
"ref_id"])) {
938 $options[
"dtpl_" . $template->getId()] = array(
939 $template->getPresentationTitle(),
940 $template->getPresentationDescription()
943 if ($template->isExclusive()) {
944 $existing_exclusive =
true;
952 if (
sizeof($options) > 1) {
954 $this->lng->txt(
'type'),
959 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
962 $type->setValue($value);
964 if (!in_array($value, array_keys($options)) || ($existing_exclusive && $value ==
"dtpl_0")) {
966 $options[$value] = array($this->lng->txt(
'not_available'));
969 if ($existing_exclusive) {
971 $keys = array_keys($options);
974 $type->setValue(
'dtpl_0');
979 foreach ($options as $id =>
$data) {
982 if ($existing_exclusive && $id ==
'dtpl_0') {
984 $option->setDisabled(
true);
987 $type->addOption($option);
1010 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
1024 $new_type = $_REQUEST[
"new_type"];
1028 $ilErr->raiseError($this->lng->txt(
"no_create_permission"),
$ilErr->MESSAGE);
1031 $this->lng->loadLanguageModule($new_type);
1032 $this->ctrl->setParameter($this,
"new_type", $new_type);
1035 if ($form->checkInput()) {
1036 $this->ctrl->setParameter($this,
"new_type",
"");
1041 include_once(
$location .
"/class." . $class_name .
".php");
1042 $newObj =
new $class_name();
1043 $newObj->setType($new_type);
1044 $newObj->setTitle($form->getInput(
"title"));
1045 $newObj->setDescription($form->getInput(
"desc"));
1053 $newObj->applyDidacticTemplate($dtpl);
1060 $args = func_get_args();
1070 $form->setValuesByPost();
1071 $tpl->setContent($form->getHtml());
1083 if (
$tpl && substr(
$tpl, 0, strlen($a_type) + 1) == $a_type .
"_") {
1084 return (
int) substr(
$tpl, strlen($a_type) + 1);
1101 if (!$a_parent_node_id) {
1102 $a_parent_node_id =
$_GET[
"ref_id"];
1106 if ((
int) $_REQUEST[
"crtptrefid"]) {
1107 $a_parent_node_id = (int) $_REQUEST[
"crtptrefid"];
1114 $this->obj_id = $a_obj->
getId();
1115 $this->ref_id = $a_obj->
getRefId();
1118 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1123 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
1124 $rbac_log_roles =
$rbacreview->getParentRoleIds($this->ref_id,
false);
1139 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
1140 $this->ctrl->returnToParent($this);
1155 $ilErr->raiseError($this->lng->txt(
"msg_no_perm_write"),
$ilErr->MESSAGE);
1158 $ilTabs->activateTab(
"settings");
1163 $form->setValuesByArray($values);
1168 $tpl->setContent($form->getHTML());
1186 $lng->loadLanguageModule($this->object->getType());
1188 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1190 $form->setFormAction($this->ctrl->getFormAction($this,
"update"));
1191 $form->setTitle($this->lng->txt($this->object->getType() .
"_edit"));
1197 $ti->setRequired(
true);
1198 $form->addItem($ti);
1204 $form->addItem($ta);
1208 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
1230 $values[
"title"] = $this->
object->getTitle();
1231 $values[
"desc"] = $this->
object->getLongDescription();
1255 $ilErr->raiseError($this->lng->txt(
"permission_denied"),
$ilErr->MESSAGE);
1259 if ($form->checkInput() &&
1261 $this->
object->setTitle($form->getInput(
"title"));
1262 $this->
object->setDescription($form->getInput(
"desc"));
1264 $this->
object->update();
1271 $ilTabs->activateTab(
"settings");
1272 $form->setValuesByPost();
1273 $tpl->setContent($form->getHtml());
1301 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1302 $this->ctrl->redirect($this,
"edit");
1317 $upload_files = $export_directory->getFilesFor((
int) $DIC->user()->getId(), (string) $a_new_type);
1318 $has_upload_files =
false;
1319 if (count($upload_files)) {
1320 $has_upload_files =
true;
1324 $form->setTarget(
"_top");
1325 $form->setFormAction($this->ctrl->getFormAction($this,
"importFile"));
1326 $form->setTitle($this->lng->txt($a_new_type .
"_import"));
1328 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"importfile");
1330 $fi->setRequired(
true);
1331 if ($has_upload_files) {
1332 $this->lng->loadLanguageModule(
'content');
1334 $this->lng->txt(
'cont_choose_file_source'),
1337 $option->
setValue(self::UPLOAD_TYPE_LOCAL);
1338 $form->addItem($option);
1341 $this->lng->txt(
'cont_choose_local'),
1342 self::UPLOAD_TYPE_LOCAL
1344 $option->addOption($direct);
1348 $this->lng->txt(
'cont_choose_upload_dir'),
1349 self::UPLOAD_TYPE_UPLOAD_DIRECTORY
1351 $option->addOption($upload);
1353 $this->lng->txt(
'cont_choose_upload_dir'),
1356 $upload_files[
''] = $this->lng->txt(
'cont_select_from_upload_dir');
1357 $files->setOptions($upload_files);
1358 $files->setRequired(
true);
1359 $upload->addSubItem($files);
1362 if (!$has_upload_files) {
1363 $form->addItem($fi);
1366 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1367 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1379 $user = $DIC->user();
1386 $parent_id =
$_GET[
"ref_id"];
1388 $new_type = $_REQUEST[
"new_type"];
1389 $upload_type = $this->request->getParsedBody()[
'upload_type'] ?? self::UPLOAD_TYPE_LOCAL;
1393 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
1396 $this->lng->loadLanguageModule($new_type);
1397 $this->ctrl->setParameter($this,
"new_type", $new_type);
1400 if ($form->checkInput()) {
1404 include_once
'./Services/Export/classes/class.ilImportContainer.php';
1407 include_once(
"./Services/Export/classes/class.ilImport.php");
1408 $imp =
new ilImport((
int) $parent_id);
1412 if ($upload_type == self::UPLOAD_TYPE_LOCAL) {
1413 $new_id = $imp->importObject(
1415 $_FILES[
"importfile"][
"tmp_name"],
1416 $_FILES[
"importfile"][
"name"],
1420 $hash = $this->request->getParsedBody()[
'uploadFile'] ??
'';
1423 $file = $export_upload->getAbsolutePathForHash(
$user->getId(), $new_type, $hash);
1425 $new_id = $imp->importObject(
1438 $this->tmp_import_dir = $imp->getTemporaryImportDir();
1439 if (!$a_catch_errors) {
1443 ilUtil::sendFailure($this->lng->txt(
"obj_import_file_error") .
" <br />" . $e->getMessage());
1444 $form->setValuesByPost();
1445 $tpl->setContent($form->getHtml());
1450 $this->ctrl->setParameter($this,
"new_type",
"");
1458 if (count($ref_ids) === 1) {
1459 $newObj->setRefId((
int) current($ref_ids));
1478 $form->setValuesByPost();
1479 $tpl->setContent($form->getHtml());
1489 ilUtil::sendSuccess($this->lng->txt(
"object_added"),
true);
1490 $this->ctrl->returnToParent($this);
1503 if ($this->formaction[$a_cmd] !=
"") {
1504 return $this->formaction[$a_cmd];
1506 return $a_formaction;
1520 $this->formaction[$a_cmd] = $a_formaction;
1532 if ($this->return_location[$a_cmd] !=
"") {
1533 return $this->return_location[$a_cmd];
1549 $this->return_location[$a_cmd] = $a_location;
1561 if ($this->target_frame[$a_cmd] !=
"") {
1562 return $this->target_frame[$a_cmd];
1563 } elseif (!empty($a_target_frame)) {
1564 return "target=\"" . $a_target_frame .
"\"";
1579 $this->target_frame[$a_cmd] =
"target=\"" . $a_target_frame .
"\"";
1587 if ($visible && $a_type ==
'crs') {
1589 if ($crs_id =
$tree->checkForParentType($a_ref_id,
'crs')) {
1594 if (!$tmp_obj->isActivated()) {
1614 $tpl = $DIC->ui()->mainTemplate();
1615 $user = $DIC->user();
1619 $this->tabs_gui->activateTab(
'view');
1622 $this->object->getType(),
1623 $this->
object->getRefId(),
1624 $this->
object->getId(),
1629 $this->ctrl->setParameter($this,
'obj_id', $this->obj_id);
1638 $tpl->setContent($itab->getHTML());
1652 if (
$_GET[
"item_ref_id"] !=
"") {
1656 if (is_array(
$_POST[
"id"])) {
1657 foreach (
$_POST[
"id"] as $idx => $id) {
1658 $_POST[
"id"][$idx] = (int) $id;
1665 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
1667 if (!$ru->showDeleteConfirmation(
$_POST[
"id"], $a_error)) {
1668 $ilCtrl->returnToParent($this);
1679 if ($this->sub_objects ==
"") {
1687 if (count(
$d) > 0) {
1688 foreach (
$d as $row) {
1691 if ($row[
"max"] > 0) {
1693 for (
$i = 0;
$i < count($this->data[
"ctrl"]);
$i++) {
1694 if ($this->data[
"ctrl"][
$i][
"type"] == $row[
"name"]) {
1700 if ($row[
"max"] ==
"" || $count < $row[
"max"]) {
1701 $subobj[] = $row[
"name"];
1706 if (is_array($subobj)) {
1710 $this->tpl->setCurrentBlock(
"add_object");
1711 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1712 $this->tpl->setVariable(
"BTN_NAME",
"create");
1713 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
1714 $this->tpl->parseCurrentBlock();
1729 die(
"ilObjectGUI::getTemplateFile() is deprecated.");
1749 $ilToolbar->addButton($a_text, $this->ctrl->getLinkTarget($this, $a_cmd), $a_target);
1761 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1774 case "clipboardObject":
1775 $offset =
$_GET[
"offset"];
1776 $order =
$_GET[
"sort_by"];
1777 $direction =
$_GET[
"sort_order"];
1778 $tbl->disable(
"footer");
1782 $offset =
$_GET[
"offset"];
1783 $order =
$_GET[
"sort_by"];
1784 $direction =
$_GET[
"sort_order"];
1788 $tbl->setOrderColumn($order);
1789 $tbl->setOrderDirection($direction);
1790 $tbl->setOffset($offset);
1791 $tbl->setLimit(
$_GET[
"limit"]);
1792 $tbl->setFooter(
"tblfooter", $this->lng->txt(
"previous"), $this->lng->txt(
"next"));
1793 $tbl->setData($result_set);
1808 $class_name = $this->objDefinition->getClassName($obj_type);
1809 $class = strtolower(
"ilObj" . $class_name .
"GUI");
1810 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_ref_id);
1811 $this->ctrl->redirectByClass(array(
"ilrepositorygui", $class), $a_cmd);
1826 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
1828 $cp->setType($a_type);
1829 $cp->setTarget(
$_GET[
'ref_id']);
1830 if ($a_tpl_varname) {
1831 $cp->showSourceSearch($a_tpl_varname);
1833 return $cp->showSourceSearch(null);
1845 include_once(
'./Services/Link/classes/class.ilLink.php');
1846 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
1851 $new_type = $_REQUEST[
'new_type'];
1853 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
1855 if (!(
int) $_REQUEST[
'clone_source']) {
1860 if (!$this->
checkPermissionBool(
"write",
"", $new_type, (
int) $_REQUEST[
'clone_source'])) {
1861 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
1867 $wizard_options->saveOwner(
$ilUser->getId());
1868 $wizard_options->saveRoot((
int) $_REQUEST[
'clone_source']);
1870 $options =
$_POST[
'cp_options'] ?
$_POST[
'cp_options'] : array();
1871 foreach ($options as $source_id => $option) {
1872 $wizard_options->addEntry($source_id, $option);
1874 $wizard_options->read();
1877 $new_obj = $orig->cloneObject((
int)
$_GET[
'ref_id'], $copy_id);
1880 $wizard_options->deleteAll();
1882 ilUtil::sendSuccess($this->lng->txt(
"object_duplicated"),
true);
1894 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
1899 if ($ilCtrl->getNextClass() !=
"ilcolumngui") {
1901 return $this->getContent();
1903 if (!$ilCtrl->isAsynch()) {
1910 $this->html = $ilCtrl->forwardCommand($column_gui);
1916 $this->html = $ilCtrl->forwardCommand($column_gui);
1920 return $this->getContent();
1938 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
1947 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
1950 $html = $ilCtrl->forwardCommand($column_gui);
1952 if (!$ilCtrl->isAsynch()) {
1953 $html = $ilCtrl->getHTML($column_gui);
1985 if (!is_int(strpos(
$_SERVER[
"PHP_SELF"],
"goto.php"))) {
1987 if ($a_perm ==
"create") {
1989 $a_ref_id =
$_GET[
"ref_id"];
1994 if (!is_object($this->
object)) {
1998 $a_ref_id = $this->
object->getRefId();
2000 $type = $this->
object->getType();
2005 include_once
"Services/Object/exceptions/class.ilObjectException.php";
2006 $this->tpl->setOnScreenMessage(
'failure', $this->lng->txt(
'msg_no_perm_read'),
true);
2007 $parent_ref_id = $this->tree->getParentNodeData($this->object->getRefId())[
'ref_id'];
2012 $this->tpl->setOnScreenMessage(
'failure', $this->lng->txt(
'msg_no_perm_read'),
true);
2013 self::_gotoRepositoryRoot();
2031 if ($a_perm ==
"create") {
2033 $a_ref_id =
$_GET[
"ref_id"];
2035 return $ilAccess->checkAccess($a_perm .
"_" . $a_type, $a_cmd, $a_ref_id);
2038 if (!is_object($this->
object)) {
2042 $a_ref_id = $this->
object->getRefId();
2044 return $ilAccess->checkAccess($a_perm, $a_cmd, $a_ref_id);
2058 $ilAccess = $DIC->access();
2060 $lng = $DIC->language();
2063 $_GET[
"cmd"] =
"frameset";
2064 $_GET[
"target"] =
"";
2066 $_GET[
"baseClass"] =
"ilRepositoryGUI";
2067 include(
"ilias.php");
2071 if ($a_raise_error) {
2086 $ilAccess = $DIC->access();
2089 $_GET[
"cmd"] = $a_cmd;
2090 $_GET[
"target"] =
"";
2091 $_GET[
"ref_id"] = $a_ref_id;
2092 $_GET[
"baseClass"] =
"ilRepositoryGUI";
2093 include(
"ilias.php");
2102 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
2105 $this->tpl->enableDragDropFileUpload($this->ref_id);
2116 method_exists($a_new_obj,
"setRating")) {
2117 $a_new_obj->setRating(
true);
2126 protected function showCustomIconsEditing($a_input_colspan = 1,
ilPropertyFormGUI $a_form = null, $a_as_section =
true)
2128 if ($this->
settings->get(
"custom_icons")) {
2132 $customIconFactory = $DIC[
'object.customicons.factory'];
2134 $customIcon = $customIconFactory->getByObjId($this->object->getId(), $this->
object->getType());
2136 if ($a_as_section) {
2138 $title->setTitle($this->lng->txt(
"icon_settings"));
2142 $a_form->addItem($title);
2144 $caption = $this->lng->txt(
"cont_custom_icon");
2147 $icon->setSuffixes($customIcon->getSupportedFileExtensions());
2148 $icon->setUseCache(
false);
2149 if ($customIcon->exists()) {
2150 $icon->setImage($customIcon->getFullPath());
2152 $icon->setImage(
'');
2154 if ($a_as_section) {
2155 $a_form->addItem($icon);
2157 $title->addSubItem($icon);
2172 $ctrl->redirectToURL($link);
2183 $this->favourites->add(
$user->getId(), (int)
$_GET[
"item_ref_id"]);
2184 $lng->loadLanguageModule(
"rep");
2185 ilUtil::sendSuccess(
$lng->txt(
"rep_added_to_favourites"),
true);
2197 $lng->loadLanguageModule(
"rep");
2198 $this->favourites->remove(
$user->getId(), (int)
$_GET[
"item_ref_id"]);
2199 ilUtil::sendSuccess(
$lng->txt(
"rep_removed_from_favourites"),
true);
redrawHeaderActionObject()
Ajax call: redraw action header only.
static lookupTemplateId($a_ref_id)
Lookup template id ilDB $ilDB.
setSubObjects($a_sub_objects="")
set possible subobjects for this object.
static initFileUpload()
Initializes the file upload and loads the needed javascripts and styles.
static _getIcon( $a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
Get icon for repository item.
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
This class represents an option in a radio group.
addAdminLocatorItems($a_do_not_add_object=false)
should be overwritten to add object specific items (repository items are preloaded) ...
static getCmdSide()
Get Column Side of Current Command.
static commentsActivated($a_rep_obj_id, $a_obj_id, $a_obj_type, $a_news_id=0)
Are comments activated for object?
getTabs()
get tabs abstract method.
setTargetFrame($a_cmd, $a_target_frame)
set specific target frame for command
const PEAR_ERROR_CALLBACK
enableDragDropFileUpload()
Enables the file upload into this object by dropping files.
TableGUI class for sub items listed in repository administration.
cancelCreation()
cancel create action and go back to repository parent
GUI class for the workflow of copying objects.
cancelObject()
cancel action and go back to previous page public
initCreationForms($a_new_type)
Init creation froms.
const TITLE_LENGTH
max length of object title
__setTableGUIBasicData(&$tbl, &$result_set, $a_from="")
standard implementation for tables use 'from' variable use different initial setting of table ...
static _getListGUIByType( $type, $context=ilObjectListGUI::CONTEXT_REPOSITORY)
static _recordWriteEvent($obj_id, $usr_id, $action, $parent_obj_id=null)
Records a write event.
initHeaderAction($a_sub_type=null, $a_sub_id=null)
Add header action menu.
__showButton($a_cmd, $a_text, $a_target='')
setReturnLocation($a_cmd, $a_location)
set specific return location for command
static get($a_var)
Get a value.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
setFormAction($a_cmd, $a_formaction)
set specific form action for command
static set($a_var, $a_val)
Set a value.
setEnableEdit($a_enableedit)
Set EnableEdit.
static _lookupTitle($a_id)
lookup object title
setActions($a_actions="")
set possible actions for objects in list.
setCreationMode($a_mode=true)
if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! ...
confirmedDeleteObject()
confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions" ...
createObject()
create new object form
afterSave(ilObject $a_new_object)
Post (successful) object creation hook.
cloneAllObject()
Clone single (not container object) Method is overwritten in ilContainerGUI.
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
Manages favourites, currently the interface for other components, needs discussion.
static gatherFaPa($a_ref_id, array $a_role_ids, $a_add_action=false)
static _getAllReferences($a_id)
get all reference ids of object
addExternalEditFormCustom(ilPropertyFormGUI $a_form)
cancelDeleteObject()
cancel deletion of object
static hasAutoRating($a_type, $a_ref_id)
Check if auto rating is active for parent group/course.
getCenterColumnHTML()
Get center column.
updateCustom(ilPropertyFormGUI $a_form)
Insert custom update form values into object.
createReference()
creates reference for object
initImportForm($a_new_type)
Init object import form.
prepareOutput($a_show_subobjects=true)
prepare output
getCreationFormsHTML(array $a_forms)
Get HTML for creation forms (accordion)
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
isVisible($a_ref_id, $a_type)
static _getInstance($a_copy_id)
Get instance of copy wizard options.
getId()
get object id public
getTargetFrame($a_cmd, $a_target_frame="")
get target frame for command (command is method name without "Object", e.g.
addSubItem($a_item)
Add Subitem.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
Column user interface class.
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
setRepositoryMode($a_repositorymode)
Set RepositoryMode.
omitLocator($a_omit=true)
const UPLOAD_TYPE_UPLOAD_DIRECTORY
getTemplateFile($a_cmd, $a_type="")
get a template blockfile format: tpl.
Repository GUI Utilities.
callCreationCallback(\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
setCols($a_cols)
Set Cols.
static infoPanel($a_keep=true)
redirection script todo: (a better solution should control the processing via a xml file) ...
importFileObject($parent_id=null, $a_catch_errors=true)
Import.
static _allocateCopyId()
Allocate a copy for further entries.
static clear($a_var)
Unset a value.
initCreateForm($a_new_type)
Init object creation form.
setTitleAndDescription()
called by prepare output
putInTree($a_parent_ref)
maybe this method should be in tree object!?
getType()
get object type public
initEditForm()
Init object edit form.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
const COPY_WIZARD_NEEDS_PAGE
getEditFormValues()
Get values for edit form.
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
addDidacticTemplateOptions(array &$a_options)
Add custom templates.
validateCustom(ilPropertyFormGUI $a_form)
Validate custom values (if not possible with checkInput())
withReferences()
determines wether objects are referenced or not (got ref ids or not)
static getScreenMode()
Get Screen Mode for current command.
getRightColumnHTML()
Display right column.
static getInstanceByObjectType($a_obj_type)
Get instance by obj type.
handleAutoRating(ilObject $a_new_obj)
Activate rating automatically if parent container setting.
static formSelect( $selected, $varname, $options, $multiple=false, $direct_text=false, $size="0", $style_class="", $attribs="", $disabled=false)
Builds a select form field with options and shows the selected option first.
Interface for gui classes (e.g ilLuceneSearchGUI) that offer add/remove to/from desktop.
static isUploadAllowed($a_ref_id, $a_type="")
Determines whether files can be uploaded to the object with the specified reference id...
redirectToRefId($a_ref_id, $a_cmd="")
redirects to (repository) view per ref id usually to a container and usually used at the end of a sav...
showPossibleSubObjects()
show possible subobjects (pulldown menu)
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
static add($a_action, $a_ref_id, array $a_diff, $a_source_ref_id=false)
insertHeaderAction($a_list_gui)
Insert header action into main template.
redirectAfterCreation()
Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html.
setColumnSettings(ilColumnGUI $column_gui)
May be overwritten in subclasses.
getCreationMode()
get creation mode
getRefId()
get reference id public
updateObject()
updates object entry in object_data
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
putObjectInTree(ilObject $a_obj, $a_parent_node_id=null)
Add object to tree at given position.
checkPermission($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission and redirect on error.
getDidacticTemplateVar($a_type)
Get didactic template setting from creation screen.
deleteObject($a_error=false)
Display deletion confirmation screen.
setTabs()
set admin tabs public
getObjectService()
Get object service.
update()
update object in db
afterUpdate()
Post (successful) object update hook.
static redirect($a_script)
Accordion user interface class.
getFormAction($a_cmd, $a_formaction="")
get form action for command (command is method name without "Object", e.g.
addHeaderAction()
Add header action menu.
setPermissions($a_parent_ref)
set permissions of object
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
Check permission.
getAdminTabs()
administration tabs show only permissions and trash folder
getReturnLocation($a_cmd, $a_location="")
get return location for command (command is method name without "Object", e.g.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Class ilCommonActionDispatcherGUI.
executeCommand()
execute command
setSubObject($a_sub_obj_type, $a_sub_obj_id)
Set sub object attributes.
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
setAdminTabs()
set admin tabs public
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded) ...
afterImport(ilObject $a_new_object)
Post (successful) object import hook.