ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilContainerSessionsContentGUI Class Reference

Shows all items in one block. More...

+ Inheritance diagram for ilContainerSessionsContentGUI:
+ Collaboration diagram for ilContainerSessionsContentGUI:

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...
 
 __showMaterials ($a_tpl)
 Show Materials. More...
 
 addFooterRow ($tpl)
 add footer row 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...
 
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page. 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

 renderSessionLimitLink ($a_previous=true)
 Show link to show/hide all previous/next sessions. More...
 
 initDetails ()
 init details More...
 
- Protected Member Functions inherited from ilContainerContentGUI
 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

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

Additional Inherited Members

- Data Fields inherited from ilContainerContentGUI
const DETAILS_DEACTIVATED = 0
 
const DETAILS_TITLE = 1
 
const DETAILS_ALL = 2
 
 $container_gui
 
 $container_obj
 

Detailed Description

Shows all items in one block.

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.ilContainerSessionsContentGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilContainerSessionsContentGUI::__construct (   $container_gui_obj)

Constructor.

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

References $DIC, ilContainerContentGUI\$lng, initDetails(), and user().

47  {
48  global $DIC;
49 
50  $this->tabs = $DIC->tabs();
51  $this->user = $DIC->user();
52  $this->ctrl = $DIC->ctrl();
53  $lng = $DIC->language();
54 
55  parent::__construct($container_gui_obj);
56  $this->lng = $lng;
57  $this->initDetails();
58  }
global $DIC
Definition: saml.php:7
user()
Definition: user.php:4
+ Here is the call graph for this function:

Member Function Documentation

◆ __showMaterials()

ilContainerSessionsContentGUI::__showMaterials (   $a_tpl)

Show Materials.

Definition at line 123 of file class.ilContainerSessionsContentGUI.php.

