2 require_once(
"Services/Style/System/classes/Documentation/class.ilKSDocumentationExplorerGUI.php");
3 require_once(
"Services/Style/System/classes/Documentation/class.ilKSDocumentationEntryGUI.php");
4 require_once(
"libs/composer/vendor/geshi/geshi/src/geshi.php");
48 $this->ctrl = $DIC->ctrl();
49 $this->lng = $DIC->language();
50 $this->tpl = $DIC[
"tpl"];
54 self::$DATA_PATH= self::DATA_DIRECTORY .
"/" . self::DATA_FILE;
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());
102 $this->tpl->setContent($content);
105 protected function resetForReadOnly()
111 global $ilHelp,
$DIC, $ilLocator;
113 $DIC->tabs()->clearTargets();
118 $ilHelp->setScreenIdComponent(
"sty");
119 $ilHelp->setScreenId(
"system_styles");
121 $skin_id =
$_GET[
"skin_id"];
122 $style_id =
$_GET[
"style_id"];
125 $style = $skin->getStyle($style_id);
127 $DIC[
"tpl"]->setTitle($DIC->language()->txt(
"documentation"));
129 if (
$style->isSubstyle()) {
130 $DIC[
"tpl"]->setDescription(
131 $this->lng->txt(
"ks_documentation_of_substyle")
133 .
$style->getName() .
"' " .
134 $this->lng->txt(
"of_parent") .
" '" . $skin->getStyle(
$style->getSubstyleOf())->getName() .
"' " .
135 $this->lng->txt(
"from_skin") .
" " . $skin->getName()
138 $DIC[
"tpl"]->setDescription(
139 $this->lng->txt(
"ks_documentation_of_style") .
" '" .
$style->getName() .
"' " .
140 $this->lng->txt(
"from_skin") .
" '" . $skin->getName() .
"'" 144 $ilLocator->clearItems();
145 $DIC[
"tpl"]->setLocator();
150 $this->tpl->setPermanentLink(
"stys",
$_GET[
"ref_id"],
"_" .
$_GET[
"node_id"] .
"_" 151 .
$_GET[
"skin_id"] .
"_" .
$_GET[
"style_id"]);
161 $entries = $crawler->crawlFactory(self::ROOT_FACTORY_PATH);
162 file_put_contents(self::$DATA_PATH, json_encode($entries));
172 $entries_array = json_decode(file_get_contents(self::$DATA_PATH),
true);
174 $entries =
new Crawler\Entry\ComponentEntries();
175 foreach ($entries_array as $entry_array) {
176 $entry =
new Crawler\Entry\ComponentEntry($entry_array);
177 $entries->addEntry($entry);
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
setIsReadOnly($is_read_only)
static generateFromId($skin_id, ilSystemStyleMessageStack $message_stack=null, ilSystemStyleConfig $system_styles_conf=null)
Generate the container class by parsing the corresponding XML.
__construct($read_only=false)
ilSystemStyleDocumentationGUI constructor.
executeCommand()
Execute command.