ILIAS  release_8 Revision v8.24
class.ilImprintGUI.php
Go to the documentation of this file.
1<?php
2
17
27{
30
31 public function __construct()
32 {
33 global $DIC;
34
35 $this->tpl = $DIC["tpl"];
36 $this->ctrl = $DIC->ctrl();
37 $this->locator = $DIC["ilLocator"];
38 $this->lng = $DIC->language();
39
40 $this->imprint_request = new StandardGUIRequest(
41 $DIC->http(),
42 $DIC->refinery()
43 );
44
45 if (!ilImprint::_exists("impr", 1)) {
46 $page = new ilImprint();
47 $page->setId(1);
48 $page->create(false);
49 }
50
51 // there is only 1 imprint page
52 parent::__construct("impr", 1);
53
54 // content style (using system defaults)
55 $this->tpl->setCurrentBlock("SyntaxStyle");
56 $this->tpl->setVariable(
57 "LOCATION_SYNTAX_STYLESHEET",
59 );
60 $this->tpl->parseCurrentBlock();
61
62 $this->tpl->setCurrentBlock("ContentStyle");
63 $this->tpl->setVariable(
64 "LOCATION_CONTENT_STYLESHEET",
66 );
67 $this->tpl->parseCurrentBlock();
68 }
69
70 public function executeCommand(): string
71 {
72 if (strtolower($this->imprint_request->getBaseClass()) ===
73 strtolower(ilImprintGUI::class)) {
74 $this->renderFullscreen();
75 }
76
77 $next_class = $this->ctrl->getNextClass($this);
78
79 $title = $this->lng->txt("adm_imprint");
80
81 switch ($next_class) {
82 default:
83 $this->setPresentationTitle($title);
84
85 $this->locator->addItem(
86 $title,
87 $this->ctrl->getLinkTarget($this, "preview")
88 );
89 $ret = parent::executeCommand();
90 $this->tabs_gui->activateTab("pg");
91 return $ret;
92 }
93 }
94
95 public function postOutputProcessing(string $a_output): string
96 {
98
100 if (!$this->getPageObject()->getActive()) {
101 $this->tpl->setOnScreenMessage('info', $lng->txt("adm_imprint_inactive"));
102 }
103 }
104
105 return $a_output;
106 }
107
108 protected function renderFullscreen(): void
109 {
110 if (!ilImprint::isActive()) {
111 $this->ctrl->redirectToURL("ilias.php?baseClass=ilDashboardGUI");
112 }
113 $this->tpl->setTitle($this->lng->txt("imprint"));
114 $this->tpl->loadStandardTemplate();
115
116 $this->setRawPageContent(true);
117 $this->tpl->setContent($this->showPage());
118
119 $this->tpl->printToStdout("DEFAULT", true, false);
120 exit();
121 }
122}
Class ilImprintGUI.
StandardGUIRequest $imprint_request
postOutputProcessing(string $a_output)
Finalizing output processing.
ilLocatorGUI $locator
executeCommand()
execute command
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static isActive()
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getContentStylePath(int $a_style_id, bool $add_random=true, bool $add_token=true)
get content style path static (to avoid full reading)
Class ilPageObjectGUI.
showPage()
display content of page
setPresentationTitle(string $a_title="")
setRawPageContent(bool $a_rawpagecontent)
Set Get raw page content only.
static _exists(string $a_parent_type, int $a_id, string $a_lang="", bool $a_no_cache=false)
Checks whether page exists.
global $DIC
Definition: feed.php:28
Interface ilCtrlBaseClassInterface describes ilCtrl base classes.
exit
Definition: login.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc