ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilContainerILincContentGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2009 ILIAS open source, University of Cologne |
7  | |
8  | This program is free software; you can redistribute it and/or |
9  | modify it under the terms of the GNU General Public License |
10  | as published by the Free Software Foundation; either version 2 |
11  | of the License, or (at your option) any later version. |
12  | |
13  | This program is distributed in the hope that it will be useful, |
14  | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15  | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16  | GNU General Public License for more details. |
17  | |
18  | You should have received a copy of the GNU General Public License |
19  | along with this program; if not, write to the Free Software |
20  | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
21  +-----------------------------------------------------------------------------+
22 */
23 
24 include_once 'Services/Container/classes/class.ilContainerByTypeContentGUI.php';
25 
34 {
40  public function __construct($container_gui_obj)
41  {
42  parent::__construct($container_gui_obj);
43  }
44 
51  public function renderItemList()
52  {
53  global $objDefinition;
54 
55  $html = '';
56 
57  $class = $objDefinition->getClassName('icla');
58  $location = $objDefinition->getLocation('icla');
59  $full_class = 'ilObj'.$class.'ListGUI';
60  include_once $location.'/class.'.$full_class.'.php';
61 
62  $tpl = $this->newBlockTemplate();
63  $first = true;
64 
65  $item_html = array();
66 
67  if(is_array($this->items['icla']))
68  {
69  foreach($this->items['icla'] as $key => $item)
70  {
71  $item_list_gui = new $full_class();
72  $item_list_gui->setContainerObject($this);
73  if($this->getContainerGUI()->isActiveAdministrationPanel())
74  {
75  $item_list_gui->enableCheckbox(true);
76  }
77 
78  $html = $item_list_gui->getListItemHTML($this->getContainerObject()->getRefId(),
79  $key, $item['name'], $item['description'], $item);
80  if($html != '')
81  {
82  $item_html[] = array('html' => $html, 'item_id' => $this->getContainerObject()->getId());
83  }
84  }
85 
86  // output block for resource type
87  if(count($item_html) > 0)
88  {
89  // separator row
90  if(!$first)
91  {
92  $this->addSeparatorRow($tpl);
93  }
94 
95  $first = false;
96 
97  // add a header for each resource type
98  $this->addHeaderRow($tpl, 'icla');
99  $this->resetRowType();
100 
101  // content row
102  foreach($item_html as $item)
103  {
104  $this->addStandardRow($tpl, $item['html'], $this->getContainerObject()->getId());
105  }
106  }
107  }
108 
109  $html = $tpl->get();
110  return $html;
111  }
112 }
113 ?>