ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilContainerRenderer Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilContainerRenderer:

Public Member Functions

 setBlockPrefixClosure (Closure $f)
 
 setBlockPostfixClosure (Closure $f)
 
 setItemHiddenClosure (Closure $f)
 
 addTypeBlock (string $a_type, ?string $a_prefix=null, ?string $a_postfix=null)
 
 hasTypeBlock (string $a_type)
 
 addCustomBlock ( $a_id, string $a_caption, ?string $a_actions=null, array $a_data=[])
 Add custom block. More...
 
 hasCustomBlock ($a_id)
 Custom block already exists? More...
 
 isValidBlock ($a_id)
 Any block with id exists? More...
 
 hideItem ($a_id)
 Mark item id as used, but do not render. More...
 
 removeItem ($a_id)
 Remove item (from any block) More...
 
 hasItem ($a_id)
 Item with id exists? More...
 
 addItemToBlock ( $a_block_id, string $a_item_type, $a_item_id, $a_item_html, bool $a_force=false)
 Add item to existing block. More...
 
 addItemId ($a_item_id)
 
 addShowMoreButton ($a_block_id)
 Add show more button to a block. More...
 
 addDetailsLevel (int $a_level, string $a_url, bool $a_active=false)
 
 resetDetails ()
 
 setBlockPosition ( $a_block_id, int $a_pos)
 
 getHTML ()
 
 renderSingleTypeBlock (string $a_type, bool $exhausted=false)
 
 renderSingleCustomBlock ($a_id)
 
 renderDetails (ilTemplate $a_tpl)
 
 getItemRenderer ()
 Render Item Block Sequence. More...
 
 renderItemBlockSequence (\ILIAS\Container\Content\ItemBlock\ItemBlockSequence $sequence)
 

Protected Member Functions

 getViewMode ()
 
 processBlockPositions ()
 
 renderHelperCustomBlock (ilTemplate $a_block_tpl, $a_block_id, bool $a_is_single=false, bool $is_exhausted=false)
 
 renderHelperTypeBlock (ilTemplate $a_block_tpl, string $a_type, bool $a_is_single=false, bool $is_exhausted=false)
 
 getViewModeOfItemGroup (int $ref_id)
 
 getListPresentationOfItemGroup (int $ref_id)
 
 renderHelperGeneric (ilTemplate $a_block_tpl, $a_block_id, array $a_block, bool $a_is_single=false, bool $is_exhausted=false)
 
 initBlockTemplate ()
 
 addHeaderRow (ilTemplate $a_tpl, string $a_type="", string $a_text="", ?array $a_types_in_block=null, string $a_commands_html="", string $a_order_id="", array $a_data=[])
 Render block header. More...
 
 addStandardRow (ilTemplate $a_tpl, string $a_html, int $a_ref_id=0)
 
 renderSelectAllBlock (ilTemplate $a_tpl)
 Render "select all". More...
 
 addSeparatorRow (ilTemplate $a_tpl)
 
 getDownloadableTypes ()
 Get downloadable repository object types. More...
 
 renderContainerPage ()
 
 getDetailsLevel (int $a_item_id)
 
 addItemGroupBlock (string $block_id, int $block_pos=0)
 replaces ilContainerContentGUI::renderItemGroup More...
 
 getBlockPrefix ($block_id)
 
 getBlockPostfix ($block_id)
 
 isItemHidden (string $block_id, int $ref_id)
 

Protected Attributes

const UNIQUE_SEPARATOR = "-"
 
ILIAS Container Content ItemManager $item_manager
 
ilAccessHandler $access
 
ilObjUser $user
 
ILIAS Containter Content ObjectiveRenderer $objective_renderer
 
ILIAS Containter Content ItemRenderer $item_renderer
 
ILIAS Container Content ItemPresentationManager $item_presentation
 
bool $admin_panel
 
ilLanguage $lng
 
ilSetting $settings
 
ilObjectDefinition $obj_definition
 
ilContainerGUI $container_gui
 
bool $enable_manage_select_all
 
bool $enable_multi_download
 
bool $active_block_ordering
 
array $type_blocks = []
 
array $custom_blocks = []
 
array $items = []
 
array $hidden_items = []
 
array $block_items = []
 
array $details = []
 
array $item_ids = []
 
array $rendered_blocks = []
 
int $bl_cnt = 0
 
array $block_pos = []
 
array $block_custom_pos = []
 
int $order_cnt = 0
 
array $show_more = []
 
int $view_mode
 
ILIAS DI UIServices $ui
 
ilCtrl $ctrl
 
Closure $block_prefix_closure = null
 
Closure $block_postfix_closure = null
 
Closure $item_hidden_closure = null
 
ILIAS Container Content BlockSessionRepository $block_repo
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Class ilContainerRenderer

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om

Definition at line 24 of file class.ilContainerRenderer.php.

Member Function Documentation

◆ addCustomBlock()

ilContainerRenderer::addCustomBlock (   $a_id,
string  $a_caption,
?string  $a_actions = null,
array  $a_data = [] 
)

Add custom block.

Parameters
mixed$a_id

Definition at line 182 of file class.ilContainerRenderer.php.

References hasCustomBlock().

Referenced by addItemGroupBlock(), and renderItemBlockSequence().

187  : bool {
188  if (!$this->hasCustomBlock($a_id)) {
189  $this->custom_blocks[$a_id] = [
190  "caption" => $a_caption
191  ,"actions" => $a_actions
192  ,"data" => $a_data
193  ];
194  return true;
195  }
196  return false;
197  }
hasCustomBlock($a_id)
Custom block already exists?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addDetailsLevel()

ilContainerRenderer::addDetailsLevel ( int  $a_level,
string  $a_url,
bool  $a_active = false 
)

Definition at line 339 of file class.ilContainerRenderer.php.

343  : void {
344  $this->details[$a_level] = [
345  "url" => $a_url
346  ,"active" => $a_active
347  ];
348  }

◆ addHeaderRow()

ilContainerRenderer::addHeaderRow ( ilTemplate  $a_tpl,
string  $a_type = "",
string  $a_text = "",
?array  $a_types_in_block = null,
string  $a_commands_html = "",
string  $a_order_id = "",
array  $a_data = [] 
)
protected

Render block header.

Parameters
string$a_order_iditem group id or type, e.g. "crs"
Exceptions
ilTemplateException

Definition at line 677 of file class.ilContainerRenderer.php.

References $ilSetting, $lng, $obj_definition, $settings, ilItemGroupBehaviour\EXPANDABLE_CLOSED, getDownloadableTypes(), ilUtil\getImagePath(), ilObjectPlugin\getPluginObjectByType(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), renderSelectAllBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), ilTemplate\touchBlock(), and ilLanguage\txt().

Referenced by renderHelperGeneric().

