90 function ilObjectGUI($a_data, $a_id = 0, $a_call_by_reference =
true, $a_prepare_output =
true)
94 $this->tabs_gui =& $ilTabs;
112 $params = array(
"ref_id");
114 if (!$a_call_by_reference)
116 $params = array(
"ref_id",
"obj_id");
119 $this->ctrl->saveParameter($this, $params);
122 $this->tree =&
$tree;
123 $this->formaction = array();
124 $this->return_location = array();
125 $this->target_frame = array();
127 $this->sub_objects =
"";
129 $this->data = $a_data;
131 $this->call_by_reference = $a_call_by_reference;
132 $this->prepare_output = $a_prepare_output;
133 $this->creation_mode =
false;
135 $this->ref_id = ($this->call_by_reference) ? $this->
id :
$_GET[
"ref_id"];
136 $this->obj_id = ($this->call_by_reference) ?
$_GET[
"obj_id"] : $this->
id;
140 $this->link_params =
"ref_id=".$this->ref_id;
147 if (is_object($this->
object))
149 if ($this->call_by_reference && $this->ref_id ==
$_GET[
"ref_id"])
151 $this->ctrl->setContext($this->object->getId(),
152 $this->
object->getType());
160 if ($a_prepare_output)
172 $next_class = $this->ctrl->getNextClass($this);
173 $cmd = $this->ctrl->getCmd();
198 return $this->call_by_reference;
209 $this->creation_mode = $a_mode;
217 return $this->creation_mode;
226 if ($this->call_by_reference)
244 $this->tpl->getStandardTemplate();
246 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
274 if($this->call_by_reference)
278 $class_name = $this->objDefinition->getClassName($obj_type);
279 $class = strtolower(
"ilObj".$class_name.
"GUI");
280 $class_path = $this->ctrl->lookupClassPath($class);
281 include_once($class_path);
282 $class_name = $this->ctrl->getClassForClasspath($class_path);
284 $this->parent_gui_obj =
new $class_name(
"",
$_GET[
"ref_id"],
true,
false);
286 $this->parent_gui_obj->setCreationMode(
true);
287 $this->parent_gui_obj->setTitleAndDescription();
299 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
301 $ilUser->getId() != ANONYMOUS_USER_ID)
308 require_once
'./Services/FileUpload/classes/class.ilFileUploadUtil.php';
323 if (!is_object($this->
object))
333 $this->tpl->setTitle($this->object->getPresentationTitle());
334 $this->tpl->setDescription($this->object->getLongDescription());
336 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
345 $this->lng->txt(
"obj_" . $this->object->getType()));
348 include_once
'./Services/Object/classes/class.ilObjectListGUIFactory.php';
350 $lgui->initItem($this->object->getRefId(), $this->
object->getId());
351 $this->tpl->setAlertProperties($lgui->getAlertProperties());
365 if(!$this->creation_mode && $this->
object)
367 include_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
369 $ilAccess, $this->object->getType(),
$this->ref_id, $this->
object->getId());
373 include_once
"Services/Object/classes/class.ilObjectListGUI.php";
374 ilObjectListGUI::prepareJSLinks($this->ctrl->getLinkTarget($this,
"redrawHeaderAction",
"",
true),
375 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"ilnotegui"),
"",
"",
true,
false),
376 $this->ctrl->getLinkTargetByClass(array(
"ilcommonactiondispatchergui",
"iltagginggui"),
"",
"",
true,
false));
378 $lg = $dispatcher->initHeaderAction();
385 $lg->setContainerObject($this);
389 $lg->enableMultiDownload(
true);
393 include_once
"Services/Notes/classes/class.ilNote.php";
394 if($ilAccess->checkAccess(
"write",
"", $this->ref_id) ||
395 $ilAccess->checkAccess(
"edit_permissions",
"", $this->ref_id) ||
398 $lg->enableComments(
true);
401 $lg->enableNotes(
true);
402 $lg->enableTags(
true);
416 if(is_object($a_list_gui))
418 $this->tpl->setHeaderActionMenu($a_list_gui->getHeaderAction());
438 echo $lg->getHeaderAction();
441 echo $tpl->getOnLoadCodeForAsynch();
451 if ($this->object->getRefId() ==
"")
456 $tpl->setMountWebfolderIcon($this->object->getRefId());
467 $this->
getTabs($this->tabs_gui);
497 $tabs_gui->addTarget(
"view",
498 $this->ctrl->getLinkTarget($this,
"view"), array(
"",
"view"), get_class($this));
504 $tabs_gui->addTarget(
"perm_settings",
505 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
"",
"ilpermissiongui");
508 if ($tree->getSavedNodeData($this->object->getRefId()))
510 $tabs_gui->addTarget(
"trash",
511 $this->ctrl->getLinkTarget($this,
"trash"),
"trash", get_class($this));
530 if (is_array($a_actions))
532 foreach ($a_actions as $name =>
$lng)
534 $this->actions[$name] = array(
"name" => $name,
"lng" =>
$lng);
551 if (is_array($a_sub_objects))
553 foreach ($a_sub_objects as $name =>
$options)
555 $this->sub_objects[$name] = array(
"name" => $name,
"max" =>
$options[
"max"]);
560 $this->sub_objects =
"";
574 global $ilLocator,
$tpl;
576 if ($this->omit_locator)
582 if($this->call_by_reference)
589 : $this->object->getRefId();
590 $ilLocator->addRepositoryItems(
$ref_id);
593 if(!$this->creation_mode)
599 if (
$_GET[
"admin_mode"] ==
"" &&
600 strtolower($this->ctrl->getCmdClass()) ==
"ilobjrolegui")
602 $this->ctrl->setParameterByClass(
"ilobjrolegui",
603 "rolf_ref_id",
$_GET[
"rolf_ref_id"]);
604 $this->ctrl->setParameterByClass(
"ilobjrolegui",
605 "obj_id",
$_GET[
"obj_id"]);
606 $ilLocator->addItem($this->lng->txt(
"role"),
607 $this->ctrl->getLinkTargetByClass(array(
"ilpermissiongui",
608 "ilobjrolegui"),
"perm"));
624 $this->omit_locator = $a_omit;
637 if (
$_GET[
"admin_mode"] ==
"settings")
639 $this->ctrl->setParameterByClass(
"ilobjsystemfoldergui",
640 "ref_id", SYSTEM_FOLDER_ID);
641 $ilLocator->addItem($this->lng->txt(
"administration"),
642 $this->ctrl->getLinkTargetByClass(array(
"iladministrationgui",
"ilobjsystemfoldergui"),
"")
644 if ($this->object->getRefId() != SYSTEM_FOLDER_ID && !$a_do_not_add_object)
646 $ilLocator->addItem($this->object->getTitle(),
647 $this->ctrl->getLinkTarget($this,
"view"));
652 $this->ctrl->setParameterByClass(
"iladministrationgui",
654 $this->ctrl->setParameterByClass(
"iladministrationgui",
655 "admin_mode",
"settings");
659 $this->ctrl->clearParametersByClass(
"iladministrationgui");
660 $ilLocator->addAdministrationItems();
673 if(isset(
$_POST[
"mref_id"]))
678 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
682 $this->ctrl->returnToParent($this);
693 $this->ctrl->returnToParent($this);
705 $this->ctrl->returnToParent($this);
721 $this->ctrl->saveParameter($this,
"crtptrefid");
723 $this->ctrl->saveParameter($this,
"crtcb");
727 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->MESSAGE);
731 $this->lng->loadLanguageModule($new_type);
732 $this->ctrl->setParameter($this,
"new_type", $new_type);
737 if(
$_GET[
"cpfl"] && isset($forms[self::CFORM_CLONE]))
739 $forms = array(self::CFORM_CLONE => $forms[self::CFORM_CLONE]);
775 foreach($a_forms as $id => $form)
779 unset($a_forms[$id]);
784 if(
sizeof($a_forms) == 1)
786 $a_forms = array_shift($a_forms);
787 return $a_forms->getHTML();
791 include_once(
"./Services/Accordion/classes/class.ilAccordionGUI.php");
796 foreach ($a_forms as $form_type => $cf)
798 $htpl =
new ilTemplate(
"tpl.creation_acc_head.html",
true,
true,
"Services/Object");
803 if(method_exists($this,
"getCreationFormTitle"))
805 $form_title = $this->getCreationFormTitle($form_type);
809 $form_title = $cf->getTitle();
813 $htpl->setVariable(
"TITLE", $this->lng->txt(
"option").
" ".$cnt.
": ".
816 $cf->setTitleIcon(null);
817 $cf->setTableWidth(
"100%");
819 $acc->addItem($htpl->get(), $cf->getHTML());
824 return "<div class='ilCreationFormSection'>".$acc->getHTML().
"</div>";
836 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
838 $form->setTarget(
"_top");
839 $form->setFormAction($this->ctrl->getFormAction($this,
"save"));
840 $form->setTitle($this->lng->txt($a_new_type.
"_new"));
846 $ti->setRequired(
true);
857 $form->addCommandButton(
"save", $this->lng->txt($a_new_type.
"_add"));
858 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
872 $lng->loadLanguageModule(
'didactic');
875 $options[
'dtpl_0'] = array($this->lng->txt(
'didactic_default_type'),
877 $this->lng->txt(
'didactic_default_type_info'),
878 $this->lng->txt(
'objs_'.$this->type)
881 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateSettings.php';
885 foreach($templates as $template)
887 $options[
"dtpl_".$template->getId()] = array($template->getTitle(),
888 $template->getDescription());
897 $this->lng->txt(
'type'),
903 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
910 $type->setValue(
'dtpl_0');
918 $type->addOption($option);
942 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
959 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
962 $this->lng->loadLanguageModule($new_type);
963 $this->ctrl->setParameter($this,
"new_type", $new_type);
966 if ($form->checkInput())
968 $this->ctrl->setParameter($this,
"new_type",
"");
971 $class_name =
"ilObj".$objDefinition->getClassName($new_type);
972 $location = $objDefinition->getLocation($new_type);
973 include_once(
$location.
"/class.".$class_name.
".php");
974 $newObj =
new $class_name();
975 $newObj->setType($new_type);
976 $newObj->setTitle($form->getInput(
"title"));
977 $newObj->setDescription($form->getInput(
"desc"));
986 $newObj->applyDidacticTemplate($dtpl);
993 $args = func_get_args();
1006 $form->setValuesByPost();
1007 $tpl->setContent($form->getHtml());
1019 if(
$tpl && substr(
$tpl, 0, strlen($a_type)+1) == $a_type.
"_")
1021 return (
int)substr(
$tpl, strlen($a_type)+1);
1035 if(!$a_parent_node_id)
1037 $a_parent_node_id =
$_GET[
"ref_id"];
1043 $a_parent_node_id = (int)$_REQUEST[
"crtptrefid"];
1050 $this->obj_id = $a_obj->
getId();
1051 $this->ref_id = $a_obj->
getRefId();
1054 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1059 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
1060 $rbac_log_roles = $rbacreview->getParentRoleIds($this->ref_id,
false);
1065 if($_REQUEST[
"crtcb"])
1068 $class_name =
"ilObj".$objDefinition->getClassName($callback_type).
"GUI";
1069 $location = $objDefinition->getLocation($callback_type);
1070 include_once(
$location.
"/class.".$class_name.
".php");
1071 if (in_array(strtolower($class_name), array(
"ilobjitemgroupgui")))
1073 $callback_obj =
new $class_name((
int)$_REQUEST[
"crtcb"]);
1078 $callback_obj =
new $class_name(null, (
int)$_REQUEST[
"crtcb"],
true,
false);
1080 $callback_obj->afterSaveCallback($a_obj);
1092 $this->ctrl->returnToParent($this);
1102 global
$tpl, $ilTabs;
1106 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
1109 $ilTabs->activateTab(
"settings");
1115 $form->setValuesByArray($values);
1117 $tpl->setContent($form->getHTML());
1129 $lng->loadLanguageModule($this->object->getType());
1131 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1133 $form->setFormAction($this->ctrl->getFormAction($this,
"update"));
1134 $form->setTitle($this->lng->txt($this->object->getType().
"_edit"));
1140 $ti->setRequired(
true);
1141 $form->addItem($ti);
1147 $form->addItem($ta);
1151 $form->addCommandButton(
"update", $this->lng->txt(
"save"));
1174 $values[
"title"] = $this->
object->getTitle();
1175 $values[
"desc"] = $this->
object->getLongDescription();
1195 global $ilTabs,
$tpl;
1199 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1203 if($form->checkInput())
1205 $this->
object->setTitle($form->getInput(
"title"));
1206 $this->
object->setDescription($form->getInput(
"desc"));
1208 $this->
object->update();
1215 $ilTabs->activateTab(
"settings");
1216 $form->setValuesByPost();
1217 $tpl->setContent($form->getHtml());
1236 $this->ctrl->redirect($this,
"edit");
1247 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
1249 $form->setTarget(
"_top");
1250 $form->setFormAction($this->ctrl->getFormAction($this,
"importFile"));
1251 $form->setTitle($this->lng->txt($a_new_type.
"_import"));
1253 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
1254 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"importfile");
1256 $fi->setRequired(
true);
1257 $form->addItem($fi);
1259 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
1260 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
1274 $parent_id =
$_GET[
"ref_id"];
1281 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
1284 $this->lng->loadLanguageModule($new_type);
1285 $this->ctrl->setParameter($this,
"new_type", $new_type);
1288 if ($form->checkInput())
1292 if($objDefinition->isContainer($new_type))
1294 include_once
'./Services/Export/classes/class.ilImportContainer.php';
1299 include_once(
"./Services/Export/classes/class.ilImport.php");
1300 $imp =
new ilImport((
int)$parent_id);
1303 $new_id = $imp->importObject(null, $_FILES[
"importfile"][
"tmp_name"],
1304 $_FILES[
"importfile"][
"name"], $new_type);
1308 $this->ctrl->setParameter($this,
"new_type",
"");
1313 if(!$objDefinition->isContainer($new_type))
1323 if($objDefinition->isContainer($new_type))
1336 $form->setValuesByPost();
1337 $tpl->setContent($form->getHtml());
1348 $this->ctrl->returnToParent($this);
1361 if ($this->formaction[$a_cmd] !=
"")
1363 return $this->formaction[$a_cmd];
1367 return $a_formaction;
1381 $this->formaction[$a_cmd] = $a_formaction;
1393 if ($this->return_location[$a_cmd] !=
"")
1395 return $this->return_location[$a_cmd];
1413 $this->return_location[$a_cmd] = $a_location;
1425 if ($this->target_frame[$a_cmd] !=
"")
1427 return $this->target_frame[$a_cmd];
1429 elseif (!empty($a_target_frame))
1431 return "target=\"".$a_target_frame.
"\"";
1448 $this->target_frame[$a_cmd] =
"target=\"".$a_target_frame.
"\"";
1456 $ilBench->start(
"Explorer",
"setOutput_isVisible");
1459 if ($visible && $a_type ==
'crs') {
1461 if($crs_id = $tree->checkForParentType($a_ref_id,
'crs'))
1468 if(!$tmp_obj->isActivated())
1473 if(($crs_id != $a_ref_id) and $tmp_obj->isArchived())
1481 $ilBench->stop(
"Explorer",
"setOutput_isVisible");
1498 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
1502 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1505 $this->object->getType(),
1506 $this->
object->getRefId(),
1507 $this->
object->getId(), $ilUser->getId());
1510 include_once(
"./Services/Repository/classes/class.ilAdminSubItemsTableGUI.php");
1511 if (!$this->call_by_reference)
1513 $this->ctrl->setParameter($this,
"obj_id", $this->obj_id);
1517 $tpl->setContent($itab->getHTML());
1531 if (
$_GET[
"item_ref_id"] !=
"")
1536 if(is_array(
$_POST[
"id"]))
1538 foreach(
$_POST[
"id"] as $idx => $id)
1540 $_POST[
"id"][$idx] = (int)$id;
1547 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
1549 if (!$ru->showDeleteConfirmation(
$_POST[
"id"], $a_error))
1551 $ilCtrl->returnToParent($this);
1562 if ($this->sub_objects ==
"")
1564 $d = $this->objDefinition->getCreatableSubObjects($this->object->getType());
1579 if ($row[
"max"] > 0)
1582 for ($i=0; $i<count($this->data[
"ctrl"]); $i++)
1584 if ($this->data[
"ctrl"][$i][
"type"] == $row[
"name"])
1591 if ($row[
"max"] ==
"" || $count < $row[
"max"])
1593 $subobj[] = $row[
"name"];
1598 if (is_array($subobj))
1603 $this->tpl->setCurrentBlock(
"add_object");
1604 $this->tpl->setVariable(
"SELECT_OBJTYPE", $opts);
1605 $this->tpl->setVariable(
"BTN_NAME",
"create");
1606 $this->tpl->setVariable(
"TXT_ADD", $this->lng->txt(
"add"));
1607 $this->tpl->parseCurrentBlock();
1621 mk(); die(
"ilObjectGUI::getTemplateFile() is deprecated.");
1634 foreach ($a_ref_ids as $id)
1637 $tmp_obj =& $this->ilias->obj_factory->getInstanceByRefId($id);
1638 $title[] = $tmp_obj->getTitle();
1642 return $title ? $title : array();
1663 $ilToolbar->addButton($a_text, $this->ctrl->getLinkTarget($this, $a_cmd), $a_target);
1675 include_once
"./Services/Table/classes/class.ilTableGUI.php";
1689 case "clipboardObject":
1690 $offset =
$_GET[
"offset"];
1691 $order =
$_GET[
"sort_by"];
1692 $direction =
$_GET[
"sort_order"];
1693 $tbl->disable(
"footer");
1697 $offset =
$_GET[
"offset"];
1698 $order =
$_GET[
"sort_by"];
1699 $direction =
$_GET[
"sort_order"];
1703 $tbl->setOrderColumn($order);
1704 $tbl->setOrderDirection($direction);
1705 $tbl->setOffset($offset);
1706 $tbl->setLimit(
$_GET[
"limit"]);
1707 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
1708 $tbl->setData($result_set);
1723 $class_name = $this->objDefinition->getClassName($obj_type);
1724 $class = strtolower(
"ilObj".$class_name.
"GUI");
1725 $this->ctrl->setParameterByClass(
"ilrepositorygui",
"ref_id", $a_ref_id);
1726 $this->ctrl->redirectByClass(array(
"ilrepositorygui", $class), $a_cmd);
1741 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
1743 $cp->setType($a_type);
1744 $cp->setTarget(
$_GET[
'ref_id']);
1747 $cp->showSourceSearch($a_tpl_varname);
1751 return $cp->showSourceSearch(null);
1763 include_once(
'./Services/Link/classes/class.ilLink.php');
1764 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
1771 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
1781 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
1787 $wizard_options->saveOwner($ilUser->getId());
1788 $wizard_options->saveRoot((
int) $_REQUEST[
'clone_source']);
1791 foreach(
$options as $source_id => $option)
1793 $wizard_options->addEntry($source_id,$option);
1795 $wizard_options->read();
1798 $new_obj = $orig->cloneObject((
int)
$_GET[
'ref_id'],$copy_id);
1801 $wizard_options->deleteAll();
1815 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
1820 if ($ilCtrl->getNextClass() !=
"ilcolumngui")
1823 return $this->getContent();
1827 if (!$ilCtrl->isAsynch())
1837 $this->html = $ilCtrl->forwardCommand($column_gui);
1844 $this->html = $ilCtrl->forwardCommand($column_gui);
1850 return $this->getContent();
1866 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
1876 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
1880 $html = $ilCtrl->forwardCommand($column_gui);
1884 if (!$ilCtrl->isAsynch())
1886 $html = $ilCtrl->getHTML($column_gui);
1898 $column_gui->setRepositoryMode(
true);
1899 $column_gui->setEnableEdit(
false);
1902 $column_gui->setEnableEdit(
true);
1919 if (!is_int(strpos($_SERVER[
"PHP_SELF"],
"goto.php")))
1922 if($a_perm ==
"create")
1926 $a_ref_id =
$_GET[
"ref_id"];
1933 if (!is_object($this->
object))
1939 $a_ref_id = $this->
object->getRefId();
1941 $type = $this->
object->getType();
1951 die(
"Permission Denied.");
1969 if($a_perm ==
"create")
1973 $a_ref_id =
$_GET[
"ref_id"];
1975 return $ilAccess->checkAccess($a_perm.
"_".$a_type, $a_cmd, $a_ref_id);
1980 if (!is_object($this->
object))
1986 $a_ref_id = $this->
object->getRefId();
1988 return $ilAccess->checkAccess($a_perm, $a_cmd, $a_ref_id);
2000 global $ilAccess,
$ilErr;
2002 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
2004 $_GET[
"cmd"] =
"frameset";
2005 $_GET[
"target"] =
"";
2006 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
2007 $_GET[
"baseClass"] =
"ilRepositoryGUI";
2008 include(
"ilias.php");
2014 $ilErr->raiseError(
$lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
2026 global $ilAccess,
$ilErr;
2028 $_GET[
"cmd"] = $a_cmd;
2029 $_GET[
"target"] =
"";
2030 $_GET[
"ref_id"] = $a_ref_id;
2031 $_GET[
"baseClass"] =
"ilRepositoryGUI";
2032 include(
"ilias.php");
2041 include_once(
"./Services/FileUpload/classes/class.ilFileUploadGUI.php");
2044 $this->tpl->enableDragDropFileUpload($this->ref_id);
2055 method_exists($a_new_obj,
"setRating"))
2057 $a_new_obj->setRating(
true);