ILIAS  release_8 Revision v8.23
ilContainerContentGUI Class Reference

Parent class of all container content GUIs. More...

+ Inheritance diagram for ilContainerContentGUI:
+ Collaboration diagram for ilContainerContentGUI:

Public Member Functions

 getContainerObject ()
 
 getContainerGUI ()
 
 setOutput ()
 This method sets the output of the right and main column in the global standard template. More...
 
 getMainContent ()
 Get content HTML for main column, this one must be overwritten in derived classes. More...
 
 determinePageEmbeddedBlocks (string $a_container_page_html)
 Determine all blocks that are embedded in the container page. More...
 
 addEmbeddedBlock (string $block_type, $block_parameter)
 Add embedded block. More...
 
 getEmbeddedBlocks ()
 
 renderPageEmbeddedBlocks ()
 
 renderItem (array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="", string $item_group_list_presentation="")
 Render an item. More...
 
 renderCard (array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="")
 
 insertPageEmbeddedBlocks (string $a_output_html)
 Insert blocks into container page. More...
 
 getSingleTypeBlockAsynch (string $type)
 Render single block. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 getIntroduction ()
 
 getItemGroupsHTML (int $a_pos=0)
 
 renderItemGroup (array $a_itgr)
 

Data Fields

const DETAILS_DEACTIVATED = 0
 
const DETAILS_TITLE = 1
 
const DETAILS_ALL = 2
 
const VIEW_MODE_LIST = 0
 
const VIEW_MODE_TILE = 1
 
ilContainerGUI $container_gui
 
ilContainer $container_obj
 
bool $adminCommands = false
 

Protected Member Functions

 getViewMode ()
 
 getDetailsLevel (int $a_item_id)
 
 getRightColumnHTML ()
 
 getCenterColumnHTML ()
 
 initRenderer ()
 Init container renderer. More...
 
 clearAdminCommandsDetermination ()
 
 determineAdminCommands (int $a_ref_id, bool $a_admin_com_included_in_list=false)
 
 getItemGUI (array $item_data)
 
 hasForcedOrderByStartDate (string $type)
 
 handleSessionExpand ()
 

Protected Attributes

ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilObjUser $user
 
ilLanguage $lng
 
ilAccessHandler $access
 
ilDBInterface $db
 
ilRbacSystem $rbacsystem
 
ilSetting $settings
 
ilObjectDefinition $obj_definition
 
int $details_level = self::DETAILS_DEACTIVATED
 
ilContainerRenderer $renderer
 
ilLogger $log
 
int $view_mode
 
array $embedded_block = []
 
array $items = []
 
array $list_gui = []
 
ClipboardManager $clipboard
 
StandardGUIRequest $request
 
ItemManager $item_manager
 
BlockSessionRepository $block_repo
 

Private Member Functions

 forwardToColumnGUI ()
 Get columngui output. More...
 

Detailed Description

Parent class of all container content GUIs.

These classes are responsible for displaying the content, i.e. the side column and main column and its subitems in container objects.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

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

Member Function Documentation

◆ addEmbeddedBlock()

ilContainerContentGUI::addEmbeddedBlock ( string  $block_type,
  $block_parameter 
)

Add embedded block.

Parameters
string$block_type
string | int$block_parameter

Definition at line 420 of file class.ilContainerContentGUI.php.

Referenced by determinePageEmbeddedBlocks().

423  : void {
424  $this->embedded_block[$block_type][] = $block_parameter;
425  }
+ Here is the caller graph for this function:

◆ clearAdminCommandsDetermination()

ilContainerContentGUI::clearAdminCommandsDetermination ( )
protected

Definition at line 327 of file class.ilContainerContentGUI.php.

Referenced by ilContainerByTypeContentGUI\renderItemList(), ilContainerSimpleContentGUI\showMaterials(), and ilContainerSessionsContentGUI\showMaterials().

327  : void
328  {
329  $this->adminCommands = false;
330  }
+ Here is the caller graph for this function:

◆ determineAdminCommands()

ilContainerContentGUI::determineAdminCommands ( int  $a_ref_id,
bool  $a_admin_com_included_in_list = false 
)
protected

Definition at line 332 of file class.ilContainerContentGUI.php.

References $rbacsystem, ilRbacSystem\checkAccess(), and getContainerGUI().

Referenced by renderItem().

335  : void {
337 
338  if (!$this->adminCommands) {
339  if (!$this->getContainerGUI()->isActiveAdministrationPanel()) {
340  if ($rbacsystem->checkAccess("delete", $a_ref_id)) {
341  $this->adminCommands = true;
342  }
343  } else {
344  $this->adminCommands = $a_admin_com_included_in_list;
345  }
346  }
347  }
checkAccess(string $a_operations, int $a_ref_id, string $a_type="")
checkAccess represents the main method of the RBAC-system in ILIAS3 developers want to use With this ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ determinePageEmbeddedBlocks()

ilContainerContentGUI::determinePageEmbeddedBlocks ( string  $a_container_page_html)

Determine all blocks that are embedded in the container page.

Definition at line 393 of file class.ilContainerContentGUI.php.

References $type, addEmbeddedBlock(), and getGroupedObjTypes().

Referenced by insertPageEmbeddedBlocks().

395  : void {
396  $type_grps = $this->getGroupedObjTypes();
397 
398  // iterate all types
399  foreach ($type_grps as $type => $v) {
400  // set template (overall or type specific)
401  if (is_int(strpos($a_container_page_html, "[list-" . $type . "]"))) {
402  $this->addEmbeddedBlock("type", $type);
403  }
404  }
405 
406  // determine item groups
407  while (preg_match('~\[(item-group-([0-9]*))\]~i', $a_container_page_html, $found)) {
408  $this->addEmbeddedBlock("itgr", (int) $found[2]);
409 
410  $html = ''; // This was never defined before
411  $a_container_page_html = preg_replace('~\[' . $found[1] . '\]~i', $html, $a_container_page_html);
412  }
413  }
$type
getGroupedObjTypes()
Get grouped repository object types.
addEmbeddedBlock(string $block_type, $block_parameter)
Add embedded block.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ forwardToColumnGUI()