685  : void {
686  $lng = $this->lng;
688  $objDefinition = $this->obj_definition;
689 
690  $a_tpl->setVariable("CB_ID", ' id="bl_cntr_' . (++$this->bl_cnt) . '"');
691 
692  if ($this->enable_manage_select_all) {
693  $this->renderSelectAllBlock($a_tpl);
694  } elseif ($this->enable_multi_download) {
695  if ($a_type) {
696  $a_types_in_block = [$a_type];
697  }
698  foreach ($a_types_in_block as $type) {
699  if (in_array($type, $this->getDownloadableTypes(), true)) {
700  $this->renderSelectAllBlock($a_tpl);
701  break;
702  }
703  }
704  }
705 
706  if ($a_text === "" && $a_type !== "") {
707  if (!$objDefinition->isPlugin($a_type)) {
708  $title = $lng->txt("objs_" . $a_type);
709  } else {
711  $title = $pl->txt("objs_" . $a_type);
712  }
713  } else {
714  $title = $a_text;
715  }
716 
717  if (is_array($a_data)) {
718  foreach ($a_data as $k => $v) {
719  $a_tpl->setCurrentBlock("cb_data");
720  $a_tpl->setVariable("DATA_KEY", $k);
721  $a_tpl->setVariable("DATA_VALUE", $v);
722  $a_tpl->parseCurrentBlock();
723 
724  if ($k === "behaviour" && $v == ilItemGroupBehaviour::EXPANDABLE_CLOSED) {
725  $a_tpl->touchBlock("container_items_hide");
726  }
727  }
728  }
729 
730  if ($a_type !== "" && $ilSetting->get("icon_position_in_lists") !== "item_rows") {
731  $icon = ilUtil::getImagePath("standard/icon_" . $a_type . ".svg");
732 
733  $a_tpl->setCurrentBlock("container_header_row_image");
734  $a_tpl->setVariable("HEADER_IMG", $icon);
735  $a_tpl->setVariable("HEADER_ALT", $title);
736  } else {
737  $a_tpl->setCurrentBlock("container_header_row");
738  }
739 
740  if ($a_order_id !== "") {
741  $a_tpl->setVariable("BLOCK_HEADER_ORDER_NAME", "position[blocks][" . $a_order_id . "]");
742  $a_tpl->setVariable("BLOCK_HEADER_ORDER_NUM", (++$this->order_cnt) * 10);
743  }
744 
745  $presentation_title = $title;
746  $sr_only = "";
747  if (trim($title) === "") {
748  $presentation_title = $this->lng->txt("cont_no_title");
749  $sr_only = "sr-only";
750  }
751  $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $presentation_title);
752  $a_tpl->setVariable("SR_ONLY", $sr_only);
753  $a_tpl->setVariable("CHR_COMMANDS", $a_commands_html);
754  $a_tpl->parseCurrentBlock();
755  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
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...
getDownloadableTypes()
Get downloadable repository object types.
touchBlock(string $block)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
ilObjectDefinition $obj_definition
static getPluginObjectByType(string $type)
Return either a repoObject plugin or a orgunit extension plugin or null if the type is not a plugin...
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
global $ilSetting
Definition: privfeed.php:31
renderSelectAllBlock(ilTemplate $a_tpl)
Render "select all".
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addItemGroupBlock()

ilContainerRenderer::addItemGroupBlock ( string  $block_id,
int  $block_pos = 0 
)
protected

replaces ilContainerContentGUI::renderItemGroup

Definition at line 1049 of file class.ilContainerRenderer.php.

References $data, addCustomBlock(), ilItemGroupBehaviour\ALWAYS_OPEN, ilItemGroupBehaviour\EXPANDABLE_CLOSED, ilItemGroupBehaviour\EXPANDABLE_OPEN, ilObjItemGroup\lookupHideTitle(), and ILIAS\Repository\user().

Referenced by renderItemBlockSequence().

