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")))
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();
349 if (parent::prepareOutput())
354 #$this->showPossibleSubObjects();
358 include_once
'./Services/Container/classes/class.ilMemberViewGUI.php';
369 if (
$_GET[
"obj_id"] !=
"")
374 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
380 $mode = (
$_SESSION[
"il_rep_mode"] ==
"flat")
383 $link =
"ilias.php?baseClass=ilRepositoryGUI&cmd=frameset&set_mode=".$mode.
"&ref_id=".$this->
object->getRefId();
384 $tpl->setTreeFlatIcon($link, $mode);
396 $this->tpl->setTitle($this->object->getTitle());
397 $this->tpl->setDescription($this->object->getLongDescription());
401 if ($ilias->getSetting(
"custom_icons") &&
402 in_array($this->object->getType(), array(
"cat",
"grp",
"crs",
"root")))
404 require_once(
"./Services/Container/classes/class.ilContainer.php");
410 $this->tpl->setTitleIcon($icon, $this->lng->txt(
"obj_".$this->object->getType()));
412 include_once
'./Services/Object/classes/class.ilObjectListGUIFactory.php';
414 $lgui->initItem($this->object->getRefId(), $this->
object->getId());
415 $this->tpl->setAlertProperties($lgui->getAlertProperties());
424 include_once
"Services/Object/classes/class.ilObjectAddNewItemGUI.php";
437 switch ($this->object->getViewMode())
441 include_once(
"./Services/Container/classes/class.ilContainerSimpleContentGUI.php");
446 include_once(
'./Services/Container/classes/class.ilContainerObjectiveGUI.php');
453 include_once(
"./Services/Container/classes/class.ilContainerSessionsContentGUI.php");
459 include_once
'Services/Container/classes/class.ilContainerILincContentGUI.php';
466 include_once(
"./Services/Container/classes/class.ilContainerByTypeContentGUI.php");
471 return $container_view;
488 $ilTabs->activateSubTab(
"manage");
492 $ilTabs->activateSubTab(
"view_content");
495 $container_view->setOutput();
497 $this->adminCommands = $container_view->adminCommands;
501 if ($ilCtrl->getNextClass() !=
"ilcolumngui")
510 if ((
int)
$_GET[
"ref_id"] > 1 && $ilSetting->get(
"rep_tree_synchronize"))
512 $ilCtrl->setParameter($this,
"active_node", (
int)
$_GET[
"ref_id"]);
536 global $ilAccess,
$lng;
538 $lng->loadLanguageModule(
'cntr');
543 $GLOBALS[
'tpl']->setPageFormAction($this->ctrl->getFormAction($this));
545 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
547 $this->ctrl->setParameter($this,
"type",
"");
548 $this->ctrl->setParameter($this,
"item_ref_id",
"");
552 if ($this->object->gotItems())
554 $toolbar->setLeadingImage(
558 $toolbar->addFormButton(
559 $this->lng->txt(
'delete_selected_items'),
562 $toolbar->addFormButton(
563 $this->lng->txt(
'move_selected_items'),
566 $toolbar->addFormButton(
567 $this->lng->txt(
'copy_selected_items'),
570 $toolbar->addFormButton(
571 $this->lng->txt(
'link_selected_items'),
576 if ($folder_set->get(
"enable_multi_download") ==
true)
578 $toolbar->addSeparator();
579 $toolbar->addFormButton(
580 $this->lng->txt(
'download_selected_items'),
585 if($this->object->getType() ==
'crs')
587 if($this->object->gotItems())
589 $toolbar->addSeparator();
593 $this->lng->txt(
'cntr_adopt_content'),
594 $this->ctrl->getLinkTargetByClass(
596 'initSourceSelection')
605 $toolbar->addFormButton(
606 $this->lng->txt(
'paste_clipboard_items'),
610 if(
$_SESSION[
"clipboard"][
"cmd"] ==
"link")
620 $toolbar->addFormButton(
621 $this->lng->txt(
'clear_clipboard'),
627 $toolbar->addSeparator();
628 $toolbar->addFormButton(
629 $this->lng->txt(
'download_selected_items'),
635 $GLOBALS[
'tpl']->addAdminPanelToolbar(
637 ($this->object->gotItems() && !
$_SESSION[
"clipboard"]) ?
true :
false,
638 ($this->object->gotItems() && !
$_SESSION[
"clipboard"]) ?
true :
false
642 if ($this->object->gotItems())
644 $GLOBALS[
'tpl']->setPageFormAction($this->ctrl->getFormAction($this));
649 if ($this->edit_order)
651 if($this->object->gotItems() and $ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
653 include_once(
'./Services/Container/classes/class.ilContainer.php');
658 $GLOBALS[
'tpl']->setPageFormAction($this->ctrl->getFormAction($this));
660 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
662 $this->ctrl->setParameter($this,
"type",
"");
663 $this->ctrl->setParameter($this,
"item_ref_id",
"");
665 $toolbar->addFormButton(
666 $this->lng->txt(
'sorting_save'),
670 $GLOBALS[
'tpl']->addAdminPanelToolbar($toolbar,
true,
false);
685 $GLOBALS[
'tpl']->setPageFormAction($this->ctrl->getFormAction($this));
687 include_once
'./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
689 $this->ctrl->setParameter($this,
"type",
"");
690 $this->ctrl->setParameter($this,
"item_ref_id",
"");
692 $toolbar->addFormButton(
693 $this->lng->txt(
'download_selected_items'),
697 $GLOBALS[
'tpl']->addAdminPanelToolbar(
699 $this->object->gotItems() ?
true :
false,
700 $this->
object->gotItems() ?
true : false
710 if(!$tree->checkForParentType($this->object->getRefId(),
'crs'))
714 $tpl->setCurrentBlock(
"custom_button");
715 $tpl->setVariable(
"ADMIN_MODE_LINK",$this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'editTimings'));
716 $tpl->setVariable(
"TXT_ADMIN_MODE",$this->lng->txt(
'timings_edit'));
717 $tpl->parseCurrentBlock();
725 $GLOBALS[
"tpl"]->setPermanentLink($this->object->getType(),
726 $this->
object->getRefId(),
"",
"_top");
737 $ilCtrl->redirect($this,
"editPageFrame");
748 $ilCtrl->redirect($this,
"editPageFrame");
758 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
760 include_once(
"./Services/XHTMLPage/classes/class.ilXHTMLPage.php");
777 $ilCtrl->redirect($this,
"editPageFrame");
785 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
788 $fs_gui->setFramesetTitle($this->object->getTitle());
789 $fs_gui->setMainFrameName(
"content");
790 $fs_gui->setSideFrameName(
"tree");
795 if ($xpage_id > 0 &&
$_SESSION[
"il_cntr_editor"] !=
"std")
797 $fs_gui->setMainFrameSource(
798 $this->ctrl->getLinkTarget(
799 $this,
"editPageContent"));
800 $fs_gui->setSideFrameSource(
801 $this->ctrl->getLinkTarget($this,
"showLinkList"));
805 $this->ctrl->redirectByClass(array(
"ilcontainerpagegui"),
"edit");
822 if (!$rbacsystem->checkAccess(
"write", $this->ref_id))
824 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
831 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
833 $content = $xpage->getContent();
837 $tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.container_edit_page_content.html",
838 "Services/Container");
840 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
841 $tpl->setVariable(
"TXT_EDIT_PAGE_CONTENT",
842 $this->lng->txt(
"edit_page_content"));
843 $tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
844 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
845 $tpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_old_editor_warning"));
846 $tpl->setVariable(
"TXT_MIGRATION_OPEN_STD_EDITOR", $lng->txt(
"cntr_old_editor_open_standard_editor"));
848 $tpl->setVariable(
"HREF_OPEN_STD_EDITOR", $ilCtrl->getLinkTarget($this,
"switchToStdEditor"));
849 $tpl->setVariable(
"ALT_WARNING", $lng->txt(
"warning"));
851 include_once(
"./Services/Form/classes/class.ilFormPropertyGUI.php");
852 include_once(
"./Services/Form/classes/class.ilTextAreaInputGUI.php");
857 include_once
"./Services/RTE/classes/class.ilRTE.php";
859 include_once
"./Services/RTE/classes/class.$rtestring.php";
860 $rte =
new $rtestring();
862 include_once
"./Services/Object/classes/class.ilObject.php";
865 $rte->addRTESupport(
$obj_id, $obj_type);
872 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
873 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
893 $xpage->setContent($text);
899 $xpage->setContent($text);
902 "xhtml_page", $xpage->getId());
905 include_once(
"Services/RTE/classes/class.ilRTE.php");
907 $this->
object->getId());
910 $this->ctrl->redirect($this,
"");
915 $this->ctrl->redirect($this,
"");
922 include_once(
"Services/Object/classes/class.ilObjectListGUIFactory.php");
927 $type_grps = $this->
object->getGroupedObjTypes();
946 $this->type_template = array();
950 foreach ($type_grps as $type => $v)
953 if (is_int(strpos($output_html,
"[list-".$type.
"]")))
960 $tpl =& $overall_tpl;
964 if (is_array($this->items[$type]))
967 $item_html = array();
969 foreach($this->items[$type] as $key => $item)
972 if ($cur_obj_type != $item[
"type"])
975 $item_list_gui->setContainerObject($this);
978 $ilBench->start(
"ilContainerGUI",
"0210_getListHTML");
983 $item_list_gui->enableDelete(
false);
984 $item_list_gui->enableLink(
false);
985 $item_list_gui->enableCut(
false);
986 $item_list_gui->enableCopy(
false);
990 $item_list_gui->enableComments(
true);
991 $item_list_gui->enableNotes(
true);
992 $item_list_gui->enableTags(
true);
993 $item_list_gui->enableRating(
true);
995 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
996 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
1000 $this->determineAdminCommands($item[
"ref_id"],
1001 $item_list_gui->adminCommandsIncluded());
1002 $ilBench->stop(
"ilContainerGUI",
"0210_getListHTML");
1006 $item_html[] = array(
1008 "item_ref_id" => $item[
"ref_id"],
1009 "item_obj_id" => $item[
"obj_id"],
1010 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
1011 $item_list_gui->getIconImageType() :
1019 if (count($item_html) > 0)
1022 if (!$first && $overall)
1024 $this->addSeparatorRow(
$tpl);
1033 if ($this->ilias->getSetting(
"icon_position_in_lists") ==
"item_rows")
1044 $this->current_position = 1;
1045 foreach($item_html as $item)
1048 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"], $item[
'item_icon_image_type']);
1053 if (is_int(strpos($output_html,
"[list-".$type.
"]")))
1055 $this->type_template[$type] =
$tpl;
1066 $this->lng->txt(
"msg_no_type_accessible"), $type);
1067 $this->type_template[$type] =
$tpl;
1079 $this->lng->txt(
"msg_no_type_available"), $type);
1080 $this->type_template[$type] =
$tpl;
1089 if ($output_html !=
"")
1093 $output_html.= $overall_tpl->get();
1098 foreach ($this->type_template as $type =>
$tpl)
1100 $output_html = eregi_replace(
"\[list-".$type.
"\]",
1101 "</p>".$tpl->get().
"<p class=\"ilc_Standard\">",
1107 $page_block =
new ilTemplate(
"tpl.container_page_block.html",
false,
false,
1108 "Services/Container");
1109 $page_block->setVariable(
"CONTAINER_PAGE_CONTENT", $output_html);
1110 $output_html = $page_block->get();
1119 return $output_html;
1126 $tpl =
new ilTemplate(
"tpl.container_link_help.html",
true,
true,
1127 "Services/Container");
1129 $type_ordering = array(
1130 "cat",
"fold",
"crs",
"icrs",
"icla",
"grp",
"chat",
"frm",
"lres",
1131 "glo",
"webr",
"file",
"exc",
1132 "tst",
"svy",
"mep",
"qpl",
"spl");
1134 $childs = $tree->getChilds(
$_GET[
"ref_id"]);
1135 foreach($childs as $child)
1137 if (in_array($child[
"type"], array(
"lm",
"dbk",
"sahs",
"htlm")))
1143 $cnt[$child[
"type"]]++;
1148 $tpl->setVariable(
"TXT_HELP_HEADER", $lng->txt(
"help"));
1149 foreach($type_ordering as $type)
1151 $tpl->setCurrentBlock(
"row");
1152 $tpl->setVariable(
"ROWCOL",
"tblrow".((($i++)%2)+1));
1153 if ($type !=
"lres")
1155 $tpl->setVariable(
"TYPE", $lng->txt(
"objs_".$type).
1156 " (".((int)$cnt[$type]).
")");
1160 $tpl->setVariable(
"TYPE", $lng->txt(
"learning_resources").
1161 " (".((int)$cnt[
"lres"]).
")");
1163 $tpl->setVariable(
"TXT_LINK",
"[list-".$type.
"]");
1164 $tpl->parseCurrentBlock();
1176 $this->adminCommands =
false;
1208 $tpl =
new ilTemplate(
"tpl.container_list_block.html",
true,
true,
1209 "Services/Container");
1210 $this->cur_row_type =
"row_type_1";
1224 $title = $this->lng->txt(
"objs_".$a_type);
1228 $a_tpl->setCurrentBlock(
"container_header_row_image");
1229 $a_tpl->setVariable(
"HEADER_IMG", $icon);
1230 $a_tpl->setVariable(
"HEADER_ALT", $title);
1234 $a_tpl->setCurrentBlock(
"container_header_row");
1237 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT", $title);
1238 $a_tpl->parseCurrentBlock();
1239 $a_tpl->touchBlock(
"container_row");
1252 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1256 $a_tpl->touchBlock($this->cur_row_type);
1259 if ($this->ilias->getSetting(
"icon_position_in_lists") ==
"item_rows")
1262 $alt = $this->lng->txt(
"obj_".$a_image_type);
1265 if ($this->ilias->getSetting(
"custom_icons") &&
1266 in_array($a_image_type, array(
"cat",
"grp",
"crs")))
1268 require_once(
"./Services/Container/classes/class.ilContainer.php");
1275 $a_tpl->setCurrentBlock(
"block_row_image");
1276 $a_tpl->setVariable(
"ROW_IMG", $icon);
1277 $a_tpl->setVariable(
"ROW_ALT", $alt);
1278 $a_tpl->parseCurrentBlock();
1284 $a_tpl->setCurrentBlock(
"block_row_check");
1285 $a_tpl->setVariable(
"ITEM_ID", $a_item_ref_id);
1286 $a_tpl->parseCurrentBlock();
1289 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
1293 $a_tpl->setCurrentBlock(
'block_position');
1294 $a_tpl->setVariable(
'POS_TYPE',$a_image_type);
1295 $a_tpl->setVariable(
'POS_ID',$a_item_ref_id);
1296 $a_tpl->setVariable(
'POSITION',sprintf(
'%.1f',$this->current_position++));
1297 $a_tpl->parseCurrentBlock();
1301 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1303 $a_tpl->setCurrentBlock(
"container_standard_row");
1304 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
1305 $a_tpl->parseCurrentBlock();
1306 $a_tpl->touchBlock(
"container_row");
1314 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1318 $a_tpl->touchBlock($this->cur_row_type);
1320 $type = $this->lng->txt(
"obj_".$a_type);
1321 $a_message = str_replace(
"[type]", $type, $a_message);
1323 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1325 $a_tpl->setCurrentBlock(
"container_standard_row");
1326 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT",
1328 $a_tpl->parseCurrentBlock();
1329 $a_tpl->touchBlock(
"container_row");
1334 $this->cur_row_type =
"";
1346 || strtolower($this->ctrl->getCmdClass()) !=
"ilcontainerpagegui")
1351 $lng->loadLanguageModule(
"content");
1356 $this->tabs_gui->setBackTarget($this->lng->txt(
"obj_cat"),
1357 $this->ctrl->getLinkTarget($this,
"frameset"),
1360 $this->tabs_gui->addTarget(
"edit", $this->ctrl->getLinkTargetByClass(
"ilcontainerpagegui",
"view")
1361 , array(
"",
"view"),
"ilcontainerpagegui");
1373 if (!is_object($this->
object))
1378 if ($a_include_view && $ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
1382 $ilTabs->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTarget($this,
""));
1386 $ilTabs->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTarget($this,
"disableAdministrationPanel"));
1390 if ( $ilUser->getId() != ANONYMOUS_USER_ID &&
1391 ($this->adminCommands ||
1392 (is_object($this->
object) &&
1393 ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())))
1395 (is_object($this->
object) &&
1396 ($this->
object->getHiddenFilesFound())) ||
1403 $ilTabs->addSubTab(
"manage", $lng->txt(
"cntr_manage"), $ilCtrl->getLinkTarget($this,
""));
1407 $ilTabs->addSubTab(
"manage", $lng->txt(
"cntr_manage"), $ilCtrl->getLinkTarget($this,
"enableAdministrationPanel"));
1410 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1411 is_object($this->
object) &&
1412 $ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
1416 $ilTabs->addSubTab(
"ordering", $lng->txt(
"cntr_ordering"), $ilCtrl->getLinkTarget($this,
"editOrder"));
1418 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1419 is_object($this->
object) &&
1420 $ilAccess->checkAccess(
"write",
"", $this->object->getRefId())
1423 if ($ilSetting->get(
"enable_cat_page_edit"))
1425 $ilTabs->addSubTab(
"page_editor", $lng->txt(
"cntr_text_media_editor"), $ilCtrl->getLinkTarget($this,
"editPageFrame"),
1441 if ($rbacsystem->checkAccess(
'edit_permission',$this->ref_id))
1443 $tabs_gui->addTarget(
"perm_settings",
1444 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1445 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1446 if ($ilCtrl->getNextClass() ==
"ilpermissiongui")
1448 $tabs_gui->activateTab(
"perm_settings");
1453 if (strtolower(
$_GET[
"baseClass"]) ==
"ilrepositorygui" && !empty(
$_SESSION[
"clipboard"]))
1455 $tabs_gui->addTarget(
"clipboard",
1456 $this->ctrl->getLinkTarget($this,
"clipboard"),
"clipboard", get_class($this));
1471 $_SESSION[
"il_cont_admin_panel"] =
true;
1472 $this->ctrl->redirect($this,
"render");
1480 $_SESSION[
"il_cont_admin_panel"] =
false;
1481 $this->ctrl->redirect($this,
"render");
1491 $this->edit_order =
true;
1492 $_SESSION[
"il_cont_admin_panel"] =
false;
1495 $ilTabs->activateSubTab(
"ordering");
1504 return $this->edit_order ?
true :
false;
1516 if((
int)$ilSetting->get(
'disable_my_offers'))
1521 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
1534 if((
int)$ilSetting->get(
'disable_my_offers'))
1539 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
1547 $this->multi_download_enabled =
true;
1561 if (!$rbacsystem->checkAccess(
"write",
$_GET[
'item_ref_id']))
1563 $this->ilErr->raiseError($this->lng->txt(
'err_no_permission'),$this->ilErr->MESSAGE);
1567 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
1570 require_once
'Services/WebDAV/classes/class.ilDAVLocks.php';
1574 $ilUser->getId(), $ilUser->getLogin(),
1575 'ref_'.$_GET[
'item_ref_id'].
'_usr_'.$ilUser->getId(),
1576 time() + 60, 0,
'exclusive'
1599 if (
$_GET[
"item_ref_id"] !=
"")
1606 if (!isset(
$_POST[
"id"]))
1608 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1615 $node_data = $this->tree->getNodeData($ref_id);
1616 $subtree_nodes = $this->tree->getSubTree($node_data);
1618 $all_node_data[] = $node_data;
1619 $all_subtree_nodes[] = $subtree_nodes;
1622 foreach ($subtree_nodes as $node)
1624 if($node[
'type'] ==
'rolf')
1629 if (!$rbacsystem->checkAccess(
'delete',$node[
"ref_id"]))
1631 $no_cut[] = $node[
"ref_id"];
1638 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_cut").
" ".implode(
',',$this->
getTitlesByRefId($no_cut)),
1639 $this->ilias->error_obj->MESSAGE);
1642 $_SESSION[
"clipboard"][
"cmd"] = $ilCtrl->getCmd();
1661 if (
$_GET[
"item_ref_id"] !=
"")
1666 if (!isset(
$_POST[
"id"]))
1668 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1676 $node_data = $this->tree->getNodeData($ref_id);
1679 if ($objDefinition->isContainer($node_data[
"type"]))
1684 $subtree_nodes = $this->tree->getSubTree($node_data);
1686 $all_node_data[] = $node_data;
1687 $all_subtree_nodes[] = $subtree_nodes;
1690 foreach ($subtree_nodes as $node)
1692 if($node[
'type'] ==
'rolf')
1697 if (!$rbacsystem->checkAccess(
'visible,read,copy',$node[
"ref_id"]))
1699 $no_copy[] = $node[
"ref_id"];
1704 if ($containers > 0 && count(
$_POST[
"id"]) > 1)
1706 $this->ilias->raiseError($this->lng->txt(
"cntr_container_only_on_their_own"), $this->ilias->error_obj->MESSAGE);
1710 if (count($no_copy))
1712 $this->ilias->raiseError(
1713 $this->lng->txt(
"msg_no_perm_copy") .
" " . implode(
',',$this->
getTitlesByRefId($no_copy)),
1714 $this->ilias->error_obj->MESSAGE);
1718 if (count(
$_POST[
"id"]) == 1)
1720 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_id",
$_POST[
"id"][0]);
1721 $ilCtrl->redirectByClass(
"ilobjectcopygui",
"initTargetSelection");
1725 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_ids", implode(
$_POST[
"id"],
"_"));
1726 $ilCtrl->redirectByClass(
"ilobjectcopygui",
"initTargetSelection");
1730 $_SESSION[
"clipboard"][
"cmd"] = $ilCtrl->getCmd();
1742 if (
$_GET[
"item_ref_id"] !=
"")
1747 if (!isset(
$_POST[
"id"]))
1749 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1755 $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1756 $obj_type =
$object->getType();
1757 if (!in_array($obj_type, array(
"fold",
"file")))
1759 $no_download[] =
$object->getType();
1761 else if (!$rbacsystem->checkAccess(
'read', $ref_id))
1768 if (count($no_download))
1770 $no_download = array_unique($no_download);
1771 foreach ($no_download as $type)
1773 $txt_objs[] = $this->lng->txt(
"objs_".$type);
1775 $this->ilias->raiseError(implode(
', ',$txt_objs).
" ".$this->lng->txt(
"msg_obj_no_download"),$this->ilias->error_obj->MESSAGE);
1779 if (count($no_perm))
1781 $this->ilias->raiseError(
1782 $this->lng->txt(
"msg_obj_perm_download").
" ".implode(
',',$no_perm),
1783 $this->ilias->error_obj->MESSAGE);
1792 global
$lng, $rbacsystem, $ilAccess;
1794 include_once
"./Services/Utilities/classes/class.ilUtil.php";
1795 include_once
'Modules/Folder/classes/class.ilObjFolder.php';
1796 include_once
'Modules/File/classes/class.ilObjFile.php';
1797 include_once
'Modules/File/classes/class.ilFileException.php';
1807 foreach ($a_ref_ids as
$ref_id)
1809 if (!$ilAccess->checkAccess(
"read",
"", $ref_id))
1816 $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1817 $obj_type =
$object->getType();
1818 if ($obj_type ==
"fold")
1823 else if ($obj_type ==
"file")
1831 $deliverFilename = ilUtil::getAsciiFilename($this->object->getTitle()) .
".zip";
1853 global $rbacsystem,
$tree, $ilAccess;
1858 $subtree = $tree->getChildsByTypeFilter($refid, array(
"fold",
"file"));
1860 foreach ($subtree as $child)
1862 if (!$ilAccess->checkAccess(
"read",
"", $child[
"ref_id"]))
1868 if ($child[
"type"] ==
"fold")
1881 if (!copy($oldFilename, $newFilename))
1882 throw new ilFileException(
"Could not copy ".$oldFilename.
" to ".$newFilename);
1884 touch($newFilename, filectime($oldFilename));
1895 global $clipboard, $rbacsystem, $rbacadmin,
$ilCtrl;
1897 if (
$_GET[
"item_ref_id"] !=
"")
1902 if (!isset(
$_POST[
"id"]))
1904 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1910 if (!$rbacsystem->checkAccess(
'delete',$ref_id))
1915 $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1917 if (!$this->objDefinition->allowLink(
$object->getType()))
1919 $no_link[] =
$object->getType();
1926 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_link").
" ".
1927 implode(
',',$no_cut),$this->ilias->error_obj->MESSAGE);
1930 if (count($no_link))
1933 $this->ilias->raiseError($this->lng->txt(
"msg_obj_no_link"),$this->ilias->error_obj->MESSAGE);
1940 $clipboard[
"parent"] =
$_GET[
"ref_id"];
1941 $clipboard[
"cmd"] = $ilCtrl->getCmd();
1943 foreach (
$_POST[
"id"] as $ref_id)
1945 $clipboard[
"ref_ids"][] =
$ref_id;
1970 if (isset(
$_POST[
"cmd"][
"clear"]))
1982 global $rbacsystem, $rbacadmin, $rbacreview,
$log,
$tree, $ilObjDataCache,
$ilUser;
1984 $command =
$_SESSION[
'clipboard'][
'cmd'];
1985 if(!in_array($command, array(
'cut',
'link',
'copy')))
1987 $message = __METHOD__.
": cmd was neither 'cut', 'link' nor 'copy'; may be a hack attempt!";
1988 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
1991 if($command ==
'cut')
1994 $_POST[
'nodes'] = array($_POST[
'node']);
1997 if(!is_array(
$_POST[
'nodes']) || !count(
$_POST[
'nodes']))
2016 $folder_objects_cache = array();
2020 $current_parent_id = $tree->getParentId($obj_data->getRefId());
2022 foreach(
$_POST[
'nodes'] as $folder_ref_id)
2024 if(!array_key_exists($folder_ref_id, $folder_objects_cache))
2030 if(!$rbacsystem->checkAccess(
'create', $folder_ref_id, $obj_data->getType()))
2032 $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().
']');
2036 if($folder_ref_id == $current_parent_id)
2038 $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().
']');
2042 if ($tree->isGrandChild($ref_id, $folder_ref_id) ||
2043 $ref_id == $folder_ref_id)
2045 $is_child[] = sprintf($this->lng->txt(
'msg_paste_object_not_in_itself'), $obj_data->getTitle().
' ['.$obj_data->getRefId().
']');
2049 if(!in_array($obj_data->getType(), array_keys($this->objDefinition->getSubObjects($folder_objects_cache[$folder_ref_id]->getType()))))
2051 $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().
']',
2052 $GLOBALS[
'lng']->txt(
'obj_'.$obj_data->getType()));
2059 if(count($exists) && $command !=
"copy")
2061 $error .= implode(
'<br />', $exists);
2064 if(count($is_child))
2066 $error .= $error !=
'' ?
'<br />' :
'';
2067 $error .= implode(
'<br />', $is_child);
2070 if(count($not_allowed_subobject))
2072 $error .= $error !=
'' ?
'<br />' :
'';
2073 $error .= implode(
'<br />', $not_allowed_subobject);
2076 if(count($no_paste))
2078 $error .= $error !=
'' ?
'<br />' :
'';
2079 $error .= implode(
'<br />', $no_paste);
2101 $log->write(__METHOD__.
", cmd: ".$command);
2107 $ref_ids =
$_SESSION[
'clipboard'][
'ref_ids'];
2108 unset(
$_SESSION[
'clipboard'][
'ref_ids']);
2111 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
2115 if($command ==
'copy')
2117 foreach(
$_POST[
'nodes'] as $folder_ref_id)
2119 foreach($ref_ids as $ref_id)
2121 $revIdMapping = array();
2123 $oldNode_data = $tree->getNodeData($ref_id);
2124 if ($oldNode_data[
'parent'] == $folder_ref_id)
2126 require_once
'Modules/File/classes/class.ilObjFileAccess.php';
2128 $newRef = $this->
cloneNodes($ref_id, $folder_ref_id, $refIdMapping, $newTitle);
2132 $newRef = $this->
cloneNodes($ref_id, $folder_ref_id, $refIdMapping, null);
2136 $old_parent_data = $tree->getParentNodeData($ref_id);
2137 $newNode_data = $tree->getNodeData($newRef);
2139 $oldNode_data[
'obj_id'], $ilUser->getId());
2141 $ilObjDataCache->lookupObjId($folder_ref_id));
2151 if($command ==
'cut')
2153 foreach(
$_POST[
'nodes'] as $folder_ref_id)
2155 foreach($ref_ids as $ref_id)
2158 $old_parent = $tree->getParentId($ref_id);
2159 $tree->moveTree($ref_id, $folder_ref_id);
2160 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
2162 include_once(
'./Services/AccessControl/classes/class.ilConditionHandler.php');
2166 $node_data = $tree->getNodeData($ref_id);
2167 $old_parent_data = $tree->getNodeData($old_parent);
2169 $old_parent_data[
'obj_id']);
2171 $ilObjDataCache->lookupObjId($folder_ref_id));
2184 if($command ==
'link')
2186 $linked_to_folders = array();
2188 include_once
"Services/AccessControl/classes/class.ilRbacLog.php";
2191 foreach(
$_POST[
'nodes'] as $folder_ref_id)
2193 $linked_to_folders[] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($folder_ref_id));
2195 foreach($ref_ids as $ref_id)
2198 $top_node = $tree->getNodeData($ref_id);
2201 $subnodes[
$ref_id] = $tree->getSubtree($top_node);
2205 foreach($subnodes as $key => $subnode)
2209 $new_ref_id = $obj_data->createReference();
2210 $obj_data->putInTree($folder_ref_id);
2211 $obj_data->setPermissions($folder_ref_id);
2214 if($rbac_log_active)
2216 $rbac_log_roles = $rbacreview->getParentRoleIds($new_ref_id,
false);
2222 $node_data = $tree->getNodeData($new_ref_id);
2224 $ilObjDataCache->lookupObjId($folder_ref_id));
2229 $log->write(__METHOD__.
', link finished');
2232 ilUtil::sendSuccess(sprintf($this->lng->txt(
'mgs_objects_linked_to_the_following_folders'), implode(
', ', $linked_to_folders)),
true);
2238 $this->ctrl->returnToParent($this);
2246 $_SESSION[
'paste_linked_repexpand'] = array();
2252 $path = $tree->getPathId((
int)
$_GET[
'ref_id']);
2253 foreach((array)
$path as $node_id)
2255 if(!in_array($node_id,
$_SESSION[
'paste_linked_repexpand']))
2256 $_SESSION[
'paste_linked_repexpand'][] = $node_id;
2267 global $ilTabs, $ilToolbar;
2269 $ilTabs->setTabActive(
'view_content');
2271 if(!in_array(
$_SESSION[
'clipboard'][
'cmd'], array(
'link',
'copy',
'cut')))
2273 $message = __METHOD__.
": Unknown action.";
2274 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
2279 include_once(
"./Services/Repository/classes/class.ilRepositorySelectorExplorerGUI.php");
2281 $exp->setTypeWhiteList(array(
"root",
"cat",
"grp",
"crs",
"fold"));
2284 $exp->setSelectMode(
"nodes",
true);
2288 $exp->setSelectMode(
"nodes[]",
false);
2290 if ($exp->handleCommand())
2294 $output = $exp->getHTML();
2296 $txt_var = (
$cmd ==
"copy")
2302 $t->setFormAction($this->ctrl->getFormAction($this,
"performPasteIntoMultipleObjects"));
2303 $t->addFormButton($this->lng->txt($txt_var),
"performPasteIntoMultipleObjects");
2305 $t->addFormButton($this->lng->txt(
"obj_insert_into_clipboard"),
"keepObjectsInClipboard");
2306 $t->addFormButton($this->lng->txt(
"cancel"),
"cancelMoveLink");
2307 $t->setCloseFormTag(
false);
2309 $output =
$t->getHTML().$output;
2311 $t->setCloseFormTag(
true);
2312 $t->setOpenFormTag(
false);
2313 $output.=
"<br />".$t->getHTML();
2315 $this->tpl->setContent($output);
2376 $GLOBALS[
'ilCtrl']->returnToParent($this);
2385 $GLOBALS[
'ilCtrl']->returnToParent($this);
2394 $_SESSION[
'paste_copy_repexpand'] = array();
2400 $path = $tree->getPathId((
int)
$_GET[
'ref_id']);
2401 foreach((array)
$path as $node_id)
2403 if(!in_array($node_id,
$_SESSION[
'paste_copy_repexpand']))
2404 $_SESSION[
'paste_copy_repexpand'][] = $node_id;
2463 $_SESSION[
'paste_cut_repexpand'] = array();
2469 $path = $tree->getPathId((
int)
$_GET[
'ref_id']);
2470 foreach((array)
$path as $node_id)
2472 if(!in_array($node_id,
$_SESSION[
'paste_cut_repexpand']))
2473 $_SESSION[
'paste_cut_repexpand'][] = $node_id;
2536 global $rbacsystem, $rbacadmin, $rbacreview,
$log,
$tree;
2540 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
2544 if (!in_array(
$_SESSION[
"clipboard"][
"cmd"],array(
"cut",
"link",
"copy")))
2546 $message = get_class($this).
"::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
2547 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
2553 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
2556 if (!$rbacsystem->checkAccess(
'create',$this->object->getRefId(), $obj_data->getType()))
2559 $no_paste_titles[] = $obj_data->getTitle();
2563 if ($this->object->getRefId() == $this->tree->getParentId($obj_data->getRefId()))
2570 if ($this->tree->isGrandChild($ref_id,$this->object->getRefId()))
2575 if ($ref_id == $this->object->getRefId())
2581 $obj_type = $obj_data->getType();
2583 if (!in_array($obj_type, array_keys($this->objDefinition->getSubObjects($this->object->getType()))))
2585 $not_allowed_subobject[] = $obj_data->getType();
2592 if (count($exists) &&
$_SESSION[
"clipboard"][
"cmd"] !=
"copy")
2595 $this->ilias->raiseError($this->lng->txt(
"msg_obj_exists"),$this->ilias->error_obj->MESSAGE);
2598 if (count($is_child))
2600 $this->ilias->raiseError($this->lng->txt(
"msg_not_in_itself").
" ".implode(
',',$is_child),
2601 $this->ilias->error_obj->MESSAGE);
2604 if (count($not_allowed_subobject))
2606 $this->ilias->raiseError($this->lng->txt(
"msg_may_not_contain").
" ".implode(
',',$not_allowed_subobject),
2607 $this->ilias->error_obj->MESSAGE);
2610 if (count($no_paste))
2612 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_paste").
" ".
2613 implode(
',',$no_paste),$this->ilias->error_obj->MESSAGE);
2617 $log->write(
"ilObjectGUI::pasteObject(), cmd: ".
$_SESSION[
"clipboard"][
"cmd"]);
2623 $ref_ids =
$_SESSION[
"clipboard"][
"ref_ids"];
2624 unset(
$_SESSION[
"clipboard"][
"ref_ids"]);
2628 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"copy")
2633 if (count($ref_ids) == 1)
2635 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"target", $this->object->getRefId());
2636 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_id", $ref_ids[0]);
2637 $ilCtrl->redirectByClass(
"ilobjectcopygui",
"saveTarget");
2641 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"target", $this->object->getRefId());
2642 $ilCtrl->setParameterByClass(
"ilobjectcopygui",
"source_ids", implode($ref_ids,
"_"));
2643 $ilCtrl->redirectByClass(
"ilobjectcopygui",
"saveTarget");
2677 $log->write(
"ilObjectGUI::pasteObject(), copy finished");
2682 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"cut")
2685 foreach($ref_ids as $ref_id)
2688 $old_parent = $tree->getParentId($ref_id);
2689 $this->tree->moveTree($ref_id,$this->object->getRefId());
2690 $rbacadmin->adjustMovedObjectPermissions($ref_id,$old_parent);
2692 include_once(
'./Services/AccessControl/classes/class.ilConditionHandler.php');
2696 $node_data = $tree->getNodeData($ref_id);
2697 $old_parent_data = $tree->getNodeData($old_parent);
2699 $old_parent_data[
'obj_id']);
2701 $this->
object->getId());
2708 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"link")
2710 foreach ($ref_ids as $ref_id)
2713 $top_node = $this->tree->getNodeData($ref_id);
2716 $subnodes[
$ref_id] = $this->tree->getSubtree($top_node);
2720 foreach ($subnodes as $key => $subnode)
2723 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($key);
2724 $new_ref_id = $obj_data->createReference();
2725 $obj_data->putInTree(
$_GET[
"ref_id"]);
2726 $obj_data->setPermissions(
$_GET[
"ref_id"]);
2729 $node_data = $tree->getNodeData($new_ref_id);
2731 $this->
object->getId());
2736 $log->write(
"ilObjectGUI::pasteObject(), link finished");
2743 $last_cmd =
$_SESSION[
"clipboard"][
"cmd"];
2749 if ($last_cmd ==
"cut")
2754 else if ($last_cmd ==
"copy")
2758 else if ($last_cmd ==
'link')
2764 $this->ctrl->returnToParent($this);
2857 $ilTabs->activateTab(
"clipboard");
2862 $message = sprintf(
'%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
2863 $ilLog->write($message,$ilLog->FATAL);
2864 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->WARNING);
2876 "type" => $tmp_obj->getType(),
2877 "type_txt" => $this->lng->txt(
"obj_".$tmp_obj->getType()),
2878 "title" => $tmp_obj->getTitle(),
2879 "cmd" => (
$_SESSION[
"clipboard"][
"cmd"] ==
"cut") ? $this->lng->txt(
"move") :$this->lng->txt(
$_SESSION[
"clipboard"][
"cmd"]),
2881 "obj_id" => $tmp_obj->getId()
2887 include_once(
"./Services/Object/classes/class.ilObjClipboardTableGUI.php");
2890 $tpl->setContent(
$tab->getHTML());
2892 if (count(
$data) > 0)
2894 $ilToolbar->setFormAction($ilCtrl->getFormAction($this));
2895 $ilToolbar->addFormButton($lng->txt(
"insert_object_here"),
2897 $ilToolbar->addFormButton($lng->txt(
"clear_clipboard"),
2911 if ($this->ilias->getSetting(
"custom_icons"))
2915 $this->tpl->addBlockFile(
"CONTAINER_ICONS",
"container_icon_settings",
2916 "tpl.container_icon_settings.html",
"Services/Container");
2918 if (($big_icon = $this->object->getBigIconPath()) !=
"")
2920 $this->tpl->setCurrentBlock(
"big_icon");
2921 $this->tpl->setVariable(
"SRC_BIG_ICON", $big_icon);
2922 $this->tpl->parseCurrentBlock();
2924 if ($this->object->getType() !=
"root")
2926 if (($small_icon = $this->object->getSmallIconPath()) !=
"")
2928 $this->tpl->setCurrentBlock(
"small_icon");
2929 $this->tpl->setVariable(
"SRC_SMALL_ICON", $small_icon);
2930 $this->tpl->parseCurrentBlock();
2932 $this->tpl->setCurrentBlock(
"small_icon_row");
2933 $this->tpl->setVariable(
"SMALL_ICON", $this->lng->txt(
"standard_icon"));
2934 $this->tpl->setVariable(
"SMALL_SIZE",
"(".
2935 $this->ilias->getSetting(
"custom_icon_small_width").
"x".
2936 $this->ilias->getSetting(
"custom_icon_small_height").
")");
2937 $this->tpl->setVariable(
"TXT_REMOVE_S", $this->lng->txt(
"remove"));
2938 $this->tpl->parseCurrentBlock();
2940 if (($tiny_icon = $this->object->getTinyIconPath()) !=
"")
2942 $this->tpl->setCurrentBlock(
"tiny_icon");
2943 $this->tpl->setVariable(
"SRC_TINY_ICON", $tiny_icon);
2944 $this->tpl->parseCurrentBlock();
2946 $this->tpl->setCurrentBlock(
"container_icon_settings");
2947 $this->tpl->setVariable(
"SPAN_TITLE", $a_input_colspan + 1);
2948 $this->tpl->setVariable(
"SPAN_INPUT", $a_input_colspan);
2949 $this->tpl->setVariable(
"ICON_SETTINGS", $this->lng->txt(
"icon_settings"));
2950 $this->tpl->setVariable(
"BIG_ICON", $this->lng->txt(
"big_icon"));
2951 $this->tpl->setVariable(
"TINY_ICON", $this->lng->txt(
"tiny_icon"));
2952 $this->tpl->setVariable(
"BIG_SIZE",
"(".
2953 $this->ilias->getSetting(
"custom_icon_big_width").
"x".
2954 $this->ilias->getSetting(
"custom_icon_big_height").
")");
2955 $this->tpl->setVariable(
"TINY_SIZE",
"(".
2956 $this->ilias->getSetting(
"custom_icon_tiny_width").
"x".
2957 $this->ilias->getSetting(
"custom_icon_tiny_height").
")");
2958 $this->tpl->setVariable(
"TXT_REMOVE", $this->lng->txt(
"remove"));
2959 $this->tpl->parseCurrentBlock();
2963 $big_icon = $this->
object->getBigIconPath();
2964 $small_icon = $this->
object->getSmallIconPath();
2965 $tiny_icon = $this->
object->getTinyIconPath();
2970 $title->setTitle($this->lng->txt(
"icon_settings"));
2976 $a_form->addItem($title);
2979 $caption = $this->lng->txt(
"big_icon").
" (".
2980 $this->ilias->getSetting(
"custom_icon_big_width").
"x".
2981 $this->ilias->getSetting(
"custom_icon_big_height").
")";
2983 $icon->setImage($big_icon);
2986 $a_form->addItem($icon);
2990 $title->addSubItem($icon);
2994 if ($this->object->getType() !=
"root")
2996 $caption = $this->lng->txt(
"standard_icon").
" (".
2997 $this->ilias->getSetting(
"custom_icon_small_width").
"x".
2998 $this->ilias->getSetting(
"custom_icon_small_height").
")";
3000 $icon->setImage($small_icon);
3003 $a_form->addItem($icon);
3007 $title->addSubItem($icon);
3012 $caption = $this->lng->txt(
"tiny_icon").
" (".
3013 $this->ilias->getSetting(
"custom_icon_tiny_width").
"x".
3014 $this->ilias->getSetting(
"custom_icon_tiny_height").
")";
3016 $icon->setImage($tiny_icon);
3019 $a_form->addItem($icon);
3023 $title->addSubItem($icon);
3035 $this->object->getRefId() &&
3036 !$ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
3041 return $_SESSION[
"il_cont_admin_panel"];
3052 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
3056 $column_gui->setEnableMovement(
true);
3059 $column_gui->setRepositoryItems(
3060 $this->object->getSubItems($this->isActiveAdministrationPanel(),
true));
3064 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
3066 $column_gui->setBlockProperty(
"news",
"settings",
true);
3068 $column_gui->setBlockProperty(
"news",
"default_visibility_option",
true);
3069 $column_gui->setBlockProperty(
"news",
"hide_news_block_option",
true);
3074 $column_gui->setAdminCommands(
true);
3126 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardPageFactory.php');
3128 global $ilObjDataCache,
$tree;
3133 if(isset(
$_SESSION[
'wizard_search_title']))
3135 $this->searchCloneSourceObject();
3145 $this->ctrl->setParameter($this,
'clone_source',(
int)
$_REQUEST[
'clone_source']);
3146 $this->ctrl->setParameter($this,
'new_type',$new_type);
3150 $this->tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
3151 $this->tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
3154 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.container_wizard_page.html',
3155 "Services/Container");
3156 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
3158 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_'.$new_type));
3159 $this->tpl->setVariable(
'TXT_DUPLICATE',$this->lng->txt($new_type.
'_wizard_page'));
3160 $this->tpl->setVariable(
'INFO_DUPLICATE',$this->lng->txt($new_type.
'_copy_threads_info'));
3161 $this->tpl->setVariable(
'BTN_COPY',$this->lng->txt(
'obj_'.$new_type.
'_duplicate'));
3162 $this->tpl->setVariable(
'BTN_BACK',$this->lng->txt(
'btn_back'));
3163 if(isset(
$_SESSION[
'wizard_search_title']))
3165 $this->tpl->setVariable(
'CMD_BACK',
'searchCloneSource');
3169 $this->tpl->setVariable(
'CMD_BACK',
'create');
3172 $this->tpl->setVariable(
'BTN_TREE',$this->lng->txt(
'treeview'));
3173 $this->tpl->setVariable(
'BTN_LIST',$this->lng->txt(
'flatview'));
3181 foreach($subnodes = $tree->getSubtree($source_node = $tree->getNodeData($source_id),
true) as $node)
3189 if($node[
'type'] ==
'rolf')
3196 for($i = $source_node[
'depth'];$i < $node[
'depth']; $i++)
3198 $this->tpl->touchBlock(
'padding');
3199 $this->tpl->touchBlock(
'end_padding');
3203 $copy_wizard_page->fillTreeSelection($node[
'ref_id'],$node[
'type'],$node[
'depth']);
3205 $this->tpl->setCurrentBlock(
'tree_row');
3207 $this->tpl->setVariable(
'TREE_ALT_IMG',$this->lng->txt(
'obj_'.$node[
'type']));
3208 $this->tpl->setVariable(
'TREE_TITLE',$node[
'title']);
3209 $this->tpl->parseCurrentBlock();
3213 $this->tpl->setCurrentBlock(
'no_content');
3214 $this->tpl->setVariable(
'TXT_NO_CONTENT',$this->lng->txt(
'container_no_items'));
3215 $this->tpl->parseCurrentBlock();
3219 $this->tpl->setCurrentBlock(
'tree_footer');
3220 $this->tpl->setVariable(
'TXT_COPY_ALL',$this->lng->txt(
'copy_all'));
3221 $this->tpl->setVariable(
'TXT_LINK_ALL',$this->lng->txt(
'link_all'));
3222 $this->tpl->setVariable(
'TXT_OMIT_ALL',$this->lng->txt(
'omit_all'));
3223 $this->tpl->parseCurrentBlock();
3229 foreach($tree->getSubTreeTypes($source_id,array(
'rolf',
'crs')) as $type)
3232 if(strlen($html = $copy_wizard_page->getWizardPageBlockHTML()))
3234 $this->tpl->setCurrentBlock(
'obj_row');
3235 $this->tpl->setVariable(
'ITEM_BLOCK',$html);
3236 $this->tpl->parseCurrentBlock();
3253 include_once(
'./Services/Link/classes/class.ilLink.php');
3254 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
3260 $clone_source = (int)
$_REQUEST[
'clone_source'];
3262 if(!$rbacsystem->checkAccess(
'create',
$ref_id,$new_type))
3264 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
3272 if(!$ilAccess->checkAccess(
'write',
'', $clone_source,$new_type))
3274 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
3285 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$ref_id);
3286 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
3291 $ilCtrl->setParameterByClass(
"ilrepositorygui",
"ref_id",
$result);
3292 $ilCtrl->redirectByClass(
"ilrepositorygui",
"");
3306 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
3310 $positions = str_replace(
',',
'.',
$_POST[
'position']);
3312 $sorting->savePost($positions);
3314 $this->ctrl->redirect($this,
"editOrder");
3334 $srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
3335 error_log(__METHOD__.
' cloning srcRef='.$srcRef.
' dstRef='.$dstRef.
'...');
3336 $newRef = $srcObj->cloneObject($dstRef)->getRefId();
3337 error_log(__METHOD__.
' ...cloning... newRef='.$newRef.
'...');
3342 if (! is_null($newName))
3344 $newObj =& $ilias->obj_factory->getInstanceByRefId($newRef);
3345 $newObj->setTitle($newName);
3350 $mapping[$newRef] = $srcRef;
3353 $children = $tree->getChilds($srcRef);
3354 foreach ($tree->getChilds($srcRef) as $child)
3358 if ($child[
"type"] !=
'rolf')
3360 $this->
cloneNodes($child[
"ref_id"],$newRef,$mapping);
3364 if (count($rolf = $tree->getChildsByType($newRef,
"rolf")))
3366 $mapping[$rolf[0][
"ref_id"]] = $child[
"ref_id"];
3370 error_log(__METHOD__.
' ...cloned srcRef='.$srcRef.
' dstRef='.$dstRef.
' newRef='.$newRef);
3384 $a_item_list_gui->addCustomProperty($lng->txt(
'path'),
3385 ilContainer::buildPath($a_item_data[
'ref_id'], $this->object->getRefId()),
3397 $path_arr = $tree->getPathFull($a_ref_id, $a_course_ref_id);
3399 foreach($path_arr as
$data)
3405 $path .= $data[
'title'];
3420 global $ilTabs,
$tpl;
3425 $tpl->setContent($this->form->getHTML());
3427 $ilTabs->activateTab(
"obj_sty");
3437 $tpl->setTreeFlatIcon(
"",
"");
3438 $ilTabs->clearTargets();
3443 $ilTabs->setBackTarget($lng->txt(
"cntr_back_to_old_editor"),
3444 $ilCtrl->getLinkTarget($this,
"switchToOldEditor"),
"_top");
3448 $ilTabs->setBackTarget($lng->txt(
"back"),
"./goto.php?target=".$this->object->getType().
"_".
3449 $this->
object->getRefId(),
"_top");
3452 include_once(
"./Services/Container/classes/class.ilContainerPageGUI.php");
3454 $style_id = $this->
object->getStyleSheetId();
3466 $ilCtrl->getHTML($page_gui);
3467 $ilTabs->setTabActive(
"obj_sty");
3469 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3470 $lng->loadLanguageModule(
"style");
3472 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
3475 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
3478 if ($fixed_style > 0)
3482 $this->lng->txt(
"global_fixed").
")");
3483 $this->form->addItem($st);
3490 $st_styles[0] = $this->lng->txt(
"default");
3500 $this->form->addItem($st);
3505 $this->form->addCommandButton(
"editStyle",
3506 $lng->txt(
"style_edit_style"));
3507 $this->form->addCommandButton(
"deleteStyle",
3508 $lng->txt(
"style_delete_style"));
3516 $st_styles,
false,
true);
3517 $style_sel =
new ilSelectInputGUI($lng->txt(
"style_current_style"),
"style_id");
3519 $style_sel->setValue($style_id);
3520 $this->form->addItem($style_sel);
3522 $this->form->addCommandButton(
"saveStyleSettings",
3524 $this->form->addCommandButton(
"createStyle",
3525 $lng->txt(
"sty_create_ind_style"));
3528 $this->form->setTitle($lng->txt(
"obj_sty"));
3529 $this->form->setFormAction($ilCtrl->getFormAction($this));
3539 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"create");
3549 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
3559 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
3569 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3570 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
3572 || $this->object->getStyleSheetId() == 0))
3575 $this->
object->update();
3578 $this->ctrl->redirect($this,
"editStyleProperties");
3595 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
3597 $item_list_gui->setContainerObject($this);
3599 $item_list_gui->enableComments(
true);
3600 $item_list_gui->enableNotes(
true);
3601 $item_list_gui->enableTags(
true);
3604 $html = $item_list_gui->getListItemHTML(
$ref_id,
3608 global $ilPluginAdmin;
3609 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"UIComponent",
"uihk");
3610 foreach ($pl_names as $pl)
3613 $gui_class = $ui_plugin->getUIClassInstance();
3614 $resp = $gui_class->getHTML(
"Services/Container",
"async_item_list", array(
"html" => $html));
3617 $html = $gui_class->modifyHTML($html, $resp);
3631 global
$tpl,$ilToolbar;
3639 include_once (
'Services/WebDAV/classes/class.ilDAVServer.php');
3641 $ilToolbar->addButton(
3642 $this->lng->txt(
'mount_webfolder'),
3643 $davServer->getMountURI($this->object->getRefId()),
3646 $davServer->getFolderURI($this->object->getRefId())
3649 $tpl->setContent($this->form->getHTML());
3658 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
3660 $this->form->setFormAction($this->ctrl->getFormAction($this));
3663 $ipass =
new ilPasswordInputGUI($this->lng->txt(
"desired_password"),
"new_password");
3666 $this->form->addItem($ipass);
3667 $this->form->addCommandButton(
"savePassword", $this->lng->txt(
"save"));
3668 $this->form->addCommandButton(
'cancel', $this->lng->txt(
'cancel'));
3670 $this->form->setTitle($this->lng->txt(
"chg_ilias_and_webfolder_password"));
3671 $this->form->setFormAction($this->ctrl->getFormAction($this));
3685 if($form->checkInput())
3687 $ilUser->resetPassword($this->form->getInput(
'new_password'),$this->form->getInput(
'new_password'));
3692 $form->setValuesByPost();
3708 $item_data = $this->
object->getSubItems(
false,
false, (
int)
$_GET[
"child_ref_id"]);
3712 include_once
'./Modules/Session/classes/class.ilEventItems.php';
3714 if(in_array((
int)$_GET[
"child_ref_id"], $event_items))
3716 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
3717 foreach ($this->object->items[
"sess"] as $id)
3720 foreach($items as $event_item)
3722 if ($event_item[
"child"] == (
int)$_GET[
"child_ref_id"])
3725 if((
int)$_GET[
"parent_ref_id"])
3727 $event_item[
"parent"] = (int)$_GET[
"parent_ref_id"];
3729 $html = $container_view->renderItem($event_item);
3738 foreach ($this->object->items[
"_all"] as $id)
3740 if ($id[
"child"] == (
int) $_GET[
"child_ref_id"])
3742 $html = $container_view->renderItem($id);
3752 echo $tpl->getOnLoadCodeForAsynch();
3770 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
3775 $lg->addCustomCommand($this->ctrl->getLinkTarget($this,
'fileManagerLaunch'),
'fm_start',
'_blank');
3789 $tpl =
new ilTemplate(
'tpl.fm_launch_ws.html',
false,
false,
'Services/WebServices/FileManager');
3790 $tpl->setVariable(
'JNLP_URL',ILIAS_HTTP_PATH.
'/Services/WebServices/FileManager/lib/dist/FileManager.jnlp');
3791 $tpl->setVariable(
'SESSION_ID',
$_COOKIE[
'PHPSESSID'].
'::'.CLIENT_ID);
3792 $tpl->setVariable(
'UID',$ilUser->getId());
3793 $tpl->setVariable(
'REF_ID', $this->object->getRefId());
3794 $tpl->setVariable(
'WSDL_URI', ILIAS_HTTP_PATH.
'/webservice/soap/server.php?wsdl');
3796 $tpl->setVariable(
'REST_URI',ILIAS_HTTP_PATH.
'/Services/WebServices/Rest/server.php');
3797 $tpl->setVariable(
'FILE_LOCKS',0);
3800 include_once(
"./Modules/SystemFolder/classes/class.ilObjSystemFolder.php");
3802 $tpl->setVariable(
'HEADER_TITLE',$header_top_title ? $header_top_title :
'');
3819 if (!empty(
$_GET[
"set_mode"]))
3822 if ($ilUser->getId() != ANONYMOUS_USER_ID)
3824 $ilUser->writePref(
"il_rep_mode",
$_GET[
"set_mode"]);
3831 if ($ilUser->getId() != ANONYMOUS_USER_ID)
3833 $_SESSION[
"il_rep_mode"] = $ilUser->getPref(
"il_rep_mode");
3840 $_SESSION[
"il_rep_mode"] = $ilSetting->get(
"default_repository_view");
3843 $mode = (
$_SESSION[
"il_rep_mode"] !=
"")
3847 if ($mode ==
"tree")
3849 include_once(
"./Services/Repository/classes/class.ilRepositoryExplorerGUI.php");
3851 if (!$exp->handleCommand())
3853 $tpl->setLeftNavContent($exp->getHTML());
3868 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
3870 $ru->showTrashTable(
$_GET[
"ref_id"]);
3880 global
$log, $ilAppEventHandler,
$lng;
3882 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
3884 $ru->removeObjectsFromSystem(
$_POST[
"trash_id"]);
3885 $this->ctrl->redirect($this,
"trash");
3893 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
3895 $ru->restoreObjects(
$_GET[
"ref_id"],
$_POST[
"trash_id"]);
3896 $this->ctrl->redirect($this,
"trash");
3905 include_once(
"./Services/Repository/classes/class.ilRepUtilGUI.php");
3907 if(!isset(
$_POST[
"trash_id"]))
3910 $this->ctrl->redirect($this,
"trash");
3914 $ru->confirmRemoveFromSystemObject(
$_POST[
"trash_id"]);