35 $this->container_gui = $container_gui_obj;
36 $this->container_obj = $this->container_gui->object;
84 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
91 require_once(
'Services/Tracking/classes/class.ilChangeEvent.php');
100 $obj_id, $ilUser->getId());
108 if ($ilCtrl->getNextClass() !=
"ilcolumngui" ||
109 !$ilCtrl->isAsynch())
123 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
128 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
138 if ($ilCtrl->getNextClass() ==
"ilcolumngui" &&
143 $html = $ilCtrl->forwardCommand($column_gui);
147 if (!$ilCtrl->isAsynch())
152 include_once(
"./Services/UIComponent/classes/class.ilUIHookProcessor.php");
154 array(
"container_content_gui" => $this));
155 if (!$uip->replaced())
157 $html = $ilCtrl->getHTML($column_gui);
159 $html = $uip->getHTML($html);
173 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
175 $tpl->addOnLoadCode(
"il.Object.setRedrawListItemUrl('".
176 $ilCtrl->getLinkTarget($this->container_gui,
"redrawListItem",
"",
true).
"');");
178 $tpl->addOnLoadCode(
"il.Object.setRatingUrl('".
179 $ilCtrl->getLinkTargetByClass(array(get_class($this->container_gui),
"ilcommonactiondispatchergui",
"ilratinggui"),
180 "saveRating",
"",
true,
false).
"');");
182 switch ($ilCtrl->getNextClass())
185 $ilCtrl->setReturn($this->container_gui,
"");
190 $ilDB->useSlave(
true);
192 $ilDB->useSlave(
false);
210 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
213 include_once
"Services/Container/classes/class.ilContainerRenderer.php";
217 ,$this->
getContainerGUI()->isActiveOrdering() && (get_class($this) !=
"ilContainerObjectiveGUI")
218 ,$sorting->getBlockPositions()
229 include_once(
"Services/Block/classes/class.ilColumnGUI.php");
237 if (!$ilCtrl->isAsynch())
247 $html = $ilCtrl->forwardCommand($column_gui);
254 $html = $ilCtrl->forwardCommand($column_gui);
271 $this->adminCommands =
false;
283 if (!$this->adminCommands)
287 if ($rbacsystem->checkAccess(
"delete", $a_ref_id))
289 $this->adminCommands =
true;
294 $this->adminCommands = $a_admin_com_included_in_list;
302 protected function getItemGUI($item_data,$a_show_path =
false)
304 include_once
'Services/Object/classes/class.ilObjectListGUIFactory.php';
307 if (!is_object ($this->list_gui[$item_data[
"type"]]))
311 $this->list_gui[$item_data[
"type"]] =& $item_list_gui;
315 $item_list_gui =& $this->list_gui[$item_data[
"type"]];
320 $item_list_gui->setParentRefId($item_data[
"parent"]);
322 $item_list_gui->setDefaultCommandParameters(array());
323 $item_list_gui->disableTitleLink(
false);
324 $item_list_gui->resetConditionTarget();
335 $item_list_gui->enableComments(
true);
336 $item_list_gui->enableNotes(
true);
337 $item_list_gui->enableTags(
true);
338 $item_list_gui->enableRating(
true);
341 $this->
getContainerGUI()->modifyItemGUI($item_list_gui, $item_data, $a_show_path);
343 return $item_list_gui;
354 foreach ($type_grps as $type => $v)
357 if (is_int(strpos($a_container_page_html,
"[list-".$type.
"]")))
364 while (eregi(
"\[(item-group-([0-9]*))\]", $a_container_page_html, $found))
368 $a_container_page_html = eregi_replace(
"\[".$found[1].
"\]", $html, $a_container_page_html);
379 $this->embedded_block[$block_type][] = $block_parameter;
387 return $this->embedded_block;
398 if (is_array($this->embedded_block[
"itgr"]))
400 $item_groups = array();
401 if (is_array($this->items[
"itgr"]))
403 foreach ($this->items[
"itgr"] as $ig)
405 $item_groups[$ig[
"ref_id"]] = $ig;
409 foreach ($this->embedded_block[
"itgr"] as
$ref_id)
411 if(isset($item_groups[$ref_id]))
419 if (is_array($this->embedded_block[
"type"]))
421 foreach ($this->embedded_block[
"type"] as $k => $type)
423 if (is_array($this->items[$type]) &&
424 $this->renderer->addTypeBlock($type))
429 $this->items[
'sess'] =
ilUtil::sortArray($this->items[
'sess'],
'start',
'ASC',
true,
true);
434 foreach($this->items[$type] as $k => $item_data)
436 if(!$this->renderer->hasItem($item_data[
"child"]))
438 $html = $this->
renderItem($item_data, $position++);
441 $this->renderer->addItemToBlock($type, $item_data[
"type"], $item_data[
"child"], $html);
457 function renderItem($a_item_data,$a_position = 0,$a_force_icon =
false, $a_pos_prefix =
"")
462 if(!$ilAccess->checkAccess(
'visible',
'',$a_item_data[
'ref_id'],$a_item_data[
'type'],$a_item_data[
'obj_id'],$a_item_data[
'tree']))
467 $item_list_gui = $this->
getItemGUI($a_item_data);
468 if ($ilSetting->get(
"icon_position_in_lists") ==
"item_rows" ||
469 $a_item_data[
"type"] ==
"sess" || $a_force_icon)
471 $item_list_gui->enableIcon(
true);
476 $item_list_gui->enableCheckbox(
true);
481 $item_list_gui->enableDownloadCheckbox($a_item_data[
"ref_id"],
true);
484 if ($this->
getContainerGUI()->isActiveItemOrdering() && ($a_item_data[
'type'] !=
'sess' || get_class($this) !=
'ilContainerSessionsContentGUI'))
486 $item_list_gui->setPositionInputField($a_pos_prefix.
"[".$a_item_data[
"ref_id"].
"]",
487 sprintf(
'%d', (
int)$a_position*10));
490 if($a_item_data[
'type'] ==
'sess' and get_class($this) !=
'ilContainerObjectiveGUI')
494 case self::DETAILS_TITLE:
496 $item_list_gui->enableExpand(
true);
497 $item_list_gui->setExpanded(
false);
498 $item_list_gui->enableDescription(
false);
499 $item_list_gui->enableProperties(
true);
502 case self::DETAILS_ALL:
504 $item_list_gui->enableExpand(
true);
505 $item_list_gui->setExpanded(
true);
506 $item_list_gui->enableDescription(
true);
507 $item_list_gui->enableProperties(
true);
512 $item_list_gui->enableExpand(
true);
513 $item_list_gui->enableDescription(
true);
514 $item_list_gui->enableProperties(
true);
519 if(method_exists($this,
"addItemDetails"))
521 $this->addItemDetails($item_list_gui, $a_item_data);
525 if($a_item_data[
'type'] ==
'sess' and (
526 $this->
getDetailsLevel($a_item_data[
'obj_id']) != self::DETAILS_TITLE or
534 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
535 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
540 $item_readable = $ilAccess->checkAccess(
'read',
'',$a_item_data[
'ref_id']);
542 foreach($items as $item)
546 if(!$ilAccess->checkAccess(
'visible',
'',$item[
'ref_id']))
552 $item_list_gui2->enableIcon(
true);
553 $item_list_gui2->enableItemDetailLinks(
false);
556 $item_list_gui2->setParentRefId($a_item_data[
'ref_id']);
559 if(!$item_readable and !$ilAccess->checkAccess(
'write',
'',$item[
'ref_id']))
561 $item_list_gui2->forceVisibleOnly(
true);
566 $item_list_gui2->enableCheckbox(
true);
571 $item_list_gui2->enableDownloadCheckbox($item[
'ref_id'],
true);
576 $item_list_gui2->setPositionInputField(
"[sess][".$a_item_data[
'obj_id'].
"][".$item[
"ref_id"].
"]",
577 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());
629 if (is_int(strpos($a_output_html,
"[list-".$type.
"]")))
631 $a_output_html = eregi_replace(
"\[list-".$type.
"\]",
632 $this->renderer->renderSingleTypeBlock($type), $a_output_html);
637 while (eregi(
"\[(item-group-([0-9]*))\]", $a_output_html, $found))
639 $itgr_ref_id = (int) $found[2];
641 $a_output_html = eregi_replace(
"\[".$found[1].
"\]",
642 $this->renderer->renderSingleCustomBlock($itgr_ref_id), $a_output_html);
645 return $a_output_html;
655 global $objDefinition;
657 if (empty($this->type_grps))
660 $objDefinition->getGroupedRepositoryObjectTypes($this->
getContainerObject()->getType());
662 return $this->type_grps;
672 $lng->loadLanguageModule(
"rep");
674 $tpl =
new ilTemplate(
"tpl.rep_intro.html",
true,
true,
"Services/Repository");
676 $tpl->setVariable(
"TXT_WELCOME", $lng->txt(
"rep_intro"));
677 $tpl->setVariable(
"TXT_INTRO_1", $lng->txt(
"rep_intro1"));
678 $tpl->setVariable(
"TXT_INTRO_2", $lng->txt(
"rep_intro2"));
679 $tpl->setVariable(
"TXT_INTRO_3", sprintf($lng->txt(
"rep_intro3"), $lng->txt(
"add")));
680 $tpl->setVariable(
"TXT_INTRO_4", sprintf($lng->txt(
"rep_intro4"), $lng->txt(
"cat_add")));
681 $tpl->setVariable(
"TXT_INTRO_5", $lng->txt(
"rep_intro5"));
682 $tpl->setVariable(
"TXT_INTRO_6", $lng->txt(
"rep_intro6"));
695 if (is_array($this->items[
"itgr"]))
697 foreach ($this->items[
"itgr"] as $itgr)
699 if (!$this->renderer->hasCustomBlock($itgr[
"child"]))
703 $this->renderer->setBlockPosition($itgr[
"ref_id"], ++$a_pos);
721 $perm_ok = ($ilAccess->checkAccess(
"visible",
"", $a_itgr[
'ref_id']) &&
722 $ilAccess->checkAccess(
"read",
"", $a_itgr[
'ref_id']));
724 include_once(
'./Services/Container/classes/class.ilContainerSorting.php');
725 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
732 foreach($items as $item)
734 $this->renderer->hideItem($item[
"child"]);
740 $item_list_gui->enableNotes(
false);
741 $item_list_gui->enableTags(
false);
742 $item_list_gui->enableComments(
false);
743 $item_list_gui->enableTimings(
false);
744 $item_list_gui->getListItemHTML($a_itgr[
"ref_id"], $a_itgr[
"obj_id"],
745 $a_itgr[
"title"], $a_itgr[
"description"]);
746 $commands_html = $item_list_gui->getCommandsHTML();
748 $this->renderer->addCustomBlock($a_itgr[
"ref_id"], $a_itgr[
"title"], $commands_html);
754 $this->
getContainerObject()->getId())->sortSubItems(
'itgr', $a_itgr[
'obj_id'], $items);
760 foreach($items as $item)
762 $html2 = $this->
renderItem($item, $position++,
false,
"[itgr][".$a_itgr[
'obj_id'].
"]");
766 $this->renderer->addItemToBlock($a_itgr[
"ref_id"], $item[
"type"], $item[
"child"], $html2,
true);