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;
97 $this->view_mode = (
ilContainer::_lookupContainerSetting($this->container_obj->getId(),
"list_presentation") ===
"tile" && !$this->container_gui->isActiveAdministrationPanel() && !$this->container_gui->isActiveOrdering())
98 ? self::VIEW_MODE_TILE
99 : self::VIEW_MODE_LIST;
101 $this->clipboard =
$DIC
106 $this->request =
$DIC
111 $this->item_manager =
$DIC
116 ->items($this->container_obj);
117 $this->block_repo =
$DIC
156 if ($ilCtrl->getNextClass() ===
"ilcolumngui" &&
157 $ilCtrl->isAsynch()) {
180 if ($ilCtrl->getNextClass() !==
"ilcolumngui" ||
181 !$ilCtrl->isAsynch()) {
204 if ($ilCtrl->getNextClass() ===
"ilcolumngui" &&
207 $html = $ilCtrl->forwardCommand($column_gui);
209 if (!$ilCtrl->isAsynch()) {
214 "components/ILIAS/Container",
216 [
"container_content_gui" => $this]
218 if (!$uip->replaced()) {
219 $html = $ilCtrl->getHTML($column_gui);
221 $html = $uip->getHTML($html);
234 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
237 $ilCtrl->getLinkTarget($this->container_gui,
"redrawListItem",
"",
true) .
"');");
240 $ilCtrl->getLinkTargetByClass(
241 [get_class($this->container_gui),
"ilcommonactiondispatchergui",
"ilratinggui"],
248 switch ($ilCtrl->getNextClass()) {
250 $this->container_gui->setSideColumnReturn();
255 $ilDB->useSlave(
true);
257 $ilDB->useSlave(
false);
273 "tpl.container_page.html",
276 "components/ILIAS/Container"
279 if (!$this->item_presentation->hasItems() &&
281 $ilAccess->checkAccess(
"write",
"", $this->getContainerObject()->getRefId())) {
284 $html = $this->renderItemList();
299 $this->item_presentation,
300 ($this->
getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()),
301 $this->getContainerGUI()->isMultiDownloadEnabled(),
302 $this->getContainerGUI()->isActiveOrdering() && (get_class($this) !==
"ilContainerObjectiveGUI")
304 $sorting->getBlockPositions(),
305 $this->container_gui,
306 $this->getViewMode(),
307 $this->getContainerGUI()->isActiveAdministrationPanel()
313 foreach ($event_items as $ev) {
332 if (!$ilCtrl->isAsynch()) {
338 $html = $ilCtrl->forwardCommand($column_gui);
344 $html = $ilCtrl->forwardCommand($column_gui);
357 if (!isset($this->list_gui[$item_data[
"type"]])) {
360 $this->list_gui[$item_data[
"type"]] = &$item_list_gui;
362 $item_list_gui = &$this->list_gui[$item_data[
"type"]];
366 $item_list_gui->setParentRefId((
int) ($item_data[
"parent"] ?? 0));
368 $item_list_gui->setDefaultCommandParameters([]);
369 $item_list_gui->disableTitleLink(
false);
370 $item_list_gui->resetConditionTarget();
372 if ($this->container_obj->isClassificationFilterActive()) {
373 $item_list_gui->enablePath(
375 $this->container_obj->getRefId(),
381 $item_list_gui->enableComments(
true);
382 $item_list_gui->enableNotes(
true);
383 $item_list_gui->enableTags(
true);
384 $item_list_gui->enableRating(
true);
387 $item_list_gui->forceVisibleOnly(
false);
392 return $item_list_gui;
399 string $a_container_page_html
406 if (is_int(strpos($a_container_page_html,
"[list-" . $type .
"]"))) {
412 while (preg_match(
'~\[(item-group-([0-9]*))\]~i', $a_container_page_html, $found)) {
416 $a_container_page_html = preg_replace(
'~\[' . $found[1] .
'\]~i', $html, $a_container_page_html);
429 $this->embedded_block[$block_type][] = $block_parameter;
434 return $this->embedded_block;
440 if (isset($this->embedded_block[
"itgr"]) && is_array($this->embedded_block[
"itgr"])) {
442 if (isset($this->items[
"itgr"]) && is_array($this->items[
"itgr"])) {
443 foreach ($this->items[
"itgr"] as $ig) {
444 $item_groups[$ig[
"ref_id"]] = $ig;
448 foreach ($this->embedded_block[
"itgr"] as
$ref_id) {
449 if (isset($item_groups[
$ref_id])) {
450 $this->renderItemGroup($item_groups[
$ref_id]);
456 if (isset($this->embedded_block[
"type"]) && is_array($this->embedded_block[
"type"])) {
457 foreach ($this->embedded_block[
"type"] as $type) {
458 if (isset($this->items[$type]) && is_array($this->items[$type]) && $this->
renderer->addTypeBlock($type)) {
459 if ($this->hasForcedOrderByStartDate($type)) {
465 foreach ($this->items[$type] as $item_data) {
466 if (!$this->
renderer->hasItem($item_data[
"child"])) {
467 $html = $this->renderItem($item_data, $position++);
469 $this->
renderer->addItemToBlock($type, $item_data[
"type"], $item_data[
"child"], $html);
480 return $type ===
'sess' && get_class($this) === ilContainerSessionsContentGUI::class;
485 $item_list_gui = $this->getItemGUI($a_item_data);
486 return $item_list_gui->getUniqueItemId();
496 bool $a_force_icon =
false,
497 string $a_pos_prefix =
"",
498 string $item_group_list_presentation =
""
501 $ilAccess = $this->access;
502 $ilCtrl = $this->ctrl;
504 if (!$ilAccess->checkAccess(
'visible',
'', $a_item_data[
'ref_id'], $a_item_data[
'type'], $a_item_data[
'obj_id'], $a_item_data[
'tree'])) {
508 $view_mode = $this->getViewMode();
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);
527 } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
529 $item_list_gui->enableDownloadCheckbox((
int) $a_item_data[
"ref_id"]);
532 if ($this->getContainerGUI()->isActiveItemOrdering() && !$this->hasForcedOrderByStartDate($a_item_data[
'type'])) {
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 ||
573 $this->getContainerGUI()->isActiveAdministrationPanel() ||
574 $this->getContainerGUI()->isActiveItemOrdering()
581 $item_readable = $ilAccess->checkAccess(
'read',
'', $a_item_data[
'ref_id']);
583 foreach ($items as $item) {
586 if (!$ilAccess->checkAccess(
'visible',
'', $item[
'ref_id'])) {
590 $item_list_gui2 = $this->getItemGUI($item);
591 $item_list_gui2->enableIcon(
true);
592 $item_list_gui2->enableItemDetailLinks(
false);
595 $item_list_gui2->setParentRefId((
int) ($a_item_data[
'ref_id'] ?? 0));
598 if (!$item_readable && !$ilAccess->checkAccess(
'write',
'', $item[
'ref_id'])) {
599 $item_list_gui2->forceVisibleOnly(
true);
602 if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()) {
603 $item_list_gui2->enableCheckbox(
true);
604 } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
606 $item_list_gui2->enableDownloadCheckbox((
int) $item[
'ref_id']);
609 if ($this->getContainerGUI()->isActiveItemOrdering()) {
610 $item_list_gui2->setPositionInputField(
611 "[sess][" . $a_item_data[
'obj_id'] .
"][" . $item[
"ref_id"] .
"]",
612 sprintf(
'%d', $pos * 10)
620 $sub_item_html = $item_list_gui2->getListItemHTML(
627 $this->determineAdminCommands($item[
"ref_id"], $item_list_gui2->adminCommandsIncluded());
628 if ($sub_item_html !==
'') {
629 $item_list_gui->addSubItemHTML($sub_item_html);
636 $html = $item_list_gui->getListItemHTML(
637 (
int) $a_item_data[
'ref_id'],
638 (
int) $a_item_data[
'obj_id'],
639 (
string) $a_item_data[
'title'],
640 (
string) $a_item_data[
'description'],
648 bool $a_force_icon =
false,
649 string $a_pos_prefix =
""
651 $item_list_gui = $this->getItemGUI($a_item_data);
654 $a_item_data[
'ref_id'],
655 $a_item_data[
'type'],
656 (
int) $a_item_data[
'obj_id']
658 $item_list_gui->initItem(
659 (
int) $a_item_data[
'ref_id'],
660 (
int) $a_item_data[
'obj_id'],
661 (
string) $a_item_data[
'type'],
662 (
string) $a_item_data[
'title'],
663 (
string) $a_item_data[
'description']
666 return $item_list_gui->getAsCard(
667 $a_item_data[
'ref_id'],
668 (
int) $a_item_data[
'obj_id'],
669 (
string) $a_item_data[
'type'],
670 (
string) $a_item_data[
'title'],
671 (
string) $a_item_data[
'description']
680 $this->determinePageEmbeddedBlocks($a_output_html);
681 $this->renderPageEmbeddedBlocks();
684 foreach ($this->getGroupedObjTypes() as $type => $v) {
686 if (is_int(strpos($a_output_html,
"[list-" . $type .
"]"))) {
687 $a_output_html = preg_replace(
688 '~\[list-' . $type .
'\]~i',
689 $this->
renderer->renderSingleTypeBlock($type),
696 while (preg_match(
'~\[(item-group-([0-9]*))\]~i', $a_output_html, $found)) {
697 $itgr_ref_id = (
int) $found[2];
699 $a_output_html = preg_replace(
700 '~\[' . $found[1] .
'\]~i',
701 $this->
renderer->renderSingleCustomBlock($itgr_ref_id),
706 return $a_output_html;
715 $this->initRenderer();
717 $this->items = $this->getContainerObject()->getSubItems(
718 $this->getContainerGUI()->isActiveAdministrationPanel()
722 $ref_ids = $this->request->getAlreadyRenderedRefIds();
725 if (is_array($this->items[$type]) &&
726 $this->
renderer->addTypeBlock($type)) {
731 foreach ($this->items[$type] as $item_data) {
732 $item_ref_id = $item_data[
"child"];
734 if (in_array($item_ref_id, $ref_ids)) {
737 if ($this->block_limit > 0 &&
$counter == $this->block_limit + 1) {
738 if (
$counter == $this->block_limit + 1) {
740 $this->
renderer->addShowMoreButton($type);
746 if (!$this->
renderer->hasItem($item_ref_id)) {
747 $html = $this->renderItem($item_data, $position++);
751 $this->
renderer->addItemToBlock($type, $item_data[
"type"], $item_ref_id, $html);
757 return $this->
renderer->renderSingleTypeBlock($type, $exhausted);
765 $objDefinition = $this->obj_definition;
767 if (empty($this->type_grps)) {
769 $objDefinition::getGroupedRepositoryObjectTypes($this->getContainerObject()->getType());
771 return $this->type_grps;
778 $lng->loadLanguageModule(
"rep");
780 $tpl =
new ilTemplate(
"tpl.rep_intro.html",
true,
true,
"components/ILIAS/Repository");
795 if (isset($this->items[
"itgr"]) && is_array($this->items[
"itgr"])) {
796 foreach ($this->items[
"itgr"] as $itgr) {
797 if (!$this->
renderer->hasCustomBlock($itgr[
"child"])) {
798 $this->renderItemGroup($itgr);
800 $this->
renderer->setBlockPosition($itgr[
"ref_id"], ++$a_pos);
809 $ilAccess = $this->access;
810 $ilUser = $this->user;
812 $perm_ok = ($ilAccess->checkAccess(
"visible",
"", $a_itgr[
'ref_id']) &&
813 $ilAccess->checkAccess(
"read",
"", $a_itgr[
'ref_id']));
818 $all_ids = array_map(
static function (array $i):
int {
819 return (
int) $i[
"child"];
820 }, $this->items[
"_all"]);
823 $items = array_filter($items,
static function (array $i) use ($all_ids):
bool {
824 return in_array($i[
"ref_id"], $all_ids);
830 foreach ($items as $item) {
831 $this->
renderer->hideItem($item[
"child"]);
836 $item_list_gui = $this->getItemGUI($a_itgr);
837 $item_list_gui->enableNotes(
false);
838 $item_list_gui->enableTags(
false);
839 $item_list_gui->enableComments(
false);
840 $item_list_gui->enableTimings(
false);
841 $item_list_gui->getListItemHTML(
845 $a_itgr[
"description"]
847 $commands_html = $item_list_gui->getCommandsHTML($a_itgr[
"title"],
false);
851 $beh = $item_group->getBehaviour();
852 $stored_val = $this->block_repo->getProperty(
853 "itgr_" . $a_itgr[
"ref_id"],
858 $beh = ($stored_val ===
"1")
865 "store-url" =>
"./ilias.php?baseClass=ilcontainerblockpropertiesstoragegui&cmd=store" .
866 "&cont_block_id=itgr_" . $a_itgr[
'ref_id']
869 !$this->getContainerGUI()->isActiveAdministrationPanel()) {
870 $this->
renderer->addCustomBlock($a_itgr[
"ref_id"],
"", $commands_html,
$data);
872 $this->
renderer->addCustomBlock($a_itgr[
"ref_id"], $a_itgr[
"title"], $commands_html,
$data);
879 $this->getContainerObject()->
getId()
880 )->sortSubItems(
'itgr', $a_itgr[
'obj_id'], $items);
886 foreach ($items as $item) {
889 $it_pres = $item_group->getListPresentation();
890 if ($this->getContainerGUI()->isActiveOrdering() ||
891 $this->getContainerGUI()->isActiveAdministrationPanel()) {
895 $html2 = $this->renderItem($item, $position++,
false,
"[itgr][" . $a_itgr[
'obj_id'] .
"]", $it_pres);
898 $this->
renderer->addItemToBlock($a_itgr[
"ref_id"], $item[
"type"], $item[
"child"], $html2,
true);
Manages items in repository clipboard.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
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)
Column user interface class.
static getCmdSide()
Get Column Side of Current Command.
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.
Parent class of all container content GUIs.
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.
initRenderer()
Init container renderer.
renderItemGroup(array $a_itgr)
insertPageEmbeddedBlocks(string $a_output_html)
Insert blocks into container page.
addEmbeddedBlock(string $block_type, $block_parameter)
Add embedded block.
determinePageEmbeddedBlocks(string $a_container_page_html)
Determine all blocks that are embedded in the container page.
setOutput()
This method sets the output of the right and main column in the global standard template.
ilContainer $container_obj
getUniqueItemId(array $a_item_data)
forwardToColumnGUI()
Get columngui output.
getGroupedObjTypes()
Get grouped repository object types.
BlockSessionRepository $block_repo
ilContainerRenderer $renderer
getMainContent()
Get content HTML for main column, this one may be overwritten in derived classes.
renderPageEmbeddedBlocks()
hasForcedOrderByStartDate(string $type)
StandardGUIRequest $request
ILIAS Container Content ItemPresentationManager $item_presentation
getItemGroupsHTML(int $a_pos=0)
ilContainerUserFilter $container_user_filter
getSingleTypeBlockAsynch(string $type)
Render single block.
ilObjectDefinition $obj_definition
renderCard(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="")
ilGlobalTemplateInterface $tpl
ItemManager $item_manager
ClipboardManager $clipboard
getItemGUI(array $item_data)
const DETAILS_DEACTIVATED
ilContainerGUI $container_gui
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstance(int $a_obj_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
Class ilCtrl provides processing control methods.
saveParameterByClass(string $a_class, $a_parameter)
@inheritDoc
static _getItemsOfContainer(int $a_ref_id)
static getLogger(string $a_component_id)
Get component logger.
Component logger with individual log levels by component id.
static lookupHideTitle(int $a_id)
static getItemsByEvent(int $event_id)
Get session material / event items.
static getItemsByItemGroup(int $item_group_ref_id)
Get materials of item group.
static addListGUIActivationProperty(ilObjectListGUI $list_gui, array &$item)
Get timing details for list gui.
parses the objects.xml it handles the xml-description of all ilias objects
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
static _lookupType(int $id, bool $reference=false)
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
static _lookupObjId(int $ref_id)
class ilRbacSystem system function like checkAccess, addActiveRole ... Supporting system functions ar...
PathGUI which handles materials assigned to sessions.
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setVariable(string $variable, $value='')
Sets the given variable to the given value.
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.
setRightContent(string $a_html)
Sets content of right column.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setContent(string $a_html)
Sets content for standard template.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
Interface ilAccessHandler This interface combines all available interfaces which can be called via gl...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.