ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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)
 
 setItemModifierClosure (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, string $a_item_id=null)
 
 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
 
Closure $item_modifier_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 189 of file class.ilContainerRenderer.php.

References hasCustomBlock().

Referenced by addItemGroupBlock(), and renderItemBlockSequence().

194  : bool {
195  if (!$this->hasCustomBlock($a_id)) {
196  $this->custom_blocks[$a_id] = [
197  "caption" => $a_caption
198  ,"actions" => $a_actions
199  ,"data" => $a_data
200  ];
201  return true;
202  }
203  return false;
204  }
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 346 of file class.ilContainerRenderer.php.

350  : void {
351  $this->details[$a_level] = [
352  "url" => $a_url
353  ,"active" => $a_active
354  ];
355  }

◆ 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 684 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().

692  : void {
693  $lng = $this->lng;
695  $objDefinition = $this->obj_definition;
696 
697  $a_tpl->setVariable("CB_ID", ' id="bl_cntr_' . (++$this->bl_cnt) . '"');
698 
699  if ($this->enable_manage_select_all) {
700  $this->renderSelectAllBlock($a_tpl);
701  } elseif ($this->enable_multi_download) {
702  if ($a_type) {
703  $a_types_in_block = [$a_type];
704  }
705  foreach ($a_types_in_block as $type) {
706  if (in_array($type, $this->getDownloadableTypes(), true)) {
707  $this->renderSelectAllBlock($a_tpl);
708  break;
709  }
710  }
711  }
712 
713  if ($a_text === "" && $a_type !== "") {
714  if (!$objDefinition->isPlugin($a_type)) {
715  $title = $lng->txt("objs_" . $a_type);
716  } else {
718  $title = $pl->txt("objs_" . $a_type);
719  }
720  } else {
721  $title = $a_text;
722  }
723 
724  if (is_array($a_data)) {
725  foreach ($a_data as $k => $v) {
726  $a_tpl->setCurrentBlock("cb_data");
727  $a_tpl->setVariable("DATA_KEY", $k);
728  $a_tpl->setVariable("DATA_VALUE", $v);
729  $a_tpl->parseCurrentBlock();
730 
731  if ($k === "behaviour" && $v == ilItemGroupBehaviour::EXPANDABLE_CLOSED) {
732  $a_tpl->touchBlock("container_items_hide");
733  }
734  }
735  }
736 
737  if ($a_type !== "" && $ilSetting->get("icon_position_in_lists") !== "item_rows") {
738  $icon = ilUtil::getImagePath("standard/icon_" . $a_type . ".svg");
739 
740  $a_tpl->setCurrentBlock("container_header_row_image");
741  $a_tpl->setVariable("HEADER_IMG", $icon);
742  $a_tpl->setVariable("HEADER_ALT", $title);
743  } else {
744  $a_tpl->setCurrentBlock("container_header_row");
745  }
746 
747  if ($a_order_id !== "") {
748  /* blocks are ordered in page editor
749  $a_tpl->setVariable("BLOCK_HEADER_ORDER_NAME", "position[blocks][" . $a_order_id . "]");
750  $a_tpl->setVariable("BLOCK_HEADER_ORDER_NUM", (++$this->order_cnt) * 10);
751  */
752  }
753 
754  $presentation_title = $title;
755  $sr_only = "";
756  if (trim($title) === "") {
757  $presentation_title = $this->lng->txt("cont_no_title");
758  $sr_only = "sr-only";
759  }
760  $a_tpl->setVariable("BLOCK_HEADER_CONTENT", $presentation_title);
761  $a_tpl->setVariable("SR_ONLY", $sr_only);
762  $a_tpl->setVariable("CHR_COMMANDS", $a_commands_html);
763  $a_tpl->parseCurrentBlock();
764  }
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 1058 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().

