33 $this->container_gui = $container_gui_obj;
34 $this->container_obj = $this->container_gui->object;
82 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
89 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
98 $obj_id, $ilUser->getId());
106 if ($ilCtrl->getNextClass() !=
"ilcolumngui" ||
107 !$ilCtrl->isAsynch())
121 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
126 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
136 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
141 $html = $ilCtrl->forwardCommand($column_gui);
145 if (!$ilCtrl->isAsynch())
150 include_once(
"./Services/UIComponent/classes/class.ilUIHookProcessor.php");
152 array(
"container_content_gui" => $this));
153 if (!$uip->replaced())
155 $html = $ilCtrl->getHTML($column_gui);
157 $html = $uip->getHTML($html);
171 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
173 $tpl->addOnLoadCode(
"il.Object.setRedrawListItemUrl('".
174 $ilCtrl->getLinkTarget($this->container_gui,
"redrawListItem",
"",
true).
"');");
176 $tpl->addOnLoadCode(
"il.Object.setRatingUrl('".
177 $ilCtrl->getLinkTargetByClass(array(get_class($this->container_gui),
"ilcommonactiondispatchergui",
"ilratinggui"),
178 "saveRating",
"",
true,
false).
"');");
180 switch ($ilCtrl->getNextClass())
183 $ilCtrl->setReturn($this->container_gui,
"");
188 $ilDB->useSlave(
true);
190 $ilDB->useSlave(
false);
210 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
218 if (!$ilCtrl->isAsynch())
228 $html = $ilCtrl->forwardCommand($column_gui);
235 $html = $ilCtrl->forwardCommand($column_gui);
252 $this->adminCommands =
false;
264 if (!$this->adminCommands)
268 if ($rbacsystem->checkAccess(
"delete", $a_ref_id))
270 $this->adminCommands =
true;
275 $this->adminCommands = $a_admin_com_included_in_list;
283 protected function getItemGUI($item_data,$a_show_path =
false)
285 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
288 if (!is_object ($this->list_gui[$item_data[
"type"]]))
292 $this->list_gui[$item_data[
"type"]] =& $item_list_gui;
296 $item_list_gui =& $this->list_gui[$item_data[
"type"]];
301 $item_list_gui->setParentRefId($item_data[
"parent"]);
312 $item_list_gui->enableComments(
true);
313 $item_list_gui->enableNotes(
true);
314 $item_list_gui->enableTags(
true);
315 $item_list_gui->enableRating(
true);
318 $this->
getContainerGUI()->modifyItemGUI($item_list_gui, $item_data, $a_show_path);
320 return $item_list_gui;
331 foreach ($type_grps as $type => $v)
334 if (is_int(strpos($a_container_page_html,
"[list-".$type.
"]")))
341 while (eregi(
"\[(item-group-([0-9]*))\]", $a_container_page_html, $found))
345 $a_container_page_html = eregi_replace(
"\[".$found[1].
"\]", $html, $a_container_page_html);
356 $this->embedded_block[$block_type][] = $block_parameter;
364 return $this->embedded_block;
375 if (is_array($this->embedded_block[
"type"]))
378 foreach ($this->embedded_block[
"type"] as $k => $type)
380 if ($this->rendered_block[
"type"][$type] ==
"")
382 if (is_array($this->items[$type]))
390 $item_rendered =
false;
395 $this->items[
'sess'] =
ilUtil::sortArray($this->items[
'sess'],
'start',
'ASC',
true,
true);
398 foreach($this->items[$type] as $k => $item_data)
400 $html = $this->
renderItem($item_data,$position++);
404 $item_rendered =
true;
405 $this->rendered_items[$item_data[
"child"]] =
true;
413 $this->rendered_block[
"type"][$type] =
"";
417 $this->rendered_block[
"type"][$type] =
$tpl->get();
425 if (is_array($this->embedded_block[
"itgr"]))
427 $item_groups = array();
428 if (is_array($this->items[
"itgr"]))
431 foreach ($this->items[
"itgr"] as $ig)
433 $item_groups[$ig[
"ref_id"]] = $ig;
438 foreach ($this->embedded_block[
"itgr"] as
$ref_id)
441 if ($this->rendered_block[
"itgr"][$ref_id] ==
"" && isset($item_groups[$ref_id]))
445 $this->rendered_block[
"itgr"][
$ref_id] =
$tpl->get();
459 function renderItem($a_item_data,$a_position = 0,$a_force_icon =
false, $a_pos_prefix =
"")
464 if(!$ilAccess->checkAccess(
'visible',
'',$a_item_data[
'ref_id'],$a_item_data[
'type'],$a_item_data[
'obj_id'],$a_item_data[
'tree']))
469 $item_list_gui = $this->
getItemGUI($a_item_data);
470 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows" ||
471 $a_item_data[
"type"] ==
"sess" || $a_force_icon)
473 $item_list_gui->enableIcon(
true);
478 $item_list_gui->enableCheckbox(
true);
483 $item_list_gui->enableDownloadCheckbox($a_item_data[
"ref_id"],
true);
486 if ($this->
getContainerGUI()->isActiveOrdering() && ($a_item_data[
'type'] !=
'sess' || get_class($this) !=
'ilContainerSessionsContentGUI'))
488 $item_list_gui->setPositionInputField($a_pos_prefix.
"[".$a_item_data[
"ref_id"].
"]",
489 sprintf(
'%d', (
int)$a_position*10));
492 if($a_item_data[
'type'] ==
'sess' and get_class($this) !=
'ilContainerObjectiveGUI')
496 case self::DETAILS_TITLE:
498 $item_list_gui->enableExpand(
true);
499 $item_list_gui->setExpanded(
false);
500 $item_list_gui->enableDescription(
false);
501 $item_list_gui->enableProperties(
true);
504 case self::DETAILS_ALL:
506 $item_list_gui->enableExpand(
true);
507 $item_list_gui->setExpanded(
true);
508 $item_list_gui->enableDescription(
true);
509 $item_list_gui->enableProperties(
true);
514 $item_list_gui->enableExpand(
true);
515 $item_list_gui->enableDescription(
true);
516 $item_list_gui->enableProperties(
true);
522 if($a_item_data[
'type'] ==
'sess' and (
523 $this->
getDetailsLevel($a_item_data[
'obj_id']) != self::DETAILS_TITLE or
531 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
532 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
537 $item_readable = $ilAccess->checkAccess(
'read',
'',$a_item_data[
'ref_id']);
539 foreach($items as $item)
543 if(!$ilAccess->checkAccess(
'visible',
'',$item[
'ref_id']))
549 $item_list_gui2->enableIcon(
true);
550 $item_list_gui2->enableItemDetailLinks(
false);
553 $item_list_gui2->setParentRefId($a_item_data[
'ref_id']);
556 if(!$item_readable and !$ilAccess->checkAccess(
'write',
'',$item[
'ref_id']))
558 $item_list_gui2->forceVisibleOnly(
true);
563 $item_list_gui2->enableCheckbox(
true);
568 $item_list_gui2->enableDownloadCheckbox($item[
'ref_id'],
true);
575 $item_list_gui2->setPositionInputField(
"[sess][".$a_item_data[
'obj_id'].
"][".$item[
"ref_id"].
"]",
576 sprintf(
'%d', (
int)$pos*10));
584 $sub_item_html = $item_list_gui2->getListItemHTML($item[
'ref_id'],
585 $item[
'obj_id'], $item[
'title'], $item[
'description']);
588 if(strlen($sub_item_html))
590 $item_list_gui->addSubItemHTML($sub_item_html);
595 if ($ilSetting->get(
"item_cmd_asynch"))
598 $ilCtrl->setParameter($this->container_gui,
"cmdrefid", $a_item_data[
'ref_id']);
599 $asynch_url = $ilCtrl->getLinkTarget($this->container_gui,
600 "getAsynchItemList",
"",
true,
false);
601 $ilCtrl->setParameter($this->container_gui,
"cmdrefid",
"");
604 include_once
"Services/Object/classes/class.ilObjectActivation.php";
607 $html = $item_list_gui->getListItemHTML($a_item_data[
'ref_id'],
608 $a_item_data[
'obj_id'], $a_item_data[
'title'], $a_item_data[
'description'],
609 $asynch,
false, $asynch_url);
611 $item_list_gui->adminCommandsIncluded());
625 $tpl =
new ilTemplate(
"tpl.container_list_block.html",
true,
true,
626 "Services/Container");
627 $this->cur_row_type =
"row_type_1";
638 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
644 $a_tpl->setCurrentBlock($this->cur_row_type);
645 $a_tpl->setVariable(
"ROW_ID",
'id="item_row_'.$a_ref_id.
'"');
646 $a_tpl->parseCurrentBlock();
650 $a_tpl->touchBlock($this->cur_row_type);
653 $a_tpl->setCurrentBlock(
"container_standard_row");
654 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT", $a_html);
655 $a_tpl->parseCurrentBlock();
656 $a_tpl->touchBlock(
"container_row");
666 $a_tpl->setVariable(
"CB_ID",
' id="bl_cntr_'.$this->bl_cnt.
'"');
678 else if ($a_type ==
"")
682 foreach($this->items[
"_all"] as $k => $item_data)
684 if ($this->rendered_items[$item_data[
"child"]] !==
true)
696 if ($a_text ==
"" && $a_type !=
"")
698 if (!$objDefinition->isPlugin($a_type))
700 $title = $lng->txt(
"objs_".$a_type);
704 include_once(
"./Services/Component/classes/class.ilPlugin.php");
713 if ($ilSetting->get(
"icon_position_in_lists") !=
"item_rows" &&
718 $a_tpl->setCurrentBlock(
"container_header_row_image");
719 $a_tpl->setVariable(
"HEADER_IMG", $icon);
720 $a_tpl->setVariable(
"HEADER_ALT", $title);
724 $a_tpl->setCurrentBlock(
"container_header_row");
727 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT", $title);
728 $a_tpl->parseCurrentBlock();
729 $a_tpl->touchBlock(
"container_row");
739 return array(
"fold",
"file");
749 $a_tpl->setCurrentBlock(
"select_all_row");
750 $a_tpl->setVariable(
"CHECKBOXNAME",
"bl_cb_".$this->bl_cnt);
751 $a_tpl->setVariable(
"SEL_ALL_PARENT",
"bl_cntr_".$this->bl_cnt);
752 $a_tpl->setVariable(
"SEL_ALL_PARENT",
"bl_cntr_".$this->bl_cnt);
753 $a_tpl->setVariable(
"TXT_SELECT_ALL", $lng->txt(
"select_all"));
754 $a_tpl->parseCurrentBlock();
763 $this->cur_row_type =
"";
777 foreach ($type_grps as $type => $v)
780 if (is_int(strpos($a_output_html,
"[list-".$type.
"]")))
782 $a_output_html = eregi_replace(
"\[list-".$type.
"\]",
783 $this->rendered_block[
"type"][$type], $a_output_html);
788 while (eregi(
"\[(item-group-([0-9]*))\]", $a_output_html, $found))
790 $itgr_ref_id = (int) $found[2];
794 if (isset($this->rendered_block[
"itgr"][$itgr_ref_id]))
796 $html = $this->rendered_block[
"itgr"][$itgr_ref_id];
797 $this->rendered_items[$itgr_ref_id] =
true;
799 $a_output_html = eregi_replace(
"\[".$found[1].
"\]", $html, $a_output_html);
802 return $a_output_html;
810 global
$lng, $objDefinition;
812 $this->cur_row_type = ($this->cur_row_type ==
"row_type_1")
816 $a_tpl->touchBlock($this->cur_row_type);
818 if (!$objDefinition->isPlugin($type))
820 $type = $lng->txt(
"obj_".$a_type);
824 include_once(
"./Services/Component/classes/class.ilPlugin.php");
827 $a_message = str_replace(
"[type]", $type, $a_message);
829 $a_tpl->setVariable(
"ROW_NBSP",
" ");
831 $a_tpl->setCurrentBlock(
"container_standard_row");
832 $a_tpl->setVariable(
"BLOCK_ROW_CONTENT",
834 $a_tpl->parseCurrentBlock();
835 $a_tpl->touchBlock(
"container_row");
845 $a_tpl->setCurrentBlock(
"container_block");
846 $a_tpl->parseCurrentBlock();
856 global $objDefinition;
858 if (empty($this->type_grps))
861 $objDefinition->getGroupedRepositoryObjectTypes($this->
getContainerObject()->getType());
863 return $this->type_grps;
873 $lng->loadLanguageModule(
"rep");
875 $tpl =
new ilTemplate(
"tpl.rep_intro.html",
true,
true,
"Services/Repository");
877 $tpl->setVariable(
"TXT_WELCOME", $lng->txt(
"rep_intro"));
878 $tpl->setVariable(
"TXT_INTRO_1", $lng->txt(
"rep_intro1"));
879 $tpl->setVariable(
"TXT_INTRO_2", $lng->txt(
"rep_intro2"));
880 $tpl->setVariable(
"TXT_INTRO_3", sprintf($lng->txt(
"rep_intro3"), $lng->txt(
"add")));
881 $tpl->setVariable(
"TXT_INTRO_4", sprintf($lng->txt(
"rep_intro4"), $lng->txt(
"cat_add")));
882 $tpl->setVariable(
"TXT_INTRO_5", $lng->txt(
"rep_intro5"));
883 $tpl->setVariable(
"TXT_INTRO_6", $lng->txt(
"rep_intro6"));
897 if (is_array($this->items[
"itgr"]))
899 foreach ($this->items[
"itgr"] as $itgr)
901 if (!$this->rendered_items[$itgr[
"child"]])
922 $perm_ok = ($ilAccess->checkAccess(
"visible",
"", $a_itgr[
'ref_id']) &&
923 $ilAccess->checkAccess(
"read",
"", $a_itgr[
'ref_id']));
925 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
926 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
929 $this->
getContainerObject()->getId())->sortSubItems(
'itgr', $a_itgr[
'obj_id'],$items);
935 foreach($items as $item)
937 $this->rendered_items[$item[
"child"]] =
true;
943 $item_list_gui->enableNotes(
false);
944 $item_list_gui->enableTags(
false);
945 $item_list_gui->enableComments(
false);
946 $item_list_gui->enableTimings(
false);
947 $item_list_gui->getListItemHTML($a_itgr[
"ref_id"], $a_itgr[
"obj_id"],
948 $a_itgr[
"title"], $a_itgr[
"description"]);
949 $commands_html = $item_list_gui->getCommandsHTML();
953 $a_tpl->setVariable(
"CB_ID",
' id="bl_cntr_'.$this->bl_cnt.
'"');
961 foreach ($items as $item)
971 $a_tpl->setCurrentBlock(
"container_header_row");
972 $a_tpl->setVariable(
"BLOCK_HEADER_CONTENT", $a_itgr[
"title"]);
973 $a_tpl->setVariable(
"CHR_COMMANDS", $commands_html);
974 $a_tpl->parseCurrentBlock();
976 $a_tpl->touchBlock(
"container_row");
982 foreach($items as $item)
984 $html2 = $this->
renderItem($item, $position++,
false,
"[itgr][".$a_itgr[
'obj_id'].
"]");
988 $this->rendered_items[$item[
"child"]] =
true;
993 $a_tpl->setCurrentBlock(
"container_block");
994 $a_tpl->parseCurrentBlock();