ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilImprintGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once("./Services/COPage/classes/class.ilPageObjectGUI.php");
5 require_once("./Services/Imprint/classes/class.ilImprint.php");
6 
18 {
22  protected $locator;
23 
27  protected $main_menu;
28 
32  public function __construct()
33  {
34  global $DIC;
35 
36  $this->tpl = $DIC["tpl"];
37  $this->ctrl = $DIC->ctrl();
38  $this->locator = $DIC["ilLocator"];
39  $this->lng = $DIC->language();
40  $this->main_menu = $DIC["ilMainMenu"];
41  $tpl = $DIC["tpl"];
42 
43  if (!ilImprint::_exists("impr", 1)) {
44  $page = new ilImprint("impr");
45  $page->setId(1);
46  $page->create();
47  }
48 
49  // there is only 1 imprint page
50  parent::__construct("impr", 1);
51 
52  // content style (using system defaults)
53  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
54 
55  $tpl->setCurrentBlock("SyntaxStyle");
56  $tpl->setVariable(
57  "LOCATION_SYNTAX_STYLESHEET",
59  );
60  $tpl->parseCurrentBlock();
61 
62  $tpl->setCurrentBlock("ContentStyle");
63  $tpl->setVariable(
64  "LOCATION_CONTENT_STYLESHEET",
66  );
67  $tpl->parseCurrentBlock();
68  }
69 
73  public function executeCommand()
74  {
76  $ilLocator = $this->locator;
77  $lng = $this->lng;
78 
79  if ($_REQUEST["baseClass"] == "ilImprintGUI") {
80  $this->renderFullscreen();
81  }
82 
83  $next_class = $ilCtrl->getNextClass($this);
84 
85  $title = $lng->txt("adm_imprint");
86 
87  switch ($next_class) {
88  case "ilpageobjectgui":
89  die("Deprecated. ilImprintGUI gui forwarding to ilpageobject");
90  return;
91 
92  default:
94 
95  $ilLocator->addItem(
96  $title,
97  $ilCtrl->getLinkTarget($this, "preview")
98  );
99 
100  return parent::executeCommand();
101  }
102  }
103 
104  public function postOutputProcessing($a_output)
105  {
106  $lng = $this->lng;
107 
108  if ($this->getOutputMode() == IL_PAGE_PREVIEW) {
109  if (!$this->getPageObject()->getActive()) {
110  ilUtil::sendInfo($lng->txt("adm_imprint_inactive"));
111  }
112  }
113 
114  return $a_output;
115  }
116 
117  protected function renderFullscreen()
118  {
119  $tpl = $this->tpl;
120  $lng = $this->lng;
121  $ilMainMenu = $this->main_menu;
122 
123  if (!ilImprint::isActive()) {
124  ilUtil::redirect("ilias.php?baseClass=ilPersonalDesktopGUI");
125  }
126 
127  $tpl->getStandardTemplate();
128 
129  $this->setRawPageContent(true);
130  $html = $this->showPage();
131 
132  $itpl = new ilTemplate("tpl.imprint.html", true, true, "Services/Imprint");
133  $itpl->setVariable("PAGE_TITLE", $lng->txt("imprint"));
134  $itpl->setVariable("IMPRINT", $html);
135  unset($html);
136 
137  $tpl->setContent($itpl->get());
138 
139  $ilMainMenu->showLogoOnly(true);
140 
141  echo $tpl->show("DEFAULT", true, false);
142  exit();
143  }
144 }
static _exists($a_parent_type, $a_id, $a_lang="", $a_no_cache=false)
Checks whether page exists.
const IL_PAGE_PREVIEW
getPageObject()
Get Page Object.
executeCommand()
execute command
global $DIC
Definition: saml.php:7
Class ilPageObjectGUI.
__construct()
Constructor.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
postOutputProcessing($a_output)
special template class to simplify handling of ITX/PEAR
Class ilImprint.
setRawPageContent($a_rawpagecontent)
Set Get raw page content only.
setPresentationTitle($a_title="")
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id, $add_random=true)
get content style path
Class ilImprintGUI.
showPage()
display content of page
static redirect($a_script)
$html
Definition: example_001.php:87
static isActive()