ilContainerContentGUI::forwardToColumnGUI ( )
private

Get columngui output.

Definition at line 294 of file class.ilContainerContentGUI.php.

References $ctrl, ilObject\_lookupObjId(), ilObject\_lookupType(), ilColumnGUI\getCmdSide(), getContainerGUI(), getContainerObject(), getMainContent(), ilColumnGUI\getScreenMode(), IL_COL_LEFT, IL_COL_RIGHT, and IL_SCREEN_SIDE.

Referenced by getCenterColumnHTML().

294  : string
295  {
296  $ilCtrl = $this->ctrl;
297  $html = "";
298 
299  // this gets us the subitems we need in setColumnSettings()
300  // todo: this should be done in ilCourseGUI->getSubItems
301 
302  $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
303  $obj_type = ilObject::_lookupType($obj_id);
304 
305  if (!$ilCtrl->isAsynch()) {
307  // right column wants center
309  $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
310  $this->getContainerGUI()->setColumnSettings($column_gui);
311  $html = $ilCtrl->forwardCommand($column_gui);
312  }
313  // left column wants center
315  $column_gui = new ilColumnGUI($obj_type, IL_COL_LEFT);
316  $this->getContainerGUI()->setColumnSettings($column_gui);
317  $html = $ilCtrl->forwardCommand($column_gui);
318  }
319  } else {
320  $html = $this->getMainContent();
321  }
322  }
323 
324  return $html;
325  }
static getCmdSide()
Get Column Side of Current Command.
const IL_COL_RIGHT
static _lookupObjId(int $ref_id)
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
Column user interface class.
static getScreenMode()
static _lookupType(int $id, bool $reference=false)
const IL_SCREEN_SIDE
const IL_COL_LEFT
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCenterColumnHTML()

ilContainerContentGUI::getCenterColumnHTML ( )
protected

Definition at line 223 of file class.ilContainerContentGUI.php.

References $ctrl, $db, $ilDB, $tpl, ilGlobalTemplateInterface\addOnLoadCode(), forwardToColumnGUI(), and getMainContent().

Referenced by setOutput().

223  : string
224  {
225  $ilCtrl = $this->ctrl;
226  $tpl = $this->tpl;
227  $ilDB = $this->db;
228 
229  $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
230 
231  $tpl->addOnLoadCode("il.Object.setRedrawListItemUrl('" .
232  $ilCtrl->getLinkTarget($this->container_gui, "redrawListItem", "", true) . "');");
233 
234  $tpl->addOnLoadCode("il.Object.setRatingUrl('" .
235  $ilCtrl->getLinkTargetByClass(
236  [get_class($this->container_gui), "ilcommonactiondispatchergui", "ilratinggui"],
237  "saveRating",
238  "",
239  true,
240  false
241  ) . "');");
242 
243  switch ($ilCtrl->getNextClass()) {
244  case "ilcolumngui":
245  $this->container_gui->setSideColumnReturn();
246  $html = $this->forwardToColumnGUI();
247  break;
248 
249  default:
250  $ilDB->useSlave(true);
251  $html = $this->getMainContent();
252  $ilDB->useSlave(false);
253  break;
254  }
255 
256  return $html;
257  }
ilGlobalTemplateInterface $tpl
getMainContent()
Get content HTML for main column, this one must be overwritten in derived classes.
forwardToColumnGUI()
Get columngui output.
addOnLoadCode(string $a_code, int $a_batch=2)
Add on load code.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getContainerGUI()

◆ getContainerObject()

◆ getDetailsLevel()

ilContainerContentGUI::getDetailsLevel ( int  $a_item_id)
protected

Definition at line 124 of file class.ilContainerContentGUI.php.

References $details_level.

Referenced by renderItem().

124  : int
125  {
126  return $this->details_level;
127  }
+ Here is the caller graph for this function:

◆ getEmbeddedBlocks()

ilContainerContentGUI::getEmbeddedBlocks ( )

Definition at line 427 of file class.ilContainerContentGUI.php.

References $embedded_block.

427  : array
428  {
429  return $this->embedded_block;
430  }

◆ getGroupedObjTypes()

ilContainerContentGUI::getGroupedObjTypes ( )

Get grouped repository object types.

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

References $obj_definition, and getContainerObject().

Referenced by determinePageEmbeddedBlocks(), insertPageEmbeddedBlocks(), and ilContainerByTypeContentGUI\renderItemList().

