ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 688 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().

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

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

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

Referenced by getHTML(), and renderItemBlockSequence().

805  : void
806  {
807  $a_tpl->setCurrentBlock("container_block");
808  $a_tpl->parseCurrentBlock();
809  }
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 770 of file class.ilContainerRenderer.php.

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

Referenced by renderHelperGeneric().

774  : void {
775  if ($a_item_id) {
776  $a_tpl->setCurrentBlock("row");
777  $a_tpl->setVariable("ROW_ID", 'id="item_row_' . $a_item_id . '"');
778  $a_tpl->parseCurrentBlock();
779  } else {
780  $a_tpl->touchBlock("row");
781  }
782 
783  $a_tpl->setCurrentBlock("container_standard_row");
784  $a_tpl->setVariable("BLOCK_ROW_CONTENT", $a_html);
785  $a_tpl->parseCurrentBlock();
786 
787  $a_tpl->touchBlock("container_row");
788  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
touchBlock(string $block)
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:546
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 1147 of file class.ilContainerRenderer.php.

References $block_postfix_closure, and $c.

Referenced by renderItemBlockSequence().

1147  : string
1148  {
1149  if ($this->block_postfix_closure instanceof Closure) {
1151  return (string) $c($block_id);
1152  }
1153  return "";
1154  }
$c
Definition: deliver.php:9
+ Here is the caller graph for this function:

◆ getBlockPrefix()

ilContainerRenderer::getBlockPrefix (   $block_id)
protected

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

References $block_prefix_closure, and $c.

Referenced by renderItemBlockSequence().

1138  : string
1139  {
1140  if ($this->block_prefix_closure instanceof Closure) {
1142  return (string) $c($block_id);
1143  }
1144  return "";
1145  }
$c
Definition: deliver.php:9
+ Here is the caller graph for this function:

◆ getDetailsLevel()

ilContainerRenderer::getDetailsLevel ( int  $a_item_id)
protected

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

References ilContainerContentGUI\DETAILS_DEACTIVATED, and ilContainerContentGUI\DETAILS_TITLE.

Referenced by renderItemBlockSequence().

844  : int
845  {
846  if ($this->container_gui->isActiveAdministrationPanel()) {
848  }
849  if ($this->item_manager->getExpanded($a_item_id) !== null) {
850  return $this->item_manager->getExpanded($a_item_id);
851  }
852  /*if ($a_item_id === $this->force_details) {
853  return ilContainerContentGUI::DETAILS_ALL;
854  }*/
856  }
+ Here is the caller graph for this function:

◆ getDownloadableTypes()

ilContainerRenderer::getDownloadableTypes ( )
protected

Get downloadable repository object types.

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

Referenced by addHeaderRow().

814  : array
815  {
816  return ["fold", "file"];
817  }
+ 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 834 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:66
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 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:66
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 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 678 of file class.ilContainerRenderer.php.

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

678  : ilTemplate
679  {
680  return new ilTemplate("tpl.container_list_block.html", true, true, "components/ILIAS/Container");
681  }
+ Here is the caller graph for this function:

◆ isItemHidden()

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

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

References $c, and $item_hidden_closure.

Referenced by renderItemBlockSequence().

1156  : bool
1157  {
1158  if ($this->item_hidden_closure instanceof Closure) {
1160  return (bool) $c($block_id, $ref_id);
1161  }
1162  return false;
1163  }
$c
Definition: deliver.php:9
$ref_id
Definition: ltiauth.php:66
+ 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 839 of file class.ilContainerRenderer.php.

Referenced by renderItemBlockSequence().

839  : string
840  {
841  return $this->container_gui->getContainerPageHTML();
842  }
+ Here is the caller graph for this function:

◆ renderDetails()

ilContainerRenderer::renderDetails ( ilTemplate  $a_tpl)

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

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

Referenced by getHTML(), and renderItemBlockSequence().

819  : void
820  {
821  $lng = $this->lng;
822 
823  if (count($this->details)) {
824  $a_tpl->setCurrentBlock('container_details_row');
825  $a_tpl->setVariable('TXT_DETAILS', $lng->txt('details'));
826  $a_tpl->parseCurrentBlock();
827  }
828  }
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:546
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(), ILIAS\Repository\ctrl(), 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  if ($this->ctrl->isAsynch()) {
638  $html = $renderer->renderAsync($deck);
639  } else {
640  $html = $renderer->render($deck);
641  }
642  $a_block_tpl->setCurrentBlock("tile_rows");
643  $a_block_tpl->setVariable("TILE_ROWS", $html);
644  $a_block_tpl->parseCurrentBlock();
645  }
646  // show more
647  if ($is_exhausted) {
648  $a_block_tpl->setCurrentBlock("show_more");
649 
650  $ctrl->setParameter($this->container_gui, "type", $a_block_id);
651  $url = $ctrl->getLinkTarget($this->container_gui, "renderBlockAsynch", "", true);
652  $ctrl->setParameter($this->container_gui, "type", "");
653 
654  $f = $this->ui->factory();
655  $renderer = $this->ui->renderer();
656  $button = $f->button()->standard($this->lng->txt("cont_show_more"), "")
658  ->withOnLoadCode(function ($id) use ($a_block_id, $url) {
659  return "il.Container.initShowMore('$id', '$a_block_id', '" . $url . "');";
660  });
661  if ($ctrl->isAsynch()) {
662  $a_block_tpl->setVariable("SHOW_MORE_BUTTON", $renderer->renderAsync($button));
663  } else {
664  $a_block_tpl->setVariable("SHOW_MORE_BUTTON", $renderer->render($button));
665  }
666  $a_block_tpl->parseCurrentBlock();
667  $a_block_tpl->setCurrentBlock("show_more");
668  $a_block_tpl->parseCurrentBlock();
669  }
670 
671  return true;
672  }
673  }
674 
675  return false;
676  }
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
$renderer
$url
Definition: shib_logout.php:63
withLoadingAnimationOnClick(bool $loading_animation_on_click=true)
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
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.
setVariable($variable, $value='')
Sets a variable value.
Definition: IT.php:546
addStandardRow(ilTemplate $a_tpl, string $a_html, string $a_item_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
getLinkTarget(object $a_gui_obj, string $a_cmd=null, string $a_anchor=null, bool $is_async=false, bool $has_xml_style=false)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24
setParameter(object $a_gui_obj, string $a_parameter, $a_value)
+ 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 858 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().

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

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

Referenced by addHeaderRow().

793  : void
794  {
795  $lng = $this->lng;
796 
797  $a_tpl->setCurrentBlock("select_all_row");
798  $a_tpl->setVariable("CHECKBOXNAME", "bl_cb_" . $this->bl_cnt);
799  $a_tpl->setVariable("SEL_ALL_PARENT", "bl_cntr_" . $this->bl_cnt);
800  $a_tpl->setVariable("SEL_ALL_PARENT", "bl_cntr_" . $this->bl_cnt);
801  $a_tpl->setVariable("TXT_SELECT_ALL", $lng->txt("select_all"));
802  $a_tpl->parseCurrentBlock();
803  }
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:546
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: