ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
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  public function __construct()
23  {
24  global $tpl;
25 
26  if(!ilImprint::_exists("impr", 1))
27  {
28  $page = new ilImprint("impr");
29  $page->setId(1);
30  $page->create();
31  }
32 
33  // there is only 1 imprint page
34  parent::__construct("impr", 1);
35 
36  // content style (using system defaults)
37  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
38 
39  $tpl->setCurrentBlock("SyntaxStyle");
40  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
42  $tpl->parseCurrentBlock();
43 
44  $tpl->setCurrentBlock("ContentStyle");
45  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
47  $tpl->parseCurrentBlock();
48 
49  // config
50  $this->setPreventHTMLUnmasking(true);
51  $this->setEnabledPCTabs(true);
52  $this->setEnabledMaps(false);
53  $this->setEnabledInternalLinks(false);
54  $this->setEnabledWikiLinks(false);
55  $this->setEnabledActivation(true);
56  }
57 
65  function initPageObject($a_parent_type, $a_id, $a_old_nr)
66  {
67  $this->setPageObject(new ilImprint("impr", 1));
68  }
69 
73  function executeCommand()
74  {
75  global $ilCtrl, $ilLocator, $lng;
76 
77  if($_REQUEST["baseClass"] == "ilImprintGUI")
78  {
79  $this->renderFullscreen();
80  }
81 
82  $next_class = $ilCtrl->getNextClass($this);
83 
84  $title = $lng->txt("adm_imprint");
85 
86  switch($next_class)
87  {
88  case "ilpageobjectgui":
89  $page_gui = new ilPageObjectGUI("impr",
90  $this->getPageObject()->getId(),
91  $this->getPageObject()->old_nr);
93  return $ilCtrl->forwardCommand($page_gui);
94 
95  default:
97 
98  $ilLocator->addItem($title,
99  $ilCtrl->getLinkTarget($this, "preview"));
100 
101  return parent::executeCommand();
102  }
103  }
104 
105  function postOutputProcessing($a_output)
106  {
107  global $lng;
108 
109  if($this->getOutputMode() == IL_PAGE_PREVIEW)
110  {
111  if(!$this->getPageObject()->getActive())
112  {
113  ilUtil::sendInfo($lng->txt("adm_imprint_inactive"));
114  }
115  }
116 
117  return $a_output;
118  }
119 
120  protected function renderFullscreen()
121  {
122  global $tpl, $lng, $ilMainMenu;
123 
124  if(!ilImprint::isActive())
125  {
126  ilUtil::redirect("ilias.php?baseClass=ilPersonalDesktopGUI");
127  }
128 
129  $tpl->getStandardTemplate();
130 
131  $this->setRawPageContent(true);
132  $html = $this->showPage();
133 
134  $itpl = new ilTemplate("tpl.imprint.html", true, true, "Services/Imprint");
135  $itpl->setVariable("PAGE_TITLE", $lng->txt("imprint"));
136  $itpl->setVariable("IMPRINT", $html);
137  unset($html);
138 
139  $tpl->setContent($itpl->get());
140 
141  $ilMainMenu->showLogoOnly(true);
142  $tpl->setFrameFixedWidth(true);
143 
144  echo $tpl->show("DEFAULT", true, false);
145  exit();
146  }
147 }
148 
149 ?>