1058  : void
1059  {
1060  $item_data = $this->item_presentation->getRawDataByRefId((int) $block_id);
1061  $item_list_gui = $this->item_renderer->getItemGUI($item_data);
1062 
1063  $perm_ok = true;
1064  /*
1065  $ilAccess = $this->access;
1066  $ilUser = $this->user;
1067 
1068  // #16493
1069  $perm_ok = ($ilAccess->checkAccess("visible", "", $item_data['ref_id']) &&
1070  $ilAccess->checkAccess("read", "", $item_data['ref_id']));
1071 
1072  $items = ilObjectActivation::getItemsByItemGroup($item_data['ref_id']);
1073 
1074  // get all valid ids (this is filtered)
1075  $all_ids = array_map(static function (array $i) : int {
1076  return (int) $i["child"];
1077  }, $this->items["_all"]);
1078 
1079  // remove filtered items
1080  $items = array_filter($items, static function (array $i) use ($all_ids) : bool {
1081  return in_array($i["ref_id"], $all_ids);
1082  });
1083 
1084  // if no permission is given, set the items to "rendered" but
1085  // do not display the whole block
1086  if (!$perm_ok) {
1087  foreach ($items as $item) {
1088  $this->renderer->hideItem($item["child"]);
1089  }
1090  return;
1091  }
1092  */
1093 
1094  $item_list_gui->enableNotes(false);
1095  $item_list_gui->enableTags(false);
1096  $item_list_gui->enableComments(false);
1097  $item_list_gui->enableTimings(false);
1098  $item_list_gui->initItem(
1099  (int) $item_data["ref_id"],
1100  (int) $item_data["obj_id"],
1101  "itgr",
1102  $item_data["title"],
1103  $item_data["description"]
1104  );
1105  $commands_html = $item_list_gui->getCommandsHTML();
1106 
1107  // determine behaviour
1108  $item_group = new ilObjItemGroup($item_data["ref_id"]);
1109  $beh = $item_group->getBehaviour();
1110  $stored_val = $this->block_repo->getProperty(
1111  "itgr_" . $item_data["ref_id"],
1112  $this->user->getId(),
1113  "opened"
1114  );
1115  if ($stored_val !== "" && $beh !== ilItemGroupBehaviour::ALWAYS_OPEN) {
1116  $beh = ($stored_val === "1")
1119  }
1120 
1121  $data = [
1122  "behaviour" => $beh,
1123  "store-url" => "./ilias.php?baseClass=ilcontainerblockpropertiesstoragegui&cmd=store" .
1124  "&cont_block_id=itgr_" . $item_data['ref_id']
1125  ];
1126  if (ilObjItemGroup::lookupHideTitle($item_data["obj_id"]) &&
1127  !$this->container_gui->isActiveAdministrationPanel()) {
1128  $this->addCustomBlock($block_id, "", $commands_html, $data);
1129  } else {
1130  $this->addCustomBlock($block_id, $item_data["title"], $commands_html, $data);
1131  }
1132  }
static lookupHideTitle(int $a_id)
Class ilObjItemGroup.
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 332 of file class.ilContainerRenderer.php.

Referenced by addItemToBlock().

332  : void
333  {
334  $this->item_ids[$a_item_id] = true;
335  }
+ 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 295 of file class.ilContainerRenderer.php.

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

Referenced by renderItemBlockSequence().

301  : bool {
302  if ($a_item_type !== "itgr" &&
303  $this->isValidBlock($a_block_id) &&
304  (!$this->hasItem($a_item_id) || $a_force)) {
305  if (is_string($a_item_html) && trim($a_item_html) === "") {
306  return false;
307  }
308  if (!$a_item_html) {
309  return false;
310  }
311 
312 
313  // #16563 - item_id (== ref_id) is NOT unique, adding parent block id
314  $uniq_id = $a_block_id . self::UNIQUE_SEPARATOR . $a_item_id;
315 
316  $this->items[$uniq_id] = [
317  "type" => $a_item_type
318  ,"html" => $a_item_html
319  ];
320 
321  // #18326
322  $this->addItemId($a_item_id);
323  $this->block_items[$a_block_id][] = $uniq_id;
324  return true;
325  }
326  return false;
327  }
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 801 of file class.ilContainerRenderer.php.

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

Referenced by getHTML(), and renderItemBlockSequence().

801  : void
802  {
803  $a_tpl->setCurrentBlock("container_block");
804  $a_tpl->parseCurrentBlock();
805  }
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 341 of file class.ilContainerRenderer.php.

341  : void
342  {
343  $this->show_more[] = $a_block_id;
344  }

◆ addStandardRow()

ilContainerRenderer::addStandardRow ( ilTemplate  $a_tpl,
string  $a_html,
string  $a_item_id = null 
)
protected

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

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