780  : array
781  {
782  $objDefinition = $this->obj_definition;
783 
784  if (empty($this->type_grps)) {
785  $this->type_grps =
786  $objDefinition::getGroupedRepositoryObjectTypes($this->getContainerObject()->getType());
787  }
788  return $this->type_grps;
789  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getIntroduction()

ilContainerContentGUI::getIntroduction ( )

Definition at line 791 of file class.ilContainerContentGUI.php.

References $lng, ilObject\_getIcon(), ilGlobalTemplateInterface\get(), ilLanguage\loadLanguageModule(), ilGlobalTemplateInterface\setVariable(), and ilLanguage\txt().

Referenced by ilContainerByTypeContentGUI\getMainContent().

791  : string
792  {
793  $lng = $this->lng;
794 
795  $lng->loadLanguageModule("rep");
796 
797  $tpl = new ilTemplate("tpl.rep_intro.html", true, true, "Services/Repository");
798  $tpl->setVariable("IMG_REP_LARGE", ilObject::_getIcon(0, "big", "root"));
799  $tpl->setVariable("TXT_WELCOME", $lng->txt("rep_intro"));
800  $tpl->setVariable("TXT_INTRO_1", $lng->txt("rep_intro1"));
801  $tpl->setVariable("TXT_INTRO_2", $lng->txt("rep_intro2"));
802  $tpl->setVariable("TXT_INTRO_3", sprintf($lng->txt("rep_intro3"), $lng->txt("add")));
803  $tpl->setVariable("TXT_INTRO_4", sprintf($lng->txt("rep_intro4"), $lng->txt("cat_add")));
804  $tpl->setVariable("TXT_INTRO_5", $lng->txt("rep_intro5"));
805  $tpl->setVariable("TXT_INTRO_6", $lng->txt("rep_intro6"));
806 
807  return $tpl->get();
808  }
static _getIcon(int $obj_id=0, string $size="big", string $type="", bool $offline=false)
Get icon for repository item.
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...
ilGlobalTemplateInterface $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
loadLanguageModule(string $a_module)
Load language module.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemGroupsHTML()

ilContainerContentGUI::getItemGroupsHTML ( int  $a_pos = 0)

Definition at line 810 of file class.ilContainerContentGUI.php.

References renderItemGroup().

Referenced by ilContainerByTypeContentGUI\renderItemList(), ilContainerSimpleContentGUI\showMaterials(), and ilContainerSessionsContentGUI\showMaterials().

810  : int
811  {
812  if (isset($this->items["itgr"]) && is_array($this->items["itgr"])) {
813  foreach ($this->items["itgr"] as $itgr) {
814  if (!$this->renderer->hasCustomBlock($itgr["child"])) {
815  $this->renderItemGroup($itgr);
816 
817  $this->renderer->setBlockPosition($itgr["ref_id"], ++$a_pos);
818  }
819  }
820  }
821  return $a_pos;
822  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemGUI()

ilContainerContentGUI::getItemGUI ( array  $item_data)
protected

Definition at line 349 of file class.ilContainerContentGUI.php.

References ilObjectListGUIFactory\_getListGUIByType(), and getContainerGUI().

Referenced by renderCard(), renderItem(), and renderItemGroup().

350  {
351  // get item list gui object
352  if (!isset($this->list_gui[$item_data["type"]])) {
353  $item_list_gui = ilObjectListGUIFactory::_getListGUIByType($item_data["type"]);
354  $item_list_gui->setContainerObject($this->getContainerGUI());
355  $this->list_gui[$item_data["type"]] = &$item_list_gui;
356  } else {
357  $item_list_gui = &$this->list_gui[$item_data["type"]];
358  }
359 
360  // unique js-ids
361  $item_list_gui->setParentRefId((int) ($item_data["parent"] ?? 0));
362 
363  $item_list_gui->setDefaultCommandParameters([]);
364  $item_list_gui->disableTitleLink(false);
365  $item_list_gui->resetConditionTarget();
366 
367  if ($this->container_obj->isClassificationFilterActive()) {
368  $item_list_gui->enablePath(
369  true,
370  $this->container_obj->getRefId(),
372  );
373  }
374 
375  // activate common social commands
376  $item_list_gui->enableComments(true);
377  $item_list_gui->enableNotes(true);
378  $item_list_gui->enableTags(true);
379  $item_list_gui->enableRating(true);
380 
381  // reset
382  $item_list_gui->forceVisibleOnly(false);
383 
384  // container specific modifications
385  $this->getContainerGUI()->modifyItemGUI($item_list_gui, $item_data);
386 
387  return $item_list_gui;
388  }
static _getListGUIByType(string $type, int $context=ilObjectListGUI::CONTEXT_REPOSITORY)
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:

◆ getMainContent()

ilContainerContentGUI::getMainContent ( )
abstract

Get content HTML for main column, this one must be overwritten in derived classes.

Referenced by forwardToColumnGUI(), and getCenterColumnHTML().

+ Here is the caller graph for this function:

◆ getRightColumnHTML()

ilContainerContentGUI::getRightColumnHTML ( )
protected

Definition at line 181 of file class.ilContainerContentGUI.php.

References $ctrl, ilObject\_lookupObjId(), ilObject\_lookupType(), getContainerGUI(), getContainerObject(), IL_COL_RIGHT, IL_SCREEN_FULL, IL_SCREEN_SIDE, and ilCtrl\saveParameterByClass().

Referenced by setOutput().

181  : string
182  {
183  $ilCtrl = $this->ctrl;
184  $html = "";
185 
186  $ilCtrl->saveParameterByClass("ilcolumngui", "col_return");
187 
188  $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
189  $obj_type = ilObject::_lookupType($obj_id);
190 
191  $column_gui = new ilColumnGUI($obj_type, IL_COL_RIGHT);
192 
193  if ($column_gui::getScreenMode() === IL_SCREEN_FULL) {
194  return "";
195  }
196 
197  $this->getContainerGUI()->setColumnSettings($column_gui);
198 
199  if ($ilCtrl->getNextClass() === "ilcolumngui" &&
200  $column_gui::getCmdSide() === IL_COL_RIGHT &&
201  $column_gui::getScreenMode() === IL_SCREEN_SIDE) {
202  $html = $ilCtrl->forwardCommand($column_gui);
203  } else {
204  if (!$ilCtrl->isAsynch()) {
205  $html = "";
206 
207  // user interface plugin slot + default rendering
208  $uip = new ilUIHookProcessor(
209  "Services/Container",
210  "right_column",
211  ["container_content_gui" => $this]
212  );
213  if (!$uip->replaced()) {
214  $html = $ilCtrl->getHTML($column_gui);
215  }
216  $html = $uip->getHTML($html);
217  }
218  }
219 
220  return $html;
221  }
const IL_COL_RIGHT
static _lookupObjId(int $ref_id)
const IL_SCREEN_FULL
Column user interface class.
saveParameterByClass(string $a_class, $a_parameter)
static _lookupType(int $id, bool $reference=false)
const IL_SCREEN_SIDE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSingleTypeBlockAsynch()

ilContainerContentGUI::getSingleTypeBlockAsynch ( string  $type)

Render single block.

Definition at line 730 of file class.ilContainerContentGUI.php.

References getContainerGUI(), getContainerObject(), initRenderer(), and renderItem().

732  : string {
733  $this->initRenderer();
734  // get all sub items
735  $this->items = $this->getContainerObject()->getSubItems(
736  $this->getContainerGUI()->isActiveAdministrationPanel()
737  );
738 
739 
740  $ref_ids = $this->request->getAlreadyRenderedRefIds();
741 
742  // iterate all types
743  if (is_array($this->items[$type]) &&
744  $this->renderer->addTypeBlock($type)) {
745  //$this->renderer->setBlockPosition($type, ++$pos);
746 
747  $position = 1;
748  $counter = 1;
749  foreach ($this->items[$type] as $item_data) {
750  $item_ref_id = $item_data["child"];
751 
752  if (in_array($item_ref_id, $ref_ids)) {
753  continue;
754  }
755 
756  if ($this->block_limit > 0 && $counter == $this->block_limit + 1) {
757  if ($counter == $this->block_limit + 1) {
758  // render more button
759  $this->renderer->addShowMoreButton($type);
760  }
761  continue;
762  }
763 
764  if (!$this->renderer->hasItem($item_ref_id)) {
765  $html = $this->renderItem($item_data, $position++);
766  if ($html != "") {
767  $counter++;
768  $this->renderer->addItemToBlock($type, $item_data["type"], $item_ref_id, $html);
769  }
770  }
771  }
772  }
773 
774  return $this->renderer->renderSingleTypeBlock($type);
775  }
$type
initRenderer()
Init container renderer.
renderItem(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="", string $item_group_list_presentation="")
Render an item.
+ Here is the call graph for this function:

◆ getViewMode()

ilContainerContentGUI::getViewMode ( )
protected

Definition at line 119 of file class.ilContainerContentGUI.php.

References $view_mode.

Referenced by ilContainerGUI\getContentGUI(), initRenderer(), and renderItem().

119  : int
120  {
121  return $this->view_mode;
122  }
+ Here is the caller graph for this function:

◆ handleSessionExpand()

ilContainerContentGUI::handleSessionExpand ( )
protected

Definition at line 921 of file class.ilContainerContentGUI.php.

Referenced by ilContainerSimpleContentGUI\initDetails(), ilContainerByTypeContentGUI\initDetails(), and ilContainerSessionsContentGUI\initDetails().

921  : void
922  {
923  $expand = $this->request->getExpand();
924  if ($expand > 0) {
925  $this->item_manager->setExpanded(abs($expand), self::DETAILS_ALL);
926  } elseif ($expand < 0) {
927  $this->item_manager->setExpanded(abs($expand), self::DETAILS_TITLE);
928  }
929  }
+ Here is the caller graph for this function:

◆ hasForcedOrderByStartDate()

ilContainerContentGUI::hasForcedOrderByStartDate ( string  $type)
protected

Definition at line 473 of file class.ilContainerContentGUI.php.

Referenced by renderItem(), and renderPageEmbeddedBlocks().

473  : bool
474  {
475  return $type === 'sess' && get_class($this) === ilContainerSessionsContentGUI::class;
476  }
$type
+ Here is the caller graph for this function:

◆ initRenderer()

ilContainerContentGUI::initRenderer ( )
protected

Init container renderer.

Definition at line 268 of file class.ilContainerContentGUI.php.

References $container_gui, ilContainerSorting\_getInstance(), ilEventItems\_getItemsOfContainer(), getContainerGUI(), getContainerObject(), ILIAS\Survey\Mode\getId(), and getViewMode().

Referenced by getSingleTypeBlockAsynch(), ilContainerByTypeContentGUI\renderItemList(), ilContainerSimpleContentGUI\showMaterials(), and ilContainerSessionsContentGUI\showMaterials().

268  : void
269  {
271 
272  $this->renderer = new ilContainerRenderer(
273  ($this->getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()),
274  $this->getContainerGUI()->isMultiDownloadEnabled(),
275  $this->getContainerGUI()->isActiveOrdering() && (get_class($this) !== "ilContainerObjectiveGUI") // no block sorting in objective view
276  ,
277  $sorting->getBlockPositions(),
279  $this->getViewMode(),
280  $this->getContainerGUI()->isActiveAdministrationPanel()
281  );
282 
283  // all event items are included per session rendering
284  // and should return true for hasItem
285  $event_items = ilEventItems::_getItemsOfContainer($this->container_obj->getRefId());
286  foreach ($event_items as $ev) {
287  $this->renderer->addItemId($ev);
288  }
289  }
static _getItemsOfContainer(int $a_ref_id)
static _getInstance(int $a_obj_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:

◆ insertPageEmbeddedBlocks()

ilContainerContentGUI::insertPageEmbeddedBlocks ( string  $a_output_html)

Insert blocks into container page.

Definition at line 696 of file class.ilContainerContentGUI.php.

References $type, determinePageEmbeddedBlocks(), getGroupedObjTypes(), ILIAS\Repository\int(), and renderPageEmbeddedBlocks().

Referenced by ilContainerByTypeContentGUI\renderItemList(), ilContainerSimpleContentGUI\showMaterials(), and ilContainerSessionsContentGUI\showMaterials().

696  : string
697  {
698  $this->determinePageEmbeddedBlocks($a_output_html);
699  $this->renderPageEmbeddedBlocks();
700 
701  // iterate all types
702  foreach ($this->getGroupedObjTypes() as $type => $v) {
703  // set template (overall or type specific)
704  if (is_int(strpos($a_output_html, "[list-" . $type . "]"))) {
705  $a_output_html = preg_replace(
706  '~\[list-' . $type . '\]~i',
707  $this->renderer->renderSingleTypeBlock($type),
708  $a_output_html
709  );
710  }
711  }
712 
713  // insert all item groups
714  while (preg_match('~\[(item-group-([0-9]*))\]~i', $a_output_html, $found)) {
715  $itgr_ref_id = (int) $found[2];
716 
717  $a_output_html = preg_replace(
718  '~\[' . $found[1] . '\]~i',
719  $this->renderer->renderSingleCustomBlock($itgr_ref_id),
720  $a_output_html
721  );
722  }
723 
724  return $a_output_html;
725  }
determinePageEmbeddedBlocks(string $a_container_page_html)
Determine all blocks that are embedded in the container page.
$type
getGroupedObjTypes()
Get grouped repository object types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderCard()

ilContainerContentGUI::renderCard ( array  $a_item_data,
int  $a_position = 0,
bool  $a_force_icon = false,
string  $a_pos_prefix = "" 
)

Definition at line 661 of file class.ilContainerContentGUI.php.

References ilCommonActionDispatcherGUI\buildAjaxHash(), getItemGUI(), and ilCommonActionDispatcherGUI\TYPE_REPOSITORY.

Referenced by renderItem().

667  $item_list_gui = $this->getItemGUI($a_item_data);
668  $item_list_gui->setAjaxHash(ilCommonActionDispatcherGUI::buildAjaxHash(
670  $a_item_data['ref_id'],
671  $a_item_data['type'],
672  (int) $a_item_data['obj_id']
673  ));
674  $item_list_gui->initItem(
675  (int) $a_item_data['ref_id'],
676  (int) $a_item_data['obj_id'],
677  (string) $a_item_data['type'],
678  (string) $a_item_data['title'],
679  (string) $a_item_data['description']
680  );
681 
682  // actions
683  $item_list_gui->insertCommands();
684  return $item_list_gui->getAsCard(
685  $a_item_data['ref_id'],
686  (int) $a_item_data['obj_id'],
687  (string) $a_item_data['type'],
688  (string) $a_item_data['title'],
689  (string) $a_item_data['description']
690  );
691  }
static buildAjaxHash(int $node_type, ?int $node_id, string $obj_type, int $obj_id, string $sub_type=null, int $sub_id=null, int $news_id=0)
Build ajax hash.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderItem()

ilContainerContentGUI::renderItem ( array  $a_item_data,
int  $a_position = 0,
bool  $a_force_icon = false,
string  $a_pos_prefix = "",
string  $item_group_list_presentation = "" 
)

Render an item.

Returns
|string|null

Definition at line 482 of file class.ilContainerContentGUI.php.

References $access, $ctrl, $ilSetting, $settings, ilContainerSorting\_getInstance(), ilObjectActivation\addListGUIActivationProperty(), ilObjectListGUI\DETAILS_ALL, ilObjectListGUI\DETAILS_MINIMAL, determineAdminCommands(), ilContainer\getCompleteDescriptions(), getContainerGUI(), getContainerObject(), getDetailsLevel(), ILIAS\Survey\Mode\getId(), getItemGUI(), ilObjectActivation\getItemsByEvent(), getViewMode(), hasForcedOrderByStartDate(), and renderCard().

Referenced by getSingleTypeBlockAsynch(), renderItemGroup(), ilContainerByTypeContentGUI\renderItemList(), renderPageEmbeddedBlocks(), ilContainerSimpleContentGUI\showMaterials(), and ilContainerSessionsContentGUI\showMaterials().

488  {
490  $ilAccess = $this->access;
491  $ilCtrl = $this->ctrl;
492 
493  // Pass type, obj_id and tree to checkAccess method to improve performance
494  if (!$ilAccess->checkAccess('visible', '', $a_item_data['ref_id'], $a_item_data['type'], $a_item_data['obj_id'], $a_item_data['tree'])) {
495  return '';
496  }
497 
498  $view_mode = $this->getViewMode();
499  if ($item_group_list_presentation != "") {
500  $view_mode = ($item_group_list_presentation === "tile")
501  ? self::VIEW_MODE_TILE
502  : self::VIEW_MODE_LIST;
503  }
504 
505  if ($view_mode === self::VIEW_MODE_TILE) {
506  return $this->renderCard($a_item_data, $a_position, $a_force_icon, $a_pos_prefix);
507  }
508 
509  $item_list_gui = $this->getItemGUI($a_item_data);
510  if ($a_item_data["type"] === "sess" ||
511  $a_force_icon ||
512  $ilSetting->get("icon_position_in_lists") === "item_rows") {
513  $item_list_gui->enableIcon(true);
514  }
515 
516  if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()) {
517  $item_list_gui->enableCheckbox(true);
518  } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
519  // display multi download checkboxes
520  $item_list_gui->enableDownloadCheckbox((int) $a_item_data["ref_id"]);
521  }
522 
523  if ($this->getContainerGUI()->isActiveItemOrdering() && !$this->hasForcedOrderByStartDate($a_item_data['type'])) {
524  $item_list_gui->setPositionInputField(
525  $a_pos_prefix . "[" . $a_item_data["ref_id"] . "]",
526  sprintf('%d', $a_position * 10)
527  );
528  }
529 
530  if ($a_item_data['type'] === 'sess' && get_class($this) !== 'ilContainerObjectiveGUI') {
531  switch ($this->getDetailsLevel($a_item_data['obj_id'])) {
532  case self::DETAILS_TITLE:
533  $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_MINIMAL);
534  $item_list_gui->enableExpand(true);
535  $item_list_gui->setExpanded(false);
536  $item_list_gui->enableDescription(false);
537  $item_list_gui->enableProperties(true);
538  break;
539 
540  case self::DETAILS_ALL:
541  $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
542  $item_list_gui->enableExpand(true);
543  $item_list_gui->setExpanded(true);
544  $item_list_gui->enableDescription(true);
545  $item_list_gui->enableProperties(true);
546  break;
547 
548  default:
549  $item_list_gui->setDetailsLevel(ilObjectListGUI::DETAILS_ALL);
550  $item_list_gui->enableExpand(true);
551  $item_list_gui->enableDescription(true);
552  $item_list_gui->enableProperties(true);
553  break;
554  }
555  }
556 
557  if (method_exists($this, "addItemDetails")) {
558  $this->addItemDetails($item_list_gui, $a_item_data);
559  }
560 
561  // show subitems
562  if ($a_item_data['type'] === 'sess' && (
563  $this->getDetailsLevel($a_item_data['obj_id']) !== self::DETAILS_TITLE ||
564  $this->getContainerGUI()->isActiveAdministrationPanel() ||
565  $this->getContainerGUI()->isActiveItemOrdering()
566  )) {
567  $pos = 1;
568 
569  $items = ilObjectActivation::getItemsByEvent($a_item_data['obj_id']);
570  $items = ilContainerSorting::_getInstance($this->getContainerObject()->getId())->sortSubItems('sess', $a_item_data['obj_id'], $items);
572 
573  $item_readable = $ilAccess->checkAccess('read', '', $a_item_data['ref_id']);
574 
575  foreach ($items as $item) {
576  // TODO: this should be removed and be handled by if(strlen($sub_item_html))
577  // see mantis: 0003944
578  if (!$ilAccess->checkAccess('visible', '', $item['ref_id'])) {
579  continue;
580  }
581 
582  $item_list_gui2 = $this->getItemGUI($item);
583  $item_list_gui2->enableIcon(true);
584  $item_list_gui2->enableItemDetailLinks(false);
585 
586  // unique js-ids
587  $item_list_gui2->setParentRefId((int) ($a_item_data['ref_id'] ?? 0));
588 
589  // @see mantis 10488
590  if (!$item_readable && !$ilAccess->checkAccess('write', '', $item['ref_id'])) {
591  $item_list_gui2->forceVisibleOnly(true);
592  }
593 
594  if ($this->getContainerGUI()->isActiveAdministrationPanel() && !$this->clipboard->hasEntries()) {
595  $item_list_gui2->enableCheckbox(true);
596  } elseif ($this->getContainerGUI()->isMultiDownloadEnabled()) {
597  // display multi download checkbox
598  $item_list_gui2->enableDownloadCheckbox((int) $item['ref_id']);
599  }
600 
601  if ($this->getContainerGUI()->isActiveItemOrdering()) {
602  $item_list_gui2->setPositionInputField(
603  "[sess][" . $a_item_data['obj_id'] . "][" . $item["ref_id"] . "]",
604  sprintf('%d', $pos * 10)
605  );
606  $pos++;
607  }
608 
609  // #10611
610  ilObjectActivation::addListGUIActivationProperty($item_list_gui2, $item);
611 
612  $sub_item_html = $item_list_gui2->getListItemHTML(
613  $item['ref_id'],
614  $item['obj_id'],
615  $item['title'],
616  $item['description']
617  );
618 
619  $this->determineAdminCommands($item["ref_id"], $item_list_gui2->adminCommandsIncluded());
620  if ($sub_item_html !== '') {
621  $item_list_gui->addSubItemHTML($sub_item_html);
622  }
623  }
624  }
625 
626  $asynch = false;
627  $asynch_url = '';
628  if ($ilSetting->get("item_cmd_asynch")) {
629  $asynch = true;
630  $ilCtrl->setParameter($this->container_gui, "cmdrefid", $a_item_data['ref_id']);
631  $asynch_url = $ilCtrl->getLinkTarget(
632  $this->container_gui,
633  "getAsynchItemList",
634  "",
635  true,
636  false
637  );
638  $ilCtrl->setParameter($this->container_gui, "cmdrefid", "");
639  }
640 
641  ilObjectActivation::addListGUIActivationProperty($item_list_gui, $a_item_data);
642 
643  $html = $item_list_gui->getListItemHTML(
644  (int) $a_item_data['ref_id'],
645  (int) $a_item_data['obj_id'],
646  (string) $a_item_data['title'],
647  (string) $a_item_data['description'],
648  $asynch,
649  false,
650  $asynch_url
651  );
652  $this->determineAdminCommands(
653  $a_item_data["ref_id"],
654  $item_list_gui->adminCommandsIncluded()
655  );
656 
657 
658  return $html;
659  }
determineAdminCommands(int $a_ref_id, bool $a_admin_com_included_in_list=false)
static getItemsByEvent(int $event_id)
Get session material / event items.
static addListGUIActivationProperty(ilObjectListGUI $list_gui, array &$item)
Get timing details for list gui.
global $ilSetting
Definition: privfeed.php:17
static _getInstance(int $a_obj_id)
renderCard(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="")
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderItemGroup()

