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");
48 $this->ctrl =
$DIC->ctrl();
49 $this->lng =
$DIC->language();
50 $this->tpl =
$DIC[
"tpl"];
62 $cmd = $this->ctrl->getCmd();
70 if ($this->is_read_only) {
71 $this->resetForReadOnly();
88 $reload_btn->setCaption($this->lng->txt(
'refresh_entries'),
false);
89 if (
$_GET[
"node_id"]) {
90 $this->ctrl->saveParameter($this,
"node_id");
92 $reload_btn->setUrl($this->ctrl->getLinkTarget($this,
'parseEntries'));
93 $toolbar->addButtonInstance($reload_btn);
94 $content .= $toolbar->getHTML();
98 $this->tpl->setLeftNavContent($explorer->getHTML());
99 $entry_gui =
new ilKSDocumentationEntryGUI($this, $explorer->getCurrentOpenedNode(), $entries);
100 $content .= $entry_gui->renderEntry();
102 $this->tpl->setContent($content);
105 protected function resetForReadOnly()
112 $DIC->tabs()->clearTargets();
117 $DIC->help()->setScreenIdComponent(
"sty");
118 $DIC->help()->setScreenId(
"system_styles");
120 $skin_id =
$_GET[
"skin_id"];
121 $style_id =
$_GET[
"style_id"];
124 $style = $skin->getStyle($style_id);
126 $DIC[
"tpl"]->setTitle(
$DIC->language()->txt(
"documentation"));
128 if (
$style->isSubstyle()) {
129 $DIC[
"tpl"]->setDescription(
130 $this->lng->txt(
"ks_documentation_of_substyle")
132 .
$style->getName() .
"' " .
133 $this->lng->txt(
"of_parent") .
" '" . $skin->getStyle(
$style->getSubstyleOf())->getName() .
"' " .
134 $this->lng->txt(
"from_skin") .
" " . $skin->getName()
137 $DIC[
"tpl"]->setDescription(
138 $this->lng->txt(
"ks_documentation_of_style") .
" '" .
$style->getName() .
"' " .
139 $this->lng->txt(
"from_skin") .
" '" . $skin->getName() .
"'"
143 $DIC[
"ilLocator"]->clearItems();
144 $DIC[
"tpl"]->setLocator();
149 $this->tpl->setPermanentLink(
"stys",
$_GET[
"ref_id"],
"_" .
$_GET[
"node_id"] .
"_"
150 .
$_GET[
"skin_id"] .
"_" .
$_GET[
"style_id"]);
160 $entries = $crawler->crawlFactory(self::ROOT_FACTORY_PATH);
161 file_put_contents(self::$DATA_PATH, json_encode($entries));
162 ilUtil::sendSuccess($this->lng->txt(
"entries_reloaded"),
true);
171 $entries_array = json_decode(file_get_contents(self::$DATA_PATH),
true);
173 $entries =
new Crawler\Entry\ComponentEntries();
174 foreach ($entries_array as $entry_array) {
175 $entry =
new Crawler\Entry\ComponentEntry($entry_array);
176 $entries->addEntry($entry);
An exception for terminatinating execution or to throw for unit testing.
setIsReadOnly($is_read_only)
__construct($read_only=false)
ilSystemStyleDocumentationGUI constructor.
executeCommand()
Execute command.
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.