ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilContainerStartObjectsContentGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
13 {
14  protected $start_object; // [ilContainerStartObjects]
15  protected $enable_desktop; // [bool]
16  protected $parent_gui; // [ilContainerGUI]
17 
23  public function __construct(ilContainer $a_parent_obj)
24  {
25  include_once "Services/Container/classes/class.ilContainerStartObjects.php";
26  $this->parent_gui = $a_parent_obj;
27  $this->start_object = new ilContainerStartObjects($a_parent_obj->getRefId(),
28  $a_parent_obj->getId());
29  }
30 
37  public function enableDesktop($a_value, ilContainerGUI $a_parent_gui)
38  {
39  $this->enable_desktop = (bool)$a_value;
40 
41  if($this->enable_desktop)
42  {
43  $this->parent_gui = $a_parent_gui;
44  }
45  }
46 
52  public function getHTML()
53  {
54  global $tpl, $lng;
55 
56  $lng->loadLanguageModule("crs");
57 
58  include_once "Services/Container/classes/class.ilContainerStartObjectsContentTableGUI.php";
60  $this->parent_gui,
61  "",
62  $this->start_object,
63  $this->enable_desktop
64  );
65  $tpl->setContent(
66  $this->getPageHTML().
67  $tbl->getHTML()
68  );
69  }
70 
77  protected function getPageHTML()
78  {
79  global $tpl, $ilSetting, $ilUser;
80 
81  if (!$ilSetting->get("enable_cat_page_edit"))
82  {
83  return;
84  }
85 
86  $page_id = $this->start_object->getObjId();
87 
88  // if page does not exist, return nothing
89  include_once("./Services/COPage/classes/class.ilPageUtil.php");
90  if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id))
91  {
92  return;
93  }
94 
95  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
96  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
98  $tpl->setCurrentBlock("SyntaxStyle");
99  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
101  $tpl->parseCurrentBlock();
102 
103  include_once("./Services/Container/classes/class.ilContainerStartObjectsPageGUI.php");
104  $page_gui = new ilContainerStartObjectsPageGUI($page_id);
105 
106  include_once("./Services/Style/classes/class.ilObjStyleSheet.php");
107  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(0));
108 
109  $page_gui->setPresentationTitle("");
110  $page_gui->setTemplateOutput(false);
111  $page_gui->setHeader("");
112  return $page_gui->showPage();
113  }
114 }
115 
116 ?>