ILIAS  release_7 Revision v7.30-3-g800a261c036
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 $title = $this->getContainerObject()->filteredSubtree()
113 ? $lng->txt("cont_found_objects")
114 : $lng->txt("content");
115 $this->renderer->addCustomBlock("_all", $title);
116
117 $position = 1;
118 foreach ($this->items["_all"] as $k => $item_data) {
119 if (!$this->renderer->hasItem($item_data["child"])) {
120 $html = $this->renderItem($item_data, $position++, true);
121 if ($html != "") {
122 $this->renderer->addItemToBlock("_all", $item_data["type"], $item_data["child"], $html);
123 }
124 }
125 }
126 }
127
128 $output_html .= $this->renderer->getHTML();
129
130 $a_tpl->setVariable("CONTAINER_PAGE_CONTENT", $output_html);
131 }
132
140 protected function initDetails()
141 {
143
144 if ($_GET['expand']) {
145 if ($_GET['expand'] > 0) {
146 $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_ALL;
147 } else {
148 $_SESSION['sess']['expanded'][abs((int) $_GET['expand'])] = self::DETAILS_TITLE;
149 }
150 }
151
152
153 if ($this->getContainerObject()->getType() == 'crs') {
154 include_once('./Modules/Session/classes/class.ilSessionAppointment.php');
156 $this->force_details = $session;
158 $this->force_details = $session;
159 }
160 }
161 }
162
170 public function getDetailsLevel($a_session_id)
171 {
172 if ($this->getContainerGUI()->isActiveAdministrationPanel()) {
174 }
175 if (isset($_SESSION['sess']['expanded'][$a_session_id])) {
176 return $_SESSION['sess']['expanded'][$a_session_id];
177 }
178 if ($a_session_id == $this->force_details) {
179 return self::DETAILS_ALL;
180 } else {
181 return self::DETAILS_TITLE;
182 }
183 }
184} // 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
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$session