Referenced by renderHelperGeneric().

770  : void {
771  if ($a_item_id) {
772  $a_tpl->setCurrentBlock("row");
773  $a_tpl->setVariable("ROW_ID", 'id="item_row_' . $a_item_id . '"');
774  $a_tpl->parseCurrentBlock();
775  } else {
776  $a_tpl->touchBlock("row");
777  }
778 
779  $a_tpl->setCurrentBlock("container_standard_row");
780  $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
781  $a_tpl->parseCurrentBlock();
782 
783  $a_tpl->touchBlock("container_row");
784  }
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 164 of file class.ilContainerRenderer.php.

References hasTypeBlock().

Referenced by renderItemBlockSequence().

168  : bool {
169  if ($a_type !== "itgr" &&
170  !$this->hasTypeBlock($a_type)) {
171  $this->type_blocks[$a_type] = [
172  "prefix" => $a_prefix
173  ,"postfix" => $a_postfix
174  ];
175  return true;
176  }
177  return false;
178  }
+ 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 1143 of file class.ilContainerRenderer.php.

References $block_postfix_closure, and $c.

Referenced by renderItemBlockSequence().

1143  : string
1144  {
1145  if ($this->block_postfix_closure instanceof Closure) {
1147  return (string) $c($block_id);
1148  }
1149  return "";
1150  }
$c
Definition: deliver.php:25
+ Here is the caller graph for this function:

◆ getBlockPrefix()

ilContainerRenderer::getBlockPrefix (   $block_id)
protected

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

References $block_prefix_closure, and $c.

Referenced by renderItemBlockSequence().

