ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilContainerStartObjectsContentGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
13{
17 protected $tpl;
18
22 protected $lng;
23
27 protected $settings;
28
32 protected $user;
33
34 protected $start_object; // [ilContainerStartObjects]
35 protected $enable_desktop; // [bool]
36 protected $parent_gui; // [ilContainerGUI]
37 protected $parent_obj;
38
44 public function __construct($a_gui, ilContainer $a_parent_obj)
45 {
46 global $DIC;
47
48 $this->tpl = $DIC["tpl"];
49 $this->lng = $DIC->language();
50 $this->settings = $DIC->settings();
51 $this->user = $DIC->user();
52 include_once "Services/Container/classes/class.ilContainerStartObjects.php";
53 $this->parent_gui = $a_gui;
54 $this->parent_obj = $a_parent_obj;
55 $this->start_object = new ilContainerStartObjects(
56 $a_parent_obj->getRefId(),
57 $a_parent_obj->getId()
58 );
59 }
60
67 public function enableDesktop($a_value, ilContainerGUI $a_parent_gui)
68 {
69 $this->enable_desktop = (bool) $a_value;
70
71 if ($this->enable_desktop) {
72 $this->parent_gui = $a_parent_gui;
73 }
74 }
75
81 public function getHTML()
82 {
85
86 $lng->loadLanguageModule("crs");
87
88 include_once "Services/Container/classes/class.ilContainerStartObjectsContentTableGUI.php";
90 $this->parent_gui,
91 "",
92 $this->start_object,
93 $this->enable_desktop
94 );
95 $tpl->setContent(
96 $this->getPageHTML() .
97 $tbl->getHTML()
98 );
99 }
100
107 protected function getPageHTML()
108 {
112
113 if (!$ilSetting->get("enable_cat_page_edit")) {
114 return;
115 }
116
117 $page_id = $this->start_object->getObjId();
118
119 // if page does not exist, return nothing
120 include_once("./Services/COPage/classes/class.ilPageUtil.php");
121 if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id)) {
122 return;
123 }
124
125 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
126 $tpl->setVariable(
127 "LOCATION_CONTENT_STYLESHEET",
129 $this->parent_obj->getStyleSheetId(),
130 $this->parent_obj->getType()
131 ))
132 );
133 $tpl->setCurrentBlock("SyntaxStyle");
134 $tpl->setVariable(
135 "LOCATION_SYNTAX_STYLESHEET",
137 );
138 $tpl->parseCurrentBlock();
139
140 include_once("./Services/Container/classes/class.ilContainerStartObjectsPageGUI.php");
141 $page_gui = new ilContainerStartObjectsPageGUI($page_id);
142
143 include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
145 $this->parent_obj->getStyleSheetId(),
146 $this->parent_obj->getType()
147 ));
148
149 $page_gui->setPresentationTitle("");
150 $page_gui->setTemplateOutput(false);
151 $page_gui->setHeader("");
152 return $page_gui->showPage();
153 }
154}
user()
Definition: user.php:4
An exception for terminatinating execution or to throw for unit testing.
Class ilContainerGUI.
__construct($a_gui, ilContainer $a_parent_obj)
Constructor.
getHTML()
Get container start objects list (presentation)
enableDesktop($a_value, ilContainerGUI $a_parent_gui)
Toggle add-to/remove-from-desktop.
Container start objects page GUI class.
Class ilContainer.
static getSyntaxStylePath()
get syntax style path
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
static getContentStylePath($a_style_id, $add_random=true, $add_token=true)
get content style path
getRefId()
get reference id @access public
getId()
get object id @access public
static _existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18
global $ilSetting
Definition: privfeed.php:17
settings()
Definition: settings.php:2