4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
5 require_once
"./Services/Container/classes/class.ilContainer.php";
6 include_once
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
28 function ilContainerGUI($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
32 $this->rbacsystem =& $rbacsystem;
34 $lng->loadLanguageModule(
"cntr");
43 $this->
ilObjectGUI($a_data, $a_id, $a_call_by_reference,
false);
54 $next_class = $this->ctrl->getNextClass();
55 $cmd = $this->ctrl->getCmd(
"render");
60 case "ilcontainerpagegui":
61 if (
$_GET[
"redirectSource"] !=
"ilinternallinkgui")
64 $tpl->setContent(
$ret);
72 case "ilobjstylesheetgui":
94 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
95 $values[
'didactic_type'] =
96 'dtpl_'.ilDidacticTemplateObjSettings::lookupTemplateId($this->object->getRefId());
107 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateObjSettings.php';
109 $this->object->getRefId()
113 if($new_tpl_id != $current_tpl_id)
118 include_once
'./Services/DidacticTemplate/classes/class.ilDidacticTemplateGUI.php';
119 $this->ctrl->setReturn($this,
'edit');
120 $this->ctrl->setCmdClass(
'ildidactictemplategui');
121 $this->ctrl->setCmd(
'confirmTemplateSwitch');
123 return $this->ctrl->forwardCommand($dtpl_gui);
136 $ilTabs->clearTargets();
138 $cmd = $ilCtrl->getCmd();
139 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
140 $this->ctrl->setReturn($this,
"editStyleProperties");
141 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
143 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
145 $style_gui->setCreationMode(
true);
148 if (
$cmd ==
"confirmedDelete")
150 $this->
object->setStyleSheetId(0);
151 $this->
object->update();
154 $ret = $this->ctrl->forwardCommand($style_gui);
156 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
159 $this->
object->setStyleSheetId($style_id);
160 $this->
object->update();
161 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
173 $cmd = $ilCtrl->getCmd();
175 if (in_array(
$cmd, array(
"displayMediaFullscreen",
"downloadFile",
"displayMedia")))
184 $ilTabs->clearTargets();
186 if (
$_GET[
"redirectSource"] ==
"ilinternallinkgui")
195 $ilTabs->setBackTarget($lng->txt(
"cntr_back_to_old_editor"),
196 $ilCtrl->getLinkTarget($this,
"switchToOldEditor"),
"_top");
200 $ilTabs->setBackTarget($lng->txt(
"back"),
"./goto.php?target=".$this->object->getType().
"_".
201 $this->
object->getRefId(),
"_top");
205 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
206 include_once(
"./Services/Container/classes/class.ilContainerPageGUI.php");
208 $lng->loadLanguageModule(
"content");
210 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
211 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
213 $this->tpl->setCurrentBlock(
"SyntaxStyle");
214 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
216 $this->tpl->parseCurrentBlock();
219 $this->object->getId()))
223 $new_page_object->setParentId($this->object->getId());
224 $new_page_object->setId($this->object->getId());
225 $new_page_object->createFromXML();
229 $this->ctrl->setReturnByClass(
"ilcontainerpagegui",
"edit");
231 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
233 $this->object->getStyleSheetId(), $this->
object->getType()));
235 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
236 $page_gui->setLinkXML($link_xml);
237 $page_gui->setFileDownloadLink(
"");
238 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"showMediaFullscreen"));
240 $page_gui->setPresentationTitle(
"");
241 $page_gui->setTemplateOutput(
false);
248 $wtpl =
new ilTemplate(
"tpl.cntr_old_editor_message.html",
true,
249 true,
"Services/Container");
250 $wtpl->setVariable(
"ALT_WARNING", $lng->txt(
"warning"));
251 $wtpl->setVariable(
"IMG_WARNING",
253 $wtpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_switch_to_new_editor_message"));
254 $wtpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_switch_to_new_editor_message"));
255 $wtpl->setVariable(
"HREF_SWITCH_TO_NEW_EDITOR",
256 $ilCtrl->getLinkTarget($this,
"useNewEditor"));
257 $wtpl->setVariable(
"TXT_MIGRATION_SWITCH",
258 $lng->txt(
"cntr_switch_to_new_editor_cmd"));
259 $page_gui->setPrependingHtml($wtpl->get());
263 $page_gui->setTabHook($this,
"addPageTabs");
265 $ret = $this->ctrl->forwardCommand($page_gui);
278 $ilTabs->addTarget(
"obj_sty",
279 $ilCtrl->getLinkTarget($this,
'editStyleProperties'),
"editStyleProperties");
289 if (!$ilSetting->get(
"enable_cat_page_edit"))
299 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
301 return $xpage->getContent();
309 include_once(
"./Services/COPage/classes/class.ilPageUtil.php");
311 $this->object->getId()))
315 include_once(
"./Services/Container/classes/class.ilContainerPage.php");
316 include_once(
"./Services/Container/classes/class.ilContainerPageGUI.php");
318 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
319 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
321 $this->tpl->setCurrentBlock(
"SyntaxStyle");
322 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
324 $this->tpl->parseCurrentBlock();
327 include_once(
"./Services/Object/classes/class.ilObjectTranslation.php");
329 $lang = $ot->getEffectiveContentLang($ilUser->getCurrentLanguage(),
"cont");
331 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
333 $this->object->getStyleSheetId(), $this->
object->getType()));
335 $page_gui->setPresentationTitle(
"");
336 $page_gui->setTemplateOutput(
false);
337 $page_gui->setHeader(
"");
338 $ret = $page_gui->showPage();
351 if (parent::prepareOutput())
356 #$this->showPossibleSubObjects();
360 include_once
'./Services/Container/classes/class.ilMemberViewGUI.php';
371 if (
$_GET[
"obj_id"] !=
"")
376 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
382 $mode = (
$_SESSION[
"il_rep_mode"] ==
"flat")
385 $link =
"ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&set_mode=".$mode.
"&ref_id=".$this->
object->getRefId();
386 $tpl->setTreeFlatIcon($link, $mode);
398 $this->tpl->setTitle($this->object->getTitle());
399 $this->tpl->setDescription($this->object->getLongDescription());
403 if ($ilias->getSetting(
"custom_icons") &&
404 in_array($this->object->getType(), array(
"cat",
"grp",
"crs",
"root")))
406 require_once(
"./Services/Container/classes/class.ilContainer.php");
412 $this->tpl->setTitleIcon($icon, $this->lng->txt(
"obj_".$this->object->getType()));
414 include_once
'./Services/Object/classes/class.ilObjectListGUIFactory.php';
416 $lgui->initItem($this->object->getRefId(), $this->
object->getId());
417 $this->tpl->setAlertProperties($lgui->getAlertProperties());
426 include_once
"Services/Object/classes/class.ilObjectAddNewItemGUI.php";
439 switch ($this->object->getViewMode())
443 include_once(
"./Services/Container/classes/class.ilContainerSimpleContentGUI.php");
448 include_once(
'./Services/Container/classes/class.ilContainerObjectiveGUI.php');
455 include_once(
"./Services/Container/classes/class.ilContainerSessionsContentGUI.php");
461 include_once
'Services/Container/classes/class.ilContainerILincContentGUI.php';
468 include_once(
"./Services/Container/classes/class.ilContainerByTypeContentGUI.php");
473 return $container_view;
490 $ilTabs->activateSubTab(
"manage");
494 $ilTabs->activateSubTab(
"view_content");
497 $container_view->setOutput();
499 $this->adminCommands = $container_view->adminCommands;
503 if ($ilCtrl->getNextClass() !=
"ilcolumngui")
512 if ((
int)
$_GET[
"ref_id"] > 1 && $ilSetting->get(
"rep_tree_synchronize"))
514 $ilCtrl->setParameter($this,
"active_node", (
int)
$_GET[
"ref_id"]);
538 global $ilAccess,
$lng;
540 $lng->loadLanguageModule(
'cntr');
545 $GLOBALS[
'tpl']->setPageFormAction($this->ctrl->getFormAction($this));
547 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
549 $this->ctrl->setParameter($this,
"type",
"");
550 $this->ctrl->setParameter($this,
"item_ref_id",
"");
554 if ($this->object->gotItems())
556 $toolbar->setLeadingImage(
560 $toolbar->addFormButton(
561 $this->lng->txt(
'delete_selected_items'),
564 $toolbar->addFormButton(
565 $this->lng->txt(
'move_selected_items'),
568 $toolbar->addFormButton(
569 $this->lng->txt(
'copy_selected_items'),
572 $toolbar->addFormButton(
573 $this->lng->txt(
'link_selected_items'),
578 if ($folder_set->get(
"enable_multi_download") ==
true)
580 $toolbar->addSeparator();
581 $toolbar->addFormButton(
582 $this->lng->txt(
'download_selected_items'),
587 if($this->object->getType() ==
'crs')
589 if($this->object->gotItems())
591 $toolbar->addSeparator();
595 $this->lng->txt(
'cntr_adopt_content'),
596 $this->ctrl->getLinkTargetByClass(
598 'initSourceSelection')
607 $toolbar->addFormButton(
608 $this->lng->txt(
'paste_clipboard_items'),
612 if(
$_SESSION[
"clipboard"][
"cmd"] ==
"link")
622 $toolbar->addFormButton(
623 $this->lng->txt(
'clear_clipboard'),
629 $toolbar->addSeparator();
630 $toolbar->addFormButton(
631 $this->lng->txt(
'download_selected_items'),
637 $GLOBALS[
'tpl']->addAdminPanelToolbar(
639 ($this->object->gotItems() && !
$_SESSION[
"clipboard"]) ?
true :
false,
640 ($this->object->gotItems() && !
$_SESSION[
"clipboard"]) ?
true :
false
644 if ($this->object->gotItems())
646 $GLOBALS[
'tpl']->setPageFormAction($this->ctrl->getFormAction($this));
651 if ($this->edit_order)
653 if($this->object->gotItems() and $ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
655 include_once(
'./Services/Container/classes/class.ilContainer.php');
660 $GLOBALS[
'tpl']->setPageFormAction($this->ctrl->getFormAction($this));
662 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
664 $this->ctrl->setParameter($this,
"type",
"");
665 $this->ctrl->setParameter($this,
"item_ref_id",
"");
667 $toolbar->addFormButton(
668 $this->lng->txt(
'sorting_save'),
672 $GLOBALS[
'tpl']->addAdminPanelToolbar($toolbar,
true,
false);
687 $GLOBALS[
'tpl']->setPageFormAction($this->ctrl->getFormAction($this));
689 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
691 $this->ctrl->setParameter($this,
"type",
"");
692 $this->ctrl->setParameter($this,
"item_ref_id",
"");
694 $toolbar->addFormButton(
695 $this->lng->txt(
'download_selected_items'),
699 $GLOBALS[
'tpl']->addAdminPanelToolbar(
701 $this->object->gotItems() ?
true :
false,
702 $this->
object->gotItems() ?
true : false
712 if(!$tree->checkForParentType($this->object->getRefId(),
'crs'))
716 $tpl->setCurrentBlock(
"custom_button");
717 $tpl->setVariable(
"ADMIN_MODE_LINK",$this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'editTimings'));
718 $tpl->setVariable(
"TXT_ADMIN_MODE",$this->lng->txt(
'timings_edit'));
719 $tpl->parseCurrentBlock();
727 $GLOBALS[
"tpl"]->setPermanentLink($this->object->getType(),
728 $this->
object->getRefId(),
"",
"_top");
739 $ilCtrl->redirect($this,
"editPageFrame");
750 $ilCtrl->redirect($this,
"editPageFrame");
760 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
762 include_once(
"./Services/XHTMLPage/classes/class.ilXHTMLPage.php");
779 $ilCtrl->redirect($this,
"editPageFrame");
787 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
790 $fs_gui->setFramesetTitle($this->object->getTitle());
791 $fs_gui->setMainFrameName(
"content");
792 $fs_gui->setSideFrameName(
"tree");
797 if ($xpage_id > 0 &&
$_SESSION[
"il_cntr_editor"] !=
"std")
799 $fs_gui->setMainFrameSource(
800 $this->ctrl->getLinkTarget(
801 $this,
"editPageContent"));
802 $fs_gui->setSideFrameSource(
803 $this->ctrl->getLinkTarget($this,
"showLinkList"));
807 $this->ctrl->redirectByClass(array(
"ilcontainerpagegui"),
"edit");
824 if (!$rbacsystem->checkAccess(
"write", $this->ref_id))
826 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
833 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
835 $content = $xpage->getContent();
839 $tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.container_edit_page_content.html",
840 "Services/Container");
842 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
843 $tpl->setVariable(
"TXT_EDIT_PAGE_CONTENT",
844 $this->lng->txt(
"edit_page_content"));
845 $tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
846 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
847 $tpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_old_editor_warning"));
848 $tpl->setVariable(
"TXT_MIGRATION_OPEN_STD_EDITOR", $lng->txt(
"cntr_old_editor_open_standard_editor"));
850 $tpl->setVariable(
"HREF_OPEN_STD_EDITOR", $ilCtrl->getLinkTarget($this,
"switchToStdEditor"));
851 $tpl->setVariable(
"ALT_WARNING", $lng->txt(
"warning"));
853 include_once(
"./Services/Form/classes/class.ilFormPropertyGUI.php");
854 include_once(
"./Services/Form/classes/class.ilTextAreaInputGUI.php");
859 include_once
"./Services/RTE/classes/class.ilRTE.php";
861 include_once
"./Services/RTE/classes/class.$rtestring.php";
862 $rte =
new $rtestring();
864 include_once
"./Services/Object/classes/class.ilObject.php";
867 $rte->addRTESupport(
$obj_id, $obj_type);
874 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
875 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
895 $xpage->setContent($text);
901 $xpage->setContent($text);
904 "xhtml_page", $xpage->getId());
907 include_once(
"Services/RTE/classes/class.ilRTE.php");
909 $this->
object->getId());
912 $this->ctrl->redirect($this,
"");
917 $this->ctrl->redirect($this,
"");
925 "Services/Container");
927 $type_ordering = array(
928 "cat",
"fold",
"crs",
"icrs",
"icla",
"grp",
"chat",
"frm",
"lres",
929 "glo",
"webr",
"file",
"exc",
930 "tst",
"svy",
"mep",
"qpl",
"spl");
932 $childs = $tree->getChilds(
$_GET[
"ref_id"]);
933 foreach($childs as $child)
935 if (in_array($child[
"type"], array(
"lm",
"dbk",
"sahs",
"htlm")))
941 $cnt[$child[
"type"]]++;
946 $tpl->setVariable(
"TXT_HELP_HEADER", $lng->txt(
"help"));
947 foreach($type_ordering as $type)
949 $tpl->setCurrentBlock(
"row");
950 $tpl->setVariable(
"ROWCOL",
"tblrow".((($i++)%2)+1));
953 $tpl->setVariable(
"TYPE", $lng->txt(
"objs_".$type).
954 " (".((int)$cnt[$type]).
")");
958 $tpl->setVariable(
"TYPE", $lng->txt(
"learning_resources").
959 " (".((int)$cnt[
"lres"]).
")");
961 $tpl->setVariable(
"TXT_LINK",
"[list-".$type.
"]");
962 $tpl->parseCurrentBlock();
974 $this->adminCommands =
false;
1006 $tpl =
new ilTemplate(
"tpl.container_list_block.html",
true,
true,
1007 "Services/Container");
1008 $this->cur_row_type =
"row_type_1";
1022 $title = $this->lng->txt(
"objs_".$a_type);
1026 $a_tpl->setCurrentBlock(
"container_header_row_image");
1027 $a_tpl->setVariable(
"HEADER_IMG", $icon);
1028 $a_tpl->setVariable(
"HEADER_ALT", $title);
1032 $a_tpl->setCurrentBlock(
"container_header_row");
1035 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT", $title);
1036 $a_tpl->parseCurrentBlock();
1037 $a_tpl->touchBlock(
"container_row");
1050 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1054 $a_tpl->touchBlock($this->cur_row_type);
1057 if ($this->ilias->getSetting(
"icon_position_in_lists") ==
"item_rows")
1060 $alt = $this->lng->txt(
"obj_".$a_image_type);
1063 if ($this->ilias->getSetting(
"custom_icons") &&
1064 in_array($a_image_type, array(
"cat",
"grp",
"crs")))
1066 require_once(
"./Services/Container/classes/class.ilContainer.php");
1073 $a_tpl->setCurrentBlock(
"block_row_image");
1074 $a_tpl->setVariable(
"ROW_IMG", $icon);
1075 $a_tpl->setVariable(
"ROW_ALT", $alt);
1076 $a_tpl->parseCurrentBlock();
1082 $a_tpl->setCurrentBlock(
"block_row_check");
1083 $a_tpl->setVariable(
"ITEM_ID", $a_item_ref_id);
1084 $a_tpl->parseCurrentBlock();
1087 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
1091 $a_tpl->setCurrentBlock(
'block_position');
1092 $a_tpl->setVariable(
'POS_TYPE',$a_image_type);
1093 $a_tpl->setVariable(
'POS_ID',$a_item_ref_id);
1094 $a_tpl->setVariable(
'POSITION',sprintf(
'%.1f',$this->current_position++));
1095 $a_tpl->parseCurrentBlock();
1099 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1101 $a_tpl->setCurrentBlock(
"container_standard_row");
1102 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
1103 $a_tpl->parseCurrentBlock();
1104 $a_tpl->touchBlock(
"container_row");
1112 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1116 $a_tpl->touchBlock($this->cur_row_type);
1118 $type = $this->lng->txt(
"obj_".$a_type);
1119 $a_message = str_replace(
"[type]", $type, $a_message);
1121 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1123 $a_tpl->setCurrentBlock(
"container_standard_row");
1124 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT",
1126 $a_tpl->parseCurrentBlock();
1127 $a_tpl->touchBlock(
"container_row");
1132 $this->cur_row_type =
"";
1144 || strtolower($this->ctrl->getCmdClass()) !=
"ilcontainerpagegui")
1149 $lng->loadLanguageModule(
"content");
1154 $this->tabs_gui->setBackTarget($this->lng->txt(
"obj_cat"),
1155 $this->ctrl->getLinkTarget($this,
"frameset"),
1158 $this->tabs_gui->addTarget(
"edit", $this->ctrl->getLinkTargetByClass(
"ilcontainerpagegui",
"view")
1159 , array(
"",
"view"),
"ilcontainerpagegui");
1171 if (!is_object($this->
object))
1176 if ($a_include_view && $ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
1180 $ilTabs->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTarget($this,
""));
1184 $ilTabs->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTarget($this,
"disableAdministrationPanel"));
1188 if ( $ilUser->getId() != ANONYMOUS_USER_ID &&
1189 ($this->adminCommands ||
1190 (is_object($this->
object) &&
1191 ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())))
1193 (is_object($this->
object) &&
1194 ($this->
object->getHiddenFilesFound())) ||
1201 $ilTabs->addSubTab(
"manage", $lng->txt(
"cntr_manage"), $ilCtrl->getLinkTarget($this,
""));
1205 $ilTabs->addSubTab(
"manage", $lng->txt(
"cntr_manage"), $ilCtrl->getLinkTarget($this,
"enableAdministrationPanel"));
1208 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1209 is_object($this->
object) &&
1210 $ilAccess->checkAccess(
"write",
"", $this->object->getRefId())
1214 $ilTabs->addSubTab(
"ordering", $lng->txt(
"cntr_ordering"), $ilCtrl->getLinkTarget($this,
"editOrder"));
1216 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1217 is_object($this->
object) &&
1218 $ilAccess->checkAccess(
"write",
"", $this->object->getRefId())
1221 if ($ilSetting->get(
"enable_cat_page_edit"))
1223 $ilTabs->addSubTab(
"page_editor", $lng->txt(
"cntr_text_media_editor"), $ilCtrl->getLinkTarget($this,
"editPageFrame"),
1239 if ($rbacsystem->checkAccess(
'edit_permission',$this->ref_id))
1241 $tabs_gui->addTarget(
"perm_settings",
1242 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1243 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1244 if ($ilCtrl->getNextClass() ==
"ilpermissiongui")
1246 $tabs_gui->activateTab(
"perm_settings");
1251 if (strtolower(
$_GET[
"baseClass"]) ==
"ilrepositorygui" && !empty(
$_SESSION[
"clipboard"]))
1253 $tabs_gui->addTarget(
"clipboard",
1254 $this->ctrl->getLinkTarget($this,
"clipboard"),
"clipboard", get_class($this));
1269 $_SESSION[
"il_cont_admin_panel"] =
true;
1270 $this->ctrl->redirect($this,
"render");
1278 $_SESSION[
"il_cont_admin_panel"] =
false;
1279 $this->ctrl->redirect($this,
"render");
1289 $this->edit_order =
true;
1290 $_SESSION[
"il_cont_admin_panel"] =
false;
1293 $ilTabs->activateSubTab(
"ordering");
1302 return $this->edit_order ?
true :
false;
1325 if((
int)$ilSetting->get(
'disable_my_offers'))
1330 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
1343 if((
int)$ilSetting->get(
'disable_my_offers'))
1348 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
1356 $this->multi_download_enabled =
true;
1370 if (!$rbacsystem->checkAccess(
"write",
$_GET[
'item_ref_id']))
1372 $this->ilErr->raiseError($this->lng->txt(
'err_no_permission'),$this->ilErr->MESSAGE);
1376 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
1379 require_once
'Services/WebDAV/classes/class.ilDAVLocks.php';
1383 $ilUser->getId(), $ilUser->getLogin(),
1384 'ref_'.$_GET[
'item_ref_id'].
'_usr_'.$ilUser->getId(),
1385 time() + 60, 0,
'exclusive'
1408 if (
$_GET[
"item_ref_id"] !=
"")
1415 if (!isset(
$_POST[
"id"]))
1417 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1424 $node_data = $this->tree->getNodeData($ref_id);
1425 $subtree_nodes = $this->tree->getSubTree($node_data);
1427 $all_node_data[] = $node_data;
1428 $all_subtree_nodes[] = $subtree_nodes;
1431 foreach ($subtree_nodes as $node)
1433 if($node[
'type'] ==
'rolf')
1438 if (!$rbacsystem->checkAccess(
'delete',$node[
"ref_id"]))
1440 $no_cut[] = $node[
"ref_id"];
1447 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_cut").
" ".implode(
',',$this->
getTitlesByRefId($no_cut)),
1448 $this->ilias->error_obj->MESSAGE);
1451 $_SESSION[
"clipboard"][
"cmd"] = $ilCtrl->getCmd();
1470 if (
$_GET[
"item_ref_id"] !=
"")
1475 if (!isset(
$_POST[
"id"]))
1477 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1485 $node_data = $this->tree->getNodeData($ref_id);
1488 if ($objDefinition->isContainer($node_data[
"type"]))
1493 $subtree_nodes = $this->tree->getSubTree($node_data);
1495 $all_node_data[] = $node_data;
1496 $all_subtree_nodes[] = $subtree_nodes;
1499 foreach ($subtree_nodes as $node)
1501 if($node[
'type'] ==
'rolf')
1506 if (!$rbacsystem->checkAccess(
'visible,read,copy',$node[
"ref_id"]))
1508 $no_copy[] = $node[
"ref_id"];
1513 if ($containers > 0 && count(
$_POST[
"id"]) > 1)
1515 $this->ilias->raiseError($this->lng->txt(
"cntr_container_only_on_their_own"), $this->ilias->error_obj->MESSAGE);
1519 if (count($no_copy))
1521 $this->ilias->raiseError(
1522 $this->lng->txt(
"msg_no_perm_copy") .
" " . implode(
',',$this->
getTitlesByRefId($no_copy)),
1523 $this->ilias->error_obj->MESSAGE);
1527 if (count(
$_POST[
"id"]) == 1)
1529 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_id",
$_POST[
"id"][0]);
1530 $ilCtrl->redirectByClass(
"ilobjectcopygui",
"initTargetSelection");
1534 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_ids", implode(
$_POST[
"id"],
"_"));
1535 $ilCtrl->redirectByClass(
"ilobjectcopygui",
"initTargetSelection");
1539 $_SESSION[
"clipboard"][
"cmd"] = $ilCtrl->getCmd();
1551 if (
$_GET[
"item_ref_id"] !=
"")
1556 if (!isset(
$_POST[
"id"]))
1558 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1564 $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1565 $obj_type =
$object->getType();
1566 if (!in_array($obj_type, array(
"fold",
"file")))
1568 $no_download[] =
$object->getType();
1570 else if (!$rbacsystem->checkAccess(
'read', $ref_id))
1577 if (count($no_download))
1579 $no_download = array_unique($no_download);
1580 foreach ($no_download as $type)
1582 $txt_objs[] = $this->lng->txt(
"objs_".$type);
1584 $this->ilias->raiseError(implode(
', ',$txt_objs).
" ".$this->lng->txt(
"msg_obj_no_download"),$this->ilias->error_obj->MESSAGE);
1588 if (count($no_perm))
1590 $this->ilias->raiseError(
1591 $this->lng->txt(
"msg_obj_perm_download").
" ".implode(
',',$no_perm),
1592 $this->ilias->error_obj->MESSAGE);
1601 global
$lng, $rbacsystem, $ilAccess;
1603 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1604 include_once
'Modules/Folder/classes/class.ilObjFolder.php';
1605 include_once
'Modules/File/classes/class.ilObjFile.php';
1606 include_once
'Modules/File/classes/class.ilFileException.php';
1616 foreach ($a_ref_ids as
$ref_id)
1618 if (!$ilAccess->checkAccess(
"read",
"", $ref_id))
1625 $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1626 $obj_type =
$object->getType();
1627 if ($obj_type ==
"fold")
1632 else if ($obj_type ==
"file")
1640 $deliverFilename = ilUtil::getAsciiFilename($this->object->getTitle()) .
".zip";
1662 global $rbacsystem,
$tree, $ilAccess;
1667 $subtree = $tree->getChildsByTypeFilter($refid, array(
"fold",
"file"));
1669 foreach ($subtree as $child)
1671 if (!$ilAccess->checkAccess(
"read",
"", $child[
"ref_id"]))
1677 if ($child[
"type"] ==
"fold")
1690 if (!copy($oldFilename, $newFilename))
1691 throw new ilFileException(
"Could not copy ".$oldFilename.
" to ".$newFilename);
1693 touch($newFilename, filectime($oldFilename));
1704 global $clipboard, $rbacsystem, $rbacadmin,
$ilCtrl;
1706 if (
$_GET[
"item_ref_id"] !=
"")
1711 if (!isset(
$_POST[
"id"]))
1713 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1719 if (!$rbacsystem->checkAccess(
'delete',$ref_id))
1724 $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1726 if (!$this->objDefinition->allowLink(
$object->getType()))
1728 $no_link[] =
$object->getType();
1735 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_link").
" ".
1736 implode(
',',$no_cut),$this->ilias->error_obj->MESSAGE);
1739 if (count($no_link))
1742 $this->ilias->raiseError($this->lng->txt(
"msg_obj_no_link"),$this->ilias->error_obj->MESSAGE);
1749 $clipboard[
"parent"] =
$_GET[
"ref_id"];
1750 $clipboard[
"cmd"] = $ilCtrl->getCmd();
1752 foreach (
$_POST[
"id"] as $ref_id)
1754 $clipboard[
"ref_ids"][] =
$ref_id;
1760 if(count($clipboard[
"ref_ids"]) == 1)
1784 if (isset(
$_POST[
"cmd"][
"clear"]))
1796 global $rbacsystem, $rbacadmin, $rbacreview,
$log,
$tree, $ilObjDataCache,
$ilUser;
1798 $command =
$_SESSION[
'clipboard'][
'cmd'];
1799 if(!in_array($command, array(
'cut',
'link',
'copy')))
1801 $message = __METHOD__.
": cmd was neither 'cut', 'link' nor 'copy'; may be a hack attempt!";
1802 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
1805 if($command ==
'cut')
1808 $_POST[
'nodes'] = array($_POST[
'node']);
1811 if(!is_array(
$_POST[
'nodes']) || !count(
$_POST[
'nodes']))
1830 $folder_objects_cache = array();
1834 $current_parent_id = $tree->getParentId($obj_data->getRefId());
1836 foreach(
$_POST[
'nodes'] as $folder_ref_id)
1838 if(!array_key_exists($folder_ref_id, $folder_objects_cache))
1844 if(!$rbacsystem->checkAccess(
'create', $folder_ref_id, $obj_data->getType()))
1846 $no_paste[] = sprintf($this->lng->txt(
'msg_no_perm_paste_object_in_folder'), $obj_data->getTitle().
' ['.$obj_data->getRefId().
']', $folder_objects_cache[$folder_ref_id]->getTitle().
' ['.$folder_objects_cache[$folder_ref_id]->getRefId().
']');
1850 if($folder_ref_id == $current_parent_id)
1852 $exists[] = sprintf($this->lng->txt(
'msg_obj_exists_in_folder'), $obj_data->getTitle().
' ['.$obj_data->getRefId().
']', $folder_objects_cache[$folder_ref_id]->getTitle().
' ['.$folder_objects_cache[$folder_ref_id]->getRefId().
']');
1856 if ($tree->isGrandChild($ref_id, $folder_ref_id) ||
1857 $ref_id == $folder_ref_id)
1859 $is_child[] = sprintf($this->lng->txt(
'msg_paste_object_not_in_itself'), $obj_data->getTitle().
' ['.$obj_data->getRefId().
']');
1863 if(!in_array($obj_data->getType(), array_keys($this->objDefinition->getSubObjects($folder_objects_cache[$folder_ref_id]->getType()))))
1865 $not_allowed_subobject[] = sprintf($this->lng->txt(
'msg_obj_may_not_contain_objects_of_type'), $folder_objects_cache[$folder_ref_id]->getTitle().
' ['.$folder_objects_cache[$folder_ref_id]->getRefId().
']',
1866 $GLOBALS[
'lng']->txt(
'obj_'.$obj_data->getType()));
1873 if(count($exists) && $command !=
"copy")
1875 $error .= implode(
'<br />', $exists);
1878 if(count($is_child))
1880 $error .= $error !=
'' ?
'<br />' :
'';
1881 $error .= implode(
'<br />', $is_child);
1884 if(count($not_allowed_subobject))
1886 $error .= $error !=
'' ?
'<br />' :
'';
1887 $error .= implode(
'<br />', $not_allowed_subobject);
1890 if(count($no_paste))
1892 $error .= $error !=
'' ?
'<br />' :
'';
1893 $error .= implode(
'<br />', $no_paste);
1915 $log->write(__METHOD__.
", cmd: ".$command);
1921 $ref_ids =
$_SESSION[
'clipboard'][
'ref_ids'];
1922 unset(
$_SESSION[
'clipboard'][
'ref_ids']);
1925 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
1929 if($command ==
'copy')
1931 foreach(
$_POST[
'nodes'] as $folder_ref_id)
1933 foreach($ref_ids as $ref_id)
1935 $revIdMapping = array();
1937 $oldNode_data = $tree->getNodeData($ref_id);
1938 if ($oldNode_data[
'parent'] == $folder_ref_id)
1940 require_once
'Modules/File/classes/class.ilObjFileAccess.php';
1942 $newRef = $this->
cloneNodes($ref_id, $folder_ref_id, $refIdMapping, $newTitle);
1946 $newRef = $this->
cloneNodes($ref_id, $folder_ref_id, $refIdMapping, null);
1950 $old_parent_data = $tree->getParentNodeData($ref_id);
1951 $newNode_data = $tree->getNodeData($newRef);
1953 $oldNode_data[
'obj_id'], $ilUser->getId());
1955 $ilObjDataCache->lookupObjId($folder_ref_id));
1965 if($command ==
'cut')
1967 foreach(
$_POST[
'nodes'] as $folder_ref_id)
1969 foreach($ref_ids as $ref_id)
1972 $old_parent = $tree->getParentId($ref_id);
1973 $tree->moveTree($ref_id, $folder_ref_id);
1974 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1976 include_once(
'./Services/AccessControl/classes/class.ilConditionHandler.php');
1980 $node_data = $tree->getNodeData($ref_id);
1981 $old_parent_data = $tree->getNodeData($old_parent);
1983 $old_parent_data[
'obj_id']);
1985 $ilObjDataCache->lookupObjId($folder_ref_id));
1998 if($command ==
'link')
2000 $linked_to_folders = array();
2002 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
2005 foreach(
$_POST[
'nodes'] as $folder_ref_id)
2007 $linked_to_folders[$folder_ref_id] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($folder_ref_id));
2009 foreach($ref_ids as $ref_id)
2012 $top_node = $tree->getNodeData($ref_id);
2015 $subnodes[
$ref_id] = $tree->getSubtree($top_node);
2019 foreach($subnodes as $key => $subnode)
2023 $new_ref_id = $obj_data->createReference();
2024 $obj_data->putInTree($folder_ref_id);
2025 $obj_data->setPermissions($folder_ref_id);
2028 if($rbac_log_active)
2030 $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id,
false);
2036 $node_data = $tree->getNodeData($new_ref_id);
2038 $ilObjDataCache->lookupObjId($folder_ref_id));
2043 $log->write(__METHOD__.
', link finished');
2046 $linked_targets = array();
2047 if(count($linked_to_folders))
2049 require_once
'Services/Link/classes/class.ilLink.php';
2050 foreach($linked_to_folders as $ref_id => $title)
2052 $linked_targets[] =
'<a href="' .
ilLink::_getLink($ref_id) .
'">' . $title .
'</a>';
2057 if(count($ref_ids) == 1)
2061 ilUtil::sendSuccess(sprintf($this->lng->txt(
'mgs_objects_linked_to_the_following_folders_' . $suffix), implode(
', ', $linked_targets)),
true);
2067 $this->ctrl->returnToParent($this);
2075 $_SESSION[
'paste_linked_repexpand'] = array();
2081 $path = $tree->getPathId((
int)
$_GET[
'ref_id']);
2082 foreach((array)
$path as $node_id)
2084 if(!in_array($node_id,
$_SESSION[
'paste_linked_repexpand']))
2085 $_SESSION[
'paste_linked_repexpand'][] = $node_id;
2096 global $ilTabs, $ilToolbar;
2098 $ilTabs->setTabActive(
'view_content');
2100 if(!in_array(
$_SESSION[
'clipboard'][
'cmd'], array(
'link',
'copy',
'cut')))
2102 $message = __METHOD__.
": Unknown action.";
2103 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
2109 if ($exp->handleCommand())
2113 $output = $exp->getHTML();
2115 $txt_var = (
$cmd ==
"copy")
2121 $t->setFormAction($this->ctrl->getFormAction($this,
"performPasteIntoMultipleObjects"));
2122 $t->addFormButton($this->lng->txt($txt_var),
"performPasteIntoMultipleObjects");
2124 $t->addFormButton($this->lng->txt(
"obj_insert_into_clipboard"),
"keepObjectsInClipboard");
2125 $t->addFormButton($this->lng->txt(
"cancel"),
"cancelMoveLink");
2126 $t->setCloseFormTag(
false);
2128 $output =
$t->getHTML().$output;
2130 $t->setCloseFormTag(
true);
2131 $t->setOpenFormTag(
false);
2132 $output.=
"<br />".$t->getHTML();
2134 $this->tpl->setContent($output);
2195 $GLOBALS[
'ilCtrl']->returnToParent($this);
2204 $GLOBALS[
'ilCtrl']->returnToParent($this);
2213 $_SESSION[
'paste_copy_repexpand'] = array();
2219 $path = $tree->getPathId((
int)
$_GET[
'ref_id']);
2220 foreach((array)
$path as $node_id)
2222 if(!in_array($node_id,
$_SESSION[
'paste_copy_repexpand']))
2223 $_SESSION[
'paste_copy_repexpand'][] = $node_id;
2282 $_SESSION[
'paste_cut_repexpand'] = array();
2288 $path = $tree->getPathId((
int)
$_GET[
'ref_id']);
2289 foreach((array)
$path as $node_id)
2291 if(!in_array($node_id,
$_SESSION[
'paste_cut_repexpand']))
2292 $_SESSION[
'paste_cut_repexpand'][] = $node_id;
2355 global $rbacsystem, $rbacadmin, $rbacreview,
$log,
$tree;
2359 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
2363 if (!in_array(
$_SESSION[
"clipboard"][
"cmd"],array(
"cut",
"link",
"copy")))
2365 $message = get_class($this).
"::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
2366 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
2372 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
2375 if (!$rbacsystem->checkAccess(
'create',$this->object->getRefId(), $obj_data->getType()))
2378 $no_paste_titles[] = $obj_data->getTitle();
2382 if ($this->object->getRefId() == $this->tree->getParentId($obj_data->getRefId()))
2389 if ($this->tree->isGrandChild($ref_id,$this->object->getRefId()))
2394 if ($ref_id == $this->object->getRefId())
2400 $obj_type = $obj_data->getType();
2402 if (!in_array($obj_type, array_keys($this->objDefinition->getSubObjects($this->object->getType()))))
2404 $not_allowed_subobject[] = $obj_data->getType();
2411 if (count($exists) &&
$_SESSION[
"clipboard"][
"cmd"] !=
"copy")
2414 $this->ilias->raiseError($this->lng->txt(
"msg_obj_exists"),$this->ilias->error_obj->MESSAGE);
2417 if (count($is_child))
2419 $this->ilias->raiseError($this->lng->txt(
"msg_not_in_itself").
" ".implode(
',',$is_child),
2420 $this->ilias->error_obj->MESSAGE);
2423 if (count($not_allowed_subobject))
2425 $this->ilias->raiseError($this->lng->txt(
"msg_may_not_contain").
" ".implode(
',',$not_allowed_subobject),
2426 $this->ilias->error_obj->MESSAGE);
2429 if (count($no_paste))
2431 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_paste").
" ".
2432 implode(
',',$no_paste),$this->ilias->error_obj->MESSAGE);
2436 $log->write(
"ilObjectGUI::pasteObject(), cmd: ".
$_SESSION[
"clipboard"][
"cmd"]);
2442 $ref_ids =
$_SESSION[
"clipboard"][
"ref_ids"];
2443 unset(
$_SESSION[
"clipboard"][
"ref_ids"]);
2447 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"copy")
2452 if (count($ref_ids) == 1)
2454 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"target", $this->object->getRefId());
2455 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_id", $ref_ids[0]);
2456 $ilCtrl->redirectByClass(
"ilobjectcopygui",
"saveTarget");
2460 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"target", $this->object->getRefId());
2461 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_ids", implode($ref_ids,
"_"));
2462 $ilCtrl->redirectByClass(
"ilobjectcopygui",
"saveTarget");
2496 $log->write(
"ilObjectGUI::pasteObject(), copy finished");
2501 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"cut")
2504 foreach($ref_ids as $ref_id)
2507 $old_parent = $tree->getParentId($ref_id);
2508 $this->tree->moveTree($ref_id,$this->object->getRefId());
2509 $rbacadmin->adjustMovedObjectPermissions($ref_id,$old_parent);
2511 include_once(
'./Services/AccessControl/classes/class.ilConditionHandler.php');
2515 $node_data = $tree->getNodeData($ref_id);
2516 $old_parent_data = $tree->getNodeData($old_parent);
2518 $old_parent_data[
'obj_id']);
2520 $this->
object->getId());
2527 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"link")
2529 foreach ($ref_ids as $ref_id)
2532 $top_node = $this->tree->getNodeData($ref_id);
2535 $subnodes[
$ref_id] = $this->tree->getSubtree($top_node);
2539 foreach ($subnodes as $key => $subnode)
2542 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($key);
2543 $new_ref_id = $obj_data->createReference();
2544 $obj_data->putInTree(
$_GET[
"ref_id"]);
2545 $obj_data->setPermissions(
$_GET[
"ref_id"]);
2548 $node_data = $tree->getNodeData($new_ref_id);
2550 $this->
object->getId());
2555 $log->write(
"ilObjectGUI::pasteObject(), link finished");
2562 $last_cmd =
$_SESSION[
"clipboard"][
"cmd"];
2568 if ($last_cmd ==
"cut")
2573 else if ($last_cmd ==
"copy")
2577 else if ($last_cmd ==
'link')
2583 $this->ctrl->returnToParent($this);
2676 $ilTabs->activateTab(
"clipboard");
2681 $message = sprintf(
'%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
2682 $ilLog->write($message,$ilLog->FATAL);
2683 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->WARNING);
2695 "type" => $tmp_obj->getType(),
2696 "type_txt" => $this->lng->txt(
"obj_".$tmp_obj->getType()),
2697 "title" => $tmp_obj->getTitle(),
2698 "cmd" => (
$_SESSION[
"clipboard"][
"cmd"] ==
"cut") ? $this->lng->txt(
"move") :$this->lng->txt(
$_SESSION[
"clipboard"][
"cmd"]),
2700 "obj_id" => $tmp_obj->getId()
2706 include_once(
"./Services/Object/classes/class.ilObjClipboardTableGUI.php");
2709 $tpl->setContent(
$tab->getHTML());
2711 if (count(
$data) > 0)
2713 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
2714 $ilToolbar->addFormButton($lng->txt(
"insert_object_here"),
2716 $ilToolbar->addFormButton($lng->txt(
"clear_clipboard"),
2730 if ($this->ilias->getSetting(
"custom_icons"))
2785 $custom_icon = $this->
object->getCustomIconPath();
2791 $title->setTitle($this->lng->txt(
"icon_settings"));
2797 $a_form->addItem($title);
2821 $caption = $this->lng->txt(
"cont_custom_icon");
2823 $icon->setSuffixes(array(
"svg"));
2824 $icon->setImage($custom_icon);
2827 $a_form->addItem($icon);
2831 $title->addSubItem($icon);
2861 $this->object->getRefId() &&
2862 !$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
2867 return $_SESSION[
"il_cont_admin_panel"];
2878 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
2882 $column_gui->setEnableMovement(
true);
2885 $column_gui->setRepositoryItems(
2886 $this->object->getSubItems($this->isActiveAdministrationPanel(),
true));
2890 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
2892 $column_gui->setBlockProperty(
"news",
"settings",
true);
2894 $column_gui->setBlockProperty(
"news",
"default_visibility_option",
true);
2895 $column_gui->setBlockProperty(
"news",
"hide_news_block_option",
true);
2900 $column_gui->setAdminCommands(
true);
2952 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardPageFactory.php');
2954 global $ilObjDataCache,
$tree;
2959 if(isset(
$_SESSION[
'wizard_search_title']))
2961 $this->searchCloneSourceObject();
2971 $this->ctrl->setParameter($this,
'clone_source',(
int)
$_REQUEST[
'clone_source']);
2972 $this->ctrl->setParameter($this,
'new_type',$new_type);
2976 $this->tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
2977 $this->tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
2980 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.container_wizard_page.html',
2981 "Services/Container");
2982 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
2984 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_'.$new_type));
2985 $this->tpl->setVariable(
'TXT_DUPLICATE',$this->lng->txt($new_type.
'_wizard_page'));
2986 $this->tpl->setVariable(
'INFO_DUPLICATE',$this->lng->txt($new_type.
'_copy_threads_info'));
2987 $this->tpl->setVariable(
'BTN_COPY',$this->lng->txt(
'obj_'.$new_type.
'_duplicate'));
2988 $this->tpl->setVariable(
'BTN_BACK',$this->lng->txt(
'btn_back'));
2989 if(isset(
$_SESSION[
'wizard_search_title']))
2991 $this->tpl->setVariable(
'CMD_BACK',
'searchCloneSource');
2995 $this->tpl->setVariable(
'CMD_BACK',
'create');
2998 $this->tpl->setVariable(
'BTN_TREE',$this->lng->txt(
'treeview'));
2999 $this->tpl->setVariable(
'BTN_LIST',$this->lng->txt(
'flatview'));
3007 foreach($subnodes = $tree->getSubtree($source_node = $tree->getNodeData($source_id),
true) as $node)
3015 if($node[
'type'] ==
'rolf')
3022 for($i = $source_node[
'depth'];$i < $node[
'depth']; $i++)
3024 $this->tpl->touchBlock(
'padding');
3025 $this->tpl->touchBlock(
'end_padding');
3029 $copy_wizard_page->fillTreeSelection($node[
'ref_id'],$node[
'type'],$node[
'depth']);
3031 $this->tpl->setCurrentBlock(
'tree_row');
3033 $this->tpl->setVariable(
'TREE_ALT_IMG',$this->lng->txt(
'obj_'.$node[
'type']));
3034 $this->tpl->setVariable(
'TREE_TITLE',$node[
'title']);
3035 $this->tpl->parseCurrentBlock();
3039 $this->tpl->setCurrentBlock(
'no_content');
3040 $this->tpl->setVariable(
'TXT_NO_CONTENT',$this->lng->txt(
'container_no_items'));
3041 $this->tpl->parseCurrentBlock();
3045 $this->tpl->setCurrentBlock(
'tree_footer');
3046 $this->tpl->setVariable(
'TXT_COPY_ALL',$this->lng->txt(
'copy_all'));
3047 $this->tpl->setVariable(
'TXT_LINK_ALL',$this->lng->txt(
'link_all'));
3048 $this->tpl->setVariable(
'TXT_OMIT_ALL',$this->lng->txt(
'omit_all'));
3049 $this->tpl->parseCurrentBlock();
3055 foreach($tree->getSubTreeTypes($source_id,array(
'rolf',
'crs')) as $type)
3058 if(strlen($html = $copy_wizard_page->getWizardPageBlockHTML()))
3060 $this->tpl->setCurrentBlock(
'obj_row');
3061 $this->tpl->setVariable(
'ITEM_BLOCK',$html);
3062 $this->tpl->parseCurrentBlock();
3079 include_once(
'./Services/Link/classes/class.ilLink.php');
3080 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
3086 $clone_source = (int)
$_REQUEST[
'clone_source'];
3088 if(!$rbacsystem->checkAccess(
'create',
$ref_id,$new_type))
3090 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
3098 if(!$ilAccess->checkAccess(
'write',
'', $clone_source,$new_type))
3100 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
3111 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$ref_id);
3112 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
3117 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$result);
3118 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
3132 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
3136 $positions = str_replace(
',',
'.',
$_POST[
'position']);
3138 $sorting->savePost($positions);
3140 $this->ctrl->redirect($this,
"editOrder");
3160 $srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
3161 error_log(__METHOD__.
' cloning srcRef='.$srcRef.
' dstRef='.$dstRef.
'...');
3162 $newRef = $srcObj->cloneObject($dstRef)->getRefId();
3163 error_log(__METHOD__.
' ...cloning... newRef='.$newRef.
'...');
3168 if (! is_null($newName))
3170 $newObj =& $ilias->obj_factory->getInstanceByRefId($newRef);
3171 $newObj->setTitle($newName);
3176 $mapping[$newRef] = $srcRef;
3179 $children = $tree->getChilds($srcRef);
3180 foreach ($tree->getChilds($srcRef) as $child)
3184 if ($child[
"type"] !=
'rolf')
3186 $this->
cloneNodes($child[
"ref_id"],$newRef,$mapping);
3190 if (count($rolf = $tree->getChildsByType($newRef,
"rolf")))
3192 $mapping[$rolf[0][
"ref_id"]] = $child[
"ref_id"];
3196 error_log(__METHOD__.
' ...cloned srcRef='.$srcRef.
' dstRef='.$dstRef.
' newRef='.$newRef);
3210 $a_item_list_gui->addCustomProperty($lng->txt(
'path'),
3211 ilContainer::buildPath($a_item_data[
'ref_id'], $this->object->getRefId()),
3223 $path_arr = $tree->getPathFull($a_ref_id, $a_course_ref_id);
3225 foreach($path_arr as
$data)
3231 $path .= $data[
'title'];
3246 global $ilTabs,
$tpl;
3251 $tpl->setContent($this->form->getHTML());
3253 $ilTabs->activateTab(
"obj_sty");
3263 $tpl->setTreeFlatIcon(
"",
"");
3264 $ilTabs->clearTargets();
3269 $ilTabs->setBackTarget($lng->txt(
"cntr_back_to_old_editor"),
3270 $ilCtrl->getLinkTarget($this,
"switchToOldEditor"),
"_top");
3274 $ilTabs->setBackTarget($lng->txt(
"back"),
"./goto.php?target=".$this->object->getType().
"_".
3275 $this->
object->getRefId(),
"_top");
3278 include_once(
"./Services/Container/classes/class.ilContainerPageGUI.php");
3280 $style_id = $this->
object->getStyleSheetId();
3290 $ilCtrl->getHTML($page_gui);
3291 $ilTabs->setTabActive(
"obj_sty");
3293 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3294 $lng->loadLanguageModule(
"style");
3296 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
3299 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
3302 if ($fixed_style > 0)
3306 $this->lng->txt(
"global_fixed").
")");
3307 $this->form->addItem($st);
3314 $st_styles[0] = $this->lng->txt(
"default");
3324 $this->form->addItem($st);
3329 $this->form->addCommandButton(
"editStyle",
3330 $lng->txt(
"style_edit_style"));
3331 $this->form->addCommandButton(
"deleteStyle",
3332 $lng->txt(
"style_delete_style"));
3340 $st_styles,
false,
true);
3341 $style_sel =
new ilSelectInputGUI($lng->txt(
"style_current_style"),
"style_id");
3343 $style_sel->setValue($style_id);
3344 $this->form->addItem($style_sel);
3346 $this->form->addCommandButton(
"saveStyleSettings",
3348 $this->form->addCommandButton(
"createStyle",
3349 $lng->txt(
"sty_create_ind_style"));
3352 $this->form->setTitle($lng->txt(
"obj_sty"));
3353 $this->form->setFormAction($ilCtrl->getFormAction($this));
3363 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"create");
3373 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
3383 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
3393 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3394 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
3396 || $this->object->getStyleSheetId() == 0))
3399 $this->
object->update();
3402 $this->ctrl->redirect($this,
"editStyleProperties");
3419 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
3421 $item_list_gui->setContainerObject($this);
3423 $item_list_gui->enableComments(
true);
3424 $item_list_gui->enableNotes(
true);
3425 $item_list_gui->enableTags(
true);
3428 $html = $item_list_gui->getListItemHTML(
$ref_id,
3432 global $ilPluginAdmin;
3433 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"UIComponent",
"uihk");
3434 foreach ($pl_names as $pl)
3437 $gui_class = $ui_plugin->getUIClassInstance();
3438 $resp = $gui_class->getHTML(
"Services/Container",
"async_item_list", array(
"html" => $html));
3441 $html = $gui_class->modifyHTML($html, $resp);
3455 global
$tpl,$ilToolbar;
3463 include_once (
'Services/WebDAV/classes/class.ilDAVServer.php');
3465 $ilToolbar->addButton(
3466 $this->lng->txt(
'mount_webfolder'),
3467 $davServer->getMountURI($this->object->getRefId()),
3470 $davServer->getFolderURI($this->object->getRefId())
3473 $tpl->setContent($this->form->getHTML());
3482 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3484 $this->form->setFormAction($this->ctrl->getFormAction($this));
3487 $ipass =
new ilPasswordInputGUI($this->lng->txt(
"desired_password"),
"new_password");
3490 $this->form->addItem($ipass);
3491 $this->form->addCommandButton(
"savePassword", $this->lng->txt(
"save"));
3492 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
3494 $this->form->setTitle($this->lng->txt(
"chg_ilias_and_webfolder_password"));
3495 $this->form->setFormAction($this->ctrl->getFormAction($this));
3509 if($form->checkInput())
3511 $ilUser->resetPassword($this->form->getInput(
'new_password'),$this->form->getInput(
'new_password'));
3516 $form->setValuesByPost();
3532 $item_data = $this->
object->getSubItems(
false,
false, (
int)
$_GET[
"child_ref_id"]);
3536 include_once
'./Modules/Session/classes/class.ilEventItems.php';
3538 if(in_array((
int)$_GET[
"child_ref_id"], $event_items))
3540 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
3541 foreach ($this->object->items[
"sess"] as $id)
3544 foreach($items as $event_item)
3546 if ($event_item[
"child"] == (
int)$_GET[
"child_ref_id"])
3549 if((
int)$_GET[
"parent_ref_id"])
3551 $event_item[
"parent"] = (int)$_GET[
"parent_ref_id"];
3553 $html = $container_view->renderItem($event_item);
3562 foreach ($this->object->items[
"_all"] as $id)
3564 if ($id[
"child"] == (
int) $_GET[
"child_ref_id"])
3566 $html = $container_view->renderItem($id);
3576 echo $tpl->getOnLoadCodeForAsynch();
3594 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
3599 $lg->addCustomCommand($this->ctrl->getLinkTarget($this,
'fileManagerLaunch'),
'fm_start',
'_blank');
3613 $tpl =
new ilTemplate(
'tpl.fm_launch_ws.html',
false,
false,
'Services/WebServices/FileManager');
3614 $tpl->setVariable(
'JNLP_URL',ILIAS_HTTP_PATH.
'/Services/WebServices/FileManager/lib/dist/FileManager.jnlp');
3615 $tpl->setVariable(
'SESSION_ID',
$_COOKIE[
'PHPSESSID'].
'::'.CLIENT_ID);
3616 $tpl->setVariable(
'UID',$ilUser->getId());
3617 $tpl->setVariable(
'REF_ID', $this->object->getRefId());
3618 $tpl->setVariable(
'WSDL_URI', ILIAS_HTTP_PATH.
'/webservice/soap/server.php?wsdl');
3620 $tpl->setVariable(
'REST_URI',ILIAS_HTTP_PATH.
'/Services/WebServices/Rest/server.php');
3621 $tpl->setVariable(
'FILE_LOCKS',0);
3624 include_once(
"./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
3625 $header_top_title = ilObjSystemFolder::_getHeaderTitle();
3626 $tpl->setVariable(
'HEADER_TITLE',$header_top_title ? $header_top_title :
'');
3643 if (!empty(
$_GET[
"set_mode"]))
3646 if ($ilUser->getId() != ANONYMOUS_USER_ID)
3648 $ilUser->writePref(
"il_rep_mode",
$_GET[
"set_mode"]);
3655 if ($ilUser->getId() != ANONYMOUS_USER_ID)
3657 $_SESSION[
"il_rep_mode"] = $ilUser->getPref(
"il_rep_mode");
3664 $_SESSION[
"il_rep_mode"] = $ilSetting->get(
"default_repository_view");
3667 $mode = (
$_SESSION[
"il_rep_mode"] !=
"")
3672 if ($mode ==
"tree" && (strtolower(
$_GET[
"baseClass"]) !=
"iladministrationgui"))
3674 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorerGUI.php");
3676 if (!$exp->handleCommand())
3678 $tpl->setLeftNavContent($exp->getHTML());
3690 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
3691 include_once
'./Services/Container/classes/class.ilContainer.php';
3699 $sort_inherit->setTitle(
3700 $this->lng->txt(
'sort_inherit_prefix').
3701 ' ('.ilContainerSortingSettings::sortModeToString(
3703 $this->object->getId())).
') '
3706 $sort_inherit->setInfo($this->lng->txt(
'sorting_info_inherit'));
3707 $sort->addOption($sort_inherit);
3712 $this->lng->txt(
'sorting_title_header'),
3715 $sort_title->
setInfo($this->lng->txt(
'sorting_info_title'));
3718 $sort->addOption($sort_title);
3723 $sort_activation->
setInfo($this->lng->txt(
'sorting_creation_info'));
3725 $sort->addOption($sort_activation);
3730 $sort_activation->
setInfo($this->lng->txt(
'crs_sort_timing_info'));
3732 $sort->addOption($sort_activation);
3737 $this->lng->txt(
'sorting_manual_header'),
3740 $sort_manual->
setInfo($this->lng->txt(
'sorting_info_manual'));
3742 $sort->addOption($sort_manual);
3745 $sort->setValue($settings->getSortMode());
3757 $direction =
new ilRadioGroupInputGUI($this->lng->txt(
'sorting_direction'),$a_prefix.
'_sorting_direction');
3759 $direction->setRequired(TRUE);
3763 $this->lng->txt(
'sorting_asc'),
3766 $direction->addOption($asc);
3770 $this->lng->txt(
'sorting_desc'),
3773 $direction->addOption($desc);
3785 $a_sorting_settings)
3787 $position =
new ilRadioGroupInputGUI($this->lng->txt(
'sorting_new_items_position'),$a_prefix.
'_new_items_position');
3789 $position->setRequired(TRUE);
3793 $this->lng->txt(
'sorting_new_items_at_top'),
3797 $position->addOption($new_top);
3801 $this->lng->txt(
'sorting_new_items_at_bottom'),
3805 $position->addOption($new_bottom);
3809 $order =
new ilRadioGroupInputGUI($this->lng->txt(
'sorting_new_items_order'),$a_prefix.
'_new_items_order');
3811 $order->setRequired(TRUE);
3817 $this->lng->txt(
'sorting_title_header'),
3821 $order->addOption($new_title);
3828 $this->lng->txt(
'sorting_creation_header'),
3832 $order->addOption($new_creation);
3840 $this->lng->txt(
'crs_sort_activation'),
3844 $order->addOption($new_activation);
3860 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
3867 $settings->setSortDirection($form->
getInput(
'title_sorting_direction'));
3870 $settings->setSortDirection($form->
getInput(
'activation_sorting_direction'));
3873 $settings->setSortDirection($form->
getInput(
'creation_sorting_direction'));
3876 $settings->setSortNewItemsPosition($form->
getInput(
'manual_new_items_position'));
3877 $settings->setSortNewItemsOrder($form->
getInput(
'manual_new_items_order'));
3878 $settings->setSortDirection($form->
getInput(
'manual_sorting_direction'));
3882 $settings->update();
3894 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
3896 $ru->showTrashTable(
$_GET[
"ref_id"]);
3906 global
$log, $ilAppEventHandler,
$lng;
3908 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
3910 $ru->removeObjectsFromSystem(
$_POST[
"trash_id"]);
3911 $this->ctrl->redirect($this,
"trash");
3919 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
3921 $ru->restoreObjects(
$_GET[
"ref_id"],
$_POST[
"trash_id"]);
3922 $this->ctrl->redirect($this,
"trash");
3931 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
3933 if(!isset(
$_POST[
"trash_id"]))
3936 $this->ctrl->redirect($this,
"trash");
3940 $ru->confirmRemoveFromSystemObject(
$_POST[
"trash_id"]);
3949 include_once(
"./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
3951 $exp->setTypeWhiteList(array(
"root",
"cat",
"grp",
"crs",
"fold"));
3952 if (
$cmd ==
"link") {
3953 $exp->setSelectMode(
"nodes",
true);
3956 $exp->setSelectMode(
"nodes[]",
false);