References $html, ilContainerContentGUI\$lng, ilContainerContentGUI\clearAdminCommandsDetermination(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilContainerContentGUI\getItemGroupsHTML(), ilContainerContentGUI\initRenderer(), ilContainerContentGUI\insertPageEmbeddedBlocks(), ilContainerContentGUI\renderItem(), renderSessionLimitLink(), and ilUtil\sortArray().

Referenced by getMainContent().

124  {
125  $lng = $this->lng;
126 
127  $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
129 
130  $this->initRenderer();
131 
132  $output_html = $this->getContainerGUI()->getContainerPageHTML();
133 
134  // get embedded blocks
135  if ($output_html != "") {
136  $output_html = $this->insertPageEmbeddedBlocks($output_html);
137  }
138 
139  if (is_array($this->items["sess"]) ||
140  $this->items['sess_link']['prev']['value'] ||
141  $this->items['sess_link']['next']['value']) {
142  $this->items['sess'] = ilUtil::sortArray($this->items['sess'], 'start', 'asc', true, false);
143 
144  if ($this->items['sess_link']['prev']['value']) {
145  $prefix = $this->renderSessionLimitLink(true);
146  }
147  if ($this->items['sess_link']['next']['value']) {
148  $postfix = $this->renderSessionLimitLink(false);
149  }
150 
151  $this->renderer->addTypeBlock("sess", $prefix, $postfix);
152  $this->renderer->setBlockPosition("sess", 1);
153 
154  $position = 1;
155 
156  foreach ($this->items["sess"] as $item_data) {
157  if (!$this->renderer->hasItem($item_data["child"])) {
158  $html = $this->renderItem($item_data, $position++, true);
159  if ($html != "") {
160  $this->renderer->addItemToBlock("sess", $item_data["type"], $item_data["child"], $html);
161  }
162  }
163  }
164  }
165 
166  $pos = $this->getItemGroupsHTML(1);
167 
168  if (is_array($this->items["_all"])) {
169  $this->renderer->addCustomBlock("_all", $lng->txt("content"));
170  $this->renderer->setBlockPosition("_all", ++$pos);
171 
172  $position = 1;
173 
174  foreach ($this->items["_all"] as $item_data) {
175  // #14599
176  if ($item_data["type"] == "sess" || $item_data["type"] == "itgr") {
177  continue;
178  }
179 
180  if (!$this->renderer->hasItem($item_data["child"])) {
181  $html = $this->renderItem($item_data, $position++, true);
182  if ($html != "") {
183  $this->renderer->addItemToBlock("_all", $item_data["type"], $item_data["child"], $html);
184  }
185  }
186  }
187  }
188 
189  $output_html .= $this->renderer->getHTML();
190 
191  $a_tpl->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
192  }
static sortArray( $array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
initRenderer()
Init container renderer.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
renderSessionLimitLink($a_previous=true)
Show link to show/hide all previous/next sessions.
getContainerGUI()
Get container GUI object.
getContainerObject()
Get container 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
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addFooterRow()

ilContainerSessionsContentGUI::addFooterRow (   $tpl)

add footer row

public

Parameters

Definition at line 257 of file class.ilContainerSessionsContentGUI.php.

References $_GET, ilContainerContentGUI\$ctrl, $ilCtrl, and ilContainerContentGUI\$tpl.

258  {
260 
261  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
262 
263  $tpl->setCurrentBlock('container_details_row');
264  $tpl->setVariable('TXT_DETAILS', $this->lng->txt('details'));
265  $tpl->parseCurrentBlock();
266  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18

◆ getDetailsLevel()

ilContainerSessionsContentGUI::getDetailsLevel (   $a_session_id)

get details level

public

Parameters
int$a_session_id
Returns
int DEATAILS_LEVEL

Definition at line 68 of file class.ilContainerSessionsContentGUI.php.

References $_SESSION, and ilContainerContentGUI\getContainerGUI().

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

◆ getMainContent()

ilContainerSessionsContentGUI::getMainContent ( )

Get content HTML for main column.

Definition at line 87 of file class.ilContainerSessionsContentGUI.php.

References ilContainerContentGUI\$lng, $tabs, ilContainerContentGUI\$tpl, and __showMaterials().

88  {
89  $lng = $this->lng;
90  $ilTabs = $this->tabs;
91 
92  // see bug #7452
93  // $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
94 
95 
96  include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
97 
98  $tpl = new ilTemplate(
99  "tpl.container_page.html",
100  true,
101  true,
102  "Services/Container"
103  );
104 
105  // Feedback
106  // @todo
107  // $this->__showFeedBack();
108 
109  $this->__showMaterials($tpl);
110 
111  // @todo: Move this completely to GUI class?
112  /* $this->getContainerGUI()->adminCommands = $this->adminCommands;
113  $this->getContainerGUI()->showAdministrationPanel($tpl);
114  $this->getContainerGUI()->showPossibleSubObjects();
115  $this->getContainerGUI()->showPermanentLink($tpl);*/
116 
117  return $tpl->get();
118  }
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

◆ initDetails()

ilContainerSessionsContentGUI::initDetails ( )
protected

init details

protected

Parameters

Definition at line 275 of file class.ilContainerSessionsContentGUI.php.

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

Referenced by __construct().

276  {
278 
279  if ($_GET['expand']) {
280  if ($_GET['expand'] > 0) {
281  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_ALL;
282  } else {
283  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_TITLE;
284  }
285  }
286 
287  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
289  $this->force_details = $session;
291  $this->force_details = array($session);
292  }
293  }
$_SESSION["AccountId"]
$_GET["client_id"]
$session
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
Create styles array
The data for the language used.
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:

◆ renderSessionLimitLink()

ilContainerSessionsContentGUI::renderSessionLimitLink (   $a_previous = true)
protected

Show link to show/hide all previous/next sessions.

Returns
string

Definition at line 198 of file class.ilContainerSessionsContentGUI.php.

References ilContainerContentGUI\$ctrl, $ilCtrl, $ilUser, ilContainerContentGUI\$lng, ilContainerContentGUI\$tpl, ilContainerContentGUI\$user, ilContainerContentGUI\getContainerGUI(), and ilContainerContentGUI\getContainerObject().

Referenced by __showMaterials().

199  {
200  $lng = $this->lng;
203 
204  $lng->loadLanguageModule('crs');
205 
206  $tpl = new ilTemplate(
207  'tpl.container_list_item.html',
208  true,
209  true,
210  "Services/Container"
211  );
212  $tpl->setVariable('DIV_CLASS', 'ilContainerListItemOuter');
213  $tpl->setCurrentBlock('item_title_linked');
214 
215  if ($a_previous) {
216  $prefp = $ilUser->getPref('crs_sess_show_prev_' . $this->getContainerObject()->getId());
217 
218  if ($prefp) {
219  $tpl->setVariable('TXT_TITLE_LINKED', $lng->txt('crs_link_hide_prev_sessions'));
220  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()), 'crs_prev_sess', (int) !$prefp);
221  $tpl->setVariable('HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
222  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
223  } else {
224  $tpl->setVariable('TXT_TITLE_LINKED', $lng->txt('crs_link_show_all_prev_sessions'));
225  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()), 'crs_prev_sess', (int) !$prefp);
226  $tpl->setVariable('HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
227  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
228  }
229  } else {
230  $prefn = $ilUser->getPref('crs_sess_show_next_' . $this->getContainerObject()->getId());
231 
232  if ($prefn) {
233  $tpl->setVariable('TXT_TITLE_LINKED', $lng->txt('crs_link_hide_next_sessions'));
234  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()), 'crs_next_sess', (int) !$prefn);
235  $tpl->setVariable('HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
236  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
237  } else {
238  $tpl->setVariable('TXT_TITLE_LINKED', $lng->txt('crs_link_show_all_next_sessions'));
239  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()), 'crs_next_sess', (int) !$prefn);
240  $tpl->setVariable('HREF_TITLE_LINKED', $ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
241  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
242  }
243  }
244  $tpl->parseCurrentBlock();
245 
246  return $tpl->get();
247  }
global $ilCtrl
Definition: ilias.php:18
getContainerGUI()
Get container GUI object.
special template class to simplify handling of ITX/PEAR
getContainerObject()
Get container object.
$ilUser
Definition: imgupload.php:18
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $force_details

ilContainerSessionsContentGUI::$force_details = array()
protected

Definition at line 40 of file class.ilContainerSessionsContentGUI.php.

◆ $tabs

ilContainerSessionsContentGUI::$tabs
protected

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

Referenced by getMainContent().


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