1049  : void
1050  {
1051  $item_data = $this->item_presentation->getRawDataByRefId((int) $block_id);
1052  $item_list_gui = $this->item_renderer->getItemGUI($item_data);
1053 
1054  $perm_ok = true;
1055  /*
1056  $ilAccess = $this->access;
1057  $ilUser = $this->user;
1058 
1059  // #16493
1060  $perm_ok = ($ilAccess->checkAccess("visible", "", $item_data['ref_id']) &&
1061  $ilAccess->checkAccess("read", "", $item_data['ref_id']));
1062 
1063  $items = ilObjectActivation::getItemsByItemGroup($item_data['ref_id']);
1064 
1065  // get all valid ids (this is filtered)
1066  $all_ids = array_map(static function (array $i) : int {
1067  return (int) $i["child"];
1068  }, $this->items["_all"]);
1069 
1070  // remove filtered items
1071  $items = array_filter($items, static function (array $i) use ($all_ids) : bool {
1072  return in_array($i["ref_id"], $all_ids);
1073  });
1074 
1075  // if no permission is given, set the items to "rendered" but
1076  // do not display the whole block
1077  if (!$perm_ok) {
1078  foreach ($items as $item) {
1079  $this->renderer->hideItem($item["child"]);
1080  }
1081  return;
1082  }
1083  */
1084 
1085  $item_list_gui->enableNotes(false);
1086  $item_list_gui->enableTags(false);
1087  $item_list_gui->enableComments(false);
1088  $item_list_gui->enableTimings(false);
1089  $item_list_gui->initItem(
1090  (int) $item_data["ref_id"],
1091  (int) $item_data["obj_id"],
1092  "itgr",
1093  $item_data["title"],
1094  $item_data["description"]
1095  );
1096  $commands_html = $item_list_gui->getCommandsHTML();
1097 
1098  // determine behaviour
1099  $item_group = new ilObjItemGroup($item_data["ref_id"]);
1100  $beh = $item_group->getBehaviour();
1101  $stored_val = $this->block_repo->getProperty(
1102  "itgr_" . $item_data["ref_id"],
1103  $this->user->getId(),
1104  "opened"
1105  );
1106  if ($stored_val !== "" && $beh !== ilItemGroupBehaviour::ALWAYS_OPEN) {
1107  $beh = ($stored_val === "1")
1110  }
1111 
1112  $data = [
1113  "behaviour" => $beh,
1114  "store-url" => "./ilias.php?baseClass=ilcontainerblockpropertiesstoragegui&cmd=store" .
1115  "&cont_block_id=itgr_" . $item_data['ref_id']
1116  ];
1117  if (ilObjItemGroup::lookupHideTitle($item_data["obj_id"]) &&
1118  !$this->container_gui->isActiveAdministrationPanel()) {
1119  $this->addCustomBlock($block_id, "", $commands_html, $data);
1120  } else {
1121  $this->addCustomBlock($block_id, $item_data["title"], $commands_html, $data);
1122  }
1123  }
static lookupHideTitle(int $a_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addCustomBlock( $a_id, string $a_caption, ?string $a_actions=null, array $a_data=[])
Add custom block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addItemId()

ilContainerRenderer::addItemId (   $a_item_id)
Parameters
mixed$a_item_id

Definition at line 325 of file class.ilContainerRenderer.php.

Referenced by addItemToBlock().

325  : void
326  {
327  $this->item_ids[$a_item_id] = true;
328  }
+ Here is the caller graph for this function:

◆ addItemToBlock()

ilContainerRenderer::addItemToBlock (   $a_block_id,
string  $a_item_type,
  $a_item_id,
  $a_item_html,
bool  $a_force = false 
)

Add item to existing block.

Parameters
mixed$a_block_id
mixed$a_item_id
mixed$a_item_html

Definition at line 288 of file class.ilContainerRenderer.php.

References addItemId(), hasItem(), and isValidBlock().

Referenced by renderItemBlockSequence().

294  : bool {
295  if ($a_item_type !== "itgr" &&
296  $this->isValidBlock($a_block_id) &&
297  (!$this->hasItem($a_item_id) || $a_force)) {
298  if (is_string($a_item_html) && trim($a_item_html) === "") {
299  return false;
300  }
301  if (!$a_item_html) {
302  return false;
303  }
304 
305 
306  // #16563 - item_id (== ref_id) is NOT unique, adding parent block id
307  $uniq_id = $a_block_id . self::UNIQUE_SEPARATOR . $a_item_id;
308 
309  $this->items[$uniq_id] = [
310  "type" => $a_item_type
311  ,"html" => $a_item_html
312  ];
313 
314  // #18326
315  $this->addItemId($a_item_id);
316  $this->block_items[$a_block_id][] = $uniq_id;
317  return true;
318  }
319  return false;
320  }
hasItem($a_id)
Item with id exists?
isValidBlock($a_id)
Any block with id exists?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addSeparatorRow()

ilContainerRenderer::addSeparatorRow ( ilTemplate  $a_tpl)
protected

Definition at line 792 of file class.ilContainerRenderer.php.

References ilTemplate\parseCurrentBlock(), and ilTemplate\setCurrentBlock().

Referenced by getHTML(), and renderItemBlockSequence().

792  : void
793  {
794  $a_tpl->setCurrentBlock("container_block");
795  $a_tpl->parseCurrentBlock();
796  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addShowMoreButton()

ilContainerRenderer::addShowMoreButton (   $a_block_id)

Add show more button to a block.

Parameters
mixed$a_block_id

Definition at line 334 of file class.ilContainerRenderer.php.

334  : void
335  {
336  $this->show_more[] = $a_block_id;
337  }

◆ addStandardRow()

ilContainerRenderer::addStandardRow ( ilTemplate  $a_tpl,
string  $a_html,
int  $a_ref_id = 0 
)
protected

Definition at line 757 of file class.ilContainerRenderer.php.

References ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilTemplate\touchBlock().

Referenced by renderHelperGeneric().

761  : void {
762  if ($a_ref_id > 0) {
763  $a_tpl->setCurrentBlock("row");
764  $a_tpl->setVariable("ROW_ID", 'id="item_row_' . $a_ref_id . '"');
765  $a_tpl->parseCurrentBlock();
766  } else {
767  $a_tpl->touchBlock("row");
768  }
769 
770  $a_tpl->setCurrentBlock("container_standard_row");
771  $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
772  $a_tpl->parseCurrentBlock();
773 
774  $a_tpl->touchBlock("container_row");
775  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
touchBlock(string $block)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addTypeBlock()

ilContainerRenderer::addTypeBlock ( string  $a_type,
?string  $a_prefix = null,
?string  $a_postfix = null 
)

Definition at line 157 of file class.ilContainerRenderer.php.

References hasTypeBlock().

Referenced by renderItemBlockSequence().

161  : bool {
162  if ($a_type !== "itgr" &&
163  !$this->hasTypeBlock($a_type)) {
164  $this->type_blocks[$a_type] = [
165  "prefix" => $a_prefix
166  ,"postfix" => $a_postfix
167  ];
168  return true;
169  }
170  return false;
171  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBlockPostfix()

ilContainerRenderer::getBlockPostfix (   $block_id)
protected

Definition at line 1134 of file class.ilContainerRenderer.php.

References $block_postfix_closure, and $c.

Referenced by renderItemBlockSequence().

1134  : string
1135  {
1136  if ($this->block_postfix_closure instanceof Closure) {
1138  return (string) $c($block_id);
1139  }
1140  return "";
1141  }
$c
Definition: deliver.php:25
+ Here is the caller graph for this function:

◆ getBlockPrefix()

ilContainerRenderer::getBlockPrefix (   $block_id)
protected

Definition at line 1125 of file class.ilContainerRenderer.php.

References $block_prefix_closure, and $c.

Referenced by renderItemBlockSequence().

1125  : string
1126  {
1127  if ($this->block_prefix_closure instanceof Closure) {
1129  return (string) $c($block_id);
1130  }
1131  return "";
1132  }
$c
Definition: deliver.php:25
+ Here is the caller graph for this function:

◆ getDetailsLevel()

ilContainerRenderer::getDetailsLevel ( int  $a_item_id)
protected

Definition at line 831 of file class.ilContainerRenderer.php.

References ilContainerContentGUI\DETAILS_DEACTIVATED, ilContainerContentGUI\DETAILS_TITLE, and null.

Referenced by renderItemBlockSequence().

831  : int
832  {
833  if ($this->container_gui->isActiveAdministrationPanel()) {
835  }
836  if ($this->item_manager->getExpanded($a_item_id) !== null) {
837  return $this->item_manager->getExpanded($a_item_id);
838  }
839  /*if ($a_item_id === $this->force_details) {
840  return ilContainerContentGUI::DETAILS_ALL;
841  }*/
843  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getDownloadableTypes()

ilContainerRenderer::getDownloadableTypes ( )
protected

Get downloadable repository object types.

Definition at line 801 of file class.ilContainerRenderer.php.

Referenced by addHeaderRow().

801  : array
802  {
803  return ["fold", "file"];
804  }
+ Here is the caller graph for this function:

◆ getHTML()

ilContainerRenderer::getHTML ( )

Definition at line 372 of file class.ilContainerRenderer.php.

References $valid, addSeparatorRow(), initBlockTemplate(), processBlockPositions(), renderDetails(), renderHelperCustomBlock(), and renderHelperTypeBlock().

372  : string
373  {
374  $valid = false;
375 
376  $block_tpl = $this->initBlockTemplate();
377 
378  foreach ($this->processBlockPositions() as $block_id) {
379  if (array_key_exists($block_id, $this->custom_blocks) && $this->renderHelperCustomBlock(
380  $block_tpl,
381  $block_id
382  )) {
383  $this->addSeparatorRow($block_tpl);
384  $valid = true;
385  }
386  if (array_key_exists($block_id, $this->type_blocks) && $this->renderHelperTypeBlock(
387  $block_tpl,
388  $block_id
389  )) {
390  $this->addSeparatorRow($block_tpl);
391  $valid = true;
392  }
393  }
394 
395  if ($valid) {
396  $this->renderDetails($block_tpl);
397 
398  return $block_tpl->get();
399  }
400  return "";
401  }
$valid
addSeparatorRow(ilTemplate $a_tpl)
renderHelperCustomBlock(ilTemplate $a_block_tpl, $a_block_id, bool $a_is_single=false, bool $is_exhausted=false)
renderDetails(ilTemplate $a_tpl)
renderHelperTypeBlock(ilTemplate $a_block_tpl, string $a_type, bool $a_is_single=false, bool $is_exhausted=false)
+ Here is the call graph for this function:

◆ getItemRenderer()

ilContainerRenderer::getItemRenderer ( )

Render Item Block Sequence.

Definition at line 821 of file class.ilContainerRenderer.php.

References $item_renderer.

◆ getListPresentationOfItemGroup()

ilContainerRenderer::getListPresentationOfItemGroup ( int  $ref_id)
protected

Definition at line 518 of file class.ilContainerRenderer.php.

Referenced by renderItemBlockSequence().

518  : string
519  {
520  $item_group = new ilObjItemGroup($ref_id);
521  return $item_group->getListPresentation();
522  }
$ref_id
Definition: ltiauth.php:65
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the caller graph for this function:

◆ getViewMode()

ilContainerRenderer::getViewMode ( )
protected

Definition at line 148 of file class.ilContainerRenderer.php.

References $view_mode.

Referenced by renderHelperGeneric().

148  : int
149  {
150  return $this->view_mode;
151  }
+ Here is the caller graph for this function:

◆ getViewModeOfItemGroup()

ilContainerRenderer::getViewModeOfItemGroup ( int  $ref_id)
protected

Definition at line 506 of file class.ilContainerRenderer.php.

References $view_mode, ilContainerContentGUI\VIEW_MODE_LIST, and ilContainerContentGUI\VIEW_MODE_TILE.

506  : int
507  {
508  $item_group = new ilObjItemGroup($ref_id);
510  if ($item_group->getListPresentation() !== "") {
511  $view_mode = ($item_group->getListPresentation() === "tile")
514  }
515  return $view_mode;
516  }
$ref_id
Definition: ltiauth.php:65
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ hasCustomBlock()

ilContainerRenderer::hasCustomBlock (   $a_id)

Custom block already exists?

Parameters
mixed$a_id

Definition at line 203 of file class.ilContainerRenderer.php.

Referenced by addCustomBlock(), isValidBlock(), and renderHelperCustomBlock().

203  : bool
204  {
205  return array_key_exists($a_id, $this->custom_blocks);
206  }
+ Here is the caller graph for this function:

◆ hasItem()

ilContainerRenderer::hasItem (   $a_id)

Item with id exists?

Parameters
mixed$a_id

Definition at line 275 of file class.ilContainerRenderer.php.

Referenced by addItemToBlock(), and removeItem().

275  : bool
276  {
277  return (array_key_exists($a_id, $this->item_ids) ||
278  array_key_exists($a_id, $this->hidden_items));
279  }
+ Here is the caller graph for this function:

◆ hasTypeBlock()

ilContainerRenderer::hasTypeBlock ( string  $a_type)

Definition at line 173 of file class.ilContainerRenderer.php.

Referenced by addTypeBlock(), isValidBlock(), and renderHelperTypeBlock().

173  : bool
174  {
175  return array_key_exists($a_type, $this->type_blocks);
176  }
+ Here is the caller graph for this function:

◆ hideItem()

ilContainerRenderer::hideItem (   $a_id)

Mark item id as used, but do not render.

Parameters
mixed$a_id

Definition at line 228 of file class.ilContainerRenderer.php.

228  : void
229  {
230  // see hasItem();
231  $this->hidden_items[$a_id] = true;
232 
233  // #16629 - do not remove hidden items from other blocks
234  // $this->removeItem($a_id);
235  }

◆ initBlockTemplate()

ilContainerRenderer::initBlockTemplate ( )
protected

Definition at line 667 of file class.ilContainerRenderer.php.

Referenced by getHTML(), renderItemBlockSequence(), renderSingleCustomBlock(), and renderSingleTypeBlock().

667  : ilTemplate
668  {
669  return new ilTemplate("tpl.container_list_block.html", true, true, "components/ILIAS/Container");
670  }
+ Here is the caller graph for this function:

◆ isItemHidden()

ilContainerRenderer::isItemHidden ( string  $block_id,
int  $ref_id 
)
protected

Definition at line 1143 of file class.ilContainerRenderer.php.

References $c, and $item_hidden_closure.

Referenced by renderItemBlockSequence().

1143  : bool
1144  {
1145  if ($this->item_hidden_closure instanceof Closure) {
1147  return (bool) $c($block_id, $ref_id);
1148  }
1149  return false;
1150  }
$c
Definition: deliver.php:25
$ref_id
Definition: ltiauth.php:65
+ Here is the caller graph for this function:

◆ isValidBlock()

ilContainerRenderer::isValidBlock (   $a_id)

Any block with id exists?

Parameters
mixed$a_id

Definition at line 212 of file class.ilContainerRenderer.php.

References hasCustomBlock(), and hasTypeBlock().

Referenced by addItemToBlock(), processBlockPositions(), and setBlockPosition().

212  : bool
213  {
214  return ($this->hasTypeBlock($a_id) ||
215  $this->hasCustomBlock($a_id));
216  }
hasCustomBlock($a_id)
Custom block already exists?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ processBlockPositions()

ilContainerRenderer::processBlockPositions ( )
protected

Definition at line 430 of file class.ilContainerRenderer.php.

References $block_pos, and isValidBlock().

Referenced by getHTML().

430  : array
431  {
432  // manual order
433  if (is_array($this->block_custom_pos) && count($this->block_custom_pos)) {
434  $tmp = $this->block_pos;
435  $this->block_pos = [];
436  foreach ($this->block_custom_pos as $idx => $block_id) {
437  if ($this->isValidBlock($block_id)) {
438  $this->block_pos[$block_id] = $idx;
439  }
440  }
441 
442  // at least some manual are valid
443  if (count($this->block_pos)) {
444  // append missing blocks from default order
445  $last = max($this->block_pos);
446  foreach (array_keys($tmp) as $block_id) {
447  if (!array_key_exists($block_id, $this->block_pos)) {
448  $this->block_pos[$block_id] = ++$last;
449  }
450  }
451  }
452  // all manual invalid, use default
453  else {
454  $this->block_pos = $tmp;
455  }
456  }
457 
458  // add missing blocks to order
459  $last = count($this->block_pos)
460  ? max($this->block_pos)
461  : 0;
462  foreach (array_keys($this->custom_blocks) as $block_id) {
463  if (!array_key_exists($block_id, $this->block_pos)) {
464  $this->block_pos[$block_id] = ++$last;
465  }
466  }
467  foreach (array_keys($this->type_blocks) as $block_id) {
468  if (!array_key_exists($block_id, $this->block_pos)) {
469  $this->block_pos[$block_id] = ++$last;
470  }
471  }
472 
473  asort($this->block_pos);
474  return array_keys($this->block_pos);
475  }
isValidBlock($a_id)
Any block with id exists?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeItem()

ilContainerRenderer::removeItem (   $a_id)

Remove item (from any block)

Parameters
mixed$a_id

Definition at line 241 of file class.ilContainerRenderer.php.

References $parts, and hasItem().

241  : void
242  {
243  if (!$this->hasItem($a_id)) {
244  return;
245  }
246 
247  unset($this->item_ids[$a_id], $this->hidden_items[$a_id]);
248 
249  foreach (array_keys($this->items) as $item_id) {
250  $parts = explode(self::UNIQUE_SEPARATOR, $item_id);
251  if (array_pop($parts) == $a_id) {
252  unset($this->items[$item_id]);
253  }
254  }
255 
256  foreach ($this->block_items as $block_id => $items) {
257  foreach ($items as $idx => $item_id) {
258  $parts = explode(self::UNIQUE_SEPARATOR, $item_id);
259  if (array_pop($parts) == $a_id) {
260  unset($this->block_items[$block_id][$idx]);
261  if (!count($this->block_items[$block_id])) {
262  unset($this->block_items[$block_id]);
263  }
264  break;
265  }
266  }
267  }
268  }
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61
hasItem($a_id)
Item with id exists?
+ Here is the call graph for this function:

◆ renderContainerPage()

ilContainerRenderer::renderContainerPage ( )
protected

Definition at line 826 of file class.ilContainerRenderer.php.

Referenced by renderItemBlockSequence().

826  : string
827  {
828  return $this->container_gui->getContainerPageHTML();
829  }
+ Here is the caller graph for this function:

◆ renderDetails()

ilContainerRenderer::renderDetails ( ilTemplate  $a_tpl)

Definition at line 806 of file class.ilContainerRenderer.php.

References $lng, ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

Referenced by getHTML(), and renderItemBlockSequence().

806  : void
807  {
808  $lng = $this->lng;
809 
810  if (count($this->details)) {
811  $a_tpl->setCurrentBlock('container_details_row');
812  $a_tpl->setVariable('TXT_DETAILS', $lng->txt('details'));
813  $a_tpl->parseCurrentBlock();
814  }
815  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
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...
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderHelperCustomBlock()

ilContainerRenderer::renderHelperCustomBlock ( ilTemplate  $a_block_tpl,
  $a_block_id,
bool  $a_is_single = false,
bool  $is_exhausted = false 
)
protected
Parameters
mixed$a_block_id

Definition at line 480 of file class.ilContainerRenderer.php.

References hasCustomBlock(), and renderHelperGeneric().

Referenced by getHTML(), renderItemBlockSequence(), and renderSingleCustomBlock().

485  : bool {
486  if ($this->hasCustomBlock($a_block_id)) {
487  return $this->renderHelperGeneric($a_block_tpl, $a_block_id, $this->custom_blocks[$a_block_id], $a_is_single, $is_exhausted);
488  }
489  return false;
490  }
renderHelperGeneric(ilTemplate $a_block_tpl, $a_block_id, array $a_block, bool $a_is_single=false, bool $is_exhausted=false)
hasCustomBlock($a_id)
Custom block already exists?
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderHelperGeneric()

ilContainerRenderer::renderHelperGeneric ( ilTemplate  $a_block_tpl,
  $a_block_id,
array  $a_block,
bool  $a_is_single = false,
bool  $is_exhausted = false 
)
protected
Parameters
mixed$a_block_id

Definition at line 527 of file class.ilContainerRenderer.php.

References $active_block_ordering, $admin_panel, $ctrl, Vendor\Package\$f, $id, $renderer, $url, ilContainer\_lookupContainerSetting(), addHeaderRow(), addStandardRow(), ilCtrl\getLinkTarget(), getViewMode(), ilCtrl\isAsynch(), ILIAS\Repository\lng(), ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), ilCtrl\setParameter(), HTML_Template_IT\setVariable(), ilContainer\TILE_EXTRA_LARGE, ilContainer\TILE_FULL, ilContainer\TILE_LARGE, ilContainer\TILE_SMALL, ILIAS\Repository\ui(), ilContainerContentGUI\VIEW_MODE_LIST, ilContainerContentGUI\VIEW_MODE_TILE, and ILIAS\UI\Implementation\Component\Button\withLoadingAnimationOnClick().

Referenced by renderHelperCustomBlock(), and renderHelperTypeBlock().

533  : bool {
534  $ctrl = $this->ctrl;
535  if (!in_array($a_block_id, $this->rendered_blocks)) {
536  $this->rendered_blocks[] = $a_block_id;
537  $block_types = [];
538  if (isset($this->block_items[$a_block_id]) && is_array($this->block_items[$a_block_id])) {
539  foreach ($this->block_items[$a_block_id] as $item_id) {
540  if (isset($this->items[$item_id]["type"])) {
541  $block_types[] = $this->items[$item_id]["type"];
542  }
543  }
544  }
545 
546  // determine view mode and tile size
547  $tile_size = ilContainer::TILE_SMALL;
548  $view_mode = $this->getViewMode();
550  $tile_size = ilContainer::_lookupContainerSetting($this->container_gui->getObject()->getId(), "tile_size");
551  }
552  if (is_numeric($a_block_id)) {
553  $item_group = new ilObjItemGroup($a_block_id);
554  if ($item_group->getListPresentation() !== "") {
555  $view_mode = ($item_group->getListPresentation() === "tile" && !$this->active_block_ordering && !$this->admin_panel)
558  $tile_size = $item_group->getTileSize();
559  }
560  }
561 
562 
563  // #14610 - manage empty item groups
564  if ((isset($this->block_items[$a_block_id]) && is_array($this->block_items[$a_block_id])) ||
565  is_numeric($a_block_id)) {
566  $cards = [];
567 
568  $order_id = (!$a_is_single && $this->active_block_ordering)
569  ? $a_block_id
570  : "";
571  $this->addHeaderRow(
572  $a_block_tpl,
573  $a_block["type"] ?? '',
574  $a_block["caption"] ?? '',
575  array_unique($block_types),
576  $a_block["actions"] ?? '',
577  $order_id,
578  $a_block["data"] ?? []
579  );
580 
582  if (isset($a_block["prefix"]) && $a_block["prefix"]) {
583  $this->addStandardRow($a_block_tpl, $a_block["prefix"]);
584  }
585  }
586 
587  if (isset($this->block_items[$a_block_id])) {
588  foreach ($this->block_items[$a_block_id] as $item_id) {
590  $this->addStandardRow($a_block_tpl, $this->items[$item_id]["html"], (int) $item_id);
591  } else {
592  $cards[] = $this->items[$item_id]["html"];
593  }
594  }
595  }
596 
598  if (isset($a_block["postfix"]) && $a_block["postfix"]) {
599  $this->addStandardRow($a_block_tpl, $a_block["postfix"]);
600  }
601  }
602 
604  $f = $this->ui->factory();
605  $renderer = $this->ui->renderer();
606 
607  //Create a deck with large cards
608  switch ($tile_size) {
610  $deck = $f->deck($cards)->withSmallCardsSize();
611  break;
612 
614  $deck = $f->deck($cards)->withLargeCardsSize();
615  break;
616 
618  $deck = $f->deck($cards)->withExtraLargeCardsSize();
619  break;
620 
622  $deck = $f->deck($cards)->withFullSizedCardsSize();
623  break;
624 
625  default:
626  $deck = $f->deck($cards)->withNormalCardsSize();
627  break;
628  }
629 
630  $html = $renderer->render($deck);
631  $a_block_tpl->setCurrentBlock("tile_rows");
632  $a_block_tpl->setVariable("TILE_ROWS", $html);
633  $a_block_tpl->parseCurrentBlock();
634  }
635  // show more
636  if ($is_exhausted) {
637  $a_block_tpl->setCurrentBlock("show_more");
638 
639  $ctrl->setParameter($this->container_gui, "type", $a_block_id);
640  $url = $ctrl->getLinkTarget($this->container_gui, "renderBlockAsynch", "", true);
641  $ctrl->setParameter($this->container_gui, "type", "");
642 
643  $f = $this->ui->factory();
644  $renderer = $this->ui->renderer();
645  $button = $f->button()->standard($this->lng->txt("cont_show_more"), "")
647  ->withOnLoadCode(function ($id) use ($a_block_id, $url) {
648  return "il.Container.initShowMore('$id', '$a_block_id', '" . $url . "');";
649  });
650  if ($ctrl->isAsynch()) {
651  $a_block_tpl->setVariable("SHOW_MORE_BUTTON", $renderer->renderAsync($button));
652  } else {
653  $a_block_tpl->setVariable("SHOW_MORE_BUTTON", $renderer->render($button));
654  }
655  $a_block_tpl->parseCurrentBlock();
656  $a_block_tpl->setCurrentBlock("show_more");
657  $a_block_tpl->parseCurrentBlock();
658  }
659 
660  return true;
661  }
662  }
663 
664  return false;
665  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$renderer
getLinkTarget(object $a_gui_obj, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
$url
Definition: shib_logout.php:66
withLoadingAnimationOnClick(bool $loading_animation_on_click=true)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
static _lookupContainerSetting(int $a_id, string $a_keyword, ?string $a_default_value=null)
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
addStandardRow(ilTemplate $a_tpl, string $a_html, int $a_ref_id=0)
addHeaderRow(ilTemplate $a_tpl, string $a_type="", string $a_text="", ?array $a_types_in_block=null, string $a_commands_html="", string $a_order_id="", array $a_data=[])
Render block header.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderHelperTypeBlock()

ilContainerRenderer::renderHelperTypeBlock ( ilTemplate  $a_block_tpl,
string  $a_type,
bool  $a_is_single = false,
bool  $is_exhausted = false 
)
protected

Definition at line 492 of file class.ilContainerRenderer.php.

References hasTypeBlock(), and renderHelperGeneric().

Referenced by getHTML(), renderItemBlockSequence(), and renderSingleTypeBlock().

497  : bool {
498  if ($this->hasTypeBlock($a_type)) {
499  $block = $this->type_blocks[$a_type];
500  $block["type"] = $a_type;
501  return $this->renderHelperGeneric($a_block_tpl, $a_type, $block, $a_is_single, $is_exhausted);
502  }
503  return false;
504  }
renderHelperGeneric(ilTemplate $a_block_tpl, $a_block_id, array $a_block, bool $a_is_single=false, bool $is_exhausted=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderItemBlockSequence()

ilContainerRenderer::renderItemBlockSequence ( \ILIAS\Container\Content\ItemBlock\ItemBlockSequence  $sequence)

Definition at line 845 of file class.ilContainerRenderer.php.

References $id, $ref_id, $valid, ilObject\_lookupObjId(), ILIAS\Repository\access(), addCustomBlock(), addItemGroupBlock(), addItemToBlock(), addSeparatorRow(), addTypeBlock(), ILIAS\Containter\Content\ItemRenderer\CHECKBOX_ADMIN, ILIAS\Containter\Content\ItemRenderer\CHECKBOX_DOWNLOAD, ILIAS\Containter\Content\ItemRenderer\CHECKBOX_NONE, ilObjectListGUI\CONTEXT_REPOSITORY, getBlockPostfix(), getBlockPrefix(), getDetailsLevel(), ilObjectActivation\getItemsByEvent(), getListPresentationOfItemGroup(), initBlockTemplate(), isItemHidden(), ILIAS\Repository\lng(), renderContainerPage(), renderDetails(), renderHelperCustomBlock(), renderHelperTypeBlock(), renderSingleCustomBlock(), and renderSingleTypeBlock().

847  : string {
848  $valid = false;
849 
850  $page_html = $this->renderContainerPage();
851  $block_tpl = $this->initBlockTemplate();
852 
854  foreach ($this->item_presentation->getAllRefIds() as $ref_id) {
855  $rd = $this->item_presentation->getRawDataByRefId($ref_id);
856  $preloader->addItem($rd["obj_id"], $rd["type"], $ref_id);
857  if ($rd["type"] === "sess") {
858  $ev_items = ilObjectActivation::getItemsByEvent((int) $rd["obj_id"]);
859  foreach ($ev_items as $ev_item) {
860  $preloader->addItem((int) $ev_item["obj_id"], $ev_item["type"], $ev_item["ref_id"]);
861  }
862  }
863  }
864  $preloader->preload();
865 
866  $embedded_block_ids = $this->item_presentation->getPageEmbeddedBlockIds();
867  foreach ($sequence->getBlocks() as $block) {
868  $block_id = "";
869  $force_item_even_if_already_rendered = false;
870  if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
871  $block_id = (string) $block->getBlock()->getRefId();
872  $force_item_even_if_already_rendered = true;
873  }
874  if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock) {
875  $block_id = $block->getBlock()->getType();
876  if ($block->getPageEmbedded()) {
877  $force_item_even_if_already_rendered = true;
878  }
879  }
880  if ($block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
881  $block_id = "sess";
882  }
883  if ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
884  $block_id = "_other";
885  }
886  if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectivesBlock) {
887  $block_id = "_lobj";
888  }
889 
890  $position = 1;
891  $pos_prefix = "";
892 
893  // (1) add block
894  if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
895  $this->addItemGroupBlock($block_id);
896  $pos_prefix = "[itgr][" . \ilObject::_lookupObjId($block->getBlock()->getRefId()) . "]";
897  }
898  if ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
899  $title = $this->item_presentation->filteredSubtree()
900  ? $this->lng->txt("cont_found_objects")
901  : $this->lng->txt("content");
902  $this->addCustomBlock($block_id, $title);
903  }
904  if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock ||
905  $block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
906  $this->addTypeBlock(
907  $block_id,
908  $this->getBlockPrefix($block_id),
909  $this->getBlockPostfix($block_id)
910  );
911  }
912 
913  // (2) render and add items
914  foreach ($block->getItemRefIds() as $ref_id) {
915  if ($this->isItemHidden($block_id, $ref_id)) {
916  continue;
917  }
918  if (!$this->access->checkAccess('visible', '', $ref_id)) {
919  continue;
920  }
921 
922  $item_data = $this->item_presentation->getRawDataByRefId($ref_id);
924  if ($this->container_gui->isActiveAdministrationPanel()) {
926  } elseif ($this->container_gui->isMultiDownloadEnabled()) {
928  }
929  $item_group_list_presentation = "";
930  if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
931  if ($this->getListPresentationOfItemGroup((int) $block_id) === "tile") {
932  if (!$this->admin_panel && !$this->active_block_ordering) {
933  $item_group_list_presentation = "tile";
934  }
935  }
936  if ($this->getListPresentationOfItemGroup((int) $block_id) === "list") {
937  if (!$this->admin_panel && !$this->active_block_ordering) {
938  $item_group_list_presentation = "list";
939  }
940  }
941  }
942  $html = $this->item_renderer->renderItem(
943  $item_data,
944  $position++,
945  false,
946  $pos_prefix,
947  $item_group_list_presentation,
948  $checkbox,
949  $this->item_presentation->isActiveItemOrdering(),
950  $this->getDetailsLevel($item_data["obj_id"])
951  );
952  if ($html != "") {
953  $this->addItemToBlock(
954  $block_id,
955  $item_data["type"],
956  $item_data["child"],
957  $html,
958  $force_item_even_if_already_rendered
959  );
960  }
961  }
962 
963  // (3) render blocks
964  if ($block->getPageEmbedded()) {
965  if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock ||
966  $block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
967  $page_html = preg_replace(
968  '~\[list-' . $block->getId() . '\]~i',
969  $this->renderSingleTypeBlock($block->getId(), $block->getLimitExhausted()),
970  $page_html
971  );
972  $valid = true;
973  } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
974  $page_html = preg_replace(
975  '~\[item-group-' . $block->getId() . '\]~i',
976  $this->renderSingleCustomBlock((int) $block->getId()),
977  $page_html
978  );
979  $valid = true;
980  } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
981  $page_html = preg_replace(
982  '~\[list-_other\]~i',
983  $this->renderSingleCustomBlock($block->getId()),
984  $page_html
985  );
986  $valid = true;
987  } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectivesBlock) {
988  $page_html = preg_replace(
989  '~\[list-_lobj\]~i',
990  $this->objective_renderer->renderObjectives(),
991  $page_html
992  );
993  $valid = true;
994  }
995  } else {
996  if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock ||
997  $block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
998  if ($this->renderHelperCustomBlock($block_tpl, $block_id, false, $block->getLimitExhausted())) {
999  $this->addSeparatorRow($block_tpl);
1000  $valid = true;
1001  }
1002  }
1003  if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock ||
1004  $block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
1005  if ($this->renderHelperTypeBlock($block_tpl, $block_id, false, $block->getLimitExhausted())) {
1006  $this->addSeparatorRow($block_tpl);
1007  $valid = true;
1008  }
1009  }
1010  if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectivesBlock) {
1011  $this->objective_renderer->renderObjectives();
1012  $block_tpl->setVariable(
1013  "CONTENT",
1014  $this->objective_renderer->getContent()
1015  );
1016  $this->addSeparatorRow($block_tpl);
1017  $valid = true;
1018  }
1019  }
1020  }
1021 
1022  // remove embedded, but unrendered blocks
1023  foreach ($this->item_presentation->getPageEmbeddedBlockIds() as $id) {
1024  if (is_numeric($id)) {
1025  $page_html = preg_replace(
1026  '~\[item-group-' . $id . '\]~i',
1027  "",
1028  $page_html
1029  );
1030  } else {
1031  $page_html = preg_replace(
1032  '~\[list-' . $id . '\]~i',
1033  "",
1034  $page_html
1035  );
1036  }
1037  }
1038 
1039  if ($valid) {
1040  $this->renderDetails($block_tpl);
1041  return $page_html . $block_tpl->get();
1042  }
1043  return $page_html;
1044  }
renderSingleTypeBlock(string $a_type, bool $exhausted=false)
static getItemsByEvent(int $event_id)
Get session material / event items.
$valid
addSeparatorRow(ilTemplate $a_tpl)
renderHelperCustomBlock(ilTemplate $a_block_tpl, $a_block_id, bool $a_is_single=false, bool $is_exhausted=false)
addTypeBlock(string $a_type, ?string $a_prefix=null, ?string $a_postfix=null)
static _lookupObjId(int $ref_id)
Preloader for object list GUIs.
renderDetails(ilTemplate $a_tpl)
$ref_id
Definition: ltiauth.php:65
isItemHidden(string $block_id, int $ref_id)
addItemToBlock( $a_block_id, string $a_item_type, $a_item_id, $a_item_html, bool $a_force=false)
Add item to existing block.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
addCustomBlock( $a_id, string $a_caption, ?string $a_actions=null, array $a_data=[])
Add custom block.
addItemGroupBlock(string $block_id, int $block_pos=0)
replaces ilContainerContentGUI::renderItemGroup
renderHelperTypeBlock(ilTemplate $a_block_tpl, string $a_type, bool $a_is_single=false, bool $is_exhausted=false)
+ Here is the call graph for this function:

