4 require_once
"./classes/class.ilObjectGUI.php";
5 require_once
"./Services/Container/classes/class.ilContainer.php";
6 include_once
'./Services/PersonalDesktop/interfaces/interface.ilDesktopItemHandling.php';
27 function ilContainerGUI($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
31 $this->rbacsystem =& $rbacsystem;
33 $lng->loadLanguageModule(
"cntr");
42 $this->
ilObjectGUI($a_data, $a_id, $a_call_by_reference,
false);
53 $next_class = $this->ctrl->getNextClass();
54 $cmd = $this->ctrl->getCmd(
"render");
59 case "ilpageobjectgui":
61 $tpl->setContent(
$ret);
64 case "ilobjstylesheetgui":
84 $ilTabs->clearTargets();
86 $cmd = $ilCtrl->getCmd();
87 include_once (
"./Services/Style/classes/class.ilObjStyleSheetGUI.php");
88 $this->ctrl->setReturn($this,
"editStyleProperties");
89 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
91 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
93 $style_gui->setCreationMode(
true);
96 if (
$cmd ==
"confirmedDelete")
98 $this->
object->setStyleSheetId(0);
99 $this->
object->update();
102 $ret = $this->ctrl->forwardCommand($style_gui);
104 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
107 $this->
object->setStyleSheetId($style_id);
108 $this->
object->update();
109 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
121 $cmd = $ilCtrl->getCmd();
123 if (in_array(
$cmd, array(
"displayMediaFullscreen")))
132 $ilTabs->clearTargets();
138 $ilTabs->setBackTarget($lng->txt(
"cntr_back_to_old_editor"),
139 $ilCtrl->getLinkTarget($this,
"switchToOldEditor"),
"_top");
143 $ilTabs->setBackTarget($lng->txt(
"back"),
"./goto.php?target=".$this->object->getType().
"_".
144 $this->
object->getRefId(),
"_top");
148 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
149 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
151 $lng->loadLanguageModule(
"content");
153 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
154 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
157 $this->tpl->setCurrentBlock(
"SyntaxStyle");
158 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
160 $this->tpl->parseCurrentBlock();
163 $this->
object->getId()))
166 $new_page_object =
new ilPageObject($this->object->getType());
167 $new_page_object->
setParentId($this->object->getId());
168 $new_page_object->setId($this->object->getId());
169 $new_page_object->createFromXML();
175 $this->ctrl->setReturnByClass(
"ilpageobjectgui",
"edit");
182 $this->
object->getId());
183 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
185 $this->object->getStyleSheetId(), $this->
object->getType()));
191 $page_gui->setIntLinkHelpDefault(
"StructureObject",
$_GET[
"ref_id"]);
192 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
193 $page_gui->setLinkXML($link_xml);
195 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
196 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"showMediaFullscreen"));
199 $page_gui->setPresentationTitle(
"");
200 $page_gui->setTemplateOutput(
false);
202 $page_gui->setHeader(
"");
203 $page_gui->setEnabledRepositoryObjects(
true);
204 $page_gui->setEnabledFileLists(
false);
205 $page_gui->setEnabledMaps(
true);
206 $page_gui->setEnabledPCTabs(
true);
213 $wtpl =
new ilTemplate(
"tpl.cntr_old_editor_message.html",
true,
214 true,
"Services/Container");
215 $wtpl->setVariable(
"ALT_WARNING", $lng->txt(
"warning"));
216 $wtpl->setVariable(
"IMG_WARNING",
218 $wtpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_switch_to_new_editor_message"));
219 $wtpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_switch_to_new_editor_message"));
220 $wtpl->setVariable(
"HREF_SWITCH_TO_NEW_EDITOR",
221 $ilCtrl->getLinkTarget($this,
"useNewEditor"));
222 $wtpl->setVariable(
"TXT_MIGRATION_SWITCH",
223 $lng->txt(
"cntr_switch_to_new_editor_cmd"));
224 $page_gui->setPrependingHtml($wtpl->get());
228 $page_gui->setTabHook($this,
"addPageTabs");
230 $ret =& $this->ctrl->forwardCommand($page_gui);
243 $ilTabs->addTarget(
"obj_sty",
244 $ilCtrl->getLinkTarget($this,
'editStyleProperties'),
"editStyleProperties");
254 if (!$ilSetting->get(
"enable_cat_page_edit"))
264 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
266 return $xpage->getContent();
274 include_once(
"./Services/COPage/classes/class.ilPageUtil.php");
276 $this->
object->getId()))
280 include_once(
"./Services/COPage/classes/class.ilPageObject.php");
281 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
283 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
284 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
286 $this->tpl->setCurrentBlock(
"SyntaxStyle");
287 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
289 $this->tpl->parseCurrentBlock();
293 $this->
object->getId());
294 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
296 $this->object->getStyleSheetId(), $this->
object->getType()));
298 $page_gui->setIntLinkHelpDefault(
"StructureObject",
$_GET[
"ref_id"]);
300 $page_gui->setLinkXML($link_xml);
301 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
305 $page_gui->setPresentationTitle(
"");
306 $page_gui->setTemplateOutput(
false);
308 $page_gui->setHeader(
"");
309 $page_gui->setEnabledRepositoryObjects(
true);
310 $page_gui->setEnabledFileLists(
false);
311 $page_gui->setEnabledPCTabs(
true);
312 $page_gui->setEnabledMaps(
true);
313 $ret = $page_gui->showPage();
324 if (parent::prepareOutput())
329 #$this->showPossibleSubObjects();
333 include_once
'./Services/Container/classes/class.ilMemberViewGUI.php';
344 if (
$_GET[
"obj_id"] !=
"")
349 include_once
'./Services/Container/classes/class.ilMemberViewSettings.php';
355 $mode = (
$_SESSION[
"il_rep_mode"] ==
"flat")
358 $link =
"repository.php?cmd=frameset&set_mode=".$mode.
"&ref_id=".$this->
object->getRefId();
359 $tpl->setTreeFlatIcon($link, $mode);
371 $this->tpl->setTitle($this->object->getTitle());
372 $this->tpl->setDescription($this->object->getLongDescription());
376 if ($ilias->getSetting(
"custom_icons") &&
377 in_array($this->object->getType(), array(
"cat",
"grp",
"crs",
"root")))
379 require_once(
"./Services/Container/classes/class.ilContainer.php");
385 $this->tpl->setTitleIcon($icon, $this->lng->txt(
"obj_".$this->object->getType()));
398 $cmd = ($this->cmd !=
"")
400 : $this->ctrl->getCmd();
402 $type = $this->
object->getType();
404 $d = $this->objDefinition->getCreatableSubObjects(
$type);
405 include_once(
"./Services/Repository/classes/class.ilRepositoryObjectPluginSlot.php");
417 if ($row[
"max"] ==
"" || $count < $row[
"max"])
419 if (!in_array($row[
"name"], array(
"rolf")))
421 if ($this->rbacsystem->checkAccess(
"create", $this->object->getRefId(), $row[
"name"]))
425 $subobj[] = array(
"value" => $row[
"name"],
426 "title" => $lng->txt(
"obj_".$row[
"name"]),
428 "alt" => $lng->txt(
"obj_".$row[
"name"]));
432 include_once(
"./Services/Component/classes/class.ilPlugin.php");
433 $subobj[] = array(
"value" => $row[
"name"],
436 "alt" => $lng->txt(
"obj_".$row[
"name"]));
444 if (is_array($subobj))
446 $formaction =
"repository.php?ref_id=".$this->object->getRefId().
"&cmd=post";
451 $subobj,
"create", $this->lng->txt(
"add"));
462 switch ($this->object->getViewMode())
466 include_once(
"./Services/Container/classes/class.ilContainerSimpleContentGUI.php");
471 include_once(
'./Services/Container/classes/class.ilContainerObjectiveGUI.php');
478 include_once(
"./Services/Container/classes/class.ilContainerSessionsContentGUI.php");
484 include_once
'Services/Container/classes/class.ilContainerILincContentGUI.php';
491 include_once(
"./Services/Container/classes/class.ilContainerByTypeContentGUI.php");
496 $container_view->setOutput();
498 $this->adminCommands = $container_view->adminCommands;
502 if ($ilCtrl->getNextClass() !=
"ilcolumngui")
512 $ilTabs->activateSubTab(
"manage");
516 $ilTabs->activateSubTab(
"view_content");
535 global $ilUser,
$lng;
542 if ($this->object->gotItems())
544 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"delete",
545 $this->lng->txt(
"delete_selected_items"),
true);
546 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"cut",
547 $this->lng->txt(
"move_selected_items"));
548 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"link",
549 $this->lng->txt(
"link_selected_items"));
563 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"clear",
564 $this->lng->txt(
"clear_clipboard"));
567 $this->ctrl->setParameter($this,
"type",
"");
568 $this->ctrl->setParameter($this,
"item_ref_id",
"");
569 $GLOBALS[
"tpl"]->setPageFormAction($this->ctrl->getFormAction($this));
571 if ($this->edit_order)
573 if($this->object->gotItems() and $ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
575 include_once(
'./Services/Container/classes/class.ilContainer.php');
579 $GLOBALS[
"tpl"]->addAdminPanelCommand(
"saveSorting",
580 $this->lng->txt(
'sorting_save'));
590 if(!$tree->checkForParentType($this->object->getRefId(),
'crs'))
594 $tpl->setCurrentBlock(
"custom_button");
595 $tpl->setVariable(
"ADMIN_MODE_LINK",$this->ctrl->getLinkTargetByClass(
'ilcoursecontentgui',
'editTimings'));
596 $tpl->setVariable(
"TXT_ADMIN_MODE",$this->lng->txt(
'timings_edit'));
597 $tpl->parseCurrentBlock();
605 $GLOBALS[
"tpl"]->setPermanentLink($this->object->getType(),
606 $this->
object->getRefId(),
"",
"_top");
617 $ilCtrl->redirect($this,
"editPageFrame");
628 $ilCtrl->redirect($this,
"editPageFrame");
638 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
640 include_once(
"./Services/XHTMLPage/classes/class.ilXHTMLPage.php");
657 $ilCtrl->redirect($this,
"editPageFrame");
665 include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
668 $fs_gui->setFramesetTitle($this->object->getTitle());
669 $fs_gui->setMainFrameName(
"content");
670 $fs_gui->setSideFrameName(
"link_list");
675 if ($xpage_id > 0 &&
$_SESSION[
"il_cntr_editor"] !=
"std")
677 $fs_gui->setMainFrameSource(
678 $this->ctrl->getLinkTarget(
679 $this,
"editPageContent"));
680 $fs_gui->setSideFrameSource(
681 $this->ctrl->getLinkTarget($this,
"showLinkList"));
685 $fs_gui->setMainWidth(
"100%");
686 $fs_gui->setSideWidth(
"0");
689 $fs_gui->setSideFrameSource(
"");
692 $fs_gui->setMainFrameSource(
693 $this->ctrl->getLinkTargetByClass(
694 array(
"ilpageobjectgui"),
"edit"));
710 if (!$rbacsystem->checkAccess(
"write", $this->ref_id))
712 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_write"),$this->ilias->error_obj->MESSAGE);
719 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
721 $content = $xpage->getContent();
725 $tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.container_edit_page_content.html",
726 "Services/Container");
728 $tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
729 $tpl->setVariable(
"TXT_EDIT_PAGE_CONTENT",
730 $this->lng->txt(
"edit_page_content"));
731 $tpl->setVariable(
"TXT_SAVE", $this->lng->txt(
"save"));
732 $tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
733 $tpl->setVariable(
"TXT_MIGRATION_INFO", $lng->txt(
"cntr_old_editor_warning"));
734 $tpl->setVariable(
"TXT_MIGRATION_OPEN_STD_EDITOR", $lng->txt(
"cntr_old_editor_open_standard_editor"));
736 $tpl->setVariable(
"HREF_OPEN_STD_EDITOR", $ilCtrl->getLinkTarget($this,
"switchToStdEditor"));
737 $tpl->setVariable(
"ALT_WARNING", $lng->txt(
"warning"));
739 include_once(
"./Services/Form/classes/class.ilFormPropertyGUI.php");
740 include_once(
"./Services/Form/classes/class.ilTextAreaInputGUI.php");
745 include_once
"./Services/RTE/classes/class.ilRTE.php";
747 include_once
"./Services/RTE/classes/class.$rtestring.php";
748 $rte =
new $rtestring();
750 include_once
"./classes/class.ilObject.php";
753 $rte->addRTESupport(
$obj_id, $obj_type);
760 include_once(
"Services/XHTMLPage/classes/class.ilXHTMLPage.php");
761 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
781 $xpage->setContent($text);
787 $xpage->setContent($text);
790 "xhtml_page", $xpage->getId());
793 include_once(
"Services/RTE/classes/class.ilRTE.php");
795 $this->
object->getId());
798 $this->ctrl->redirect($this,
"");
803 $this->ctrl->redirect($this,
"");
810 include_once(
"classes/class.ilObjectListGUIFactory.php");
815 $type_grps = $this->
object->getGroupedObjTypes();
834 $this->type_template = array();
838 foreach ($type_grps as
$type => $v)
841 if (is_int(strpos($output_html,
"[list-".
$type.
"]")))
848 $tpl =& $overall_tpl;
852 if (is_array($this->items[
$type]))
855 $item_html = array();
857 foreach($this->items[$type] as
$key => $item)
860 if ($cur_obj_type != $item[
"type"])
863 $item_list_gui->setContainerObject($this);
866 $ilBench->start(
"ilContainerGUI",
"0210_getListHTML");
871 $item_list_gui->enableDelete(
false);
872 $item_list_gui->enableLink(
false);
873 $item_list_gui->enableCut(
false);
874 $item_list_gui->enableCopy(
false);
877 $html = $item_list_gui->getListItemHTML($item[
"ref_id"],
878 $item[
"obj_id"], $item[
"title"], $item[
"description"]);
882 $this->determineAdminCommands($item[
"ref_id"],
883 $item_list_gui->adminCommandsIncluded());
884 $ilBench->stop(
"ilContainerGUI",
"0210_getListHTML");
888 $item_html[] = array(
890 "item_ref_id" => $item[
"ref_id"],
891 "item_obj_id" => $item[
"obj_id"],
892 'item_icon_image_type' => (method_exists($item_list_gui,
'getIconImageType')) ?
893 $item_list_gui->getIconImageType() :
901 if (count($item_html) > 0)
904 if (!$first && $overall)
906 $this->addSeparatorRow(
$tpl);
915 if ($this->ilias->getSetting(
"icon_position_in_lists") ==
"item_rows")
926 $this->current_position = 1;
927 foreach($item_html as $item)
930 $this->
addStandardRow(
$tpl, $item[
"html"], $item[
"item_ref_id"], $item[
"item_obj_id"], $item[
'item_icon_image_type']);
935 if (is_int(strpos($output_html,
"[list-".$type.
"]")))
948 $this->lng->txt(
"msg_no_type_accessible"),
$type);
961 $this->lng->txt(
"msg_no_type_available"),
$type);
971 if ($output_html !=
"")
975 $output_html.= $overall_tpl->get();
980 foreach ($this->type_template as
$type =>
$tpl)
982 $output_html = eregi_replace(
"\[list-".
$type.
"\]",
983 "</p>".$tpl->get().
"<p class=\"ilc_Standard\">",
991 $page_block =
new ilTemplate(
"tpl.container_page_block.html",
false,
false,
992 "Services/Container");
993 $page_block->setVariable(
"CONTAINER_PAGE_CONTENT", $output_html);
994 $output_html = $page_block->get();
1003 return $output_html;
1010 $tpl =
new ilTemplate(
"tpl.container_link_help.html",
true,
true);
1012 $type_ordering = array(
1013 "cat",
"fold",
"crs",
"icrs",
"icla",
"grp",
"chat",
"frm",
"lres",
1014 "glo",
"webr",
"file",
"exc",
1015 "tst",
"svy",
"mep",
"qpl",
"spl");
1017 $childs = $tree->getChilds(
$_GET[
"ref_id"]);
1018 foreach($childs as $child)
1020 if (in_array($child[
"type"], array(
"lm",
"dbk",
"sahs",
"htlm")))
1026 $cnt[$child[
"type"]]++;
1031 $tpl->setVariable(
"TXT_HELP_HEADER", $lng->txt(
"help"));
1032 foreach($type_ordering as
$type)
1034 $tpl->setCurrentBlock(
"row");
1035 $tpl->setVariable(
"ROWCOL",
"tblrow".((($i++)%2)+1));
1036 if ($type !=
"lres")
1038 $tpl->setVariable(
"TYPE", $lng->txt(
"objs_".$type).
1039 " (".((int)$cnt[$type]).
")");
1043 $tpl->setVariable(
"TYPE", $lng->txt(
"learning_resources").
1044 " (".((int)$cnt[
"lres"]).
")");
1046 $tpl->setVariable(
"TXT_LINK",
"[list-".$type.
"]");
1047 $tpl->parseCurrentBlock();
1059 $this->adminCommands =
false;
1091 $tpl =
new ilTemplate (
"tpl.container_list_block.html",
true,
true,
1092 "Services/Container");
1093 $this->cur_row_type =
"row_type_1";
1107 $title = $this->lng->txt(
"objs_".$a_type);
1111 $a_tpl->setCurrentBlock(
"container_header_row_image");
1112 $a_tpl->setVariable(
"HEADER_IMG", $icon);
1113 $a_tpl->setVariable(
"HEADER_ALT",
$title);
1117 $a_tpl->setCurrentBlock(
"container_header_row");
1120 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT",
$title);
1121 $a_tpl->parseCurrentBlock();
1122 $a_tpl->touchBlock(
"container_row");
1135 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1139 $a_tpl->touchBlock($this->cur_row_type);
1142 if ($this->ilias->getSetting(
"icon_position_in_lists") ==
"item_rows")
1145 $alt = $this->lng->txt(
"obj_".$a_image_type);
1148 if ($this->ilias->getSetting(
"custom_icons") &&
1149 in_array($a_image_type, array(
"cat",
"grp",
"crs")))
1151 require_once(
"./Services/Container/classes/class.ilContainer.php");
1158 $a_tpl->setCurrentBlock(
"block_row_image");
1159 $a_tpl->setVariable(
"ROW_IMG", $icon);
1160 $a_tpl->setVariable(
"ROW_ALT", $alt);
1161 $a_tpl->parseCurrentBlock();
1167 $a_tpl->setCurrentBlock(
"block_row_check");
1168 $a_tpl->setVariable(
"ITEM_ID", $a_item_ref_id);
1169 $a_tpl->parseCurrentBlock();
1172 include_once(
'Services/Container/classes/class.ilContainerSortingSettings.php');
1176 $a_tpl->setCurrentBlock(
'block_position');
1177 $a_tpl->setVariable(
'POS_TYPE',$a_image_type);
1178 $a_tpl->setVariable(
'POS_ID',$a_item_ref_id);
1179 $a_tpl->setVariable(
'POSITION',sprintf(
'%.1f',$this->current_position++));
1180 $a_tpl->parseCurrentBlock();
1184 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1186 $a_tpl->setCurrentBlock(
"container_standard_row");
1187 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
1188 $a_tpl->parseCurrentBlock();
1189 $a_tpl->touchBlock(
"container_row");
1197 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
1201 $a_tpl->touchBlock($this->cur_row_type);
1203 $type = $this->lng->txt(
"obj_".$a_type);
1204 $a_message = str_replace(
"[type]",
$type, $a_message);
1206 $a_tpl->setVariable(
"ROW_NBSP",
" ");
1208 $a_tpl->setCurrentBlock(
"container_standard_row");
1209 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT",
1211 $a_tpl->parseCurrentBlock();
1212 $a_tpl->touchBlock(
"container_row");
1217 $this->cur_row_type =
"";
1229 || strtolower($this->ctrl->getCmdClass()) !=
"ilpageobjectgui")
1234 $lng->loadLanguageModule(
"content");
1239 $this->tabs_gui->setBackTarget($this->lng->txt(
"obj_cat"),
1240 $this->ctrl->getLinkTarget($this,
"frameset"),
1243 $this->tabs_gui->addTarget(
"edit", $this->ctrl->getLinkTargetByClass(
"ilpageobjectgui",
"view")
1244 , array(
"",
"view"),
"ilpageobjectgui");
1256 if (!is_object($this->
object))
1261 if ($a_include_view && $ilAccess->checkAccess(
"read",
"", $this->object->getRefId()))
1265 $ilTabs->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTarget($this,
""));
1269 $ilTabs->addSubTab(
"view_content", $lng->txt(
"view"), $ilCtrl->getLinkTarget($this,
"disableAdministrationPanel"));
1273 if ( $ilUser->getId() != ANONYMOUS_USER_ID &&
1274 ($this->adminCommands ||
1275 (is_object($this->
object) &&
1276 ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId())))
1278 (is_object($this->
object) &&
1279 ($this->
object->getHiddenFilesFound())) ||
1286 $ilTabs->addSubTab(
"manage", $lng->txt(
"cntr_manage"), $ilCtrl->getLinkTarget($this,
""));
1290 $ilTabs->addSubTab(
"manage", $lng->txt(
"cntr_manage"), $ilCtrl->getLinkTarget($this,
"enableAdministrationPanel"));
1293 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1294 is_object($this->
object) &&
1295 $ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
1299 $ilTabs->addSubTab(
"ordering", $lng->txt(
"cntr_ordering"), $ilCtrl->getLinkTarget($this,
"editOrder"));
1301 if ($ilUser->getId() != ANONYMOUS_USER_ID &&
1302 is_object($this->
object) &&
1303 $ilAccess->checkAccess(
"write",
"", $this->object->getRefId())
1306 if ($ilSetting->get(
"enable_cat_page_edit"))
1308 $ilTabs->addSubTab(
"page_editor", $lng->txt(
"cntr_text_media_editor"), $ilCtrl->getLinkTarget($this,
"editPageFrame"),
1324 if ($rbacsystem->checkAccess(
'edit_permission',$this->ref_id))
1326 $tabs_gui->addTarget(
"perm_settings",
1327 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
1328 array(
"perm",
"info",
"owner"),
'ilpermissiongui');
1329 if ($ilCtrl->getNextClass() ==
"ilpermissiongui")
1331 $tabs_gui->activateTab(
"perm_settings");
1336 if ($this->ctrl->getTargetScript() ==
"repository.php" and !empty(
$_SESSION[
"clipboard"]))
1338 $tabs_gui->addTarget(
"clipboard",
1339 $this->ctrl->getLinkTarget($this,
"clipboard"),
"clipboard", get_class($this));
1354 $_SESSION[
"il_cont_admin_panel"] =
true;
1355 $this->ctrl->redirect($this,
"render");
1363 $_SESSION[
"il_cont_admin_panel"] =
false;
1364 $this->ctrl->redirect($this,
"render");
1374 $this->edit_order =
true;
1375 $_SESSION[
"il_cont_admin_panel"] =
false;
1378 $ilTabs->activateSubTab(
"ordering");
1387 return $this->edit_order ?
true :
false;
1399 if((
int)$ilSetting->get(
'disable_my_offers'))
1404 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
1416 if((
int)$ilSetting->get(
'disable_my_offers'))
1421 include_once
'./Services/PersonalDesktop/classes/class.ilDesktopItemGUI.php';
1429 global
$tree, $ilUser, $rbacsystem;
1431 if (!$rbacsystem->checkAccess(
"write",
$_GET[
'item_ref_id']))
1433 $this->ilErr->raiseError($this->lng->txt(
'err_no_permission'),$this->ilErr->MESSAGE);
1437 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
1440 require_once
'Services/WebDAV/classes/class.ilDAVLocks.php';
1444 $ilUser->getId(), $ilUser->getLogin(),
1445 'ref_'.$_GET[
'item_ref_id'].
'_usr_'.$ilUser->getId(),
1446 time() + 60, 0,
'exclusive'
1469 if (
$_GET[
"item_ref_id"] !=
"")
1478 if (!isset(
$_POST[
"id"]))
1480 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1487 $node_data = $this->tree->getNodeData($ref_id);
1488 $subtree_nodes = $this->tree->getSubTree($node_data);
1490 $all_node_data[] = $node_data;
1491 $all_subtree_nodes[] = $subtree_nodes;
1494 foreach ($subtree_nodes as $node)
1496 if($node[
'type'] ==
'rolf')
1501 if (!$rbacsystem->checkAccess(
'delete',$node[
"ref_id"]))
1503 $no_cut[] = $node[
"ref_id"];
1510 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_cut").
" ".implode(
',',$this->
getTitlesByRefId($no_cut)),
1511 $this->ilias->error_obj->MESSAGE);
1515 $_SESSION[
"clipboard"][
"cmd"] = $ilCtrl->getCmd();
1534 global $clipboard, $rbacsystem, $rbacadmin,
$ilCtrl;
1536 if (
$_GET[
"item_ref_id"] !=
"")
1541 if (!isset(
$_POST[
"id"]))
1543 $this->ilias->raiseError($this->lng->txt(
"no_checkbox"),$this->ilias->error_obj->MESSAGE);
1549 if (!$rbacsystem->checkAccess(
'delete',$ref_id))
1554 $object =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
1556 if (!$this->objDefinition->allowLink(
$object->getType()))
1558 $no_link[] =
$object->getType();
1565 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_link").
" ".
1566 implode(
',',$no_cut),$this->ilias->error_obj->MESSAGE);
1569 if (count($no_link))
1571 $no_link = array_unique($no_link);
1573 foreach ($no_link as
$type)
1575 $txt_objs[] = $this->lng->txt(
"objs_".$type);
1578 $this->ilias->raiseError(implode(
', ',$txt_objs).
" ".$this->lng->txt(
"msg_obj_no_link"),$this->ilias->error_obj->MESSAGE);
1585 $clipboard[
"parent"] =
$_GET[
"ref_id"];
1586 $clipboard[
"cmd"] = $ilCtrl->getCmd();
1588 foreach (
$_POST[
"id"] as $ref_id)
1590 $clipboard[
"ref_ids"][] =
$ref_id;
1614 if (isset(
$_POST[
"cmd"][
"clear"]))
1618 $this->ctrl->returnToParent($this);
1625 global $rbacsystem, $rbacadmin, $rbacreview,
$log,
$tree, $ilObjDataCache, $ilUser;
1627 if(!in_array(
$_SESSION[
'clipboard'][
'cmd'], array(
'cut',
'link')))
1629 $message = __METHOD__.
": cmd was neither 'cut' nor 'link'; may be a hack attempt!";
1630 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
1633 if(
$_SESSION[
'clipboard'][
'cmd'] ==
'cut')
1636 $_POST[
'nodes'] = array($_POST[
'node']);
1639 if(!is_array(
$_POST[
'nodes']) || !count(
$_POST[
'nodes']))
1642 if(
$_SESSION[
'clipboard'][
'cmd'] ==
'cut')
1650 $folder_objects_cache = array();
1654 $current_parent_id = $tree->getParentId($obj_data->getRefId());
1656 foreach(
$_POST[
'nodes'] as $folder_ref_id)
1658 if(!array_key_exists($folder_ref_id, $folder_objects_cache))
1664 if(!$rbacsystem->checkAccess(
'create', $folder_ref_id, $obj_data->getType()))
1666 $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().
']');
1670 if($folder_ref_id == $current_parent_id)
1672 $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().
']');
1676 if($tree->isGrandChild($ref_id, $folder_ref_id))
1678 $is_child[] = sprintf($this->lng->txt(
'msg_paste_object_not_in_itself'), $obj_data->getTitle().
' ['.$obj_data->getRefId().
']');
1682 if(!in_array($obj_data->getType(), array_keys($this->objDefinition->getSubObjects($folder_objects_cache[$folder_ref_id]->getType()))))
1684 $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().
']', $obj_data->getType());
1693 $error .= implode(
'<br />', $exists);
1696 if(count($is_child))
1699 $error .= implode(
'<br />', $is_child);
1702 if(count($not_allowed_subobject))
1705 $error .= implode(
'<br />', $not_allowed_subobject);
1708 if(count($no_paste))
1711 $error .= implode(
'<br />', $no_paste);
1717 if(
$_SESSION[
'clipboard'][
'cmd'] ==
'cut')
1725 $log->write(__METHOD__.
", cmd: ".
$_SESSION[
"clipboard"][
"cmd"]);
1731 $ref_ids =
$_SESSION[
'clipboard'][
'ref_ids'];
1732 unset(
$_SESSION[
'clipboard'][
'ref_ids']);
1735 if(
$_SESSION[
'clipboard'][
'cmd'] ==
'cut')
1737 foreach(
$_POST[
'nodes'] as $folder_ref_id)
1739 foreach($ref_ids as $ref_id)
1742 $old_parent = $tree->getParentId($ref_id);
1743 $tree->moveTree($ref_id, $folder_ref_id);
1744 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1746 include_once(
'classes/class.ilConditionHandler.php');
1752 $node_data = $tree->getNodeData($ref_id);
1753 $old_parent_data = $tree->getNodeData($old_parent);
1755 $old_parent_data[
'obj_id']);
1757 $ilObjDataCache->lookupObjId($folder_ref_id));
1771 if(
$_SESSION[
'clipboard'][
'cmd'] ==
'link')
1773 $linked_to_folders = array();
1775 foreach(
$_POST[
'nodes'] as $folder_ref_id)
1777 $linked_to_folders[] = $ilObjDataCache->lookupTitle($ilObjDataCache->lookupObjId($folder_ref_id));
1779 foreach($ref_ids as $ref_id)
1782 $top_node = $tree->getNodeData($ref_id);
1785 $subnodes[
$ref_id] = $tree->getSubtree($top_node);
1789 foreach($subnodes as
$key => $subnode)
1793 $new_ref_id = $obj_data->createReference();
1794 $obj_data->putInTree($folder_ref_id);
1795 $obj_data->setPermissions($folder_ref_id);
1798 array_shift($subnode);
1801 $mapping[$new_ref_id] =
$key;
1804 $old_ref_id = $obj_data->getRefId();
1805 $obj_data->setRefId($new_ref_id);
1806 $obj_data->initDefaultRoles();
1807 $rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());
1809 if(isset($rolf_data[
'child']))
1812 $rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);
1817 $mapping[$rolf_data[
'child']] = (int)$rolf_data_old[
'child'];
1820 $log->write(__METHOD__.
", created role folder (ref_id): ".$rolf_data[
'child'].
1821 ", for object ref_id:".$obj_data->getRefId().
", obj_id: ".$obj_data->getId().
1822 ", type: ".$obj_data->getType().
", title: ".$obj_data->getTitle());
1829 $node_data = $tree->getNodeData($new_ref_id);
1831 $ilObjDataCache->lookupObjId($folder_ref_id));
1837 if(count($subnode) > 0)
1839 foreach($subnode as $node)
1841 if($node[
'type'] !=
'rolf')
1844 $new_ref_id = $obj_data->createReference();
1847 $new_parent = array_search($node[
"parent"],$mapping);
1849 $mapping[$new_ref_id] = (int)$node[
'child'];
1851 $obj_data->putInTree($new_parent);
1852 $obj_data->setPermissions($new_parent);
1855 $old_ref_id = $obj_data->getRefId();
1856 $obj_data->setRefId($new_ref_id);
1857 $obj_data->initDefaultRoles();
1858 $rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());
1860 if(isset($rolf_data[
'child']))
1863 $rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);
1868 $mapping[$rolf_data[
'child']] = (int)$rolf_data_old[
'child'];
1871 $log->write(__METHOD__.
", created role folder (ref_id): ".$rolf_data[
'child'].
1872 ", for object ref_id:".$obj_data->getRefId().
", obj_id: ".$obj_data->getId().
1873 ", type: ".$obj_data->getType().
", title: ".$obj_data->getTitle());
1879 foreach($subnodes as $old_ref => $subnode)
1881 $new_ref = array_search($old_ref, $mapping);
1883 foreach($subnode as $node)
1885 $node[
'child'] = array_search($node[
'child'], $mapping);
1886 $node[
'parent'] = array_search($node[
'parent'], $mapping);
1887 $new_subnodes[
$ref_id][] = $node;
1895 $log->write(__METHOD__.
', link finished');
1898 ilUtil::sendSuccess(sprintf($this->lng->txt(
'mgs_objects_linked_to_the_following_folders'), implode(
', ', $linked_to_folders)),
true);
1904 $this->ctrl->returnToParent($this);
1912 $_SESSION[
'paste_linked_repexpand'] = array();
1918 $path = $tree->getPathId((
int)
$_GET[
'ref_id']);
1919 foreach((array)$path as $node_id)
1921 if(!in_array($node_id,
$_SESSION[
'paste_linked_repexpand']))
1922 $_SESSION[
'paste_linked_repexpand'][] = $node_id;
1930 global $ilTabs, $ilToolbar;
1932 $ilTabs->setTabActive(
'view_content');
1934 if(!in_array(
$_SESSION[
'clipboard'][
'cmd'], array(
'link')))
1936 $message = __METHOD__.
": cmd was not 'link'; may be a hack attempt!";
1937 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
1940 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paste_into_multiple_objects.html');
1942 require_once
'classes/class.ilPasteIntoMultipleItemsExplorer.php';
1944 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showLinkIntoMultipleObjectsTree'));
1945 $exp->setTargetGet(
'ref_id');
1946 $exp->setPostVar(
'nodes[]');
1947 is_array(
$_POST[
'nodes']) ? $exp->setCheckedItems((array)
$_POST[
'nodes']) : $exp->setCheckedItems(array());
1949 if(
$_GET[
'paste_linked_repexpand'] ==
'')
1951 $expanded = $this->tree->readRootId();
1955 $expanded =
$_GET[
'paste_linked_repexpand'];
1958 $this->tpl->setVariable(
'FORM_TARGET',
'_top');
1959 $this->tpl->setVariable(
'FORM_ACTION', $this->ctrl->getFormAction($this,
'performPasteIntoMultipleObjects'));
1961 $exp->setExpand($expanded);
1964 $output = $exp->getOutput();
1966 $this->tpl->setVariable(
'OBJECT_TREE', $output);
1968 $this->tpl->setVariable(
'CMD_SUBMIT',
'performPasteIntoMultipleObjects');
1969 $this->tpl->setVariable(
'TXT_SUBMIT', $this->lng->txt(
'paste'));
1971 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getParentReturnByClass(get_class($this)));
1979 $_SESSION[
'paste_cut_repexpand'] = array();
1985 $path = $tree->getPathId((
int)
$_GET[
'ref_id']);
1986 foreach((array)$path as $node_id)
1988 if(!in_array($node_id,
$_SESSION[
'paste_cut_repexpand']))
1989 $_SESSION[
'paste_cut_repexpand'][] = $node_id;
1997 global $ilTabs, $ilToolbar;
1999 $ilTabs->setTabActive(
'view_content');
2001 if(!in_array(
$_SESSION[
'clipboard'][
'cmd'], array(
'cut')))
2003 $message = __METHOD__.
": cmd was not 'cut'; may be a hack attempt!";
2004 $this->ilias->raiseError($message, $this->ilias->error_obj->WARNING);
2007 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paste_into_multiple_objects.html');
2009 require_once
'classes/class.ilPasteIntoMultipleItemsExplorer.php';
2011 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showMoveIntoObjectTree'));
2012 $exp->setTargetGet(
'ref_id');
2013 $exp->setPostVar(
'node');
2014 $exp->setCheckedItems(array((
int)
$_POST[
'node']));
2016 if(
$_GET[
'paste_cut_repexpand'] ==
'')
2018 $expanded = $this->tree->readRootId();
2022 $expanded =
$_GET[
'paste_cut_repexpand'];
2025 $this->tpl->setVariable(
'FORM_TARGET',
'_top');
2026 $this->tpl->setVariable(
'FORM_ACTION', $this->ctrl->getFormAction($this,
'performPasteIntoMultipleObjects'));
2028 $exp->setExpand($expanded);
2031 $output = $exp->getOutput();
2033 $this->tpl->setVariable(
'OBJECT_TREE', $output);
2035 $this->tpl->setVariable(
'CMD_SUBMIT',
'performPasteIntoMultipleObjects');
2036 $this->tpl->setVariable(
'TXT_SUBMIT', $this->lng->txt(
'paste'));
2038 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getParentReturnByClass(get_class($this)));
2049 global $rbacsystem, $rbacadmin, $rbacreview,
$log,
$tree;
2050 global $ilUser,
$lng;
2053 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
2057 if (!in_array(
$_SESSION[
"clipboard"][
"cmd"],array(
"cut",
"link",
"copy")))
2059 $message = get_class($this).
"::pasteObject(): cmd was neither 'cut','link' or 'copy'; may be a hack attempt!";
2060 $this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);
2066 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId($ref_id);
2069 if (!$rbacsystem->checkAccess(
'create',$this->object->getRefId(), $obj_data->getType()))
2072 $no_paste_titles[] = $obj_data->getTitle();
2076 if ($this->object->getRefId() == $this->tree->getParentId($obj_data->getRefId()))
2083 if ($this->tree->isGrandChild($ref_id,$this->object->getRefId()))
2089 $obj_type = $obj_data->getType();
2091 if (!in_array($obj_type, array_keys($this->objDefinition->getSubObjects($this->object->getType()))))
2093 $not_allowed_subobject[] = $obj_data->getType();
2100 if (count($exists) &&
$_SESSION[
"clipboard"][
"cmd"] !=
"copy")
2103 $this->ilias->raiseError($this->lng->txt(
"msg_obj_exists"),$this->ilias->error_obj->MESSAGE);
2106 if (count($is_child))
2108 $this->ilias->raiseError($this->lng->txt(
"msg_not_in_itself").
" ".implode(
',',$is_child),
2109 $this->ilias->error_obj->MESSAGE);
2112 if (count($not_allowed_subobject))
2114 $this->ilias->raiseError($this->lng->txt(
"msg_may_not_contain").
" ".implode(
',',$not_allowed_subobject),
2115 $this->ilias->error_obj->MESSAGE);
2118 if (count($no_paste))
2120 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_paste").
" ".
2121 implode(
',',$no_paste),$this->ilias->error_obj->MESSAGE);
2125 $log->write(
"ilObjectGUI::pasteObject(), cmd: ".
$_SESSION[
"clipboard"][
"cmd"]);
2131 $ref_ids =
$_SESSION[
"clipboard"][
"ref_ids"];
2132 unset(
$_SESSION[
"clipboard"][
"ref_ids"]);
2136 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"copy")
2138 foreach($ref_ids as $ref_id)
2140 $revIdMapping = array();
2142 $oldNode_data = $tree->getNodeData($ref_id);
2143 if ($oldNode_data[
'parent'] == $this->object->getRefId())
2145 require_once
'Modules/File/classes/class.ilObjFileAccess.php';
2147 $newRef = $this->
cloneNodes($ref_id, $this->object->getRefId(), $refIdMapping, $newTitle);
2151 $newRef = $this->
cloneNodes($ref_id, $this->object->getRefId(), $refIdMapping, null);
2158 $old_parent_data = $tree->getParentNodeData($ref_id);
2159 $newNode_data = $tree->getNodeData($newRef);
2162 $this->
object->getId());
2167 $log->write(
"ilObjectGUI::pasteObject(), copy finished");
2172 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"cut")
2175 foreach($ref_ids as $ref_id)
2178 $old_parent = $tree->getParentId($ref_id);
2179 $this->tree->moveTree($ref_id,$this->object->getRefId());
2180 $rbacadmin->adjustMovedObjectPermissions($ref_id,$old_parent);
2182 include_once(
'classes/class.ilConditionHandler.php');
2188 $node_data = $tree->getNodeData($ref_id);
2189 $old_parent_data = $tree->getNodeData($old_parent);
2191 $old_parent_data[
'obj_id']);
2193 $this->
object->getId());
2201 if (
$_SESSION[
"clipboard"][
"cmd"] ==
"link")
2203 foreach ($ref_ids as $ref_id)
2206 $top_node = $this->tree->getNodeData($ref_id);
2209 $subnodes[
$ref_id] = $this->tree->getSubtree($top_node);
2213 foreach ($subnodes as
$key => $subnode)
2216 $obj_data =& $this->ilias->obj_factory->getInstanceByRefId(
$key);
2217 $new_ref_id = $obj_data->createReference();
2218 $obj_data->putInTree(
$_GET[
"ref_id"]);
2219 $obj_data->setPermissions(
$_GET[
"ref_id"]);
2222 array_shift($subnode);
2225 $mapping[$new_ref_id] =
$key;
2229 $old_ref_id = $obj_data->getRefId();
2230 $obj_data->setRefId($new_ref_id);
2231 $obj_data->initDefaultRoles();
2232 $rolf_data = $rbacreview->getRoleFolderOfObject($obj_data->getRefId());
2234 if (isset($rolf_data[
"child"]))
2238 $rolf_data_old = $rbacreview->getRoleFolderOfObject($old_ref_id);
2243 $mapping[$rolf_data[
"child"]] = (int) $rolf_data_old[
"child"];
2246 $log->write(
"ilObjectGUI::pasteObject(), created role folder (ref_id): ".$rolf_data[
"child"].
2247 ", for object ref_id:".$obj_data->getRefId().
", obj_id: ".$obj_data->getId().
2248 ", type: ".$obj_data->getType().
", title: ".$obj_data->getTitle());
2254 $node_data = $tree->getNodeData($new_ref_id);
2256 $this->
object->getId());
2326 $log->write(
"ilObjectGUI::pasteObject(), link finished");
2333 $last_cmd =
$_SESSION[
"clipboard"][
"cmd"];
2339 if ($last_cmd ==
"cut")
2344 else if ($last_cmd ==
"copy")
2348 else if ($last_command ==
'link')
2354 $this->ctrl->returnToParent($this);
2370 global $ilAccess,$ilObjDefinition;
2372 if(!$ilAccess->checkAccess(
'copy',
'',
$_GET[
'item_ref_id']))
2377 $this->ctrl->returnToParent($this);
2384 return $this->initAndDisplayCopyIntoObjectObject();
2395 $node_data = $this->tree->getNodeData($ref_id);
2396 $subtree_nodes = $this->tree->getSubTree($node_data);
2398 $all_node_data[] = $node_data;
2399 $all_subtree_nodes[] = $subtree_nodes;
2402 foreach ($subtree_nodes as $node)
2404 if($node[
'type'] ==
'rolf')
2409 if (!$rbacsystem->checkAccess(
'visible,read,copy',$node[
"ref_id"]))
2411 $no_copy[] = $node[
"ref_id"];
2416 if (count($no_copy))
2418 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_copy").
" ".implode(
',',$this->
getTitlesByRefId($no_copy)),
2419 $this->ilias->error_obj->MESSAGE);
2429 $this->ctrl->returnToParent($this);
2445 $message = sprintf(
'%s::clipboardObject(): Illegal access. Clipboard variable is empty!', get_class($this));
2446 $ilLog->write($message,$ilLog->FATAL);
2447 $ilErr->raiseError($this->lng->txt(
"permission_denied"),$ilErr->WARNING);
2450 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.rep_clipboard.html");
2454 $f_result = array();
2464 $f_result[$counter][] = $this->lng->txt(
"obj_".$tmp_obj->getType());
2465 $f_result[$counter][] = $tmp_obj->getTitle();
2467 $f_result[$counter][] = (
$_SESSION[
"clipboard"][
"cmd"] ==
"cut") ? $this->lng->txt(
"move") :$this->lng->txt(
$_SESSION[
"clipboard"][
"cmd"]);
2485 if ($this->ilias->getSetting(
"custom_icons"))
2487 $this->tpl->addBlockFile(
"CONTAINER_ICONS",
"container_icon_settings",
2488 "tpl.container_icon_settings.html");
2490 if (($big_icon = $this->object->getBigIconPath()) !=
"")
2492 $this->tpl->setCurrentBlock(
"big_icon");
2493 $this->tpl->setVariable(
"SRC_BIG_ICON", $big_icon);
2494 $this->tpl->parseCurrentBlock();
2496 if ($this->object->getType() !=
"root")
2498 if (($small_icon = $this->object->getSmallIconPath()) !=
"")
2500 $this->tpl->setCurrentBlock(
"small_icon");
2501 $this->tpl->setVariable(
"SRC_SMALL_ICON", $small_icon);
2502 $this->tpl->parseCurrentBlock();
2504 $this->tpl->setCurrentBlock(
"small_icon_row");
2505 $this->tpl->setVariable(
"SMALL_ICON", $this->lng->txt(
"standard_icon"));
2506 $this->tpl->setVariable(
"SMALL_SIZE",
"(".
2507 $this->ilias->getSetting(
"custom_icon_small_width").
"x".
2508 $this->ilias->getSetting(
"custom_icon_small_height").
")");
2509 $this->tpl->setVariable(
"TXT_REMOVE_S", $this->lng->txt(
"remove"));
2510 $this->tpl->parseCurrentBlock();
2512 if (($tiny_icon = $this->object->getTinyIconPath()) !=
"")
2514 $this->tpl->setCurrentBlock(
"tiny_icon");
2515 $this->tpl->setVariable(
"SRC_TINY_ICON", $tiny_icon);
2516 $this->tpl->parseCurrentBlock();
2518 $this->tpl->setCurrentBlock(
"container_icon_settings");
2519 $this->tpl->setVariable(
"SPAN_TITLE", $a_input_colspan + 1);
2520 $this->tpl->setVariable(
"SPAN_INPUT", $a_input_colspan);
2521 $this->tpl->setVariable(
"ICON_SETTINGS", $this->lng->txt(
"icon_settings"));
2522 $this->tpl->setVariable(
"BIG_ICON", $this->lng->txt(
"big_icon"));
2523 $this->tpl->setVariable(
"TINY_ICON", $this->lng->txt(
"tiny_icon"));
2524 $this->tpl->setVariable(
"BIG_SIZE",
"(".
2525 $this->ilias->getSetting(
"custom_icon_big_width").
"x".
2526 $this->ilias->getSetting(
"custom_icon_big_height").
")");
2527 $this->tpl->setVariable(
"TINY_SIZE",
"(".
2528 $this->ilias->getSetting(
"custom_icon_tiny_width").
"x".
2529 $this->ilias->getSetting(
"custom_icon_tiny_height").
")");
2530 $this->tpl->setVariable(
"TXT_REMOVE", $this->lng->txt(
"remove"));
2531 $this->tpl->parseCurrentBlock();
2537 return $_SESSION[
"il_cont_admin_panel"];
2548 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()) &&
2552 $column_gui->setEnableMovement(
true);
2555 $column_gui->setRepositoryItems(
2556 $this->object->getSubItems($this->isActiveAdministrationPanel(),
true));
2560 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
2562 $column_gui->setBlockProperty(
"news",
"settings",
true);
2564 $column_gui->setBlockProperty(
"news",
"default_visibility_option",
true);
2565 $column_gui->setBlockProperty(
"news",
"hide_news_block_option",
true);
2570 $column_gui->setAdminCommands(
true);
2622 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardPageFactory.php');
2624 global $ilObjDataCache,
$tree;
2626 if(!$_REQUEST[
'clone_source'])
2629 if(isset(
$_SESSION[
'wizard_search_title']))
2639 $source_id = $_REQUEST[
'clone_source'];
2640 $new_type = $_REQUEST[
'new_type'];
2641 $this->ctrl->setParameter($this,
'clone_source',(
int) $_REQUEST[
'clone_source']);
2642 $this->ctrl->setParameter($this,
'new_type',$new_type);
2646 $this->tpl->addJavaScript(
'./Services/CopyWizard/js/ilContainer.js');
2647 $this->tpl->setVariable(
'BODY_ATTRIBUTES',
'onload="ilDisableChilds(\'cmd\');"');
2650 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.container_wizard_page.html');
2651 $this->tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
2653 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_'.$new_type));
2654 $this->tpl->setVariable(
'TXT_DUPLICATE',$this->lng->txt($new_type.
'_wizard_page'));
2655 $this->tpl->setVariable(
'INFO_DUPLICATE',$this->lng->txt($new_type.
'_copy_threads_info'));
2656 $this->tpl->setVariable(
'BTN_COPY',$this->lng->txt(
'obj_'.$new_type.
'_duplicate'));
2657 $this->tpl->setVariable(
'BTN_BACK',$this->lng->txt(
'btn_back'));
2658 if(isset(
$_SESSION[
'wizard_search_title']))
2660 $this->tpl->setVariable(
'CMD_BACK',
'searchCloneSource');
2664 $this->tpl->setVariable(
'CMD_BACK',
'create');
2667 $this->tpl->setVariable(
'BTN_TREE',$this->lng->txt(
'treeview'));
2668 $this->tpl->setVariable(
'BTN_LIST',$this->lng->txt(
'flatview'));
2676 foreach($subnodes = $tree->getSubtree($source_node = $tree->getNodeData($source_id),
true) as $node)
2684 if($node[
'type'] ==
'rolf')
2691 for($i = $source_node[
'depth'];$i < $node[
'depth']; $i++)
2693 $this->tpl->touchBlock(
'padding');
2694 $this->tpl->touchBlock(
'end_padding');
2698 $copy_wizard_page->fillTreeSelection($node[
'ref_id'],$node[
'type'],$node[
'depth']);
2700 $this->tpl->setCurrentBlock(
'tree_row');
2702 $this->tpl->setVariable(
'TREE_ALT_IMG',$this->lng->txt(
'obj_'.$node[
'type']));
2703 $this->tpl->setVariable(
'TREE_TITLE',$node[
'title']);
2704 $this->tpl->parseCurrentBlock();
2708 $this->tpl->setCurrentBlock(
'no_content');
2709 $this->tpl->setVariable(
'TXT_NO_CONTENT',$this->lng->txt(
'container_no_items'));
2710 $this->tpl->parseCurrentBlock();
2714 $this->tpl->setCurrentBlock(
'tree_footer');
2715 $this->tpl->setVariable(
'TXT_COPY_ALL',$this->lng->txt(
'copy_all'));
2716 $this->tpl->setVariable(
'TXT_LINK_ALL',$this->lng->txt(
'link_all'));
2717 $this->tpl->setVariable(
'TXT_OMIT_ALL',$this->lng->txt(
'omit_all'));
2718 $this->tpl->parseCurrentBlock();
2724 foreach($tree->getSubTreeTypes($source_id,array(
'rolf',
'crs')) as
$type)
2727 if(strlen($html = $copy_wizard_page->getWizardPageBlockHTML()))
2729 $this->tpl->setCurrentBlock(
'obj_row');
2730 $this->tpl->setVariable(
'ITEM_BLOCK',$html);
2731 $this->tpl->parseCurrentBlock();
2748 include_once(
'classes/class.ilLink.php');
2749 include_once(
'Services/CopyWizard/classes/class.ilCopyWizardOptions.php');
2751 global $ilAccess,
$ilErr,$rbacsystem,
$tree,$ilUser;
2753 $new_type = $_REQUEST[
'new_type'];
2755 $clone_source = (int) $_REQUEST[
'clone_source'];
2757 if(!$rbacsystem->checkAccess(
'create',
$ref_id,$new_type))
2759 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
2767 if(!$ilAccess->checkAccess(
'write',
'', $clone_source,$new_type))
2769 $ilErr->raiseError($this->lng->txt(
'permission_denied'));
2772 $options =
$_POST[
'cp_options'] ?
$_POST[
'cp_options'] : array();
2800 case self::COPY_WIZARD_NEEDS_PAGE:
2817 include_once(
'Services/Container/classes/class.ilContainerSorting.php');
2819 $sorting->savePost(
$_POST[
'position']);
2821 $this->ctrl->redirect($this,
"editOrder");
2841 $srcObj =& $ilias->obj_factory->getInstanceByRefId($srcRef);
2842 error_log(__METHOD__.
' cloning srcRef='.$srcRef.
' dstRef='.$dstRef.
'...');
2843 $newRef = $srcObj->cloneObject($dstRef)->getRefId();
2844 error_log(__METHOD__.
' ...cloning... newRef='.$newRef.
'...');
2849 if (! is_null($newName))
2851 $newObj =& $ilias->obj_factory->getInstanceByRefId($newRef);
2852 $newObj->setTitle($newName);
2857 $mapping[$newRef] = $srcRef;
2860 $children = $tree->getChilds($srcRef);
2861 foreach ($tree->getChilds($srcRef) as $child)
2865 if ($child[
"type"] !=
'rolf')
2867 $this->
cloneNodes($child[
"ref_id"],$newRef,$mapping);
2871 if (count($rolf = $tree->getChildsByType($newRef,
"rolf")))
2873 $mapping[$rolf[0][
"ref_id"]] = $child[
"ref_id"];
2877 error_log(__METHOD__.
' ...cloned srcRef='.$srcRef.
' dstRef='.$dstRef.
' newRef='.$newRef);
2891 $a_item_list_gui->addCustomProperty($lng->txt(
'path'),
2892 ilContainer_buildPath($a_item_data[
'ref_id'], $this->object->getRefId()),
2904 $path_arr = $tree->getPathFull($a_ref_id, $a_course_ref_id);
2906 foreach($path_arr as
$data)
2912 $path .= $data[
'title'];
2927 global $ilTabs,
$tpl;
2932 $tpl->setContent($this->form->getHTML());
2934 $ilTabs->activateTab(
"obj_sty");
2944 $tpl->setTreeFlatIcon(
"",
"");
2945 $ilTabs->clearTargets();
2950 $ilTabs->setBackTarget($lng->txt(
"cntr_back_to_old_editor"),
2951 $ilCtrl->getLinkTarget($this,
"switchToOldEditor"),
"_top");
2955 $ilTabs->setBackTarget($lng->txt(
"back"),
"./goto.php?target=".$this->object->getType().
"_".
2956 $this->
object->getRefId(),
"_top");
2959 include_once(
"./Services/COPage/classes/class.ilPageObjectGUI.php");
2961 $this->
object->getId());
2962 $page_gui->
setStyleId($this->object->getStyleSheetId());
2963 $page_gui->setTabHook($this,
"addPageTabs");
2966 $ilCtrl->getHTML($page_gui);
2967 $ilTabs->setTabActive(
"obj_sty");
2969 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
2970 $lng->loadLanguageModule(
"style");
2972 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2975 $fixed_style = $ilSetting->get(
"fixed_content_style_id");
2976 $style_id = $this->
object->getStyleSheetId();
2978 if ($fixed_style > 0)
2982 $this->lng->txt(
"global_fixed").
")");
2983 $this->form->addItem($st);
2990 $st_styles[0] = $this->lng->txt(
"default");
3000 $this->form->addItem($st);
3005 $this->form->addCommandButton(
"editStyle",
3006 $lng->txt(
"style_edit_style"));
3007 $this->form->addCommandButton(
"deleteStyle",
3008 $lng->txt(
"style_delete_style"));
3016 $st_styles,
false,
true);
3017 $style_sel =
new ilSelectInputGUI($lng->txt(
"style_current_style"),
"style_id");
3019 $style_sel->setValue($style_id);
3020 $this->form->addItem($style_sel);
3022 $this->form->addCommandButton(
"saveStyleSettings",
3024 $this->form->addCommandButton(
"createStyle",
3025 $lng->txt(
"sty_create_ind_style"));
3028 $this->form->setTitle($lng->txt(
"obj_sty"));
3029 $this->form->setFormAction($ilCtrl->getFormAction($this));
3039 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"create");
3049 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
3059 $ilCtrl->redirectByClass(
"ilobjstylesheetgui",
"delete");
3069 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
3070 if ($ilSetting->get(
"fixed_content_style_id") <= 0 &&
3072 || $this->object->getStyleSheetId() == 0))
3075 $this->
object->update();
3078 $this->ctrl->redirect($this,
"editStyleProperties");
3095 include_once
'./classes/class.ilObjectListGUIFactory.php';
3097 $item_list_gui->setContainerObject($this);
3099 $html = $item_list_gui->getListItemHTML(
$ref_id,