Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions components/ILIAS/Container/Content/class.ItemRenderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,7 @@ public function getItemGUI(array $item_data): \ilObjectListGUI
$item_list_gui = $this->list_gui[$item_data["type"]];
}

// unique js-ids
$item_list_gui->setParentRefId((int) ($item_data["parent"] ?? 0));
$item_list_gui->setParentRefId((int) ($item_data["block_parent"] ?? $item_data["parent"] ?? 0));

$item_list_gui->setDefaultCommandParameters(array());
$item_list_gui->disableTitleLink(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -935,6 +935,10 @@ public function renderItemBlockSequence(
if ($item_data === null) {
continue;
}
// use block_id as parent for unique IDs when item appears in multiple blocks
if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
$item_data["block_parent"] = (int) $block_id;
}
$checkbox = \ILIAS\Containter\Content\ItemRenderer::CHECKBOX_NONE;
if ($this->container_gui->isActiveAdministrationPanel()) {
$checkbox = \ILIAS\Containter\Content\ItemRenderer::CHECKBOX_ADMIN;
Expand Down
29 changes: 27 additions & 2 deletions components/ILIAS/Container/classes/class.ilContainerGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use ILIAS\Container\StandardGUIRequest;
use ILIAS\Container\Content\ModeManager;
use ILIAS\ILIASObject\Properties\Translations\TranslationGUI;
use ILIAS\UI\Component\Card\RepositoryObject;

/**
* Class ilContainerGUI
Expand Down Expand Up @@ -2171,6 +2172,8 @@ public function redrawListItemObject(): void
$item_data = $this->object->getSubItems(false, false, $child_ref_id);
$container_view = $this->getContentGUI();

$item_group_list_presentation = $this->getListPresentationForRedraw($parent_ref_id);

// see #41377 (material not redrawn, when not a direct child)
$sess_data = [];
if (isset($this->object->items["sess"])) {
Expand All @@ -2192,7 +2195,7 @@ public function redrawListItemObject(): void
if ($parent_ref_id > 0) {
$event_item["parent"] = $parent_ref_id;
}
$html = $container_view->renderItem($event_item);
$html = $container_view->renderItem($event_item, 0, false, "", $item_group_list_presentation);
}
}
}
Expand All @@ -2202,12 +2205,19 @@ public function redrawListItemObject(): void
if (!$html) {
foreach (($this->object->items["_all"] ?? []) as $id) {
if ($id["child"] == $child_ref_id) {
$html = $container_view->renderItem($id);
$id_with_block = $id;
if ($parent_ref_id > 0 && ilObject::_lookupType($parent_ref_id, true) === "itgr") {
$id_with_block["block_parent"] = $parent_ref_id;
}
$html = $container_view->renderItem($id_with_block, 0, false, "", $item_group_list_presentation);
}
}
}

if ($html) {
if ($html instanceof RepositoryObject) {
$html = $this->ui->renderer()->renderAsync($html);
}
echo $html;

// we need to add onload code manually (rating, comments, etc.)
Expand All @@ -2217,6 +2227,21 @@ public function redrawListItemObject(): void
exit;
}

protected function getListPresentationForRedraw(int $parent_ref_id): string
{
if ($parent_ref_id > 0 && ilObject::_lookupType($parent_ref_id, true) === "itgr") {
$item_group = new \ilObjItemGroup($parent_ref_id, true);
$presentation = $item_group->getListPresentation();
if ($presentation === "tile" || $presentation === "list") {
return $presentation;
}
}
$list_presentation = ilContainer::_lookupContainerSetting($this->object->getId(), "list_presentation");
return ($list_presentation === "tile" && !$this->isActiveAdministrationPanel() && !$this->isActiveItemOrdering())
? "tile"
: "list";
}

protected function initEditForm(): ilPropertyFormGUI
{
$lng = $this->lng;
Expand Down
Loading