◆ renderSelectAllBlock()

ilContainerRenderer::renderSelectAllBlock ( ilTemplate  $a_tpl)
protected

Render "select all".

Definition at line 780 of file class.ilContainerRenderer.php.

References $lng, ilTemplate\parseCurrentBlock(), ilTemplate\setCurrentBlock(), HTML_Template_IT\setVariable(), and ilLanguage\txt().

Referenced by addHeaderRow().

780  : void
781  {
782  $lng = $this->lng;
783 
784  $a_tpl->setCurrentBlock("select_all_row");
785  $a_tpl->setVariable("CHECKBOXNAME", "bl_cb_" . $this->bl_cnt);
786  $a_tpl->setVariable("SEL_ALL_PARENT", "bl_cntr_" . $this->bl_cnt);
787  $a_tpl->setVariable("SEL_ALL_PARENT", "bl_cntr_" . $this->bl_cnt);
788  $a_tpl->setVariable("TXT_SELECT_ALL", $lng->txt("select_all"));
789  $a_tpl->parseCurrentBlock();
790  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
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...
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderSingleCustomBlock()

ilContainerRenderer::renderSingleCustomBlock (   $a_id)
Parameters
mixed$a_id

Definition at line 415 of file class.ilContainerRenderer.php.

References initBlockTemplate(), and renderHelperCustomBlock().

Referenced by renderItemBlockSequence().

415  : string
416  {
417  $block_tpl = $this->initBlockTemplate();
418 
419  if ($this->renderHelperCustomBlock($block_tpl, $a_id, true)) {
420  return $block_tpl->get();
421  }
422  return "";
423  }
renderHelperCustomBlock(ilTemplate $a_block_tpl, $a_block_id, bool $a_is_single=false, bool $is_exhausted=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderSingleTypeBlock()

ilContainerRenderer::renderSingleTypeBlock ( string  $a_type,
bool  $exhausted = false 
)

Definition at line 403 of file class.ilContainerRenderer.php.

References initBlockTemplate(), and renderHelperTypeBlock().

Referenced by renderItemBlockSequence().

403  : string
404  {
405  $block_tpl = $this->initBlockTemplate();
406  if ($this->renderHelperTypeBlock($block_tpl, $a_type, true, $exhausted)) {
407  return $block_tpl->get();
408  }
409  return "";
410  }
renderHelperTypeBlock(ilTemplate $a_block_tpl, string $a_type, bool $a_is_single=false, bool $is_exhausted=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ resetDetails()

ilContainerRenderer::resetDetails ( )

Definition at line 350 of file class.ilContainerRenderer.php.

350  : void
351  {
352  $this->details = [];
353  }

◆ setBlockPosition()

ilContainerRenderer::setBlockPosition (   $a_block_id,
int  $a_pos 
)
Parameters
mixed$a_block_id

Definition at line 363 of file class.ilContainerRenderer.php.

References isValidBlock().

366  : void {
367  if ($this->isValidBlock($a_block_id)) {
368  $this->block_pos[$a_block_id] = $a_pos;
369  }
370  }
isValidBlock($a_id)
Any block with id exists?
+ Here is the call graph for this function:

◆ setBlockPostfixClosure()

ilContainerRenderer::setBlockPostfixClosure ( Closure  $f)

Definition at line 138 of file class.ilContainerRenderer.php.

References Vendor\Package\$f.

138  : void
139  {
140  $this->block_postfix_closure = $f;
141  }

◆ setBlockPrefixClosure()

ilContainerRenderer::setBlockPrefixClosure ( Closure  $f)

Definition at line 133 of file class.ilContainerRenderer.php.

References Vendor\Package\$f.

133  : void
134  {
135  $this->block_prefix_closure = $f;
136  }

◆ setItemHiddenClosure()

ilContainerRenderer::setItemHiddenClosure ( Closure  $f)

Definition at line 143 of file class.ilContainerRenderer.php.

References Vendor\Package\$f.

143  : void
144  {
145  $this->item_hidden_closure = $f;
146  }

Field Documentation

◆ $access

ilAccessHandler ilContainerRenderer::$access
protected

Definition at line 28 of file class.ilContainerRenderer.php.

◆ $active_block_ordering

bool ilContainerRenderer::$active_block_ordering
protected

Definition at line 43 of file class.ilContainerRenderer.php.

Referenced by renderHelperGeneric().

◆ $admin_panel

bool ilContainerRenderer::$admin_panel
protected

Definition at line 33 of file class.ilContainerRenderer.php.

Referenced by renderHelperGeneric().

◆ $bl_cnt

int ilContainerRenderer::$bl_cnt = 0
protected

Definition at line 56 of file class.ilContainerRenderer.php.

◆ $block_custom_pos

array ilContainerRenderer::$block_custom_pos = []
protected

Definition at line 60 of file class.ilContainerRenderer.php.

◆ $block_items

array ilContainerRenderer::$block_items = []
protected

Definition at line 50 of file class.ilContainerRenderer.php.

◆ $block_pos

array ilContainerRenderer::$block_pos = []
protected

Definition at line 59 of file class.ilContainerRenderer.php.

Referenced by processBlockPositions().

◆ $block_postfix_closure

Closure ilContainerRenderer::$block_postfix_closure = null
protected

Definition at line 68 of file class.ilContainerRenderer.php.

Referenced by getBlockPostfix().

◆ $block_prefix_closure

Closure ilContainerRenderer::$block_prefix_closure = null
protected

Definition at line 67 of file class.ilContainerRenderer.php.

Referenced by getBlockPrefix().

◆ $block_repo

ILIAS Container Content BlockSessionRepository ilContainerRenderer::$block_repo
protected

Definition at line 70 of file class.ilContainerRenderer.php.

◆ $container_gui

ilContainerGUI ilContainerRenderer::$container_gui
protected

Definition at line 38 of file class.ilContainerRenderer.php.

◆ $ctrl

ilCtrl ilContainerRenderer::$ctrl
protected

Definition at line 66 of file class.ilContainerRenderer.php.

Referenced by renderHelperGeneric().

◆ $custom_blocks

array ilContainerRenderer::$custom_blocks = []
protected

Definition at line 47 of file class.ilContainerRenderer.php.

◆ $details

array ilContainerRenderer::$details = []
protected

Definition at line 51 of file class.ilContainerRenderer.php.

◆ $enable_manage_select_all

bool ilContainerRenderer::$enable_manage_select_all
protected

Definition at line 41 of file class.ilContainerRenderer.php.

◆ $enable_multi_download

bool ilContainerRenderer::$enable_multi_download
protected

Definition at line 42 of file class.ilContainerRenderer.php.

◆ $hidden_items

array ilContainerRenderer::$hidden_items = []
protected

Definition at line 49 of file class.ilContainerRenderer.php.

◆ $item_hidden_closure

Closure ilContainerRenderer::$item_hidden_closure = null
protected

Definition at line 69 of file class.ilContainerRenderer.php.

Referenced by isItemHidden().

◆ $item_ids

array ilContainerRenderer::$item_ids = []
protected

Definition at line 52 of file class.ilContainerRenderer.php.

◆ $item_manager

ILIAS Container Content ItemManager ilContainerRenderer::$item_manager
protected

Definition at line 27 of file class.ilContainerRenderer.php.

◆ $item_presentation

ILIAS Container Content ItemPresentationManager ilContainerRenderer::$item_presentation
protected

Definition at line 32 of file class.ilContainerRenderer.php.

◆ $item_renderer

ILIAS Containter Content ItemRenderer ilContainerRenderer::$item_renderer
protected

Definition at line 31 of file class.ilContainerRenderer.php.

Referenced by getItemRenderer().

◆ $items

array ilContainerRenderer::$items = []
protected

Definition at line 48 of file class.ilContainerRenderer.php.

◆ $lng

ilLanguage ilContainerRenderer::$lng
protected

Definition at line 35 of file class.ilContainerRenderer.php.

Referenced by addHeaderRow(), renderDetails(), and renderSelectAllBlock().

◆ $obj_definition

ilObjectDefinition ilContainerRenderer::$obj_definition
protected

Definition at line 37 of file class.ilContainerRenderer.php.

Referenced by addHeaderRow().

◆ $objective_renderer

ILIAS Containter Content ObjectiveRenderer ilContainerRenderer::$objective_renderer
protected

Definition at line 30 of file class.ilContainerRenderer.php.

◆ $order_cnt

int ilContainerRenderer::$order_cnt = 0
protected

Definition at line 61 of file class.ilContainerRenderer.php.

◆ $rendered_blocks

array ilContainerRenderer::$rendered_blocks = []
protected

Definition at line 55 of file class.ilContainerRenderer.php.

◆ $settings

ilSetting ilContainerRenderer::$settings
protected

Definition at line 36 of file class.ilContainerRenderer.php.

Referenced by addHeaderRow().

◆ $show_more

array ilContainerRenderer::$show_more = []
protected

Definition at line 63 of file class.ilContainerRenderer.php.

◆ $type_blocks

array ilContainerRenderer::$type_blocks = []
protected

Definition at line 46 of file class.ilContainerRenderer.php.

◆ $ui

ILIAS DI UIServices ilContainerRenderer::$ui
protected

Definition at line 65 of file class.ilContainerRenderer.php.

◆ $user

ilObjUser ilContainerRenderer::$user
protected

Definition at line 29 of file class.ilContainerRenderer.php.

◆ $view_mode

int ilContainerRenderer::$view_mode
protected

Definition at line 64 of file class.ilContainerRenderer.php.

Referenced by getViewMode(), and getViewModeOfItemGroup().

◆ UNIQUE_SEPARATOR

const ilContainerRenderer::UNIQUE_SEPARATOR = "-"
protected

Definition at line 26 of file class.ilContainerRenderer.php.


The documentation for this class was generated from the following file: