71 $this->tpl =
$DIC[
"tpl"];
72 $this->
ctrl = $DIC->ctrl();
73 $this->
user = $DIC->user();
74 $this->
lng = $DIC->language();
75 $this->
access = $DIC->access();
76 $this->db =
$DIC->database();
77 $this->rbacsystem =
$DIC->rbac()->system();
79 $this->obj_definition =
$DIC[
"objDefinition"];
82 $this->container_gui = $container_gui_obj;
85 $this->container_obj = $obj;
91 $this->view_mode = (
ilContainer::_lookupContainerSetting($this->container_obj->getId(),
"list_presentation") ===
"tile" && !$this->container_gui->isActiveAdministrationPanel() && !$this->container_gui->isActiveOrdering())
92 ? self::VIEW_MODE_TILE
93 : self::VIEW_MODE_LIST;
95 $this->clipboard =
$DIC
100 $this->request =
$DIC
105 $this->item_manager =
$DIC
110 ->items($this->container_obj);
111 $this->block_repo =
$DIC
151 if ($ilCtrl->getNextClass() ===
"ilcolumngui" &&
152 $ilCtrl->isAsynch()) {
175 if ($ilCtrl->getNextClass() !==
"ilcolumngui" ||
176 !$ilCtrl->isAsynch()) {
199 if ($ilCtrl->getNextClass() ===
"ilcolumngui" &&
202 $html = $ilCtrl->forwardCommand($column_gui);
204 if (!$ilCtrl->isAsynch()) {
209 "Services/Container",
211 [
"container_content_gui" => $this]
213 if (!$uip->replaced()) {
214 $html = $ilCtrl->getHTML($column_gui);
216 $html = $uip->getHTML($html);
229 $ilCtrl->saveParameterByClass(
"ilcolumngui",
"col_return");
232 $ilCtrl->getLinkTarget($this->container_gui,
"redrawListItem",
"",
true) .
"');");
235 $ilCtrl->getLinkTargetByClass(
236 [get_class($this->container_gui),
"ilcommonactiondispatchergui",
"ilratinggui"],
243 switch ($ilCtrl->getNextClass()) {
245 $this->container_gui->setSideColumnReturn();
250 $ilDB->useSlave(
true);
252 $ilDB->useSlave(
false);
273 ($this->
getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()),
274 $this->getContainerGUI()->isMultiDownloadEnabled(),
275 $this->getContainerGUI()->isActiveOrdering() && (get_class($this) !==
"ilContainerObjectiveGUI")
277 $sorting->getBlockPositions(),
278 $this->container_gui,
279 $this->getViewMode(),
280 $this->getContainerGUI()->isActiveAdministrationPanel()
286 foreach ($event_items as $ev) {
287 $this->renderer->addItemId($ev);
305 if (!$ilCtrl->isAsynch()) {
311 $html = $ilCtrl->forwardCommand($column_gui);
317 $html = $ilCtrl->forwardCommand($column_gui);
329 $this->adminCommands =
false;
334 bool $a_admin_com_included_in_list =
false
338 if (!$this->adminCommands) {
341 $this->adminCommands =
true;
344 $this->adminCommands = $a_admin_com_included_in_list;
352 if (!isset($this->list_gui[$item_data[
"type"]])) {
354 $item_list_gui->setContainerObject($this->getContainerGUI());
355 $this->list_gui[$item_data[
"type"]] = &$item_list_gui;
357 $item_list_gui = &$this->list_gui[$item_data[
"type"]];
361 $item_list_gui->setParentRefId((
int) ($item_data[
"parent"] ?? 0));
363 $item_list_gui->setDefaultCommandParameters([]);
364 $item_list_gui->disableTitleLink(
false);
365 $item_list_gui->resetConditionTarget();
367 if ($this->container_obj->isClassificationFilterActive()) {
368 $item_list_gui->enablePath(
370 $this->container_obj->getRefId(),
376 $item_list_gui->enableComments(
true);
377 $item_list_gui->enableNotes(
true);
378 $item_list_gui->enableTags(
true);
379 $item_list_gui->enableRating(
true);
382 $item_list_gui->forceVisibleOnly(
false);
385 $this->getContainerGUI()->modifyItemGUI($item_list_gui, $item_data);
387 return $item_list_gui;
394 string $a_container_page_html
396 $type_grps = $this->getGroupedObjTypes();
399 foreach ($type_grps as
$type => $v) {
401 if (is_int(strpos($a_container_page_html,
"[list-" .
$type .
"]"))) {
402 $this->addEmbeddedBlock(
"type",
$type);
407 while (preg_match(
'~\[(item-group-([0-9]*))\]~i', $a_container_page_html, $found)) {
408 $this->addEmbeddedBlock(
"itgr", (
int) $found[2]);
411 $a_container_page_html = preg_replace(
'~\[' . $found[1] .
'\]~i', $html, $a_container_page_html);
424 $this->embedded_block[$block_type][] = $block_parameter;
429 return $this->embedded_block;
435 if (isset($this->embedded_block[
"itgr"]) && is_array($this->embedded_block[
"itgr"])) {
437 if (isset($this->items[
"itgr"]) && is_array($this->items[
"itgr"])) {
438 foreach ($this->items[
"itgr"] as $ig) {
439 $item_groups[$ig[
"ref_id"]] = $ig;
443 foreach ($this->embedded_block[
"itgr"] as
$ref_id) {
444 if (isset($item_groups[
$ref_id])) {
445 $this->renderItemGroup($item_groups[
$ref_id]);
451 if (isset($this->embedded_block[
"type"]) && is_array($this->embedded_block[
"type"])) {
452 foreach ($this->embedded_block[
"type"] as
$type) {
453 if (isset($this->items[
$type]) && is_array($this->items[
$type]) && $this->renderer->addTypeBlock(
$type)) {
454 if ($this->hasForcedOrderByStartDate(
$type)) {
460 foreach ($this->items[
$type] as $item_data) {
461 if (!$this->renderer->hasItem($item_data[
"child"])) {
462 $html = $this->renderItem($item_data, $position++);
464 $this->renderer->addItemToBlock(
$type, $item_data[
"type"], $item_data[
"child"], $html);
475 return $type ===
'sess' && get_class($this) === ilContainerSessionsContentGUI::class;
485 bool $a_force_icon =
false,
486 string $a_pos_prefix =
"",
487 string $item_group_list_presentation =
""
490 $ilAccess = $this->access;
491 $ilCtrl = $this->ctrl;
494 if (!$ilAccess->checkAccess(
'visible',
'', $a_item_data[
'ref_id'], $a_item_data[
'type'], $a_item_data[
'obj_id'], $a_item_data[
'tree'])) {
498 $view_mode = $this->getViewMode();
499 if ($item_group_list_presentation !=
"") {
500 $view_mode = ($item_group_list_presentation ===
"tile")
501 ? self::VIEW_MODE_TILE
502 : self::VIEW_MODE_LIST;
505 if ($view_mode === self::VIEW_MODE_TILE) {
506 return $this->renderCard($a_item_data, $a_position, $a_force_icon, $a_pos_prefix);
509 $item_list_gui = $this->getItemGUI($a_item_data);
510 if ($a_item_data[
"type"] ===
"sess" ||
512 $ilSetting->get(
"icon_position_in_lists") ===
"item_rows") {
513 $item_list_gui->enableIcon(
true);
516 if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()) {
517 $item_list_gui->enableCheckbox(
true);
518 } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
520 $item_list_gui->enableDownloadCheckbox((
int) $a_item_data[
"ref_id"]);
523 if ($this->getContainerGUI()->isActiveItemOrdering() && !$this->hasForcedOrderByStartDate($a_item_data[
'type'])) {
524 $item_list_gui->setPositionInputField(
525 $a_pos_prefix .
"[" . $a_item_data[
"ref_id"] .
"]",
526 sprintf(
'%d', $a_position * 10)
530 if ($a_item_data[
'type'] ===
'sess' && get_class($this) !==
'ilContainerObjectiveGUI') {
531 switch ($this->getDetailsLevel($a_item_data[
'obj_id'])) {
532 case self::DETAILS_TITLE:
534 $item_list_gui->enableExpand(
true);
535 $item_list_gui->setExpanded(
false);
536 $item_list_gui->enableDescription(
false);
537 $item_list_gui->enableProperties(
true);
540 case self::DETAILS_ALL:
542 $item_list_gui->enableExpand(
true);
543 $item_list_gui->setExpanded(
true);
544 $item_list_gui->enableDescription(
true);
545 $item_list_gui->enableProperties(
true);
550 $item_list_gui->enableExpand(
true);
551 $item_list_gui->enableDescription(
true);
552 $item_list_gui->enableProperties(
true);
557 if (method_exists($this,
"addItemDetails")) {
558 $this->addItemDetails($item_list_gui, $a_item_data);
562 if ($a_item_data[
'type'] ===
'sess' && (
563 $this->getDetailsLevel($a_item_data[
'obj_id']) !== self::DETAILS_TITLE ||
564 $this->getContainerGUI()->isActiveAdministrationPanel() ||
565 $this->getContainerGUI()->isActiveItemOrdering()
573 $item_readable = $ilAccess->checkAccess(
'read',
'', $a_item_data[
'ref_id']);
575 foreach ($items as $item) {
578 if (!$ilAccess->checkAccess(
'visible',
'', $item[
'ref_id'])) {
582 $item_list_gui2 = $this->getItemGUI($item);
583 $item_list_gui2->enableIcon(
true);
584 $item_list_gui2->enableItemDetailLinks(
false);
587 $item_list_gui2->setParentRefId((
int) ($a_item_data[
'ref_id'] ?? 0));
590 if (!$item_readable && !$ilAccess->checkAccess(
'write',
'', $item[
'ref_id'])) {
591 $item_list_gui2->forceVisibleOnly(
true);
594 if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()) {
595 $item_list_gui2->enableCheckbox(
true);
596 } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
598 $item_list_gui2->enableDownloadCheckbox((
int) $item[
'ref_id']);
601 if ($this->getContainerGUI()->isActiveItemOrdering()) {
602 $item_list_gui2->setPositionInputField(
603 "[sess][" . $a_item_data[
'obj_id'] .
"][" . $item[
"ref_id"] .
"]",
604 sprintf(
'%d', $pos * 10)
612 $sub_item_html = $item_list_gui2->getListItemHTML(
619 $this->determineAdminCommands($item[
"ref_id"], $item_list_gui2->adminCommandsIncluded());
620 if ($sub_item_html !==
'') {
621 $item_list_gui->addSubItemHTML($sub_item_html);
630 $ilCtrl->setParameter($this->container_gui,
"cmdrefid", $a_item_data[
'ref_id']);
631 $asynch_url = $ilCtrl->getLinkTarget(
632 $this->container_gui,
638 $ilCtrl->setParameter($this->container_gui,
"cmdrefid",
"");
643 $html = $item_list_gui->getListItemHTML(
644 (
int) $a_item_data[
'ref_id'],
645 (
int) $a_item_data[
'obj_id'],
646 (
string) $a_item_data[
'title'],
647 (
string) $a_item_data[
'description'],
652 $this->determineAdminCommands(
653 $a_item_data[
"ref_id"],
654 $item_list_gui->adminCommandsIncluded()
664 bool $a_force_icon =
false,
665 string $a_pos_prefix =
""
667 $item_list_gui = $this->getItemGUI($a_item_data);
670 $a_item_data[
'ref_id'],
671 $a_item_data[
'type'],
672 (
int) $a_item_data[
'obj_id']
674 $item_list_gui->initItem(
675 (
int) $a_item_data[
'ref_id'],
676 (
int) $a_item_data[
'obj_id'],
677 (
string) $a_item_data[
'type'],
678 (
string) $a_item_data[
'title'],
679 (
string) $a_item_data[
'description']
683 $item_list_gui->insertCommands();
684 return $item_list_gui->getAsCard(
685 $a_item_data[
'ref_id'],
686 (
int) $a_item_data[
'obj_id'],
687 (
string) $a_item_data[
'type'],
688 (
string) $a_item_data[
'title'],
689 (
string) $a_item_data[
'description']
698 $this->determinePageEmbeddedBlocks($a_output_html);
699 $this->renderPageEmbeddedBlocks();
702 foreach ($this->getGroupedObjTypes() as
$type => $v) {
704 if (is_int(strpos($a_output_html,
"[list-" .
$type .
"]"))) {
705 $a_output_html = preg_replace(
706 '~\[list-' .
$type .
'\]~i',
707 $this->renderer->renderSingleTypeBlock(
$type),
714 while (preg_match(
'~\[(item-group-([0-9]*))\]~i', $a_output_html, $found)) {
715 $itgr_ref_id = (
int) $found[2];
717 $a_output_html = preg_replace(
718 '~\[' . $found[1] .
'\]~i',
719 $this->renderer->renderSingleCustomBlock($itgr_ref_id),
724 return $a_output_html;
733 $this->initRenderer();
735 $this->items = $this->getContainerObject()->getSubItems(
736 $this->getContainerGUI()->isActiveAdministrationPanel()
740 $ref_ids = $this->request->getAlreadyRenderedRefIds();
743 if (is_array($this->items[
$type]) &&
744 $this->renderer->addTypeBlock(
$type)) {
749 foreach ($this->items[
$type] as $item_data) {
750 $item_ref_id = $item_data[
"child"];
752 if (in_array($item_ref_id, $ref_ids)) {
756 if ($this->block_limit > 0 && $counter == $this->block_limit + 1) {
757 if ($counter == $this->block_limit + 1) {
759 $this->renderer->addShowMoreButton(
$type);
764 if (!$this->renderer->hasItem($item_ref_id)) {
765 $html = $this->renderItem($item_data, $position++);
768 $this->renderer->addItemToBlock(
$type, $item_data[
"type"], $item_ref_id, $html);
774 return $this->renderer->renderSingleTypeBlock(
$type);
782 $objDefinition = $this->obj_definition;
784 if (empty($this->type_grps)) {
786 $objDefinition::getGroupedRepositoryObjectTypes($this->getContainerObject()->getType());
788 return $this->type_grps;
795 $lng->loadLanguageModule(
"rep");
797 $tpl =
new ilTemplate(
"tpl.rep_intro.html",
true,
true,
"Services/Repository");
799 $tpl->setVariable(
"TXT_WELCOME",
$lng->txt(
"rep_intro"));
800 $tpl->setVariable(
"TXT_INTRO_1",
$lng->txt(
"rep_intro1"));
801 $tpl->setVariable(
"TXT_INTRO_2",
$lng->txt(
"rep_intro2"));
802 $tpl->setVariable(
"TXT_INTRO_3", sprintf(
$lng->txt(
"rep_intro3"),
$lng->txt(
"add")));
803 $tpl->setVariable(
"TXT_INTRO_4", sprintf(
$lng->txt(
"rep_intro4"),
$lng->txt(
"cat_add")));
804 $tpl->setVariable(
"TXT_INTRO_5",
$lng->txt(
"rep_intro5"));
805 $tpl->setVariable(
"TXT_INTRO_6",
$lng->txt(
"rep_intro6"));
812 if (isset($this->items[
"itgr"]) && is_array($this->items[
"itgr"])) {
813 foreach ($this->items[
"itgr"] as $itgr) {
814 if (!$this->renderer->hasCustomBlock($itgr[
"child"])) {
815 $this->renderItemGroup($itgr);
817 $this->renderer->setBlockPosition($itgr[
"ref_id"], ++$a_pos);
826 $ilAccess = $this->access;
830 $perm_ok = ($ilAccess->checkAccess(
"visible",
"", $a_itgr[
'ref_id']) &&
831 $ilAccess->checkAccess(
"read",
"", $a_itgr[
'ref_id']));
836 $all_ids = array_map(
static function (array
$i):
int {
837 return (
int)
$i[
"child"];
838 }, $this->items[
"_all"]);
841 $items = array_filter($items,
static function (array
$i) use ($all_ids):
bool {
842 return in_array(
$i[
"ref_id"], $all_ids);
848 foreach ($items as $item) {
849 $this->renderer->hideItem($item[
"child"]);
854 $item_list_gui = $this->getItemGUI($a_itgr);
855 $item_list_gui->enableNotes(
false);
856 $item_list_gui->enableTags(
false);
857 $item_list_gui->enableComments(
false);
858 $item_list_gui->enableTimings(
false);
859 $item_list_gui->getListItemHTML(
863 $a_itgr[
"description"]
865 $commands_html = $item_list_gui->getCommandsHTML();
869 $beh = $item_group->getBehaviour();
870 $stored_val = $this->block_repo->getProperty(
871 "itgr_" . $a_itgr[
"ref_id"],
876 $beh = ($stored_val ===
"1")
883 "store-url" =>
"./ilias.php?baseClass=ilcontainerblockpropertiesstoragegui&cmd=store" .
884 "&cont_block_id=itgr_" . $a_itgr[
'ref_id']
887 !$this->getContainerGUI()->isActiveAdministrationPanel()) {
888 $this->renderer->addCustomBlock($a_itgr[
"ref_id"],
"", $commands_html,
$data);
890 $this->renderer->addCustomBlock($a_itgr[
"ref_id"], $a_itgr[
"title"], $commands_html,
$data);
897 $this->getContainerObject()->
getId()
898 )->sortSubItems(
'itgr', $a_itgr[
'obj_id'], $items);
904 foreach ($items as $item) {
907 $it_pres = $item_group->getListPresentation();
908 if ($this->getContainerGUI()->isActiveOrdering() ||
909 $this->getContainerGUI()->isActiveAdministrationPanel()) {
913 $html2 = $this->renderItem($item, $position++,
false,
"[itgr][" . $a_itgr[
'obj_id'] .
"]", $it_pres);
916 $this->renderer->addItemToBlock($a_itgr[
"ref_id"], $item[
"type"], $item[
"child"], $html2,
true);
923 $expand = $this->request->getExpand();
925 $this->item_manager->setExpanded(abs($expand), self::DETAILS_ALL);
926 } elseif ($expand < 0) {
927 $this->item_manager->setExpanded(abs($expand), self::DETAILS_TITLE);
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.
determineAdminCommands(int $a_ref_id, bool $a_admin_com_included_in_list=false)
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
forwardToColumnGUI()
Get columngui output.
getGroupedObjTypes()
Get grouped repository object types.
BlockSessionRepository $block_repo
ilContainerRenderer $renderer
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
renderPageEmbeddedBlocks()
hasForcedOrderByStartDate(string $type)
StandardGUIRequest $request
getItemGroupsHTML(int $a_pos=0)
getDetailsLevel(int $a_item_id)
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
clearAdminCommandsDetermination()
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
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...
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...
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...
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.
setContent(string $a_html)
Sets content for standard template.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
setRightContent(string $a_html)
Sets content of right column.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ChatMainBarProvider \MainMenu\Provider.