ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
24include_once("./Services/Container/classes/class.ilContainerContentGUI.php");
25
34{
38 protected $tabs;
39
40 protected $force_details;
41
46 public function __construct($container_gui_obj)
47 {
48 global $DIC;
49
50 $this->lng = $DIC->language();
51 $this->tabs = $DIC->tabs();
52 $this->access = $DIC->access();
53 $this->user = $DIC->user();
54 parent::__construct($container_gui_obj);
55 $this->initDetails();
56 }
57
58
62 public function getMainContent()
63 {
65 $ilTabs = $this->tabs;
66
67 // see bug #7452
68 // $ilTabs->setSubTabActive($this->getContainerObject()->getType().'_content');
69
70 include_once 'Services/Object/classes/class.ilObjectListGUIFactory.php';
71
72 $tpl = new ilTemplate(
73 "tpl.container_page.html",
74 true,
75 true,
76 "Services/Container"
77 );
78
79 // Feedback
80 // @todo
81 // $this->__showFeedBack();
82
83 $this->__showMaterials($tpl);
84
85 return $tpl->get();
86 }
87
91 public function __showMaterials($a_tpl)
92 {
93 $ilAccess = $this->access;
95
96 $this->items = $this->getContainerObject()->getSubItems($this->getContainerGUI()->isActiveAdministrationPanel());
98
99 $this->initRenderer();
100
101 $output_html = $this->getContainerGUI()->getContainerPageHTML();
102
103 // get embedded blocks
104 if ($output_html != "") {
105 $output_html = $this->insertPageEmbeddedBlocks($output_html);
106 }
107
108 // item groups
109 $this->getItemGroupsHTML();
110
111 if (is_array($this->items["_all"])) {
112 $this->renderer->addCustomBlock("_all", $lng->txt("content"));
113
114 $position = 1;
115 foreach ($this->items["_all"] as $k => $item_data) {
116 if (!$this->renderer->hasItem($item_data["child"])) {
117 $html = $this->renderItem($item_data, $position++, true);
118 if ($html != "") {
119 $this->renderer->addItemToBlock("_all", $item_data["type"], $item_data["child"], $html);
120 }
121 }
122 }
123 }
124
125 $output_html .= $this->renderer->getHTML();
126
127 $a_tpl->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
128 }
129
137 protected function initDetails()
138 {
140
141 if ($_GET['expand']) {
142 if ($_GET['expand'] > 0) {
143 $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_ALL;
144 } else {
145 $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_TITLE;
146 }
147 }
148
149
150 if ($this->getContainerObject()->getType() == 'crs') {
151 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
153 $this->force_details = $session;
155 $this->force_details = $session;
156 }
157 }
158 }
159
167 public function getDetailsLevel($a_session_id)
168 {
169 if ($this->getContainerGUI()->isActiveAdministrationPanel()) {
171 }
172 if (isset($_SESSION['sess']['expanded'][$a_session_id])) {
173 return $_SESSION['sess']['expanded'][$a_session_id];
174 }
175 if ($a_session_id == $this->force_details) {
176 return self::DETAILS_ALL;
177 } else {
178 return self::DETAILS_TITLE;
179 }
180 }
181} // END class.ilContainerSimpleContentGUI
user()
Definition: user.php:4
$_GET["client_id"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
Parent class of all container content GUIs.
initRenderer()
Init container renderer.
getContainerObject()
Get container object.
getContainerGUI()
Get container GUI object.
renderItem($a_item_data, $a_position=0, $a_force_icon=false, $a_pos_prefix="")
Render an item.
insertPageEmbeddedBlocks($a_output_html)
Insert blocks into container page.
getItemGroupsHTML($a_pos=0)
Get item groups HTML.
clearAdminCommandsDetermination()
cleaer administration commands determination
getDetailsLevel($a_session_id)
get details level
__construct($container_gui_obj)
Constructor.
getMainContent()
Get content HTML for main column.
static lookupLastSessionByCourse($a_ref_id)
@access public
static lookupNextSessionByCourse($a_ref_id)
@access public
special template class to simplify handling of ITX/PEAR
$html
Definition: example_001.php:87
$session
global $DIC
Definition: saml.php:7
$ilUser
Definition: imgupload.php:18