ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
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...
 
 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

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

References initDetails().

42  {
43  parent::__construct($container_gui_obj);
44  $this->initDetails();
45  }
+ 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 54 of file class.ilContainerByTypeContentGUI.php.

References $_SESSION, and ilContainerContentGUI\getContainerGUI().

55  {
56  if($this->getContainerGUI()->isActiveAdministrationPanel())
57  {
58  return self::DETAILS_DEACTIVATED;
59  }
60  if(isset($_SESSION['sess']['expanded'][$a_session_id]))
61  {
62  return $_SESSION['sess']['expanded'][$a_session_id];
63  }
64  if($a_session_id == $this->force_details)
65  {
66  return self::DETAILS_ALL;
67  }
68  else
69  {
70  return self::DETAILS_TITLE;
71  }
72  }
< 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()

ilContainerByTypeContentGUI::getMainContent ( )

Get content HTML for main column.

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

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

79  {
80  global $ilBench, $tree, $ilTabs, $ilAccess;
81 
82  // see bug #7452
83 // $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
84 
85  $tpl = new ilTemplate("tpl.container_page.html", true, true,
86  "Services/Container");
87 
88  // get all sub items
89  $ilBench->start("ilContainerGUI", "0100_getSubItems");
90  $this->items = $this->getContainerObject()->getSubItems(
91  $this->getContainerGUI()->isActiveAdministrationPanel());
92  $ilBench->stop("ilContainerGUI", "0100_getSubItems");
93 
94  // Show introduction, if repository is empty
95  // @todo: maybe we move this
96  if (count($this->items) == 0 &&
97  $this->getContainerObject()->getRefId() == ROOT_FOLDER_ID &&
98  $ilAccess->checkAccess("write", "", $this->getContainerObject()->getRefId()))
99  {
100  $html = $this->getIntroduction();
101  $tpl->setVariable("CONTAINER_PAGE_CONTENT", $html);
102  }
103  else // show item list otherwise
104  {
105  $html = $this->renderItemList();
106  $tpl->setVariable("CONTAINER_PAGE_CONTENT", $html);
107  }
108 
109  // @todo: Move this completely to GUI class?
110 /* $this->getContainerGUI()->adminCommands = $this->adminCommands;
111  $this->getContainerGUI()->showAdministrationPanel($tpl);
112  $this->getContainerGUI()->showPossibleSubObjects();
113  $this->getContainerGUI()->showPermanentLink($tpl);*/
114 
115  $this->html = $tpl->get();
116 
117  return $this->html;
118  }
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 $ilBench
Definition: ilias.php:18
+ Here is the call graph for this function:

◆ initDetails()

ilContainerByTypeContentGUI::initDetails ( )
protected

init details

protected

Parameters

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

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

Referenced by __construct().

222  {
223  global $ilUser;
224 
225  if($_GET['expand'])
226  {
227  if($_GET['expand'] > 0)
228  {
229  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_ALL;
230  }
231  else
232  {
233  $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_TITLE;
234  }
235  }
236 
237 
238  if($this->getContainerObject()->getType() == 'crs')
239  {
240  include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
241  if($session = ilSessionAppointment::lookupNextSessionByCourse($this->getContainerObject()->getRefId()))
242  {
243  $this->force_details = $session;
244  }
245  elseif($session = ilSessionAppointment::lookupLastSessionByCourse($this->getContainerObject()->getRefId()))
246  {
247  $this->force_details = $session;
248  }
249  }
250  }
< 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:

◆ renderItemList()

ilContainerByTypeContentGUI::renderItemList ( )

Render Items.

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

References $ilBench, $ilSetting, $lng, $tpl, ilContainerContentGUI\addHeaderRow(), ilContainerContentGUI\addSeparatorRow(), ilContainerContentGUI\addStandardRow(), ilContainerContentGUI\clearAdminCommandsDetermination(), ilContainerContentGUI\getContainerGUI(), ilContainerContentGUI\getGroupedObjTypes(), ilContainerContentGUI\getItemGroupsHTML(), ilContainerContentGUI\insertPageEmbeddedBlocks(), ilContainerContentGUI\newBlockTemplate(), and ilContainerContentGUI\renderItem().

Referenced by getMainContent().

124  {
125  global $objDefinition, $ilBench, $ilSetting, $lng;
126 
127  include_once("Services/Object/classes/class.ilObjectListGUIFactory.php");
128 
129  $output_html = "";
131 
132  $type_grps = $this->getGroupedObjTypes();
133 
134  // text/media page content
135  $output_html.= $this->getContainerGUI()->getContainerPageHTML();
136 
137  // get embedded blocks
138  if ($output_html != "")
139  {
140  $output_html = $this->insertPageEmbeddedBlocks($output_html);
141  }
142 
143  $tpl = $this->newBlockTemplate();
144 
145  $first = true;
146 
147  // item groups
148  if ($this->getItemGroupsHTML($tpl))
149  {
150  $first = false;
151  }
152 
153  // iterate all types
154  foreach ($type_grps as $type => $v)
155  {
156  if ($type == "itgr")
157  {
158  continue;
159  }
160  if ($this->rendered_block["type"][$type] == "" &&
161  is_array($this->items[$type]))
162  {
163  // all rows
164  $item_r = array();
165  $position = 1;
166 
167  foreach($this->items[$type] as $item_data)
168  {
169  if ($this->rendered_items[$item_data["child"]])
170  {
171  continue;
172  }
173  $html = $this->renderItem($item_data,$position++);
174  if ($html != "")
175  {
176  $item_r[] = array("html" => $html, "id" => $item_data["child"]);
177  }
178  }
179 
180  // if we have at least one item, output the block
181  if (count($item_r) > 0)
182  {
183  if (!$first)
184  {
185  $this->addSeparatorRow($tpl);
186  }
187  $this->addHeaderRow($tpl, $type);
188  foreach($item_r as $h)
189  {
190  $this->addStandardRow($tpl, $h["html"], $h["id"]);
191  }
192  $first = false;
193  }
194  }
195  }
196  if (!$first)
197  {
198  $output_html.= $tpl->get();
199  }
200 
201 /* old page
202  if ($xpage_id > 0)
203  {
204  $page_block = new ilTemplate("tpl.container_page_block.html", false, false,
205  "Services/Container");
206  $page_block->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
207  $output_html = $page_block->get();
208  }
209 */
210 
211  return $output_html;
212  }
newBlockTemplate()
returns a new list block template
addSeparatorRow(&$a_tpl)
Add separator row between two blocks.
addHeaderRow($a_tpl, $a_type="", $a_text="")
Add header row to block template.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
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.
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 $ilSetting
Definition: privfeed.php:40
global $lng
Definition: privfeed.php:40
global $ilBench
Definition: ilias.php:18
getGroupedObjTypes()
Get grouped repository object types.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $force_details

ilContainerByTypeContentGUI::$force_details
protected

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


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