ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilContainerByTypeContentGUI Class Reference

Shows all items grouped by type. More...

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

Public Member Functions

 __construct ($container_gui_obj)
 Constructor. More...
 
 getDetailsLevel ($a_session_id)
 get details level More...
 
 getMainContent ()
 Get content HTML for main column. More...
 
 renderItemList ()
 Render Items. More...
 
- Public Member Functions inherited from ilContainerContentGUI
 __construct (&$container_gui_obj)
 Constructor. More...
 
 getContainerObject ()
 Get container object. More...
 
 getContainerGUI ()
 Get container GUI object. More...
 
 setOutput ()
 Sets view output into column layout. More...
 
 getMainContent ()
 Get content HTML for main column, this one must be overwritten in derived classes. More...
 
 determinePageEmbeddedBlocks ($a_container_page_html)
 Determine all blocks that are embedded in the container page. More...
 
 addEmbeddedBlock ($block_type, $block_parameter)
 Add embedded block. More...
 
 getEmbeddedBlocks ()
 Get page embedded blocks. More...
 
 renderPageEmbeddedBlocks ()
 Render Page Embedded Blocks. More...
 
 renderItem ($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
 Render an item. More...
 
 renderCard ($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
 Render card. More...
 
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page. More...
 
 getSingleTypeBlockAsynch ($type)
 Render single block. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 getIntroduction ()
 Get introduction. More...
 
 getItemGroupsHTML ($a_pos=0)
 Get item groups HTML. More...
 
 renderItemGroup ($a_itgr)
 Render item group. More...
 

Protected Member Functions

 initDetails ()
 init details More...
 
- Protected Member Functions inherited from ilContainerContentGUI
 getViewMode ()
 Get view mode. More...
 
 getDetailsLevel ($a_item_id)
 get details level More...
 
 getRightColumnHTML ()
 Get HTML for right column. More...
 
 getCenterColumnHTML ()
 Get HTML for center column. More...
 
 initRenderer ()
 Init container renderer. More...
 
 clearAdminCommandsDetermination ()
 cleaer administration commands determination More...
 
 determineAdminCommands ($a_ref_id, $a_admin_com_included_in_list=false)
 determin admin commands More...
 
 getItemGUI ($item_data, $a_show_path=false)
 Get ListGUI object for item. More...
 

Protected Attributes

 $access
 
 $user
 
 $force_details
 
 $block_limit
 
- Protected Attributes inherited from ilContainerContentGUI
 $tpl
 
 $ctrl
 
 $user
 
 $lng
 
 $access
 
 $plugin_admin
 
 $db
 
 $rbacsystem
 
 $settings
 
 $obj_definition
 
 $details_level = self::DETAILS_DEACTIVATED
 
 $renderer
 
 $log
 
 $view_mode
 

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
 
 $container_gui
 
 $container_obj
 

Detailed Description

Shows all items grouped by type.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilContainerByTypeContentGUI::__construct (   $container_gui_obj)

Constructor.

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

References $DIC, ilContainer\_lookupContainerSetting(), initDetails(), and user().

54  {
55  global $DIC;
56 
57  $this->access = $DIC->access();
58  $this->user = $DIC->user();
59  parent::__construct($container_gui_obj);
60  $this->initDetails();
61  $this->block_limit = (int) ilContainer::_lookupContainerSetting($container_gui_obj->object->getId(), "block_limit");
62  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
static _lookupContainerSetting($a_id, $a_keyword, $a_default_value=null)
Lookup a container setting.
+ Here is the call graph for this function:

Member Function Documentation

◆ getDetailsLevel()

ilContainerByTypeContentGUI::getDetailsLevel (   $a_session_id)

get details level

public

Parameters
int$a_session_id
Returns
int DEATAILS_LEVEL

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

References $_SESSION, and ilContainerContentGUI\getContainerGUI().

72  {
73  if ($this->getContainerGUI()->isActiveAdministrationPanel()) {
74  return self::DETAILS_DEACTIVATED;
75  }
76  if (isset($_SESSION['sess']['expanded'][$a_session_id])) {
77  return $_SESSION['sess']['expanded'][$a_session_id];
78  }
79  if ($a_session_id == $this->force_details) {
80  return self::DETAILS_ALL;
81  } else {
82  return self::DETAILS_TITLE;
83  }
84  }
$_SESSION["AccountId"]
getContainerGUI()
Get container GUI object.
+ Here is the call graph for this function:

◆ getMainContent()

ilContainerByTypeContentGUI::getMainContent ( )

Get content HTML for main column.

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

References $access, $html, ilContainerContentGUI\$tpl, ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilContainerContentGUI\getIntroduction(), and renderItemList().

91  {
92  $ilAccess = $this->access;
93 
94  $tpl = new ilTemplate(
95  "tpl.container_page.html",
96  true,
97  true,
98  "Services/Container"
99  );
100 
101  // get all sub items
102  $this->items = $this->getContainerObject()->getSubItems(
103  $this->getContainerGUI()->isActiveAdministrationPanel()
104  );
105 
106  // Show introduction, if repository is empty
107  // @todo: maybe we move this
108  if ((!is_array($this->items) || count($this->items) == 0) &&
109  $this->getContainerObject()->getRefId() == ROOT_FOLDER_ID &&
110  $ilAccess->checkAccess("write", "", $this->getContainerObject()->getRefId())) {
111  $html = $this->getIntroduction();
112  $tpl->setVariable("CONTAINER_PAGE_CONTENT", $html);
113  } else { // show item list otherwise
114  $html = $this->renderItemList();
115  $tpl->setVariable("CONTAINER_PAGE_CONTENT", $html);
116  }
117 
118  return $tpl->get();
119  }
getContainerGUI()
Get container GUI object.
special template class to simplify handling of ITX/PEAR
getContainerObject()
Get container object.
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ initDetails()

ilContainerByTypeContentGUI::initDetails ( )
protected

init details

protected

Parameters

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

References $_GET, $_SESSION, $ilUser, $session, $user, ilContainerContentGUI\getContainerObject(), ilSessionAppointment\lookupLastSessionByCourse(), and ilSessionAppointment\lookupNextSessionByCourse().

Referenced by __construct().

185  {
187 
188  if ($_GET['expand']) {
189  if ($_GET['expand'] > 0) {
190  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_ALL;
191  } else {
192  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_TITLE;
193  }
194  }
195 
196 
197  if ($this->getContainerObject()->getType() == 'crs') {
198  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
200  $this->force_details = $session;
202  $this->force_details = $session;
203  }
204  }
205  }
$_SESSION["AccountId"]
$_GET["client_id"]
$session
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
static lookupLastSessionByCourse($a_ref_id)
public
static lookupNextSessionByCourse($a_ref_id)
public
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderItemList()

ilContainerByTypeContentGUI::renderItemList ( )

Render Items.

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

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

Referenced by getMainContent().

125  {
126  include_once("Services/Object/classes/class.ilObjectListGUIFactory.php");
127 
129 
130  $this->initRenderer();
131 
132  // text/media page content
133  $output_html = $this->getContainerGUI()->getContainerPageHTML();
134 
135  // get embedded blocks
136  if ($output_html != "") {
137  $output_html = $this->insertPageEmbeddedBlocks($output_html);
138  }
139 
140  // item groups
141  $pos = $this->getItemGroupsHTML();
142 
143  // iterate all types
144  foreach ($this->getGroupedObjTypes() as $type => $v) {
145  if (is_array($this->items[$type]) &&
146  $this->renderer->addTypeBlock($type)) {
147  $this->renderer->setBlockPosition($type, ++$pos);
148 
149  $position = 1;
150 
151  foreach ($this->items[$type] as $item_data) {
152  $item_ref_id = $item_data["child"];
153 
154  if ($this->block_limit > 0 && !$this->getContainerGUI()->isActiveItemOrdering() && $position == $this->block_limit + 1) {
155  if ($position == $this->block_limit + 1) {
156  // render more button
157  $this->renderer->addShowMoreButton($type);
158  }
159  continue;
160  }
161 
162  if (!$this->renderer->hasItem($item_ref_id)) {
163  $html = $this->renderItem($item_data, $position++);
164  if ($html != "") {
165  $this->renderer->addItemToBlock($type, $item_data["type"], $item_ref_id, $html);
166  }
167  }
168  }
169  }
170  }
171 
172  $output_html .= $this->renderer->getHTML();
173 
174  return $output_html;
175  }
$type
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
initRenderer()
Init container renderer.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
getContainerGUI()
Get container GUI object.
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
clearAdminCommandsDetermination()
cleaer administration commands determination
$html
Definition: example_001.php:87
getGroupedObjTypes()
Get grouped repository object types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilContainerByTypeContentGUI::$access
protected

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

Referenced by getMainContent().

◆ $block_limit

ilContainerByTypeContentGUI::$block_limit
protected

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

◆ $force_details

ilContainerByTypeContentGUI::$force_details
protected

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

◆ $user

ilContainerByTypeContentGUI::$user
protected

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

Referenced by initDetails().


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