1134  : string
1135  {
1136  if ($this->block_prefix_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:

◆ getDetailsLevel()

ilContainerRenderer::getDetailsLevel ( int  $a_item_id)
protected

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

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

Referenced by renderItemBlockSequence().

840  : int
841  {
842  if ($this->container_gui->isActiveAdministrationPanel()) {
844  }
845  if ($this->item_manager->getExpanded($a_item_id) !== null) {
846  return $this->item_manager->getExpanded($a_item_id);
847  }
848  /*if ($a_item_id === $this->force_details) {
849  return ilContainerContentGUI::DETAILS_ALL;
850  }*/
852  }
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 810 of file class.ilContainerRenderer.php.

Referenced by addHeaderRow().

810  : array
811  {
812  return ["fold", "file"];
813  }
+ Here is the caller graph for this function:

◆ getHTML()

ilContainerRenderer::getHTML ( )

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

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

379  : string
380  {
381  $valid = false;
382 
383  $block_tpl = $this->initBlockTemplate();
384 
385  foreach ($this->processBlockPositions() as $block_id) {
386  if (array_key_exists($block_id, $this->custom_blocks) && $this->renderHelperCustomBlock(
387  $block_tpl,
388  $block_id
389  )) {
390  $this->addSeparatorRow($block_tpl);
391  $valid = true;
392  }
393  if (array_key_exists($block_id, $this->type_blocks) && $this->renderHelperTypeBlock(
394  $block_tpl,
395  $block_id
396  )) {
397  $this->addSeparatorRow($block_tpl);
398  $valid = true;
399  }
400  }
401 
402  if ($valid) {
403  $this->renderDetails($block_tpl);
404 
405  return $block_tpl->get();
406  }
407  return "";
408  }
$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 830 of file class.ilContainerRenderer.php.

References $item_renderer.

◆ getListPresentationOfItemGroup()

ilContainerRenderer::getListPresentationOfItemGroup ( int  $ref_id)
protected

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

Referenced by renderItemBlockSequence().

525  : string
526  {
527  $item_group = new ilObjItemGroup($ref_id);
528  return $item_group->getListPresentation();
529  }
$ref_id
Definition: ltiauth.php:65
Class ilObjItemGroup.
+ Here is the caller graph for this function:

◆ getViewMode()

ilContainerRenderer::getViewMode ( )
protected

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

References $view_mode.

Referenced by renderHelperGeneric().

155  : int
156  {
157  return $this->view_mode;
158  }
+ Here is the caller graph for this function:

◆ getViewModeOfItemGroup()

ilContainerRenderer::getViewModeOfItemGroup ( int  $ref_id)
protected

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

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

513  : int
514  {
515  $item_group = new ilObjItemGroup($ref_id);
517  if ($item_group->getListPresentation() !== "") {
518  $view_mode = ($item_group->getListPresentation() === "tile")
521  }
522  return $view_mode;
523  }
$ref_id
Definition: ltiauth.php:65
Class ilObjItemGroup.

◆ hasCustomBlock()

ilContainerRenderer::hasCustomBlock (   $a_id)

Custom block already exists?

Parameters
mixed$a_id

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

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

210  : bool
211  {
212  return array_key_exists($a_id, $this->custom_blocks);
213  }
+ Here is the caller graph for this function:

◆ hasItem()

ilContainerRenderer::hasItem (   $a_id)

Item with id exists?

Parameters
mixed$a_id

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

Referenced by addItemToBlock(), and removeItem().

282  : bool
283  {
284  return (array_key_exists($a_id, $this->item_ids) ||
285  array_key_exists($a_id, $this->hidden_items));
286  }
+ Here is the caller graph for this function:

◆ hasTypeBlock()

ilContainerRenderer::hasTypeBlock ( string  $a_type)

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

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

180  : bool
181  {
182  return array_key_exists($a_type, $this->type_blocks);
183  }
+ 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 235 of file class.ilContainerRenderer.php.

235  : void
236  {
237  // see hasItem();
238  $this->hidden_items[$a_id] = true;
239 
240  // #16629 - do not remove hidden items from other blocks
241  // $this->removeItem($a_id);
242  }

◆ initBlockTemplate()

ilContainerRenderer::initBlockTemplate ( )
protected

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

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

674  : ilTemplate
675  {
676  return new ilTemplate("tpl.container_list_block.html", true, true, "components/ILIAS/Container");
677  }
+ Here is the caller graph for this function:

◆ isItemHidden()

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

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

References $c, and $item_hidden_closure.

Referenced by renderItemBlockSequence().

1152  : bool
1153  {
1154  if ($this->item_hidden_closure instanceof Closure) {
1156  return (bool) $c($block_id, $ref_id);
1157  }
1158  return false;
1159  }
$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 219 of file class.ilContainerRenderer.php.

References hasCustomBlock(), and hasTypeBlock().

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

219  : bool
220  {
221  return ($this->hasTypeBlock($a_id) ||
222  $this->hasCustomBlock($a_id));
223  }
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 437 of file class.ilContainerRenderer.php.

References $block_pos, and isValidBlock().

Referenced by getHTML().

437  : array
438  {
439  // manual order
440  if (is_array($this->block_custom_pos) && count($this->block_custom_pos)) {
441  $tmp = $this->block_pos;
442  $this->block_pos = [];
443  foreach ($this->block_custom_pos as $idx => $block_id) {
444  if ($this->isValidBlock($block_id)) {
445  $this->block_pos[$block_id] = $idx;
446  }
447  }
448 
449  // at least some manual are valid
450  if (count($this->block_pos)) {
451  // append missing blocks from default order
452  $last = max($this->block_pos);
453  foreach (array_keys($tmp) as $block_id) {
454  if (!array_key_exists($block_id, $this->block_pos)) {
455  $this->block_pos[$block_id] = ++$last;
456  }
457  }
458  }
459  // all manual invalid, use default
460  else {
461  $this->block_pos = $tmp;
462  }
463  }
464 
465  // add missing blocks to order
466  $last = count($this->block_pos)
467  ? max($this->block_pos)
468  : 0;
469  foreach (array_keys($this->custom_blocks) as $block_id) {
470  if (!array_key_exists($block_id, $this->block_pos)) {
471  $this->block_pos[$block_id] = ++$last;
472  }
473  }
474  foreach (array_keys($this->type_blocks) as $block_id) {
475  if (!array_key_exists($block_id, $this->block_pos)) {
476  $this->block_pos[$block_id] = ++$last;
477  }
478  }
479 
480  asort($this->block_pos);
481  return array_keys($this->block_pos);
482  }
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 248 of file class.ilContainerRenderer.php.

References $parts, and hasItem().

248  : void
249  {
250  if (!$this->hasItem($a_id)) {
251  return;
252  }
253 
254  unset($this->item_ids[$a_id], $this->hidden_items[$a_id]);
255 
256  foreach (array_keys($this->items) as $item_id) {
257  $parts = explode(self::UNIQUE_SEPARATOR, $item_id);
258  if (array_pop($parts) == $a_id) {
259  unset($this->items[$item_id]);
260  }
261  }
262 
263  foreach ($this->block_items as $block_id => $items) {
264  foreach ($items as $idx => $item_id) {
265  $parts = explode(self::UNIQUE_SEPARATOR, $item_id);
266  if (array_pop($parts) == $a_id) {
267  unset($this->block_items[$block_id][$idx]);
268  if (!count($this->block_items[$block_id])) {
269  unset($this->block_items[$block_id]);
270  }
271  break;
272  }
273  }
274  }
275  }
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 835 of file class.ilContainerRenderer.php.

Referenced by renderItemBlockSequence().

835  : string
836  {
837  return $this->container_gui->getContainerPageHTML();
838  }
+ Here is the caller graph for this function:

◆ renderDetails()

ilContainerRenderer::renderDetails ( ilTemplate  $a_tpl)

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

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

Referenced by getHTML(), and renderItemBlockSequence().

815  : void
816  {
817  $lng = $this->lng;
818 
819  if (count($this->details)) {
820  $a_tpl->setCurrentBlock('container_details_row');
821  $a_tpl->setVariable('TXT_DETAILS', $lng->txt('details'));
822  $a_tpl->parseCurrentBlock();
823  }
824  }
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 487 of file class.ilContainerRenderer.php.

References hasCustomBlock(), and renderHelperGeneric().

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

492  : bool {
493  if ($this->hasCustomBlock($a_block_id)) {
494  return $this->renderHelperGeneric($a_block_tpl, $a_block_id, $this->custom_blocks[$a_block_id], $a_is_single, $is_exhausted);
495  }
496  return false;
497  }
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 534 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().

540  : bool {
541  $ctrl = $this->ctrl;
542  if (!in_array($a_block_id, $this->rendered_blocks)) {
543  $this->rendered_blocks[] = $a_block_id;
544  $block_types = [];
545  if (isset($this->block_items[$a_block_id]) && is_array($this->block_items[$a_block_id])) {
546  foreach ($this->block_items[$a_block_id] as $item_id) {
547  if (isset($this->items[$item_id]["type"])) {
548  $block_types[] = $this->items[$item_id]["type"];
549  }
550  }
551  }
552 
553  // determine view mode and tile size
554  $tile_size = ilContainer::TILE_SMALL;
555  $view_mode = $this->getViewMode();
557  $tile_size = ilContainer::_lookupContainerSetting($this->container_gui->getObject()->getId(), "tile_size");
558  }
559  if (is_numeric($a_block_id)) {
560  $item_group = new ilObjItemGroup($a_block_id);
561  if ($item_group->getListPresentation() !== "") {
562  $view_mode = ($item_group->getListPresentation() === "tile" && !$this->active_block_ordering && !$this->admin_panel)
565  $tile_size = $item_group->getTileSize();
566  }
567  }
568 
569 
570  // #14610 - manage empty item groups
571  if ((isset($this->block_items[$a_block_id]) && is_array($this->block_items[$a_block_id])) ||
572  is_numeric($a_block_id)) {
573  $cards = [];
574 
575  $order_id = (!$a_is_single && $this->active_block_ordering)
576  ? $a_block_id
577  : "";
578  $this->addHeaderRow(
579  $a_block_tpl,
580  $a_block["type"] ?? '',
581  $a_block["caption"] ?? '',
582  array_unique($block_types),
583  $a_block["actions"] ?? '',
584  $order_id,
585  $a_block["data"] ?? []
586  );
587 
589  if (isset($a_block["prefix"]) && $a_block["prefix"]) {
590  $this->addStandardRow($a_block_tpl, $a_block["prefix"]);
591  }
592  }
593 
594  if (isset($this->block_items[$a_block_id])) {
595  foreach ($this->block_items[$a_block_id] as $item_id) {
597  $this->addStandardRow($a_block_tpl, $this->items[$item_id]["html"], $item_id);
598  } else {
599  $cards[] = $this->items[$item_id]["html"];
600  }
601  }
602  }
603 
605  if (isset($a_block["postfix"]) && $a_block["postfix"]) {
606  $this->addStandardRow($a_block_tpl, $a_block["postfix"]);
607  }
608  }
609 
611  $f = $this->ui->factory();
612  $renderer = $this->ui->renderer();
613 
614  //Create a deck with large cards
615  switch ($tile_size) {
617  $deck = $f->deck($cards)->withSmallCardsSize();
618  break;
619 
621  $deck = $f->deck($cards)->withLargeCardsSize();
622  break;
623 
625  $deck = $f->deck($cards)->withExtraLargeCardsSize();
626  break;
627 
629  $deck = $f->deck($cards)->withFullSizedCardsSize();
630  break;
631 
632  default:
633  $deck = $f->deck($cards)->withNormalCardsSize();
634  break;
635  }
636 
637  $html = $renderer->render($deck);
638  $a_block_tpl->setCurrentBlock("tile_rows");
639  $a_block_tpl->setVariable("TILE_ROWS", $html);
640  $a_block_tpl->parseCurrentBlock();
641  }
642  // show more
643  if ($is_exhausted) {
644  $a_block_tpl->setCurrentBlock("show_more");
645 
646  $ctrl->setParameter($this->container_gui, "type", $a_block_id);
647  $url = $ctrl->getLinkTarget($this->container_gui, "renderBlockAsynch", "", true);
648  $ctrl->setParameter($this->container_gui, "type", "");
649 
650  $f = $this->ui->factory();
651  $renderer = $this->ui->renderer();
652  $button = $f->button()->standard($this->lng->txt("cont_show_more"), "")
654  ->withOnLoadCode(function ($id) use ($a_block_id, $url) {
655  return "il.Container.initShowMore('$id', '$a_block_id', '" . $url . "');";
656  });
657  if ($ctrl->isAsynch()) {
658  $a_block_tpl->setVariable("SHOW_MORE_BUTTON", $renderer->renderAsync($button));
659  } else {
660  $a_block_tpl->setVariable("SHOW_MORE_BUTTON", $renderer->render($button));
661  }
662  $a_block_tpl->parseCurrentBlock();
663  $a_block_tpl->setCurrentBlock("show_more");
664  $a_block_tpl->parseCurrentBlock();
665  }
666 
667  return true;
668  }
669  }
670 
671  return false;
672  }
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:68
withLoadingAnimationOnClick(bool $loading_animation_on_click=true)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:544
addStandardRow(ilTemplate $a_tpl, string $a_html, string $a_item_id=null)
Class ilObjItemGroup.
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)
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 499 of file class.ilContainerRenderer.php.

