ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilContainerByTypeContentGUI Class Reference

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

+ Inheritance diagram for ilContainerByTypeContentGUI:
+ Collaboration diagram for ilContainerByTypeContentGUI:

Public Member Functions

 __construct (ilContainerGUI $container_gui_obj, ilContainerUserFilter $container_user_filter=null)
 
 getMainContent ()
 
 renderItemList ()
 
- Public Member Functions inherited from ilContainerContentGUI
 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)
 

Protected Member Functions

 getDetailsLevel (int $a_item_id)
 
 initDetails ()
 
- Protected Member Functions inherited from ilContainerContentGUI
 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

 $force_details = null
 
int $block_limit
 
ilContainerUserFilter $container_user_filter
 
- Protected Attributes inherited from ilContainerContentGUI
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
 

Additional Inherited Members

- Data Fields inherited from ilContainerContentGUI
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
 

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 Shows all items grouped by type.

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

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

Constructor & Destructor Documentation

◆ __construct()

ilContainerByTypeContentGUI::__construct ( ilContainerGUI  $container_gui_obj,
ilContainerUserFilter  $container_user_filter = null 
)

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

References $container_user_filter, $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilContainer\_lookupContainerSetting(), ILIAS\Repository\access(), ilObjectGUI\getObject(), initDetails(), ILIAS\Repository\int(), and ILIAS\Repository\user().

36  {
37  global $DIC;
38 
39  $this->access = $DIC->access();
40  $this->user = $DIC->user();
41  parent::__construct($container_gui_obj);
42  $this->initDetails();
43  $this->block_limit = (int) ilContainer::_lookupContainerSetting($container_gui_obj->getObject()->getId(), "block_limit");
44  $this->container_user_filter = $container_user_filter;
45  }
static _lookupContainerSetting(int $a_id, string $a_keyword, string $a_default_value=null)
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getDetailsLevel()

ilContainerByTypeContentGUI::getDetailsLevel ( int  $a_item_id)
protected

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

References ilContainerContentGUI\getContainerGUI().

47  : int
48  {
49  if ($this->getContainerGUI()->isActiveAdministrationPanel()) {
50  return self::DETAILS_DEACTIVATED;
51  }
52  if ($this->item_manager->getExpanded($a_item_id) !== null) {
53  return $this->item_manager->getExpanded($a_item_id);
54  }
55  if ($a_item_id == $this->force_details) {
56  return self::DETAILS_ALL;
57  }
58 
59  return self::DETAILS_TITLE;
60  }
+ Here is the call graph for this function:

◆ getMainContent()

ilContainerByTypeContentGUI::getMainContent ( )

Definition at line 62 of file class.ilContainerByTypeContentGUI.php.

References ilContainerContentGUI\$access, ilContainerContentGUI\$tpl, ilGlobalTemplateInterface\get(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilContainerContentGUI\getIntroduction(), renderItemList(), ROOT_FOLDER_ID, and ilGlobalTemplateInterface\setVariable().

62  : string
63  {
64  $ilAccess = $this->access;
65 
66  $tpl = new ilTemplate(
67  "tpl.container_page.html",
68  true,
69  true,
70  "Services/Container"
71  );
72 
73  // get all sub items
74  $this->items = $this->getContainerObject()->getSubItems(
75  $this->getContainerGUI()->isActiveAdministrationPanel(),
76  false,
77  0,
78  $this->container_user_filter
79  );
80 
81  //$this->items = $this->applyFilterToItems($this->items);
82 
83  // Show introduction, if repository is empty
84  // @todo: maybe we move this
85  if ((!is_array($this->items) || count($this->items) === 0) &&
86  $this->getContainerObject()->getRefId() === ROOT_FOLDER_ID &&
87  $ilAccess->checkAccess("write", "", $this->getContainerObject()->getRefId())) {
88  $html = $this->getIntroduction();
89  } else { // show item list otherwise
90  $html = $this->renderItemList();
91  }
92  $tpl->setVariable("CONTAINER_PAGE_CONTENT", $html);
93 
94  return $tpl->get();
95  }
const ROOT_FOLDER_ID
Definition: constants.php:32
ilGlobalTemplateInterface $tpl
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
+ Here is the call graph for this function:

◆ initDetails()

ilContainerByTypeContentGUI::initDetails ( )
protected

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

References $session, ilContainerContentGUI\getContainerObject(), ilContainerContentGUI\handleSessionExpand(), ilSessionAppointment\lookupLastSessionByCourse(), and ilSessionAppointment\lookupNextSessionByCourse().

Referenced by __construct().

149  : void
150  {
151  $this->handleSessionExpand();
152 
153  if ($this->getContainerObject()->getType() === 'crs') {
155  $this->force_details = $session;
157  $this->force_details = $session;
158  }
159  }
160  }
$session
static lookupNextSessionByCourse(int $a_ref_id)
static lookupLastSessionByCourse(int $a_ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderItemList()

ilContainerByTypeContentGUI::renderItemList ( )

Definition at line 97 of file class.ilContainerByTypeContentGUI.php.

References $type, ilContainerContentGUI\clearAdminCommandsDetermination(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getGroupedObjTypes(), ilContainerContentGUI\getItemGroupsHTML(), ilContainerContentGUI\initRenderer(), ilContainerContentGUI\insertPageEmbeddedBlocks(), and ilContainerContentGUI\renderItem().

Referenced by getMainContent().

97  : string
98  {
100 
101  $this->initRenderer();
102 
103  // text/media page content
104  $output_html = $this->getContainerGUI()->getContainerPageHTML();
105 
106  // get embedded blocks
107  if ($output_html !== "") {
108  $output_html = $this->insertPageEmbeddedBlocks($output_html);
109  }
110 
111  // item groups
112  $pos = $this->getItemGroupsHTML();
113 
114  // iterate all types
115  foreach ($this->getGroupedObjTypes() as $type => $v) {
116  if (isset($this->items[$type]) && is_array($this->items[$type]) &&
117  $this->renderer->addTypeBlock($type)) {
118  $this->renderer->setBlockPosition($type, ++$pos);
119 
120  $position = 1;
121  $counter = 1;
122  foreach ($this->items[$type] as $item_data) {
123  $item_ref_id = $item_data["child"];
124 
125  if ($this->block_limit > 0 && $counter == $this->block_limit + 1 && !$this->getContainerGUI()->isActiveItemOrdering()) {
126  if ($counter == $this->block_limit + 1) {
127  // render more button
128  $this->renderer->addShowMoreButton($type);
129  }
130  continue;
131  }
132 
133  if (!$this->renderer->hasItem($item_ref_id)) {
134  $html = $this->renderItem($item_data, $position++);
135  if ($html != "") {
136  $counter++;
137  $this->renderer->addItemToBlock($type, $item_data["type"], $item_ref_id, $html);
138  }
139  }
140  }
141  }
142  }
143 
144  $output_html .= $this->renderer->getHTML();
145 
146  return $output_html;
147  }
$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.
getGroupedObjTypes()
Get grouped repository object types.
insertPageEmbeddedBlocks(string $a_output_html)
Insert blocks into container page.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $block_limit

int ilContainerByTypeContentGUI::$block_limit
protected

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

◆ $container_user_filter

ilContainerUserFilter ilContainerByTypeContentGUI::$container_user_filter
protected

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

Referenced by __construct().

◆ $force_details

ilContainerByTypeContentGUI::$force_details = null
protected

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


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