ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilContainerStartObjectsContentGUI.php
Go to the documentation of this file.
1<?php
2
19use ILIAS\UI\Factory as UIFactory;
20use ILIAS\UI\Renderer as UIRenderer;
22
29{
31 protected ilLanguage $lng;
33 protected ilObjUser $user;
35 protected UIFactory $ui_factory;
36 protected UIRenderer $ui_renderer;
37 protected bool $enable_desktop;
40 protected \ILIAS\Style\Content\GUIService $content_style_gui;
41 protected \ILIAS\Style\Content\Object\ObjectFacade $content_style_domain;
42
43 public function __construct(
44 ilContainerGUI $a_gui,
45 ilContainer $a_parent_obj
46 ) {
47 global $DIC;
48
49 $this->tpl = $DIC["tpl"];
50 $this->lng = $DIC->language();
51 $this->settings = $DIC->settings();
52 $this->user = $DIC->user();
53 $this->ui_factory = $DIC->ui()->factory();
54 $this->ui_renderer = $DIC->ui()->renderer();
55 $this->parent_gui = $a_gui;
56 $this->parent_obj = $a_parent_obj;
57 $this->start_object = new ilContainerStartObjects(
58 $a_parent_obj->getRefId(),
59 $a_parent_obj->getId()
60 );
61 $cs = $DIC->contentStyle();
62 $this->content_style_domain = $cs->domain()->styleForRefId($a_parent_obj->getRefId());
63 $this->content_style_gui = $cs->gui();
64 }
65
66 public function enableDesktop(
67 bool $a_value,
68 ilContainerGUI $a_parent_gui
69 ): void {
70 $this->enable_desktop = $a_value;
71
72 if ($this->enable_desktop) {
73 $this->parent_gui = $a_parent_gui;
74 }
75 }
76
77 // Set HTML in main template
78 public function getHTML(): void
79 {
80 $tpl = $this->tpl;
82
83 $lng->loadLanguageModule("crs");
84
85 $tbl = new ObjectsContent(
86 $this->parent_gui,
87 $this->start_object,
88 $this->ui_factory,
89 $this->ui_renderer,
90 $this->enable_desktop
91 );
92 $tpl->setContent(
93 $this->getPageHTML() .
94 $tbl->render()
95 );
96 }
97
98 protected function getPageHTML(): string
99 {
100 $tpl = $this->tpl;
101 $ilSetting = $this->settings;
102
103 if (!$ilSetting->get("enable_cat_page_edit")) {
104 return "";
105 }
106
107 $page_id = $this->start_object->getObjId();
108
109 // if page does not exist, return nothing
110 if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id)) {
111 return "";
112 }
113
114 $this->content_style_gui->addCss($tpl, $this->parent_obj->getRefId());
115 $tpl->setCurrentBlock("SyntaxStyle");
116 $tpl->setVariable(
117 "LOCATION_SYNTAX_STYLESHEET",
119 );
120 $tpl->parseCurrentBlock();
121
122 $page_gui = new ilContainerStartObjectsPageGUI($page_id);
123
124 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
125
126 $page_gui->setPresentationTitle("");
127 $page_gui->setTemplateOutput(false);
128 $page_gui->setHeader("");
129 return $page_gui->showPage();
130 }
131}
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
ILIAS Style Content Object ObjectFacade $content_style_domain
__construct(ilContainerGUI $a_gui, ilContainer $a_parent_obj)
enableDesktop(bool $a_value, ilContainerGUI $a_parent_gui)
Container start objects page GUI class.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilContainer.
language handling
User class.
static _existsAndNotEmpty(string $a_parent_type, int $a_id, string $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages)
ILIAS Setting Class.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
parseCurrentBlock(string $block_name=self::DEFAULT_BLOCK)
Parses the given block.
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
setContent(string $a_html)
Sets content for standard template.
An entity that renders components to a string output.
Definition: Renderer.php:31
global $lng
Definition: privfeed.php:31
global $ilSetting
Definition: privfeed.php:31
global $DIC
Definition: shib_login.php:26