References hasTypeBlock(), and renderHelperGeneric().

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

504  : bool {
505  if ($this->hasTypeBlock($a_type)) {
506  $block = $this->type_blocks[$a_type];
507  $block["type"] = $a_type;
508  return $this->renderHelperGeneric($a_block_tpl, $a_type, $block, $a_is_single, $is_exhausted);
509  }
510  return false;
511  }
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 854 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().

856  : string {
857  $valid = false;
858 
859  $page_html = $this->renderContainerPage();
860  $block_tpl = $this->initBlockTemplate();
861 
863  foreach ($this->item_presentation->getAllRefIds() as $ref_id) {
864  $rd = $this->item_presentation->getRawDataByRefId($ref_id);
865  $preloader->addItem($rd["obj_id"], $rd["type"], $ref_id);
866  if ($rd["type"] === "sess") {
867  $ev_items = ilObjectActivation::getItemsByEvent((int) $rd["obj_id"]);
868  foreach ($ev_items as $ev_item) {
869  $preloader->addItem((int) $ev_item["obj_id"], $ev_item["type"], $ev_item["ref_id"]);
870  }
871  }
872  }
873  $preloader->preload();
874 
875  $embedded_block_ids = $this->item_presentation->getPageEmbeddedBlockIds();
876  foreach ($sequence->getBlocks() as $block) {
877  $block_id = "";
878  $force_item_even_if_already_rendered = false;
879  if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
880  $block_id = (string) $block->getBlock()->getRefId();
881  $force_item_even_if_already_rendered = true;
882  }
883  if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock) {
884  $block_id = $block->getBlock()->getType();
885  if ($block->getPageEmbedded()) {
886  $force_item_even_if_already_rendered = true;
887  }
888  }
889  if ($block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
890  $block_id = "sess";
891  }
892  if ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
893  $block_id = "_other";
894  }
895  if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectivesBlock) {
896  $block_id = "_lobj";
897  }
898 
899  $position = 1;
900  $pos_prefix = "";
901 
902  // (1) add block
903  if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
904  $this->addItemGroupBlock($block_id);
905  $pos_prefix = "[itgr][" . \ilObject::_lookupObjId($block->getBlock()->getRefId()) . "]";
906  }
907  if ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
908  $title = $this->item_presentation->filteredSubtree()
909  ? $this->lng->txt("cont_found_objects")
910  : $this->lng->txt("content");
911  $this->addCustomBlock($block_id, $title);
912  }
913  if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock ||
914  $block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
915  $this->addTypeBlock(
916  $block_id,
917  $this->getBlockPrefix($block_id),
918  $this->getBlockPostfix($block_id)
919  );
920  }
921 
922  // (2) render and add items
923  foreach ($block->getItemRefIds() as $ref_id) {
924  if ($this->isItemHidden($block_id, $ref_id)) {
925  continue;
926  }
927  if (!$this->access->checkAccess('visible', '', $ref_id)) {
928  continue;
929  }
930 
931  $item_data = $this->item_presentation->getRawDataByRefId($ref_id);
933  if ($this->container_gui->isActiveAdministrationPanel()) {
935  } elseif ($this->container_gui->isMultiDownloadEnabled()) {
937  }
938  $item_group_list_presentation = "";
939  if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
940  if ($this->getListPresentationOfItemGroup((int) $block_id) === "tile") {
941  if (!$this->admin_panel && !$this->active_block_ordering) {
942  $item_group_list_presentation = "tile";
943  }
944  }
945  if ($this->getListPresentationOfItemGroup((int) $block_id) === "list") {
946  if (!$this->admin_panel && !$this->active_block_ordering) {
947  $item_group_list_presentation = "list";
948  }
949  }
950  }
951  $html = $this->item_renderer->renderItem(
952  $item_data,
953  $position++,
954  false,
955  $pos_prefix,
956  $item_group_list_presentation,
957  $checkbox,
958  $this->item_presentation->isActiveItemOrdering($item_data["type"]),
959  $this->getDetailsLevel($item_data["obj_id"])
960  );
961  if ($html != "") {
962  $this->addItemToBlock(
963  $block_id,
964  $item_data["type"],
965  $item_data["child"],
966  $html,
967  $force_item_even_if_already_rendered
968  );
969  }
970  }
971 
972  // (3) render blocks
973  if ($block->getPageEmbedded()) {
974  if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock ||
975  $block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
976  $page_html = preg_replace(
977  '~\[list-' . $block->getId() . '\]~i',
978  $this->renderSingleTypeBlock($block->getId(), $block->getLimitExhausted()),
979  $page_html
980  );
981  $valid = true;
982  } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock) {
983  $page_html = preg_replace(
984  '~\[item-group-' . $block->getId() . '\]~i',
985  $this->renderSingleCustomBlock((int) $block->getId()),
986  $page_html
987  );
988  $valid = true;
989  } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
990  $page_html = preg_replace(
991  '~\[list-_other\]~i',
992  $this->renderSingleCustomBlock($block->getId()),
993  $page_html
994  );
995  $valid = true;
996  } elseif ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectivesBlock) {
997  $page_html = preg_replace(
998  '~\[list-_lobj\]~i',
999  $this->objective_renderer->renderObjectives(),
1000  $page_html
1001  );
1002  $valid = true;
1003  }
1004  } else {
1005  if ($block->getBlock() instanceof \ILIAS\Container\Content\ItemGroupBlock ||
1006  $block->getBlock() instanceof \ILIAS\Container\Content\OtherBlock) {
1007  if ($this->renderHelperCustomBlock($block_tpl, $block_id, false, $block->getLimitExhausted())) {
1008  $this->addSeparatorRow($block_tpl);
1009  $valid = true;
1010  }
1011  }
1012  if ($block->getBlock() instanceof \ILIAS\Container\Content\TypeBlock ||
1013  $block->getBlock() instanceof \ILIAS\Container\Content\SessionBlock) {
1014  if ($this->renderHelperTypeBlock($block_tpl, $block_id, false, $block->getLimitExhausted())) {
1015  $this->addSeparatorRow($block_tpl);
1016  $valid = true;
1017  }
1018  }
1019  if ($block->getBlock() instanceof \ILIAS\Container\Content\ObjectivesBlock) {
1020  $this->objective_renderer->renderObjectives();
1021  $block_tpl->setVariable(
1022  "CONTENT",
1023  $this->objective_renderer->getContent()
1024  );
1025  $this->addSeparatorRow($block_tpl);
1026  $valid = true;
1027  }
1028  }
1029  }
1030 
1031  // remove embedded, but unrendered blocks
1032  foreach ($this->item_presentation->getPageEmbeddedBlockIds() as $id) {
1033  if (is_numeric($id)) {
1034  $page_html = preg_replace(
1035  '~\[item-group-' . $id . '\]~i',
1036  "",
1037  $page_html
1038  );
1039  } else {
1040  $page_html = preg_replace(
1041  '~\[list-' . $id . '\]~i',
1042  "",
1043  $page_html
1044  );
1045  }
1046  }
1047 
1048  if ($valid) {
1049  $this->renderDetails($block_tpl);
1050  return $page_html . $block_tpl->get();
1051  }
1052  return $page_html;
1053  }
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)
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 789 of file class.ilContainerRenderer.php.

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

