ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
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

 $force_details = array()
 
- Protected Attributes inherited from ilContainerContentGUI
 $details_level = self::DETAILS_DEACTIVATED
 
 $renderer
 

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 41 of file class.ilContainerSessionsContentGUI.php.

References $lng, and initDetails().

42  {
43  global $lng;
44 
45  parent::__construct($container_gui_obj);
46  $this->lng = $lng;
47  $this->initDetails();
48  }
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

Member Function Documentation

◆ __showMaterials()

ilContainerSessionsContentGUI::__showMaterials (   $a_tpl)

Show Materials.

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

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

Referenced by getMainContent().

114  {
115  global $lng;
116 
117  $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
119 
120  $this->initRenderer();
121 
122  $output_html = $this->getContainerGUI()->getContainerPageHTML();
123 
124  // get embedded blocks
125  if ($output_html != "")
126  {
127  $output_html = $this->insertPageEmbeddedBlocks($output_html);
128  }
129 
130  if (is_array($this->items["sess"]) ||
131  $this->items['sess_link']['prev']['value'] ||
132  $this->items['sess_link']['next']['value'])
133  {
134  $this->items['sess'] = ilUtil::sortArray($this->items['sess'],'start','ASC',true,true);
135 
136  if($this->items['sess_link']['prev']['value'])
137  {
138  $prefix = $this->renderSessionLimitLink(true);
139  }
140  if($this->items['sess_link']['next']['value'])
141  {
142  $postfix = $this->renderSessionLimitLink(false);
143  }
144 
145  $this->renderer->addTypeBlock("sess", $prefix, $postfix);
146  $this->renderer->setBlockPosition("sess", 1);
147 
148  $position = 1;
149 
150  foreach($this->items["sess"] as $item_data)
151  {
152  if (!$this->renderer->hasItem($item_data["child"]))
153  {
154  $html = $this->renderItem($item_data, $position++, true);
155  if ($html != "")
156  {
157  $this->renderer->addItemToBlock("sess", $item_data["type"], $item_data["child"], $html);
158  }
159  }
160  }
161  }
162 
163  $pos = $this->getItemGroupsHTML(1);
164 
165  if (is_array($this->items["_all"]))
166  {
167  $this->renderer->addCustomBlock("_all", $lng->txt("content"));
168  $this->renderer->setBlockPosition("_all", ++$pos);
169 
170  $position = 1;
171 
172  foreach($this->items["_all"] as $item_data)
173  {
174  // #14599
175  if ($item_data["type"] == "sess" || $item_data["type"] == "itgr")
176  {
177  continue;
178  }
179 
180  if (!$this->renderer->hasItem($item_data["child"]))
181  {
182  $html = $this->renderItem($item_data, $position++, true);
183  if ($html != "")
184  {
185  $this->renderer->addItemToBlock("_all", $item_data["type"], $item_data["child"], $html);
186  }
187  }
188  }
189  }
190 
191  $output_html .= $this->renderer->getHTML();
192 
193  $a_tpl->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
194  }
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
initRenderer()
Init container renderer.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
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
global $lng
Definition: privfeed.php:40
+ 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 262 of file class.ilContainerSessionsContentGUI.php.

References $_GET, $ilCtrl, and $tpl.

263  {
264  global $ilCtrl;
265 
266  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
267 
268  $tpl->setCurrentBlock('container_details_row');
269  $tpl->setVariable('TXT_DETAILS',$this->lng->txt('details'));
270  $tpl->parseCurrentBlock();
271  }
$_GET["client_id"]
global $tpl
Definition: ilias.php:8
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 58 of file class.ilContainerSessionsContentGUI.php.

References $_SESSION, and ilContainerContentGUI\getContainerGUI().

