ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 newBlockTemplate ()
 returns a new list block template More...
 
 addStandardRow (&$a_tpl, $a_html, $a_ref_id=0)
 add item row to template More...
 
 addHeaderRow ($a_tpl, $a_type="", $a_text="")
 Add header row to block template. More...
 
 resetRowType ()
 Reset row type (toggling background colors) More...
 
 insertPageEmbeddedBlocks ($a_output_html)
 Insert blocks into container page. More...
 
 addMessageRow (&$a_tpl, $a_message, $a_type)
 add message row More...
 
 addSeparatorRow (&$a_tpl)
 Add separator row between two blocks. More...
 
 getGroupedObjTypes ()
 Get grouped repository object types. More...
 
 getIntroduction ()
 Get introduction. More...
 
 getItemGroupsHTML ($a_tpl)
 Get item groups HTML. More...
 
 renderItemGroup ($a_tpl, $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...
 
 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
 

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, $tpl, ilContainerContentGUI\addHeaderRow(), ilContainerContentGUI\addSeparatorRow(), ilContainerContentGUI\addStandardRow(), ilContainerContentGUI\clearAdminCommandsDetermination(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getContainerObject(), ilContainerContentGUI\getItemGroupsHTML(), ilContainerContentGUI\insertPageEmbeddedBlocks(), ilContainerContentGUI\newBlockTemplate(), ilContainerContentGUI\renderItem(), renderSessionLimitLink(), and ilUtil\sortArray().

Referenced by getMainContent().

114  {
115  global $ilAccess, $lng;
116 
117  $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
119 
120  $output_html = $this->getContainerGUI()->getContainerPageHTML();
121 
122  // get embedded blocks
123  if ($output_html != "")
124  {
125  $output_html = $this->insertPageEmbeddedBlocks($output_html);
126  }
127 
128  // sessions
129  $done_sessions = false;
130  $tpl = $this->newBlockTemplate();
131  if (
132  is_array($this->items["sess"]) or
133  $this->items['sess_link']['prev']['value'] or
134  $this->items['sess_link']['next']['value'])
135  {
136  $this->items['sess'] = ilUtil::sortArray($this->items['sess'],'start','ASC',true,true);
137 
138  // all rows
139  $item_html = array();
140  $position = 1;
141 
142  if($this->items['sess_link']['prev']['value'])
143  {
144  $item_html[] = $this->renderSessionLimitLink(true);
145  }
146 
147  foreach($this->items["sess"] as $item_data)
148  {
149  if ($this->rendered_items[$item_data["child"]] !== true)
150  {
151  $html = $this->renderItem($item_data,$position++,true);
152 
153  if ($html != "")
154  {
155  $item_html[] = $html;
156  }
157  }
158  }
159  if($this->items['sess_link']['next']['value'])
160  {
161  $item_html[] = $this->renderSessionLimitLink(false);
162  }
163 
164  // if we have at least one item, output the block
165  if (count($item_html) > 0)
166  {
167  $this->addHeaderRow($tpl, "", $lng->txt("objs_sess"));
168  foreach($item_html as $h)
169  {
170  $this->addStandardRow($tpl, $h);
171  }
172  $done_sessions = true;
173  }
174  }
175 
176  // all other items
177  if ($done_sessions)
178  {
179  $this->addSeparatorRow($tpl);
180  }
181 
182  // item groups
183  $this->getItemGroupsHTML($tpl);
184 
185 
186  if (is_array($this->items["_all"]))
187  {
188  // all rows
189  $item_html = array();
190  $position = 1;
191  foreach($this->items["_all"] as $item_data)
192  {
193  if ($this->rendered_items[$item_data["child"]] !== true)
194  {
195  if ($item_data["type"] == "sess" || $item_data["type"] == "itgr")
196  {
197  continue;
198  }
199  $html = $this->renderItem($item_data,$position++,true);
200  if ($html != "")
201  {
202  $item_html[] = $html;
203  }
204  }
205  }
206 
207  // if we have at least one item, output the block
208  if (count($item_html) > 0)
209  {
210  $this->addHeaderRow($tpl, "", $lng->txt("content"));
211  foreach($item_html as $h)
212  {
213  $this->addStandardRow($tpl, $h);
214  }
215  }
216  }
217 
218  $output_html .= $tpl->get();
219 
220  $a_tpl->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
221  }
newBlockTemplate()
returns a new list block template
addSeparatorRow(&$a_tpl)
Add separator row between two blocks.
static sortArray($array, $a_array_sortby, $a_array_sortorder=0, $a_numeric=false, $a_keep_keys=false)
sortArray
addHeaderRow($a_tpl, $a_type="", $a_text="")
Add header row to block template.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
renderSessionLimitLink($a_previous=true)
Show link to show/hide all previous/next sessions.
getItemGroupsHTML($a_tpl)
Get item groups HTML.
addStandardRow(&$a_tpl, $a_html, $a_ref_id=0)
add item row to template
getContainerGUI()
Get container GUI object.
getContainerObject()
Get container object.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 289 of file class.ilContainerSessionsContentGUI.php.

References $_GET, $ilCtrl, $tpl, ilContainerContentGUI\getContainerObject(), and ilUtil\getImagePath().

290  {
291  global $ilCtrl;
292 
293  $tpl->setCurrentBlock('details_img');
294 
295  $append = $this->details_level == 1 ? 'off' : '';
296  $tpl->setCurrentBlock('details_img');
297  $tpl->setVariable('DETAILS_SRC',ilUtil::getImagePath('details1'.$append.'.png'));
298  $tpl->setVariable('DETAILS_ALT',$this->lng->txt('details').' 1');
299  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $this->getContainerObject()->getRefId());
300  $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "1");
301  $tpl->setVariable('DETAILS_LINK',
302  $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
303  $tpl->parseCurrentBlock();
304 
305  $append = $this->details_level == 2 ? 'off' : '';
306  $tpl->setCurrentBlock('details_img');
307  $tpl->setVariable('DETAILS_SRC',ilUtil::getImagePath('details2'.$append.'.png'));
308  $tpl->setVariable('DETAILS_ALT',$this->lng->txt('details').' 2');
309  $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "2");
310  $tpl->setVariable('DETAILS_LINK',
311  $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
312  $tpl->parseCurrentBlock();
313 
314  $append = $this->details_level == 3 ? 'off' : '';
315  $tpl->setCurrentBlock('details_img');
316  $tpl->setVariable('DETAILS_SRC',ilUtil::getImagePath('details3'.$append.'.png'));
317  $tpl->setVariable('DETAILS_ALT',$this->lng->txt('details').' 3');
318  $ilCtrl->setParameterByClass("ilrepositorygui", "details_level", "3");
319  $tpl->setVariable('DETAILS_LINK',
320  $ilCtrl->getLinkTargetByClass("ilrepositorygui", ""));
321  $tpl->parseCurrentBlock();
322 
323  $ilCtrl->setParameterByClass("ilrepositorygui", "ref_id", $_GET["ref_id"]);
324 
325  $tpl->setCurrentBlock('container_details_row');
326  $tpl->setVariable('TXT_DETAILS',$this->lng->txt('details'));
327  $tpl->parseCurrentBlock();
328  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getContainerObject()
Get container object.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
+ Here is the call graph for this function:

◆ 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  }
special template class to simplify handling of ITX/PEAR
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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 337 of file class.ilContainerSessionsContentGUI.php.

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

Referenced by __construct().

338  {
339  global $ilUser;
340 
341  if($_GET['expand'])
342  {
343  if($_GET['expand'] > 0)
344  {
345  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_ALL;
346  }
347  else
348  {
349  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_TITLE;
350  }
351  }
352 
353  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
354  if($session = ilSessionAppointment::lookupNextSessionByCourse($this->getContainerObject()->getRefId()))
355  {
356  $this->force_details = $session;
357  }
358  elseif($session = ilSessionAppointment::lookupLastSessionByCourse($this->getContainerObject()->getRefId()))
359  {
360  $this->force_details = array($session);
361  }
362  }
< 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 227 of file class.ilContainerSessionsContentGUI.php.

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

Referenced by __showMaterials().

228  {
229  global $lng, $ilUser, $ilCtrl;
230 
231  $lng->loadLanguageModule('crs');
232 
233  $tpl = new ilTemplate('tpl.container_list_item.html',true,true,
234  "Services/Container");
235  $tpl->setVariable('DIV_CLASS','ilContainerListItemOuter');
236  $tpl->setCurrentBlock('item_title_linked');
237 
238  if($a_previous)
239  {
240  $prefp = $ilUser->getPref('crs_sess_show_prev_'.$this->getContainerObject()->getId());
241 
242  if($prefp)
243  {
244  $tpl->setVariable('TXT_TITLE_LINKED',$lng->txt('crs_link_hide_prev_sessions'));
245  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()),'crs_prev_sess',(int) !$prefp);
246  $tpl->setVariable('HREF_TITLE_LINKED',$ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
247  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
248  }
249  else
250  {
251  $tpl->setVariable('TXT_TITLE_LINKED',$lng->txt('crs_link_show_all_prev_sessions'));
252  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()),'crs_prev_sess',(int) !$prefp);
253  $tpl->setVariable('HREF_TITLE_LINKED',$ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
254  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
255  }
256  }
257  else
258  {
259  $prefn = $ilUser->getPref('crs_sess_show_next_'.$this->getContainerObject()->getId());
260 
261  if($prefn)
262  {
263  $tpl->setVariable('TXT_TITLE_LINKED',$lng->txt('crs_link_hide_next_sessions'));
264  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()),'crs_next_sess',(int) !$prefn);
265  $tpl->setVariable('HREF_TITLE_LINKED',$ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
266  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
267  }
268  else
269  {
270  $tpl->setVariable('TXT_TITLE_LINKED',$lng->txt('crs_link_show_all_next_sessions'));
271  $ilCtrl->setParameterByClass(get_class($this->getContainerGUI()),'crs_next_sess',(int) !$prefn);
272  $tpl->setVariable('HREF_TITLE_LINKED',$ilCtrl->getLinkTargetByClass(get_class($this->getContainerGUI())));
273  $ilCtrl->clearParametersByClass(get_class($this->getContainerGUI()));
274  }
275  }
276  $tpl->parseCurrentBlock();
277 
278  return $tpl->get();
279  }
global $ilCtrl
Definition: ilias.php:18
getContainerGUI()
Get container GUI object.
special template class to simplify handling of ITX/PEAR
getContainerObject()
Get container object.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
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: