72 \
ILIAS\Container\Content\ItemPresentationManager $item_presentation
76 $this->tpl = $DIC[
"tpl"];
77 $this->
ctrl = $DIC->ctrl();
78 $this->
user = $DIC->user();
79 $this->
lng = $DIC->language();
80 $this->
access = $DIC->access();
81 $this->db = $DIC->database();
82 $this->rbacsystem = $DIC->rbac()->system();
84 $this->obj_definition = $DIC[
"objDefinition"];
87 $this->container_gui = $container_gui_obj;
90 $this->container_obj = $obj;
96 $this->view_mode = (
ilContainer::_lookupContainerSetting($this->container_obj->getId(),
"list_presentation") ===
"tile" && !$this->container_gui->isActiveAdministrationPanel() && !$this->container_gui->isActiveOrdering())
97 ? self::VIEW_MODE_TILE
98 : self::VIEW_MODE_LIST;
100 $this->clipboard = $DIC
105 $this->request = $DIC
110 $this->item_manager = $DIC
115 ->items($this->container_obj);
116 $this->block_repo = $DIC
155 if ($ilCtrl->getNextClass() ===
"ilcolumngui" &&
156 $ilCtrl->isAsynch()) {
179 if ($ilCtrl->getNextClass() !==
"ilcolumngui" ||
180 !$ilCtrl->isAsynch()) {
203 if ($ilCtrl->getNextClass() ===
"ilcolumngui" &&
206 $html = $ilCtrl->forwardCommand($column_gui);
208 if (!$ilCtrl->isAsynch()) {
213 "Services/Container",
215 [
"container_content_gui" => $this]
217 if (!$uip->replaced()) {
218 $html = $ilCtrl->getHTML($column_gui);
220 $html = $uip->getHTML($html);
233 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
236 $ilCtrl->getLinkTarget($this->container_gui,
"redrawListItem",
"",
true) .
"');");
239 $ilCtrl->getLinkTargetByClass(
240 [get_class($this->container_gui),
"ilcommonactiondispatchergui",
"ilratinggui"],
247 switch ($ilCtrl->getNextClass()) {
249 $this->container_gui->setSideColumnReturn();
254 $ilDB->useSlave(
true);
256 $ilDB->useSlave(
false);
272 "tpl.container_page.html",
278 if (!$this->item_presentation->hasItems() &&
283 $html = $this->renderItemList();
285 $tpl->
setVariable(
"CONTAINER_PAGE_CONTENT", $html);
298 $this->item_presentation,
299 ($this->
getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()),
301 $this->
getContainerGUI()->isActiveOrdering() && (get_class($this) !==
"ilContainerObjectiveGUI")
303 $sorting->getBlockPositions(),
312 foreach ($event_items as $ev) {
313 $this->renderer->addItemId($ev);
331 if (!$ilCtrl->isAsynch()) {
337 $html = $ilCtrl->forwardCommand($column_gui);
343 $html = $ilCtrl->forwardCommand($column_gui);
356 if (!isset($this->list_gui[$item_data[
"type"]])) {
359 $this->list_gui[$item_data[
"type"]] = &$item_list_gui;
361 $item_list_gui = &$this->list_gui[$item_data[
"type"]];
365 $item_list_gui->setParentRefId((
int) ($item_data[
"parent"] ?? 0));
367 $item_list_gui->setDefaultCommandParameters([]);
368 $item_list_gui->disableTitleLink(
false);
369 $item_list_gui->resetConditionTarget();
371 if ($this->container_obj->isClassificationFilterActive()) {
372 $item_list_gui->enablePath(
374 $this->container_obj->getRefId(),
380 $item_list_gui->enableComments(
true);
381 $item_list_gui->enableNotes(
true);
382 $item_list_gui->enableTags(
true);
383 $item_list_gui->enableRating(
true);
386 $item_list_gui->forceVisibleOnly(
false);
391 return $item_list_gui;
398 string $a_container_page_html
403 foreach ($type_grps as $type => $v) {
405 if (is_int(strpos($a_container_page_html,
"[list-" . $type .
"]"))) {
411 while (preg_match(
'~\[(item-group-([0-9]*))\]~i', $a_container_page_html, $found)) {
415 $a_container_page_html = preg_replace(
'~\[' . $found[1] .
'\]~i', $html, $a_container_page_html);
428 $this->embedded_block[$block_type][] = $block_parameter;
439 if (isset($this->embedded_block[
"itgr"]) && is_array($this->embedded_block[
"itgr"])) {
441 if (isset($this->items[
"itgr"]) && is_array($this->items[
"itgr"])) {
442 foreach ($this->items[
"itgr"] as $ig) {
443 $item_groups[$ig[
"ref_id"]] = $ig;
447 foreach ($this->embedded_block[
"itgr"] as
$ref_id) {
448 if (isset($item_groups[$ref_id])) {
455 if (isset($this->embedded_block[
"type"]) && is_array($this->embedded_block[
"type"])) {
456 foreach ($this->embedded_block[
"type"] as $type) {
457 if (isset($this->items[$type]) && is_array($this->items[$type]) && $this->renderer->addTypeBlock($type)) {
464 foreach ($this->items[$type] as $item_data) {
465 if (!$this->renderer->hasItem($item_data[
"child"])) {
466 $html = $this->
renderItem($item_data, $position++);
468 $this->renderer->addItemToBlock($type, $item_data[
"type"], $item_data[
"child"], $html);
479 return $type ===
'sess' && get_class($this) === ilContainerSessionsContentGUI::class;
484 $item_list_gui = $this->
getItemGUI($a_item_data);
485 return $item_list_gui->getUniqueItemId();
495 bool $a_force_icon =
false,
496 string $a_pos_prefix =
"",
497 string $item_group_list_presentation =
"" 504 if (!$ilAccess->checkAccess(
'visible',
'', $a_item_data[
'ref_id'], $a_item_data[
'type'], $a_item_data[
'obj_id'], $a_item_data[
'tree'])) {
509 if ($item_group_list_presentation !=
"") {
510 $view_mode = ($item_group_list_presentation ===
"tile")
511 ? self::VIEW_MODE_TILE
512 : self::VIEW_MODE_LIST;
514 if ($view_mode === self::VIEW_MODE_TILE) {
515 return $this->
renderCard($a_item_data, $a_position, $a_force_icon, $a_pos_prefix);
518 $item_list_gui = $this->
getItemGUI($a_item_data);
519 if ($a_item_data[
"type"] ===
"sess" ||
521 $ilSetting->get(
"icon_position_in_lists") ===
"item_rows") {
522 $item_list_gui->enableIcon(
true);
525 if ($this->
getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()) {
526 $item_list_gui->enableCheckbox(
true);
529 $item_list_gui->enableDownloadCheckbox((
int) $a_item_data[
"ref_id"]);
533 $item_list_gui->setPositionInputField(
534 $a_pos_prefix .
"[" . $a_item_data[
"ref_id"] .
"]",
535 sprintf(
'%d', $a_position * 10)
539 if ($a_item_data[
'type'] ===
'sess' && get_class($this) !==
'ilContainerObjectiveGUI') {
540 switch ($this->getDetailsLevel($a_item_data[
'obj_id'])) {
541 case self::DETAILS_TITLE:
543 $item_list_gui->enableExpand(
true);
544 $item_list_gui->setExpanded(
false);
545 $item_list_gui->enableDescription(
false);
546 $item_list_gui->enableProperties(
true);
549 case self::DETAILS_ALL:
551 $item_list_gui->enableExpand(
true);
552 $item_list_gui->setExpanded(
true);
553 $item_list_gui->enableDescription(
true);
554 $item_list_gui->enableProperties(
true);
559 $item_list_gui->enableExpand(
true);
560 $item_list_gui->enableDescription(
true);
561 $item_list_gui->enableProperties(
true);
566 if (method_exists($this,
"addItemDetails")) {
567 $this->addItemDetails($item_list_gui, $a_item_data);
571 if ($a_item_data[
'type'] ===
'sess' && (
572 $this->getDetailsLevel($a_item_data[
'obj_id']) !== self::DETAILS_TITLE ||
582 $item_readable = $ilAccess->checkAccess(
'read',
'', $a_item_data[
'ref_id']);
584 foreach ($items as $item) {
587 if (!$ilAccess->checkAccess(
'visible',
'', $item[
'ref_id'])) {
592 $item_list_gui2->enableIcon(
true);
593 $item_list_gui2->enableItemDetailLinks(
false);
596 $item_list_gui2->setParentRefId((
int) ($a_item_data[
'ref_id'] ?? 0));
599 if (!$item_readable && !$ilAccess->checkAccess(
'write',
'', $item[
'ref_id'])) {
600 $item_list_gui2->forceVisibleOnly(
true);
603 if ($this->
getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()) {
604 $item_list_gui2->enableCheckbox(
true);
607 $item_list_gui2->enableDownloadCheckbox((
int) $item[
'ref_id']);
611 $item_list_gui2->setPositionInputField(
612 "[sess][" . $a_item_data[
'obj_id'] .
"][" . $item[
"ref_id"] .
"]",
613 sprintf(
'%d', $pos * 10)
621 $sub_item_html = $item_list_gui2->getListItemHTML(
628 $this->determineAdminCommands($item[
"ref_id"], $item_list_gui2->adminCommandsIncluded());
629 if ($sub_item_html !==
'') {
630 $item_list_gui->addSubItemHTML($sub_item_html);
639 $ilCtrl->setParameter($this->container_gui,
"cmdrefid", $a_item_data[
'ref_id']);
640 $asynch_url = $ilCtrl->getLinkTarget(
641 $this->container_gui,
647 $ilCtrl->setParameter($this->container_gui,
"cmdrefid",
"");
652 $html = $item_list_gui->getListItemHTML(
653 (
int) $a_item_data[
'ref_id'],
654 (
int) $a_item_data[
'obj_id'],
655 (
string) $a_item_data[
'title'],
656 (
string) $a_item_data[
'description'],
667 bool $a_force_icon =
false,
668 string $a_pos_prefix =
"" 670 $item_list_gui = $this->
getItemGUI($a_item_data);
673 $a_item_data[
'ref_id'],
674 $a_item_data[
'type'],
675 (
int) $a_item_data[
'obj_id']
677 $item_list_gui->initItem(
678 (
int) $a_item_data[
'ref_id'],
679 (
int) $a_item_data[
'obj_id'],
680 (
string) $a_item_data[
'type'],
681 (
string) $a_item_data[
'title'],
682 (
string) $a_item_data[
'description']
686 $item_list_gui->insertCommands();
687 return $item_list_gui->getAsCard(
688 $a_item_data[
'ref_id'],
689 (
int) $a_item_data[
'obj_id'],
690 (
string) $a_item_data[
'type'],
691 (
string) $a_item_data[
'title'],
692 (
string) $a_item_data[
'description']
707 if (is_int(strpos($a_output_html,
"[list-" . $type .
"]"))) {
708 $a_output_html = preg_replace(
709 '~\[list-' . $type .
'\]~i',
710 $this->renderer->renderSingleTypeBlock($type),
717 while (preg_match(
'~\[(item-group-([0-9]*))\]~i', $a_output_html, $found)) {
718 $itgr_ref_id = (
int) $found[2];
720 $a_output_html = preg_replace(
721 '~\[' . $found[1] .
'\]~i',
722 $this->renderer->renderSingleCustomBlock($itgr_ref_id),
727 return $a_output_html;
743 $ref_ids = $this->request->getAlreadyRenderedRefIds();
746 if (is_array($this->items[$type]) &&
747 $this->renderer->addTypeBlock($type)) {
752 foreach ($this->items[$type] as $item_data) {
753 $item_ref_id = $item_data[
"child"];
755 if (in_array($item_ref_id, $ref_ids)) {
758 if ($this->block_limit > 0 && $counter == $this->block_limit + 1) {
759 if ($counter == $this->block_limit + 1) {
761 $this->renderer->addShowMoreButton($type);
767 if (!$this->renderer->hasItem($item_ref_id)) {
768 $html = $this->
renderItem($item_data, $position++);
774 "tpl.adv_selection_list_js_init.js",
777 "Services/UIComponent/AdvancedSelectionList",
782 $this->
ctrl->setParameter($this->container_gui,
"cmdrefid", $item_data[
'ref_id']);
783 $asynch_url = $this->
ctrl->getLinkTarget(
784 $this->container_gui,
790 $this->
ctrl->setParameter($this->container_gui,
"cmdrefid",
"");
791 $unique_id =
'act_' . $unique_id;
792 $js_tpl->setVariable(
"ID", $unique_id);
793 $js_tpl->setCurrentBlock(
"asynch_bl");
794 $js_tpl->setVariable(
"ASYNCH_URL", $asynch_url);
795 $js_tpl->setVariable(
"ASYNCH_ID", $unique_id);
796 $js_tpl->setVariable(
"ASYNCH_TRIGGER_ID", $unique_id);
797 $js_tpl->parseCurrentBlock();
798 if (is_string($html)) {
799 $html .=
"<script>" . $js_tpl->get() .
"</script>";
805 $this->renderer->addItemToBlock($type, $item_data[
"type"], $item_ref_id, $html);
811 return $this->renderer->renderSingleTypeBlock($type, $exhausted);
821 if (empty($this->type_grps)) {
823 $objDefinition::getGroupedRepositoryObjectTypes($this->
getContainerObject()->getType());
834 $tpl =
new ilTemplate(
"tpl.rep_intro.html",
true,
true,
"Services/Repository");
839 $tpl->
setVariable(
"TXT_INTRO_3", sprintf($lng->
txt(
"rep_intro3"), $lng->
txt(
"add")));
840 $tpl->
setVariable(
"TXT_INTRO_4", sprintf($lng->
txt(
"rep_intro4"), $lng->
txt(
"cat_add")));
849 if (isset($this->items[
"itgr"]) && is_array($this->items[
"itgr"])) {
850 foreach ($this->items[
"itgr"] as $itgr) {
851 if (!$this->renderer->hasCustomBlock($itgr[
"child"])) {
854 $this->renderer->setBlockPosition($itgr[
"ref_id"], ++$a_pos);
866 $perm_ok = ($ilAccess->checkAccess(
"visible",
"", $a_itgr[
'ref_id']) &&
867 $ilAccess->checkAccess(
"read",
"", $a_itgr[
'ref_id']));
872 $all_ids = array_map(
static function (array $i):
int {
873 return (
int) $i[
"child"];
874 }, $this->items[
"_all"]);
877 $items = array_filter($items,
static function (array $i) use ($all_ids):
bool {
878 return in_array($i[
"ref_id"], $all_ids);
884 foreach ($items as $item) {
885 $this->renderer->hideItem($item[
"child"]);
891 $item_list_gui->enableNotes(
false);
892 $item_list_gui->enableTags(
false);
893 $item_list_gui->enableComments(
false);
894 $item_list_gui->enableTimings(
false);
895 $item_list_gui->getListItemHTML(
899 $a_itgr[
"description"]
901 $commands_html = $item_list_gui->getCommandsHTML();
905 $beh = $item_group->getBehaviour();
906 $stored_val = $this->block_repo->getProperty(
907 "itgr_" . $a_itgr[
"ref_id"],
912 $beh = ($stored_val ===
"1")
919 "store-url" =>
"./ilias.php?baseClass=ilcontainerblockpropertiesstoragegui&cmd=store" .
920 "&cont_block_id=itgr_" . $a_itgr[
'ref_id']
924 $this->renderer->addCustomBlock($a_itgr[
"ref_id"],
"", $commands_html,
$data);
926 $this->renderer->addCustomBlock($a_itgr[
"ref_id"], $a_itgr[
"title"], $commands_html,
$data);
934 )->sortSubItems(
'itgr', $a_itgr[
'obj_id'], $items);
940 foreach ($items as $item) {
943 $it_pres = $item_group->getListPresentation();
949 $html2 = $this->
renderItem($item, $position++,
false,
"[itgr][" . $a_itgr[
'obj_id'] .
"]", $it_pres);
952 $this->renderer->addItemToBlock($a_itgr[
"ref_id"], $item[
"type"], $item[
"child"], $html2,
true);
ilContainerUserFilter $container_user_filter
static getCmdSide()
Get Column Side of Current Command.
getSingleTypeBlockAsynch(string $type)
Render single block.
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
determinePageEmbeddedBlocks(string $a_container_page_html)
Determine all blocks that are embedded in the container page.
static getLogger(string $a_component_id)
Get component logger.
ilContainerGUI $container_gui
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
ItemManager $item_manager
getItemGroupsHTML(int $a_pos=0)
static getItemsByEvent(int $event_id)
Get session material / event items.
ilGlobalTemplateInterface $tpl
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
getItemGUI(array $item_data)
getUniqueItemId(array $a_item_data)
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
static lookupHideTitle(int $a_id)
loadLanguageModule(string $a_module)
Load language module.
renderPageEmbeddedBlocks()
setVariable(string $variable, $value='')
Sets the given variable to the given value.
initRenderer()
Init container renderer.
static _getItemsOfContainer(int $a_ref_id)
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
static _lookupObjId(int $ref_id)
Parent class of all container content GUIs.
renderItemGroup(array $a_itgr)
getMainContent()
Get content HTML for main column, this one may be overwritten in derived classes. ...
parses the objects.xml it handles the xml-description of all ilias objects
ILIAS Container Content ItemPresentationManager $item_presentation
hasForcedOrderByStartDate(string $type)
renderItem(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="", string $item_group_list_presentation="")
Render an item.
setContent(string $a_html)
Sets content for standard template.
Column user interface class.
StandardGUIRequest $request
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
forwardToColumnGUI()
Get columngui output.
static addListGUIActivationProperty(ilObjectListGUI $list_gui, array &$item)
Get timing details for list gui.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
Manages items in repository clipboard.
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
static getItemsByItemGroup(int $item_group_ref_id)
Get materials of item group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static buildAjaxHash(int $node_type, ?int $node_id, string $obj_type, int $obj_id, string $sub_type=null, int $sub_id=null, int $news_id=0)
Build ajax hash.
static _getInstance(int $a_obj_id)
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
setRightContent(string $a_html)
Sets content of right column.
renderCard(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="")
saveParameterByClass(string $a_class, $a_parameter)
static _lookupType(int $id, bool $reference=false)
BlockSessionRepository $block_repo
ilContainerRenderer $renderer
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ilObjectDefinition $obj_definition
ClipboardManager $clipboard
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
ilContainer $container_obj
getGroupedObjTypes()
Get grouped repository object types.
const DETAILS_DEACTIVATED
addEmbeddedBlock(string $block_type, $block_parameter)
Add embedded block.
insertPageEmbeddedBlocks(string $a_output_html)
Insert blocks into container page.
setOutput()
This method sets the output of the right and main column in the global standard template.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)