ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilSystemStyleDocumentationGUI.php
Go to the documentation of this file.
1<?php
2require_once("Services/Style/System/classes/Documentation/class.ilKSDocumentationExplorerGUI.php");
3require_once("Services/Style/System/classes/Documentation/class.ilKSDocumentationEntryGUI.php");
4require_once("libs/composer/vendor/geshi/geshi/src/geshi.php");
5
6
13{
17 protected $tpl;
21 protected $ctrl;
22
26 protected $lng;
27
31 protected $is_read_only = false;
32
33 const ROOT_FACTORY_PATH = "./Services/Style/System/data/abstractDataFactory.php";
34 const DATA_DIRECTORY = "./Services/Style/System/data";
35 const DATA_FILE = "data.php";
36 const SHOW_TREE = "system_styles_show_tree";
37 public static $DATA_PATH;
38
43 public function __construct($read_only = false)
44 {
45 global $DIC;
46
47 $this->ctrl = $DIC->ctrl();
48 $this->lng = $DIC->language();
49 $this->tpl = $DIC["tpl"];
50 $this->global_screen = $DIC->globalScreen();
51
52 $this->setIsReadOnly($read_only);
53
54 self::$DATA_PATH = self::DATA_DIRECTORY . "/" . self::DATA_FILE;
55 }
56
60 public function executeCommand()
61 {
62 if ($this->is_read_only) {
63 $this->resetForReadOnly();
64 }
65 $this->addGotoLink();
67 $this->show();
68 }
69
70 protected function setGlobalScreenContext()
71 {
72 $context = $this->global_screen->tool()->context()->current();
73 $context->addAdditionalData(self::SHOW_TREE, true);
74 }
75
76 public function show()
77 {
78 $content = "";
79
80
81 $entry_gui = new ilKSDocumentationEntryGUI(
82 $this
83 );
84
85 $content .= $entry_gui->renderEntry();
86 $this->tpl->setContent($content);
87 }
88
89 protected function resetForReadOnly()
90 {
94 global $DIC;
95
96 $DIC->tabs()->clearTargets();
97
101 $DIC->help()->setScreenIdComponent("sty");
102 $DIC->help()->setScreenId("system_styles");
103
104 $skin_id = $_GET["skin_id"];
105 $style_id = $_GET["style_id"];
106
107 $skin = ilSystemStyleSkinContainer::generateFromId($skin_id)->getSkin();
108 $style = $skin->getStyle($style_id);
109
110 $DIC["tpl"]->setTitle($DIC->language()->txt("documentation"));
111
112 if ($style->isSubstyle()) {
113 $DIC["tpl"]->setDescription(
114 $this->lng->txt("ks_documentation_of_substyle")
115 . " '"
116 . $style->getName() . "' " .
117 $this->lng->txt("of_parent") . " '" . $skin->getStyle($style->getSubstyleOf())->getName() . "' " .
118 $this->lng->txt("from_skin") . " " . $skin->getName()
119 );
120 } else {
121 $DIC["tpl"]->setDescription(
122 $this->lng->txt("ks_documentation_of_style") . " '" . $style->getName() . "' " .
123 $this->lng->txt("from_skin") . " '" . $skin->getName() . "'"
124 );
125 }
126
127 $DIC["ilLocator"]->clearItems();
128 $DIC["tpl"]->setLocator();
129 }
130
131 protected function addGotoLink()
132 {
133 $this->tpl->setPermanentLink("stys", $_GET["ref_id"], "_" . $_GET["node_id"] . "_"
134 . $_GET["skin_id"] . "_" . $_GET["style_id"]);
135 }
136
140 public function isReadOnly()
141 {
142 return $this->is_read_only;
143 }
144
149 {
150 $this->is_read_only = $is_read_only;
151 }
152}
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
__construct($read_only=false)
ilSystemStyleDocumentationGUI constructor.
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
global $DIC
Definition: goto.php:24
$context
Definition: webdav.php:26