Referenced by addHeaderRow().

789  : void
790  {
791  $lng = $this->lng;
792 
793  $a_tpl->setCurrentBlock("select_all_row");
794  $a_tpl->setVariable("CHECKBOXNAME", "bl_cb_" . $this->bl_cnt);
795  $a_tpl->setVariable("SEL_ALL_PARENT", "bl_cntr_" . $this->bl_cnt);
796  $a_tpl->setVariable("SEL_ALL_PARENT", "bl_cntr_" . $this->bl_cnt);
797  $a_tpl->setVariable("TXT_SELECT_ALL", $lng->txt("select_all"));
798  $a_tpl->parseCurrentBlock();
799  }
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 422 of file class.ilContainerRenderer.php.

References initBlockTemplate(), and renderHelperCustomBlock().

Referenced by renderItemBlockSequence().

422  : string
423  {
424  $block_tpl = $this->initBlockTemplate();
425 
426  if ($this->renderHelperCustomBlock($block_tpl, $a_id, true)) {
427  return $block_tpl->get();
428  }
429  return "";
430  }
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 410 of file class.ilContainerRenderer.php.

References initBlockTemplate(), and renderHelperTypeBlock().

Referenced by renderItemBlockSequence().

410  : string
411  {
412  $block_tpl = $this->initBlockTemplate();
413  if ($this->renderHelperTypeBlock($block_tpl, $a_type, true, $exhausted)) {
414  return $block_tpl->get();
415  }
416  return "";
417  }
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 357 of file class.ilContainerRenderer.php.

357  : void
358  {
359  $this->details = [];
360  }

◆ setBlockPosition()

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

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

References isValidBlock().

373  : void {
374  if ($this->isValidBlock($a_block_id)) {
375  $this->block_pos[$a_block_id] = $a_pos;
376  }
377  }
isValidBlock($a_id)
Any block with id exists?
+ Here is the call graph for this function:

◆ setBlockPostfixClosure()

ilContainerRenderer::setBlockPostfixClosure ( Closure  $f)

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

References Vendor\Package\$f.

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

◆ setBlockPrefixClosure()

ilContainerRenderer::setBlockPrefixClosure ( Closure  $f)

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

References Vendor\Package\$f.

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

◆ setItemHiddenClosure()

ilContainerRenderer::setItemHiddenClosure ( Closure  $f)

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

References Vendor\Package\$f.

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

◆ setItemModifierClosure()

ilContainerRenderer::setItemModifierClosure ( Closure  $f)

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

References Vendor\Package\$f.

149  : void
150  {
151  $this->item_renderer->setItemModifierClosure($f);
152  $this->item_modifier_closure = $f;
153  }

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 71 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_modifier_closure

Closure ilContainerRenderer::$item_modifier_closure = null
protected

Definition at line 70 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: