ILIAS  Release_3_10_x_branch Revision 61812
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilContainerSimpleContentGUI.php
Go to the documentation of this file.
1 <?php
2 /*
3  +-----------------------------------------------------------------------------+
4  | ILIAS open source |
5  +-----------------------------------------------------------------------------+
6  | Copyright (c) 1998-2008 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.ilContainerContentGUI.php");
25 
34 {
39  function __construct($container_gui_obj)
40  {
41  parent::__construct($container_gui_obj);
42  }
43 
44 
48  function getMainContent()
49  {
50  global $lng,$ilTabs;
51 
52  $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
53 
54  include_once './classes/class.ilObjectListGUIFactory.php';
55 
56  $tpl = new ilTemplate ("tpl.container_page.html", true, true,
57  "Services/Container");
58 
59  // Feedback
60  // @todo
61 // $this->__showFeedBack();
62 
63  $this->__showMaterials($tpl);
64 
65  // @todo: Move this completely to GUI class?
66  $this->getContainerGUI()->adminCommands = $this->adminCommands;
67  $this->getContainerGUI()->showAdministrationPanel($tpl);
68  $this->getContainerGUI()->showPossibleSubObjects();
69  $this->getContainerGUI()->showPermanentLink($tpl);
70 
71  return $tpl->get();
72  }
73 
77  function __showMaterials($a_tpl)
78  {
79  global $ilAccess, $lng;
80 
81  $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
83 
84  $output_html = $this->getContainerGUI()->getContainerPageHTML();
85 
86  // get embedded blocks
87  if ($output_html != "")
88  {
89  $output_html = $this->insertPageEmbeddedBlocks($output_html);
90  }
91 
92 
93  $tpl = $this->newBlockTemplate();
94  if (is_array($this->items["_all"]))
95  {
96  // all rows
97  $item_html = array();
98  $position = 1;
99  foreach($this->items["_all"] as $k => $item_data)
100  {
101  if ($this->rendered_items[$item_data["child"]] !== true)
102  {
103  $html = $this->renderItem($item_data,$position++,true);
104  if ($html != "")
105  {
106  $item_html[] = $html;
107  }
108  }
109  }
110 
111  // if we have at least one item, output the block
112  if (count($item_html) > 0)
113  {
114  $this->addHeaderRow($tpl, "", $lng->txt("content"));
115  foreach($item_html as $h)
116  {
117  $this->addStandardRow($tpl, $h);
118  }
119  }
120  }
121 
122  $output_html .= $tpl->get();
123  $a_tpl->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
124  }
125 
126 } // END class.ilContainerSimpleContentGUI
127 ?>