37 require_once
"./classes/class.ilObjectGUI.php";
38 require_once
"./Services/Container/classes/class.ilContainer.php";
46 function ilContainerGUI($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
50 $this->rbacsystem =& $rbacsystem;
52 $lng->loadLanguageModule(
"cntr");
61 $this->
ilObjectGUI($a_data, $a_id, $a_call_by_reference,
false);
72 $next_class = $this->ctrl->getNextClass();
73 $cmd = $this->ctrl->getCmd(
"render");
78 case "ilpageobjectgui":
80 $tpl->setContent(
$ret);
99 $ilTabs->clearTargets();
105 $ilTabs->setBackTarget($lng->txt(
"cntr_back_to_old_editor"),
106 $ilCtrl->getLinkTarget($this,
"switchToOldEditor"),
"_top");
110 $ilTabs->setBackTarget($lng->txt(
"back"),
"./goto.php?target=".$this->object->getType().
"_".
111 $this->
object->getRefId(),
"_top");
115 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
116 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
118 $lng->loadLanguageModule(
"content");
120 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
121 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
125 $this->
object->getId()))
128 $new_page_object =
new ilPageObject($this->object->getType());
129 $new_page_object->
setParentId($this->object->getId());
130 $new_page_object->setId($this->object->getId());
131 $new_page_object->createFromXML();
137 $this->ctrl->setReturnByClass(
"ilpageobjectgui",
"edit");
144 $this->
object->getId());
151 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
152 $page_gui->setLinkXML($link_xml);
154 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
155 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"showMediaFullscreen"));
157 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this,
""));
158 $page_gui->setPresentationTitle(
"");
159 $page_gui->setTemplateOutput(
false);
161 $page_gui->setHeader(
"");
162 $page_gui->setEnabledRepositoryObjects(
true);
163 $page_gui->setEnabledFileLists(
false);
164 $page_gui->setEnabledMaps(
true);
165 $page_gui->setEnabledPCTabs(
true);
172 $wtpl =
new ilTemplate(
"tpl.cntr_old_editor_message.html",
true,
173 true,
"Services/Container");
174 $wtpl->setVariable(
"ALT_WARNING", $lng->txt(
"warning"));
175 $wtpl->setVariable(
"IMG_WARNING",
177 $wtpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_switch_to_new_editor_message"));
178 $wtpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_switch_to_new_editor_message"));
179 $wtpl->setVariable(
"HREF_SWITCH_TO_NEW_EDITOR",
180 $ilCtrl->getLinkTarget($this,
"useNewEditor"));
181 $wtpl->setVariable(
"TXT_MIGRATION_SWITCH",
182 $lng->txt(
"cntr_switch_to_new_editor_cmd"));
183 $page_gui->setPrependingHtml($wtpl->get());
186 $ret =& $this->ctrl->forwardCommand($page_gui);
199 if (!$ilSetting->get(
"enable_cat_page_edit"))
210 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
212 return $xpage->getContent();
217 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
218 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
222 $this->
object->getId()))
227 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
228 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
233 $this->
object->getId());
237 $page_gui->setLinkXML($link_xml);
238 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
241 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this,
""));
242 $page_gui->setPresentationTitle(
"");
243 $page_gui->setTemplateOutput(
false);
245 $page_gui->setHeader(
"");
246 $page_gui->setEnabledRepositoryObjects(
true);
247 $page_gui->setEnabledFileLists(
false);
248 $page_gui->setEnabledPCTabs(
true);
249 $page_gui->setEnabledMaps(
true);
250 $ret = $page_gui->showPage();
261 if (parent::prepareOutput())
266 #$this->showPossibleSubObjects();
277 if (
$_GET[
"obj_id"] !=
"")
282 $mode = (
$_SESSION[
"il_rep_mode"] ==
"flat")
285 $link =
"repository.php?cmd=frameset&set_mode=".$mode.
"&ref_id=".$this->
object->getRefId();
286 $tpl->setTreeFlatIcon($link, $mode);
298 $this->tpl->setTitle($this->object->getTitle());
299 $this->tpl->setDescription($this->object->getLongDescription());
303 if ($ilias->getSetting(
"custom_icons") &&
304 in_array($this->object->getType(), array(
"cat",
"grp",
"crs",
"root")))
306 require_once(
"./Services/Container/classes/class.ilContainer.php");
312 $this->tpl->setTitleIcon($icon, $this->lng->txt(
"obj_".$this->object->getType()));
325 $cmd = ($this->cmd !=
"")
327 : $this->ctrl->getCmd();
329 #if ($cmd != "" && $cmd != "showList" && $cmd != "render"
335 $type = $this->
object->getType();
337 $d = $this->objDefinition->getCreatableSubObjects($type);
359 if ($row[
"max"] ==
"" || $count < $row[
"max"])
365 if (!in_array($row[
"name"], array(
"rolf")))
367 if ($this->rbacsystem->checkAccess(
"create", $this->object->getRefId(), $row[
"name"]))
369 $subobj[] = $row[
"name"];
375 if (is_array($subobj))
377 $formaction =
"repository.php?ref_id=".$this->object->getRefId().
"&cmd=post";
382 $opts,
"create", $this->lng->txt(
"add"));
393 switch ($this->object->getViewMode())
397 include_once(
"./Services/Container/classes/class.ilContainerSimpleContentGUI.php");
402 include_once(
'./Services/Container/classes/class.ilContainerObjectiveGUI.php');
409 include_once(
"./Services/Container/classes/class.ilContainerSessionsContentGUI.php");
415 include_once
'Services/Container/classes/class.ilContainerILincContentGUI.php';
422 include_once(
"./Services/Container/classes/class.ilContainerByTypeContentGUI.php");
427 $container_view->setOutput();
525 $GLOBALS[
"tpl"]->setAdminViewButton(
526 $this->ctrl->getLinkTarget($this,
"disableAdministrationPanel"),
527 $this->lng->txt(
"basic_commands"));
530 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())
531 && $this->object->enablePageEditing())
534 $this->ctrl->getLinkTarget($this,
"editPageFrame"),
535 $this->lng->txt(
"edit_page"),
540 if ($this->object->gotItems())
542 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"delete",
543 $this->lng->txt(
"delete_selected_items"));
548 if ($this->object->gotItems())
550 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"cut",
551 $this->lng->txt(
"move_selected_items"));
557 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"link",
558 $this->lng->txt(
"link_selected_items"));
563 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"paste",
564 $this->lng->txt(
"paste_clipboard_items"));
565 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"clear",
566 $this->lng->txt(
"clear_clipboard"));
568 if($this->object->gotItems() and $ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
570 include_once(
'./Services/Container/classes/class.ilContainer.php');
574 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"saveSorting",
575 $this->lng->txt(
'sorting_save'));
579 $this->ctrl->setParameter($this,
"type",
"");
580 $this->ctrl->setParameter($this,
"item_ref_id",
"");
581 $GLOBALS[
"tpl"]->setPageFormAction($this->ctrl->getFormAction($this));
584 $ilUser->getId() != ANONYMOUS_USER_ID &&
585 ($this->adminCommands ||
586 (is_object($this->
object) &&
587 ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())))
589 (is_object($this->
object) &&
590 ($this->
object->getHiddenFilesFound())) ||
595 $GLOBALS[
"tpl"]->setAdminViewButton(
596 $this->ctrl->getLinkTarget($this,
"enableAdministrationPanel"),
597 $this->lng->txt(
"all_commands"));
605 if(!$tree->checkForParentType($this->object->getRefId(),
'crs'))
609 $tpl->setCurrentBlock(
"custom_button");
610 $tpl->setVariable(
"ADMIN_MODE_LINK",$this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'editTimings'));
611 $tpl->setVariable(
"TXT_ADMIN_MODE",$this->lng->txt(
'timings_edit'));
612 $tpl->parseCurrentBlock();
620 $GLOBALS[
"tpl"]->setPermanentLink($this->object->getType(),
621 $this->
object->getRefId(),
"",
"_top");
632 $ilCtrl->redirect($this,
"editPageFrame");
643 $ilCtrl->redirect($this,
"editPageFrame");
653 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
655 include_once(
"./Services/XHTMLPage/classes/class.ilXHTMLPage.php");
672 $ilCtrl->redirect($this,
"editPageFrame");
680 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
683 $fs_gui->setFramesetTitle($this->object->getTitle());
684 $fs_gui->setMainFrameName(
"content");
685 $fs_gui->setSideFrameName(
"link_list");
690 if ($xpage_id > 0 &&
$_SESSION[
"il_cntr_editor"] !=
"std")
692 $fs_gui->setMainFrameSource(
693 $this->ctrl->getLinkTarget(
694 $this,
"editPageContent"));
695 $fs_gui->setSideFrameSource(
696 $this->ctrl->getLinkTarget($this,
"showLinkList"));
700 $fs_gui->setMainWidth(
"100%");
701 $fs_gui->setSideWidth(
"0");
704 $fs_gui->setSideFrameSource(
"");
707 $fs_gui->setMainFrameSource(
708 $this->ctrl->getLinkTargetByClass(
709 array(
"ilpageobjectgui"),
"edit"));
725 if (!$rbacsystem->checkAccess(
"write", $this->ref_id))
727 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
734 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
736 $content = $xpage->getContent();
740 $tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.container_edit_page_content.html",
741 "Services/Container");
743 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
744 $tpl->setVariable(
"TXT_EDIT_PAGE_CONTENT",
745 $this->lng->txt(
"edit_page_content"));
746 $tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
747 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
748 $tpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_old_editor_warning"));
749 $tpl->setVariable(
"TXT_MIGRATION_OPEN_STD_EDITOR", $lng->txt(
"cntr_old_editor_open_standard_editor"));
751 $tpl->setVariable(
"HREF_OPEN_STD_EDITOR", $ilCtrl->getLinkTarget($this,
"switchToStdEditor"));
752 $tpl->setVariable(
"ALT_WARNING", $lng->txt(
"warning"));
754 include_once(
"./Services/Form/classes/class.ilFormPropertyGUI.php");
755 include_once(
"./Services/Form/classes/class.ilTextAreaInputGUI.php");
760 include_once
"./Services/RTE/classes/class.ilRTE.php";
762 include_once
"./Services/RTE/classes/class.$rtestring.php";
763 $rte =
new $rtestring();
765 include_once
"./classes/class.ilObject.php";
768 $rte->addRTESupport(
$obj_id, $obj_type);
775 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
776 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
796 $xpage->setContent($text);
802 $xpage->setContent($text);
805 "xhtml_page", $xpage->getId());
808 include_once(
"Services/RTE/classes/class.ilRTE.php");
810 $this->
object->getId());
813 $this->ctrl->redirect($this,
"");
819 $this->ctrl->redirect($this,
"");
826 include_once(
"classes/class.ilObjectListGUIFactory.php");
831 $type_grps = $this->
object->getGroupedObjTypes();
850 $this->type_template = array();
854 foreach ($type_grps as $type => $v)
857 if (is_int(strpos($output_html,
"[list-".$type.
"]")))
864 $tpl =& $overall_tpl;
868 if (is_array($this->items[$type]))
871 $item_html = array();
873 foreach($this->items[$type] as $key => $item)
876 if ($cur_obj_type != $item[
"type"])
879 $item_list_gui->setContainerObject($this);
882 $ilBench->start(
"ilContainerGUI",
"0210_getListHTML");
887 $item_list_gui->enableDelete(
false);
888 $item_list_gui->enableLink(
false);
889 $item_list_gui->enableCut(
false);
892 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
893 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
897 $this->determineAdminCommands($item[
"ref_id"],
898 $item_list_gui->adminCommandsIncluded());
899 $ilBench->stop(
"ilContainerGUI",
"0210_getListHTML");
903 $item_html[] = array(
905 "item_ref_id" => $item[
"ref_id"],
906 "item_obj_id" => $item[
"obj_id"],
907 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
908 $item_list_gui->getIconImageType() :
916 if (count($item_html) > 0)
919 if (!$first && $overall)
930 if ($this->ilias->getSetting(
"icon_position_in_lists") ==
"item_rows")
941 $this->current_position = 1;
942 foreach($item_html as $item)
945 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"], $item[
'item_icon_image_type']);
950 if (is_int(strpos($output_html,
"[list-".$type.
"]")))
952 $this->type_template[$type] =
$tpl;
963 $this->lng->txt(
"msg_no_type_accessible"), $type);
964 $this->type_template[$type] =
$tpl;
976 $this->lng->txt(
"msg_no_type_available"), $type);
977 $this->type_template[$type] =
$tpl;
986 if ($output_html !=
"")
990 $output_html.= $overall_tpl->get();
995 foreach ($this->type_template as $type =>
$tpl)
997 $output_html = eregi_replace(
"\[list-".$type.
"\]",
998 "</p>".$tpl->get().
"<p class=\"ilc_Standard\">",
1006 $page_block =
new ilTemplate(
"tpl.container_page_block.html",
false,
false,
1007 "Services/Container");
1008 $page_block->setVariable(
"CONTAINER_PAGE_CONTENT", $output_html);
1009 $output_html = $page_block->get();
1018 return $output_html;
1025 $tpl =
new ilTemplate(
"tpl.container_link_help.html",
true,
true);
1027 $type_ordering = array(
1028 "cat",
"fold",
"crs",
"icrs",
"icla",
"grp",
"chat",
"frm",
"lres",
1029 "glo",
"webr",
"file",
"exc",
1030 "tst",
"svy",
"mep",
"qpl",
"spl");
1032 $childs = $tree->getChilds(
$_GET[
"ref_id"]);
1033 foreach($childs as $child)
1035 if (in_array($child[
"type"], array(
"lm",
"dbk",
"sahs",
"htlm")))
1041 $cnt[$child[
"type"]]++;
1046 $tpl->setVariable(
"TXT_HELP_HEADER", $lng->txt(
"help"));
1047 foreach($type_ordering as $type)
1049 $tpl->setCurrentBlock(
"row");
1050 $tpl->setVariable(
"ROWCOL",
"tblrow".((($i++)%2)+1));
1051 if ($type !=
"lres")
1053 $tpl->setVariable(
"TYPE", $lng->txt(
"objs_".$type).
1054 " (".((int)$cnt[$type]).
")");
1058 $tpl->setVariable(
"TYPE", $lng->txt(
"learning_resources").
1059 " (".((int)$cnt[
"lres"]).
")");
1061 $tpl->setVariable(
"TXT_LINK",
"[list-".$type.
"]");
1062 $tpl->parseCurrentBlock();
1074 $this->adminCommands =
false;
1106 $tpl =
new ilTemplate (
"tpl.container_list_block.html",
true,
true,
1107 "Services/Container");
1108 $this->cur_row_type =
"row_type_1";
1122 $title = $this->lng->txt(
"objs_".$a_type);
1126 $a_tpl->setCurrentBlock(
"container_header_row_image");
1127 $a_tpl->setVariable(
"HEADER_IMG", $icon);
1128 $a_tpl->setVariable(
"HEADER_ALT",
$title);
1132 $a_tpl->setCurrentBlock(
"container_header_row");
1135 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT",
$title);
1136 $a_tpl->parseCurrentBlock();
1137 $a_tpl->touchBlock(
"container_row");
1150 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1154 $a_tpl->touchBlock($this->cur_row_type);
1157 if ($this->ilias->getSetting(
"icon_position_in_lists") ==
"item_rows")
1160 $alt = $this->lng->txt(
"obj_".$a_image_type);
1163 if ($this->ilias->getSetting(
"custom_icons") &&
1164 in_array($a_image_type, array(
"cat",
"grp",
"crs")))
1166 require_once(
"./Services/Container/classes/class.ilContainer.php");
1173 $a_tpl->setCurrentBlock(
"block_row_image");
1174 $a_tpl->setVariable(
"ROW_IMG", $icon);
1175 $a_tpl->setVariable(
"ROW_ALT", $alt);
1176 $a_tpl->parseCurrentBlock();
1182 $a_tpl->setCurrentBlock(
"block_row_check");
1183 $a_tpl->setVariable(
"ITEM_ID", $a_item_ref_id);
1184 $a_tpl->parseCurrentBlock();
1187 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
1191 $a_tpl->setCurrentBlock(
'block_position');
1192 $a_tpl->setVariable(
'POS_TYPE',$a_image_type);
1193 $a_tpl->setVariable(
'POS_ID',$a_item_ref_id);
1194 $a_tpl->setVariable(
'POSITION',sprintf(
'%.1f',$this->current_position++));
1195 $a_tpl->parseCurrentBlock();
1199 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1201 $a_tpl->setCurrentBlock(
"container_standard_row");
1202 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
1203 $a_tpl->parseCurrentBlock();
1204 $a_tpl->touchBlock(
"container_row");
1212 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1216 $a_tpl->touchBlock($this->cur_row_type);
1218 $type = $this->lng->txt(
"obj_".$a_type);
1219 $a_message = str_replace(
"[type]", $type, $a_message);
1221 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1223 $a_tpl->setCurrentBlock(
"container_standard_row");
1224 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT",
1226 $a_tpl->parseCurrentBlock();
1227 $a_tpl->touchBlock(
"container_row");
1232 $this->cur_row_type =
"";
1237 $a_tpl->touchBlock(
"separator_row");
1238 $a_tpl->touchBlock(
"container_row");
1246 || strtolower($this->ctrl->getCmdClass()) !=
"ilpageobjectgui")
1251 $lng->loadLanguageModule(
"content");
1256 $this->tabs_gui->setBackTarget($this->lng->txt(
"obj_cat"),
1257 $this->ctrl->getLinkTarget($this,
"frameset"),
1260 $this->tabs_gui->addTarget(
"edit", $this->ctrl->getLinkTargetByClass(
"ilpageobjectgui",
"view")
1261 , array(
"",
"view"),
"ilpageobjectgui");
1276 if ($rbacsystem->checkAccess(
'edit_permission',$this->ref_id))
1278 $tabs_gui->addTarget(
"perm_settings",
1279 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1283 if ($this->ctrl->getTargetScript() ==
"repository.php" and !empty(
$_SESSION[
"clipboard"]))
1285 $tabs_gui->addTarget(
"clipboard",
1286 $this->ctrl->getLinkTarget($this,
"clipboard"),
"clipboard", get_class($this));
1301 $_SESSION[
"il_cont_admin_panel"] =
true;
1302 $this->ctrl->redirect($this,
"render");
1310 $_SESSION[
"il_cont_admin_panel"] =
false;
1311 $this->ctrl->redirect($this,
"render");
1321 $this->ilias->account->addDesktopItem($_GET[
"item_ref_id"], $_GET[
"type"]);
1325 if ($_POST[
"items"])
1327 foreach ($_POST[
"items"] as $item)
1330 $this->ilias->account->addDesktopItem($item, $type);
1339 global
$tree, $ilUser, $rbacsystem;
1341 if (!$rbacsystem->checkAccess(
"write",
$_GET[
'item_ref_id']))
1343 $this->ilErr->raiseError($this->lng->txt(
'err_no_permission'),$this->ilErr->MESSAGE);
1347 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
1350 require_once
'Services/WebDAV/classes/class.ilDAVLocks.php';
1354 $ilUser->getId(), $ilUser->getLogin(),
1355 'ref_'.$_GET[
'item_ref_id'].
'_usr_'.$ilUser->getId(),
1356 time() + 60, 0,
'exclusive'
1376 "cut" => array(
"name" =>
"cut",
"lng" =>
"cut"),
1377 "delete" => array(
"name" =>
"delete",
"lng" =>
"delete"),
1378 "link" => array(
"name" =>
"link",
"lng" =>
"link"),
1379 "paste" => array(
"name" =>
"paste",
"lng" =>
"paste"),
1380 "clear" => array(
"name" =>
"clear",
"lng" =>
"clear")
1392 $this->ilias->account->dropDesktopItem($_GET[
"item_ref_id"], $_GET[
"type"]);
1396 if ($_POST[
"items"])
1398 foreach ($_POST[
"items"] as $item)
1401 $this->ilias->account->dropDesktopItem($item, $type);
1420 if (
$_GET[
"item_ref_id"] !=
"")
1422 $_POST[
"id"] = array(
$_GET[
"item_ref_id"]);
1429 if (!isset($_POST[
"id"]))
1431 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1435 foreach ($_POST[
"id"] as
$ref_id)
1438 $node_data = $this->tree->getNodeData($ref_id);
1439 $subtree_nodes = $this->tree->getSubTree($node_data);
1441 $all_node_data[] = $node_data;
1442 $all_subtree_nodes[] = $subtree_nodes;
1445 foreach ($subtree_nodes as $node)
1447 if($node[
'type'] ==
'rolf')
1452 if (!$rbacsystem->checkAccess(
'delete',$node[
"ref_id"]))
1454 $no_cut[] = $node[
"ref_id"];
1461 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_cut").
" ".implode(
',',$this->
getTitlesByRefId($no_cut)),
1462 $this->ilias->error_obj->MESSAGE);
1468 : key($_POST[
"cmd"]);
1470 $_SESSION[
"clipboard"][
"ref_ids"] = $_POST[
"id"];
1475 $this->ctrl->returnToParent($this);
1488 global $clipboard, $rbacsystem, $rbacadmin;
1490 if (
$_GET[
"item_ref_id"] !=
"")
1492 $_POST[
"id"] = array(
$_GET[
"item_ref_id"]);
1495 if (!isset($_POST[
"id"]))
1497 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1501 foreach ($_POST[
"id"] as
$ref_id)
1503 if (!$rbacsystem->checkAccess(
'delete',$ref_id))
1508 $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1510 if (!$this->objDefinition->allowLink(
$object->getType()))
1512 $no_link[] =
$object->getType();
1519 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_link").
" ".
1520 implode(
',',$no_cut),$this->ilias->error_obj->MESSAGE);
1523 if (count($no_link))
1525 $no_link = array_unique($no_link);
1527 foreach ($no_link as $type)
1529 $txt_objs[] = $this->lng->txt(
"objs_".$type);
1532 $this->ilias->raiseError(implode(
', ',$txt_objs).
" ".$this->lng->txt(
"msg_obj_no_link"),$this->ilias->error_obj->MESSAGE);
1539 $clipboard[
"parent"] =
$_GET[
"ref_id"];
1540 $clipboard[
"cmd"] = (
$_GET[
"cmd"] !=
"" &&
$_GET[
"cmd"] !=
"post")
1542 : key($_POST[
"cmd"]);
1544 foreach ($_POST[
"id"] as $ref_id)
1546 $clipboard[
"ref_ids"][] =
$ref_id;
1553 $this->ctrl->returnToParent($this);
1570 if (isset($_POST[
"cmd"][
"clear"]))
1574 $this->ctrl->returnToParent($this);
1587 global $rbacsystem, $rbacadmin, $rbacreview,
$log,
$tree;
1588 global $ilUser,
$lng;
1591 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1595 if (!in_array(
$_SESSION[
"clipboard"][
"cmd"],array(
"cut",
"link",
"copy")))
1597 $message = get_class($this).
"::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
1598 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
1604 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1607 if (!$rbacsystem->checkAccess(
'create',$this->object->getRefId(), $obj_data->getType()))
1610 $no_paste_titles[] = $obj_data->getTitle();
1614 if ($this->object->getRefId() == $this->tree->getParentId($obj_data->getRefId()))
1621 if ($this->tree->isGrandChild($ref_id,$this->object->getRefId()))
1627 $obj_type = $obj_data->getType();
1629 if (!in_array($obj_type, array_keys($this->objDefinition->getSubObjects($this->object->getType()))))
1631 $not_allowed_subobject[] = $obj_data->getType();
1638 if (count($exists) &&
$_SESSION[
"clipboard"][
"cmd"] !=
"copy")
1641 $this->ilias->raiseError($this->lng->txt(
"msg_obj_exists"),$this->ilias->error_obj->MESSAGE);
1644 if (count($is_child))
1646 $this->ilias->raiseError($this->lng->txt(
"msg_not_in_itself").
" ".implode(
',',$is_child),
1647 $this->ilias->error_obj->MESSAGE);
1650 if (count($not_allowed_subobject))
1652 $this->ilias->raiseError($this->lng->txt(
"msg_may_not_contain").
" ".implode(
',',$not_allowed_subobject),
1653 $this->ilias->error_obj->MESSAGE);
1656 if (count($no_paste))
1658 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_paste").
" ".
1659 implode(
',',$no_paste),$this->ilias->error_obj->MESSAGE);
1663 $log->write(
"ilObjectGUI::pasteObject(), cmd: ".
$_SESSION[
"clipboard"][
"cmd"]);
1669 $ref_ids =
$_SESSION[
"clipboard"][
"ref_ids"];
1670 unset(
$_SESSION[
"clipboard"][
"ref_ids"]);
1674 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"copy")
1676 foreach($ref_ids as $ref_id)
1678 $revIdMapping = array();
1680 $oldNode_data = $tree->getNodeData($ref_id);
1681 if ($oldNode_data[
'parent'] == $this->object->getRefId())
1683 require_once
'Modules/File/classes/class.ilObjFileAccess.php';
1685 $newRef = $this->
cloneNodes($ref_id, $this->object->getRefId(), $refIdMapping, $newTitle);
1689 $newRef = $this->
cloneNodes($ref_id, $this->object->getRefId(), $refIdMapping, null);
1696 $old_parent_data = $tree->getParentNodeData($ref_id);
1697 $newNode_data = $tree->getNodeData($newRef);
1700 $this->
object->getId());
1705 $log->write(
"ilObjectGUI::pasteObject(), copy finished");
1710 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"cut")
1713 foreach($ref_ids as $ref_id)
1716 $old_parent = $tree->getParentId($ref_id);
1717 $this->tree->moveTree($ref_id,$this->object->getRefId());
1718 $rbacadmin->adjustMovedObjectPermissions($ref_id,$old_parent);
1720 include_once(
'classes/class.ilConditionHandler.php');
1726 $node_data = $tree->getNodeData($ref_id);
1727 $old_parent_data = $tree->getNodeData($old_parent);
1729 $old_parent_data[
'obj_id']);
1731 $this->
object->getId());
1739 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"link")
1741 foreach ($ref_ids as $ref_id)
1744 $top_node = $this->tree->getNodeData($ref_id);
1747 $subnodes[
$ref_id] = $this->tree->getSubtree($top_node);
1751 foreach ($subnodes as $key => $subnode)
1754 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($key);
1755 $new_ref_id = $obj_data->createReference();
1756 $obj_data->putInTree(
$_GET[
"ref_id"]);
1757 $obj_data->setPermissions(
$_GET[
"ref_id"]);
1760 array_shift($subnode);
1763 $mapping[$new_ref_id] = $key;
1766 $old_ref_id = $obj_data->getRefId();
1767 $obj_data->setRefId($new_ref_id);
1768 $obj_data->initDefaultRoles();
1769 $rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());
1771 if (isset($rolf_data[
"child"]))
1774 $rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);
1779 $mapping[$rolf_data[
"child"]] = (int) $rolf_data_old[
"child"];
1782 $log->write(
"ilObjectGUI::pasteObject(), created role folder (ref_id): ".$rolf_data[
"child"].
1783 ", for object ref_id:".$obj_data->getRefId().
", obj_id: ".$obj_data->getId().
1784 ", type: ".$obj_data->getType().
", title: ".$obj_data->getTitle());
1790 $node_data = $tree->getNodeData($new_ref_id);
1792 $this->
object->getId());
1798 if (count($subnode) > 0)
1800 foreach ($subnode as $node)
1802 if ($node[
"type"] !=
'rolf')
1804 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($node[
"child"]);
1805 $new_ref_id = $obj_data->createReference();
1808 $new_parent = array_search($node[
"parent"],$mapping);
1810 $mapping[$new_ref_id] = (int) $node[
"child"];
1812 $obj_data->putInTree($new_parent);
1813 $obj_data->setPermissions($new_parent);
1816 $old_ref_id = $obj_data->getRefId();
1817 $obj_data->setRefId($new_ref_id);
1818 $obj_data->initDefaultRoles();
1819 $rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());
1821 if (isset($rolf_data[
"child"]))
1824 $rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);
1829 $mapping[$rolf_data[
"child"]] = (int) $rolf_data_old[
"child"];
1832 $log->write(
"ilObjectGUI::pasteObject(), created role folder (ref_id): ".$rolf_data[
"child"].
1833 ", for object ref_id:".$obj_data->getRefId().
", obj_id: ".$obj_data->getId().
1834 ", type: ".$obj_data->getType().
", title: ".$obj_data->getTitle());
1840 foreach ($subnodes as $old_ref => $subnode)
1842 $new_ref = array_search($old_ref,$mapping);
1844 foreach ($subnode as $node)
1846 $node[
"child"] = array_search($node[
"child"],$mapping);
1847 $node[
"parent"] = array_search($node[
"parent"],$mapping);
1848 $new_subnodes[
$ref_id][] = $node;
1856 $log->write(
"ilObjectGUI::pasteObject(), link finished");
1863 $last_cmd =
$_SESSION[
"clipboard"][
"cmd"];
1869 if ($last_cmd ==
"cut")
1874 else if ($last_cmd ==
"copy")
1878 else if ($last_command ==
'link')
1884 $this->ctrl->returnToParent($this);
1899 if (
$_GET[
"item_ref_id"] !=
"")
1901 $_POST[
"id"] = array(
$_GET[
"item_ref_id"]);
1904 if (!isset($_POST[
"id"]))
1906 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1910 foreach ($_POST[
"id"] as
$ref_id)
1913 $node_data = $this->tree->getNodeData($ref_id);
1914 $subtree_nodes = $this->tree->getSubTree($node_data);
1916 $all_node_data[] = $node_data;
1917 $all_subtree_nodes[] = $subtree_nodes;
1920 foreach ($subtree_nodes as $node)
1922 if($node[
'type'] ==
'rolf')
1927 if (!$rbacsystem->checkAccess(
'visible,read,copy',$node[
"ref_id"]))
1929 $no_copy[] = $node[
"ref_id"];
1934 if (count($no_copy))
1936 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_copy").
" ".implode(
',',$this->
getTitlesByRefId($no_copy)),
1937 $this->ilias->error_obj->MESSAGE);
1942 : key($_POST[
"cmd"]);
1943 $_SESSION[
"clipboard"][
"ref_ids"] = $_POST[
"id"];
1947 $this->ctrl->returnToParent($this);
1963 $message = sprintf(
'%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
1964 $ilLog->write($message,$ilLog->FATAL);
1965 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->WARNING);
1968 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.rep_clipboard.html");
1972 $f_result = array();
1982 $f_result[$counter][] = $this->lng->txt(
"obj_".$tmp_obj->getType());
1983 $f_result[$counter][] = $tmp_obj->getTitle();
1985 $f_result[$counter][] = (
$_SESSION[
"clipboard"][
"cmd"] ==
"cut") ? $this->lng->txt(
"move") :$this->lng->txt(
$_SESSION[
"clipboard"][
"cmd"]);
2003 if ($this->ilias->getSetting(
"custom_icons"))
2005 $this->tpl->addBlockFile(
"CONTAINER_ICONS",
"container_icon_settings",
2006 "tpl.container_icon_settings.html");
2008 if (($big_icon = $this->object->getBigIconPath()) !=
"")
2010 $this->tpl->setCurrentBlock(
"big_icon");
2011 $this->tpl->setVariable(
"SRC_BIG_ICON", $big_icon);
2012 $this->tpl->parseCurrentBlock();
2014 if (($small_icon = $this->object->getSmallIconPath()) !=
"")
2016 $this->tpl->setCurrentBlock(
"small_icon");
2017 $this->tpl->setVariable(
"SRC_SMALL_ICON", $small_icon);
2018 $this->tpl->parseCurrentBlock();
2020 if (($tiny_icon = $this->object->getTinyIconPath()) !=
"")
2022 $this->tpl->setCurrentBlock(
"tiny_icon");
2023 $this->tpl->setVariable(
"SRC_TINY_ICON", $tiny_icon);
2024 $this->tpl->parseCurrentBlock();
2026 $this->tpl->setCurrentBlock(
"container_icon_settings");
2027 $this->tpl->setVariable(
"SPAN_TITLE", $a_input_colspan + 1);
2028 $this->tpl->setVariable(
"SPAN_INPUT", $a_input_colspan);
2029 $this->tpl->setVariable(
"ICON_SETTINGS", $this->lng->txt(
"icon_settings"));
2030 $this->tpl->setVariable(
"BIG_ICON", $this->lng->txt(
"big_icon"));
2031 $this->tpl->setVariable(
"SMALL_ICON", $this->lng->txt(
"standard_icon"));
2032 $this->tpl->setVariable(
"TINY_ICON", $this->lng->txt(
"tiny_icon"));
2033 $this->tpl->setVariable(
"BIG_SIZE",
"(".
2034 $this->ilias->getSetting(
"custom_icon_big_width").
"x".
2035 $this->ilias->getSetting(
"custom_icon_big_height").
")");
2036 $this->tpl->setVariable(
"SMALL_SIZE",
"(".
2037 $this->ilias->getSetting(
"custom_icon_small_width").
"x".
2038 $this->ilias->getSetting(
"custom_icon_small_height").
")");
2039 $this->tpl->setVariable(
"TINY_SIZE",
"(".
2040 $this->ilias->getSetting(
"custom_icon_tiny_width").
"x".
2041 $this->ilias->getSetting(
"custom_icon_tiny_height").
")");
2042 $this->tpl->setVariable(
"TXT_REMOVE", $this->lng->txt(
"remove"));
2043 $this->tpl->parseCurrentBlock();
2049 return $_SESSION[
"il_cont_admin_panel"];
2060 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
2064 $column_gui->setEnableMovement(
true);
2067 $column_gui->setRepositoryItems(
2068 $this->object->getSubItems($this->isActiveAdministrationPanel(),
true));
2072 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
2074 $column_gui->setBlockProperty(
"news",
"settings",
true);
2076 $column_gui->setBlockProperty(
"news",
"default_visibility_option",
true);
2077 $column_gui->setBlockProperty(
"news",
"hide_news_block_option",
true);
2082 $column_gui->setAdminCommands(
true);
2134 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardPageFactory.php');
2136 global $ilObjDataCache,
$tree;
2138 if(!$_REQUEST[
'clone_source'])
2141 if(isset(
$_SESSION[
'wizard_search_title']))
2151 $source_id = $_REQUEST[
'clone_source'];
2152 $new_type = $_REQUEST[
'new_type'];
2153 $this->ctrl->setParameter($this,
'clone_source',(
int) $_REQUEST[
'clone_source']);
2154 $this->ctrl->setParameter($this,
'new_type',$new_type);
2158 $this->tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
2159 $this->tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
2162 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.container_wizard_page.html');
2163 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
2165 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_'.$new_type));
2166 $this->tpl->setVariable(
'TXT_DUPLICATE',$this->lng->txt($new_type.
'_wizard_page'));
2167 $this->tpl->setVariable(
'INFO_DUPLICATE',$this->lng->txt($new_type.
'_copy_threads_info'));
2168 $this->tpl->setVariable(
'BTN_COPY',$this->lng->txt(
'obj_'.$new_type.
'_duplicate'));
2169 $this->tpl->setVariable(
'BTN_BACK',$this->lng->txt(
'btn_back'));
2170 if(isset(
$_SESSION[
'wizard_search_title']))
2172 $this->tpl->setVariable(
'CMD_BACK',
'searchCloneSource');
2176 $this->tpl->setVariable(
'CMD_BACK',
'create');
2179 $this->tpl->setVariable(
'BTN_TREE',$this->lng->txt(
'treeview'));
2180 $this->tpl->setVariable(
'BTN_LIST',$this->lng->txt(
'flatview'));
2188 foreach($subnodes = $tree->getSubtree($source_node = $tree->getNodeData($source_id),
true) as $node)
2196 if($node[
'type'] ==
'rolf')
2203 for($i = $source_node[
'depth'];$i < $node[
'depth']; $i++)
2205 $this->tpl->touchBlock(
'padding');
2206 $this->tpl->touchBlock(
'end_padding');
2210 $copy_wizard_page->fillTreeSelection($node[
'ref_id'],$node[
'type'],$node[
'depth']);
2212 $this->tpl->setCurrentBlock(
'tree_row');
2214 $this->tpl->setVariable(
'TREE_ALT_IMG',$this->lng->txt(
'obj_'.$node[
'type']));
2215 $this->tpl->setVariable(
'TREE_TITLE',$node[
'title']);
2216 $this->tpl->parseCurrentBlock();
2220 $this->tpl->setCurrentBlock(
'no_content');
2221 $this->tpl->setVariable(
'TXT_NO_CONTENT',$this->lng->txt(
'container_no_items'));
2222 $this->tpl->parseCurrentBlock();
2226 $this->tpl->setCurrentBlock(
'tree_footer');
2227 $this->tpl->setVariable(
'TXT_COPY_ALL',$this->lng->txt(
'copy_all'));
2228 $this->tpl->setVariable(
'TXT_LINK_ALL',$this->lng->txt(
'link_all'));
2229 $this->tpl->setVariable(
'TXT_OMIT_ALL',$this->lng->txt(
'omit_all'));
2230 $this->tpl->parseCurrentBlock();
2236 foreach($tree->getSubTreeTypes($source_id,array(
'rolf',
'crs')) as $type)
2239 if(strlen($html = $copy_wizard_page->getWizardPageBlockHTML()))
2241 $this->tpl->setCurrentBlock(
'obj_row');
2242 $this->tpl->setVariable(
'ITEM_BLOCK',$html);
2243 $this->tpl->parseCurrentBlock();
2260 include_once(
'classes/class.ilLink.php');
2261 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
2263 global $ilAccess,
$ilErr,$rbacsystem,
$tree,$ilUser;
2265 $new_type = $_REQUEST[
'new_type'];
2267 $clone_source = (int) $_REQUEST[
'clone_source'];
2269 if(!$rbacsystem->checkAccess(
'create',
$ref_id,$new_type))
2271 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
2279 if(!$ilAccess->checkAccess(
'write',
'', $clone_source,$new_type))
2281 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
2284 $options = $_POST[
'cp_options'] ? $_POST[
'cp_options'] : array();
2312 case self::COPY_WIZARD_NEEDS_PAGE:
2329 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
2331 $sorting->savePost($_POST[
'position']);
2333 $this->ctrl->returnToParent($this);
2353 $srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
2354 error_log(__METHOD__.
' cloning srcRef='.$srcRef.
' dstRef='.$dstRef.
'...');
2355 $newRef = $srcObj->cloneObject($dstRef)->getRefId();
2356 error_log(__METHOD__.
' ...cloning... newRef='.$newRef.
'...');
2361 if (! is_null($newName))
2363 $newObj =& $ilias->obj_factory->getInstanceByRefId($newRef);
2364 $newObj->setTitle($newName);
2369 $mapping[$newRef] = $srcRef;
2372 $children = $tree->getChilds($srcRef);
2373 foreach ($tree->getChilds($srcRef) as $child)
2377 if ($child[
"type"] !=
'rolf')
2379 $this->
cloneNodes($child[
"ref_id"],$newRef,$mapping);
2383 if (count($rolf = $tree->getChildsByType($newRef,
"rolf")))
2385 $mapping[$rolf[0][
"ref_id"]] = $child[
"ref_id"];
2389 error_log(__METHOD__.
' ...cloned srcRef='.$srcRef.
' dstRef='.$dstRef.
' newRef='.$newRef);
2403 $a_item_list_gui->addCustomProperty($lng->txt(
'path'),
2404 ilContainer_buildPath($a_item_data[
'ref_id'], $this->object->getRefId()),
2416 $path_arr = $tree->getPathFull($a_ref_id, $a_course_ref_id);
2418 foreach($path_arr as
$data)
2424 $path .= $data[
'title'];