ILIAS  release_8 Revision v8.24
class.ilContainerStartObjectsContentGUI.php
Go to the documentation of this file.
1<?php
2
25{
27 protected ilLanguage $lng;
29 protected ilObjUser $user;
31 protected bool $enable_desktop;
34 protected \ILIAS\Style\Content\GUIService $content_style_gui;
35 protected \ILIAS\Style\Content\Object\ObjectFacade $content_style_domain;
36
37 public function __construct(
38 ilContainerGUI $a_gui,
39 ilContainer $a_parent_obj
40 ) {
41 global $DIC;
42
43 $this->tpl = $DIC["tpl"];
44 $this->lng = $DIC->language();
45 $this->settings = $DIC->settings();
46 $this->user = $DIC->user();
47 $this->parent_gui = $a_gui;
48 $this->parent_obj = $a_parent_obj;
49 $this->start_object = new ilContainerStartObjects(
50 $a_parent_obj->getRefId(),
51 $a_parent_obj->getId()
52 );
53 $cs = $DIC->contentStyle();
54 $this->content_style_domain = $cs->domain()->styleForRefId($a_parent_obj->getRefId());
55 $this->content_style_gui = $cs->gui();
56 }
57
58 public function enableDesktop(
59 bool $a_value,
60 ilContainerGUI $a_parent_gui
61 ): void {
62 $this->enable_desktop = $a_value;
63
64 if ($this->enable_desktop) {
65 $this->parent_gui = $a_parent_gui;
66 }
67 }
68
69 // Set HTML in main template
70 public function getHTML(): void
71 {
74
75 $lng->loadLanguageModule("crs");
76
78 $this->parent_gui,
79 "",
80 $this->start_object,
81 $this->enable_desktop
82 );
83 $tpl->setContent(
84 $this->getPageHTML() .
85 $tbl->getHTML()
86 );
87 }
88
89 protected function getPageHTML(): string
90 {
93
94 if (!$ilSetting->get("enable_cat_page_edit")) {
95 return "";
96 }
97
98 $page_id = $this->start_object->getObjId();
99
100 // if page does not exist, return nothing
101 if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id)) {
102 return "";
103 }
104
105 $this->content_style_gui->addCss($tpl, $this->parent_obj->getRefId());
106 $tpl->setCurrentBlock("SyntaxStyle");
107 $tpl->setVariable(
108 "LOCATION_SYNTAX_STYLESHEET",
110 );
111 $tpl->parseCurrentBlock();
112
113 $page_gui = new ilContainerStartObjectsPageGUI($page_id);
114
115 $page_gui->setStyleId($this->content_style_domain->getEffectiveStyleId());
116
117 $page_gui->setPresentationTitle("");
118 $page_gui->setTemplateOutput(false);
119 $page_gui->setHeader("");
120 return $page_gui->showPage();
121 }
122}
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder,...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS Style Content Object ObjectFacade $content_style_domain
__construct(ilContainerGUI $a_gui, ilContainer $a_parent_obj)
enableDesktop(bool $a_value, ilContainerGUI $a_parent_gui)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
array $settings
Setting values (LTI parameters, custom parameters and local parameters).
Definition: System.php:200
global $ilSetting
Definition: privfeed.php:17
$lng