ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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  protected $parent_obj;
18 
24  public function __construct($a_gui, ilContainer $a_parent_obj)
25  {
26  include_once "Services/Container/classes/class.ilContainerStartObjects.php";
27  $this->parent_gui = $a_gui;
28  $this->parent_obj = $a_parent_obj;
29  $this->start_object = new ilContainerStartObjects($a_parent_obj->getRefId(),
30  $a_parent_obj->getId());
31  }
32 
39  public function enableDesktop($a_value, ilContainerGUI $a_parent_gui)
40  {
41  $this->enable_desktop = (bool)$a_value;
42 
43  if($this->enable_desktop)
44  {
45  $this->parent_gui = $a_parent_gui;
46  }
47  }
48 
54  public function getHTML()
55  {
56  global $tpl, $lng;
57 
58  $lng->loadLanguageModule("crs");
59 
60  include_once "Services/Container/classes/class.ilContainerStartObjectsContentTableGUI.php";
62  $this->parent_gui,
63  "",
64  $this->start_object,
65  $this->enable_desktop
66  );
67  $tpl->setContent(
68  $this->getPageHTML().
69  $tbl->getHTML()
70  );
71  }
72 
79  protected function getPageHTML()
80  {
81  global $tpl, $ilSetting, $ilUser;
82 
83  if (!$ilSetting->get("enable_cat_page_edit"))
84  {
85  return;
86  }
87 
88  $page_id = $this->start_object->getObjId();
89 
90  // if page does not exist, return nothing
91  include_once("./Services/COPage/classes/class.ilPageUtil.php");
92  if (!ilPageUtil::_existsAndNotEmpty("cstr", $page_id))
93  {
94  return;
95  }
96 
97  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
98  $tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
100  $this->parent_obj->getStyleSheetId(), $this->parent_obj->getType())));
101  $tpl->setCurrentBlock("SyntaxStyle");
102  $tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
104  $tpl->parseCurrentBlock();
105 
106  include_once("./Services/Container/classes/class.ilContainerStartObjectsPageGUI.php");
107  $page_gui = new ilContainerStartObjectsPageGUI($page_id);
108 
109  include_once("./Services/Style/Content/classes/class.ilObjStyleSheet.php");
110  $page_gui->setStyleId(ilObjStyleSheet::getEffectiveContentStyleId(
111  $this->parent_obj->getStyleSheetId(), $this->parent_obj->getType()));
112 
113  $page_gui->setPresentationTitle("");
114  $page_gui->setTemplateOutput(false);
115  $page_gui->setHeader("");
116  return $page_gui->showPage();
117  }
118 }
119 
120 ?>
Container start objects page GUI class.
$tbl
Definition: example_048.php:81
global $tpl
Definition: ilias.php:8
getHTML()
Get container start objects list (presentation)
static _existsAndNotEmpty($a_parent_type, $a_id, $a_lang="-")
checks whether page exists and is not empty (may return true on some empty pages) ...
getId()
get object id public
static getEffectiveContentStyleId($a_style_id, $a_type="")
Get effective Style Id.
$ilUser
Definition: imgupload.php:18
Class ilContainer.
static getSyntaxStylePath()
get syntax style path
static getContentStylePath($a_style_id)
get content style path
global $ilSetting
Definition: privfeed.php:17
global $lng
Definition: privfeed.php:17
getRefId()
get reference id public
enableDesktop($a_value, ilContainerGUI $a_parent_gui)
Toggle add-to/remove-from-desktop.
Class ilContainerStartObjectsContentGUI.
Class ilContainerGUI.
__construct($a_gui, ilContainer $a_parent_obj)
Constructor.