59  {
60  if($this->getContainerGUI()->isActiveAdministrationPanel())
61  {
62  return self::DETAILS_DEACTIVATED;
63  }
64  if(isset($_SESSION['sess']['expanded'][$a_session_id]))
65  {
66  return $_SESSION['sess']['expanded'][$a_session_id];
67  }
68  if(in_array($a_session_id,$this->force_details))
69  {
70  return self::DETAILS_ALL;
71  }
72  else
73  {
74  return self::DETAILS_TITLE;
75  }
76  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
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 82 of file class.ilContainerSessionsContentGUI.php.

References $lng, $tpl, and __showMaterials().

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

◆ initDetails()

ilContainerSessionsContentGUI::initDetails ( )
protected

init details

protected

Parameters

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

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

Referenced by __construct().

281  {
282  global $ilUser;
283 
284  if($_GET['expand'])
285  {
286  if($_GET['expand'] > 0)
287  {
288  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_ALL;
289  }
290  else
291  {
292  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_TITLE;
293  }
294  }
295 
296  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
297  if($session = ilSessionAppointment::lookupNextSessionByCourse($this->getContainerObject()->getRefId()))
298  {
299  $this->force_details = $session;
300  }
301  elseif($session = ilSessionAppointment::lookupLastSessionByCourse($this->getContainerObject()->getRefId()))
302  {
303  $this->force_details = array($session);
304  }
305  }
< a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('siimage').src = './securimage_show.php?sid=' + Math.random(); this.blur(); return false">< img src="./images/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0"/></a >< br/>< strong > Enter Code *if($_SERVER['REQUEST_METHOD']=='POST' &&@ $_POST['do']=='contact') $_SESSION['ctform']['success']
$_GET["client_id"]
getContainerObject()
Get container object.
static lookupLastSessionByCourse($a_ref_id)
public
global $ilUser
Definition: imgupload.php:15
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 200 of file class.ilContainerSessionsContentGUI.php.

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

Referenced by __showMaterials().

201  {
202  global $lng, $ilUser, $ilCtrl;
203 
204  $lng->loadLanguageModule('crs');
205 
206  $tpl = new ilTemplate('tpl.container_list_item.html',true,true,
207  "Services/Container");
208  $tpl->setVariable('DIV_CLASS','ilContainerListItemOuter');
209  $tpl->setCurrentBlock('item_title_linked');
210 
211  if($a_previous)
212  {
213  $prefp = $ilUser->getPref('crs_sess_show_prev_'.$this->getContainerObject()->getId());
214 
215  if($prefp)
216  {
217  $tpl->setVariable('TXT_TITLE_LINKED',$lng->txt('crs_link_hide_prev_sessions'));
218  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()),'crs_prev_sess',(int) !$prefp);
219  $tpl->setVariable('HREF_TITLE_LINKED',$ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
220  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
221  }
222  else
223  {
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  }
230  else
231  {
232  $prefn = $ilUser->getPref('crs_sess_show_next_'.$this->getContainerObject()->getId());
233 
234  if($prefn)
235  {
236  $tpl->setVariable('TXT_TITLE_LINKED',$lng->txt('crs_link_hide_next_sessions'));
237  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()),'crs_next_sess',(int) !$prefn);
238  $tpl->setVariable('HREF_TITLE_LINKED',$ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
239  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
240  }
241  else
242  {
243  $tpl->setVariable('TXT_TITLE_LINKED',$lng->txt('crs_link_show_all_next_sessions'));
244  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()),'crs_next_sess',(int) !$prefn);
245  $tpl->setVariable('HREF_TITLE_LINKED',$ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
246  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
247  }
248  }
249  $tpl->parseCurrentBlock();
250 
251  return $tpl->get();
252  }
global $tpl
Definition: ilias.php:8
global $ilCtrl
Definition: ilias.php:18
getContainerGUI()
Get container GUI object.
special template class to simplify handling of ITX/PEAR
getContainerObject()
Get container object.
global $ilUser
Definition: imgupload.php:15
global $lng
Definition: privfeed.php:40
+ 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 35 of file class.ilContainerSessionsContentGUI.php.


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