ilContainerContentGUI::renderItemGroup ( array  $a_itgr)

Definition at line 824 of file class.ilContainerContentGUI.php.

References $access, $data, $i, $ilUser, $user, ilContainerSorting\_getInstance(), ilItemGroupBehaviour\ALWAYS_OPEN, ilItemGroupBehaviour\EXPANDABLE_CLOSED, ilItemGroupBehaviour\EXPANDABLE_OPEN, ilContainer\getCompleteDescriptions(), getContainerGUI(), getContainerObject(), ILIAS\Survey\Mode\getId(), getItemGUI(), ilObjectActivation\getItemsByItemGroup(), ilObjItemGroup\lookupHideTitle(), and renderItem().

Referenced by getItemGroupsHTML(), and renderPageEmbeddedBlocks().

824  : void
825  {
826  $ilAccess = $this->access;
828 
829  // #16493
830  $perm_ok = ($ilAccess->checkAccess("visible", "", $a_itgr['ref_id']) &&
831  $ilAccess->checkAccess("read", "", $a_itgr['ref_id']));
832 
833  $items = ilObjectActivation::getItemsByItemGroup($a_itgr['ref_id']);
834 
835  // get all valid ids (this is filtered)
836  $all_ids = array_map(static function (array $i): int {
837  return (int) $i["child"];
838  }, $this->items["_all"]);
839 
840  // remove filtered items
841  $items = array_filter($items, static function (array $i) use ($all_ids): bool {
842  return in_array($i["ref_id"], $all_ids);
843  });
844 
845  // if no permission is given, set the items to "rendered" but
846  // do not display the whole block
847  if (!$perm_ok) {
848  foreach ($items as $item) {
849  $this->renderer->hideItem($item["child"]);
850  }
851  return;
852  }
853 
854  $item_list_gui = $this->getItemGUI($a_itgr);
855  $item_list_gui->enableNotes(false);
856  $item_list_gui->enableTags(false);
857  $item_list_gui->enableComments(false);
858  $item_list_gui->enableTimings(false);
859  $item_list_gui->getListItemHTML(
860  $a_itgr["ref_id"],
861  $a_itgr["obj_id"],
862  $a_itgr["title"],
863  $a_itgr["description"]
864  );
865  $commands_html = $item_list_gui->getCommandsHTML();
866 
867  // determine behaviour
868  $item_group = new ilObjItemGroup($a_itgr["ref_id"]);
869  $beh = $item_group->getBehaviour();
870  $stored_val = $this->block_repo->getProperty(
871  "itgr_" . $a_itgr["ref_id"],
872  $ilUser->getId(),
873  "opened"
874  );
875  if ($stored_val !== "" && $beh !== ilItemGroupBehaviour::ALWAYS_OPEN) {
876  $beh = ($stored_val === "1")
879  }
880 
881  $data = [
882  "behaviour" => $beh,
883  "store-url" => "./ilias.php?baseClass=ilcontainerblockpropertiesstoragegui&cmd=store" .
884  "&cont_block_id=itgr_" . $a_itgr['ref_id']
885  ];
886  if (ilObjItemGroup::lookupHideTitle($a_itgr["obj_id"]) &&
887  !$this->getContainerGUI()->isActiveAdministrationPanel()) {
888  $this->renderer->addCustomBlock($a_itgr["ref_id"], "", $commands_html, $data);
889  } else {
890  $this->renderer->addCustomBlock($a_itgr["ref_id"], $a_itgr["title"], $commands_html, $data);
891  }
892 
893 
894  // render item group sub items
895 
897  $this->getContainerObject()->getId()
898  )->sortSubItems('itgr', $a_itgr['obj_id'], $items);
899 
900  // #18285
901  $items = ilContainer::getCompleteDescriptions($items);
902 
903  $position = 1;
904  foreach ($items as $item) {
905  // we are NOT using hasItem() here, because item might be in multiple item groups
906 
907  $it_pres = $item_group->getListPresentation();
908  if ($this->getContainerGUI()->isActiveOrdering() ||
909  $this->getContainerGUI()->isActiveAdministrationPanel()) {
910  $it_pres = "list";
911  }
912 
913  $html2 = $this->renderItem($item, $position++, false, "[itgr][" . $a_itgr['obj_id'] . "]", $it_pres);
914  if ($html2 != "") {
915  // :TODO: show it multiple times?
916  $this->renderer->addItemToBlock($a_itgr["ref_id"], $item["type"], $item["child"], $html2, true);
917  }
918  }
919  }
static lookupHideTitle(int $a_id)
renderItem(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="", string $item_group_list_presentation="")
Render an item.
static getItemsByItemGroup(int $item_group_ref_id)
Get materials of item group.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _getInstance(int $a_obj_id)
$ilUser
Definition: imgupload.php:34
static getCompleteDescriptions(array $objects)
overwrites description fields to long or short description in an assoc array keys needed (obj_id and ...
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderPageEmbeddedBlocks()

ilContainerContentGUI::renderPageEmbeddedBlocks ( )

Definition at line 432 of file class.ilContainerContentGUI.php.

References $ref_id, $type, hasForcedOrderByStartDate(), renderItem(), renderItemGroup(), and ilArrayUtil\sortArray().

Referenced by insertPageEmbeddedBlocks().

432  : void
433  {
434  // item groups
435  if (isset($this->embedded_block["itgr"]) && is_array($this->embedded_block["itgr"])) {
436  $item_groups = [];
437  if (isset($this->items["itgr"]) && is_array($this->items["itgr"])) {
438  foreach ($this->items["itgr"] as $ig) {
439  $item_groups[$ig["ref_id"]] = $ig;
440  }
441  }
442 
443  foreach ($this->embedded_block["itgr"] as $ref_id) {
444  if (isset($item_groups[$ref_id])) {
445  $this->renderItemGroup($item_groups[$ref_id]);
446  }
447  }
448  }
449 
450  // type specific blocks
451  if (isset($this->embedded_block["type"]) && is_array($this->embedded_block["type"])) {
452  foreach ($this->embedded_block["type"] as $type) {
453  if (isset($this->items[$type]) && is_array($this->items[$type]) && $this->renderer->addTypeBlock($type)) {
454  if ($this->hasForcedOrderByStartDate($type)) {
455  $this->items['sess'] = ilArrayUtil::sortArray($this->items['sess'], 'start', 'ASC', true, true);
456  }
457 
458  $position = 1;
459 
460  foreach ($this->items[$type] as $item_data) {
461  if (!$this->renderer->hasItem($item_data["child"])) {
462  $html = $this->renderItem($item_data, $position++);
463  if ($html != "") {
464  $this->renderer->addItemToBlock($type, $item_data["type"], $item_data["child"], $html);
465  }
466  }
467  }
468  }
469  }
470  }
471  }
$type
$ref_id
Definition: ltiauth.php:67
renderItem(array $a_item_data, int $a_position=0, bool $a_force_icon=false, string $a_pos_prefix="", string $item_group_list_presentation="")
Render an item.
static sortArray(array $array, string $a_array_sortby_key, string $a_array_sortorder="asc", bool $a_numeric=false, bool $a_keep_keys=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setOutput()

ilContainerContentGUI::setOutput ( )

This method sets the output of the right and main column in the global standard template.

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

References $ctrl, $ilUser, $tpl, $user, ilObject\_lookupObjId(), ilChangeEvent\_recordReadEvent(), getCenterColumnHTML(), getContainerObject(), getRightColumnHTML(), ilGlobalTemplateInterface\setContent(), and ilGlobalTemplateInterface\setRightContent().

143  : void
144  {
145  $tpl = $this->tpl;
146  $ilCtrl = $this->ctrl;
147 
148  // note: we do not want to get the center html in case of
149  // asynchronous calls to blocks in the right column (e.g. news)
150  // see #13012
151  if ($ilCtrl->getNextClass() === "ilcolumngui" &&
152  $ilCtrl->isAsynch()) {
154  }
155 
156  // BEGIN ChangeEvent: record read event.
158 
159  $obj_id = ilObject::_lookupObjId($this->getContainerObject()->getRefId());
161  $this->getContainerObject()->getType(),
162  $this->getContainerObject()->getRefId(),
163  $obj_id,
164  $ilUser->getId()
165  );
166  // END ChangeEvent: record read event.
167 
168  $html = $this->getCenterColumnHTML();
169  if ($html !== '') {
170  $tpl->setContent($html);
171  }
172 
173  // see above, all other cases (this was the old position of setRightContent,
174  // maybe the position above is ok and all ifs can be removed)
175  if ($ilCtrl->getNextClass() !== "ilcolumngui" ||
176  !$ilCtrl->isAsynch()) {
178  }
179  }
ilGlobalTemplateInterface $tpl
static _lookupObjId(int $ref_id)
setContent(string $a_html)
Sets content for standard template.
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
$ilUser
Definition: imgupload.php:34
setRightContent(string $a_html)
Sets content of right column.
+ Here is the call graph for this function:

Field Documentation

◆ $access

◆ $adminCommands

bool ilContainerContentGUI::$adminCommands = false

Definition at line 54 of file class.ilContainerContentGUI.php.

◆ $block_repo

BlockSessionRepository ilContainerContentGUI::$block_repo
protected

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

◆ $clipboard

ClipboardManager ilContainerContentGUI::$clipboard
protected

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

◆ $container_gui

ilContainerGUI ilContainerContentGUI::$container_gui

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

Referenced by getContainerGUI(), and initRenderer().

◆ $container_obj

ilContainer ilContainerContentGUI::$container_obj

Definition at line 53 of file class.ilContainerContentGUI.php.

Referenced by getContainerObject().

◆ $ctrl

◆ $db

ilDBInterface ilContainerContentGUI::$db
protected

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

Referenced by getCenterColumnHTML().

◆ $details_level

int ilContainerContentGUI::$details_level = self::DETAILS_DEACTIVATED
protected

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

Referenced by getDetailsLevel().

◆ $embedded_block

array ilContainerContentGUI::$embedded_block = []
protected

Definition at line 57 of file class.ilContainerContentGUI.php.

Referenced by getEmbeddedBlocks().

◆ $item_manager

ItemManager ilContainerContentGUI::$item_manager
protected

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

◆ $items

array ilContainerContentGUI::$items = []
protected

◆ $list_gui

array ilContainerContentGUI::$list_gui = []
protected

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

◆ $lng

◆ $log

ilLogger ilContainerContentGUI::$log
protected

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

◆ $obj_definition

ilObjectDefinition ilContainerContentGUI::$obj_definition
protected

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

Referenced by getGroupedObjTypes().

◆ $rbacsystem

ilRbacSystem ilContainerContentGUI::$rbacsystem
protected

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

Referenced by determineAdminCommands().

◆ $renderer

ilContainerRenderer ilContainerContentGUI::$renderer
protected

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

◆ $request

StandardGUIRequest ilContainerContentGUI::$request
protected

◆ $settings

ilSetting ilContainerContentGUI::$settings
protected

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

Referenced by renderItem().

◆ $tpl

◆ $user

◆ $view_mode

int ilContainerContentGUI::$view_mode
protected

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

Referenced by getViewMode().

◆ DETAILS_ALL

const ilContainerContentGUI::DETAILS_ALL = 2

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

◆ DETAILS_DEACTIVATED

const ilContainerContentGUI::DETAILS_DEACTIVATED = 0

Definition at line 34 of file class.ilContainerContentGUI.php.

◆ DETAILS_TITLE

const ilContainerContentGUI::DETAILS_TITLE = 1

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

◆ VIEW_MODE_LIST

const ilContainerContentGUI::VIEW_MODE_LIST = 0

◆ VIEW_MODE_TILE

const ilContainerContentGUI::VIEW_MODE_TILE = 1

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