ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilSystemStyleDocumentationGUI Class Reference
+ Collaboration diagram for ilSystemStyleDocumentationGUI:

Public Member Functions

 __construct ($read_only=false)
 ilSystemStyleDocumentationGUI constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 show ()
 
 isReadOnly ()
 
 setIsReadOnly ($is_read_only)
 

Data Fields

const ROOT_FACTORY_PATH = "./Services/Style/System/data/abstractDataFactory.php"
 
const DATA_DIRECTORY = "./Services/Style/System/data"
 
const DATA_FILE = "data.json"
 

Static Public Attributes

static $DATA_PATH
 

Protected Member Functions

 addGotoLink ()
 
 parseEntries ()
 
 readEntries ()
 

Protected Attributes

 $tpl
 
 $ctrl
 
 $lng
 
 $is_read_only = false
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSystemStyleDocumentationGUI::__construct (   $read_only = false)

ilSystemStyleDocumentationGUI constructor.

Parameters
bool | false$read_only

Definition at line 44 of file class.ilSystemStyleDocumentationGUI.php.

References $DIC, and setIsReadOnly().

45  {
46  global $DIC;
47 
48  $this->ctrl = $DIC->ctrl();
49  $this->lng = $DIC->language();
50  $this->tpl = $DIC["tpl"];
51 
52  $this->setIsReadOnly($read_only);
53 
54  self::$DATA_PATH= self::DATA_DIRECTORY . "/" . self::DATA_FILE;
55  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

Member Function Documentation

◆ addGotoLink()

ilSystemStyleDocumentationGUI::addGotoLink ( )
protected

Definition at line 148 of file class.ilSystemStyleDocumentationGUI.php.

References $_GET.

Referenced by executeCommand().

149  {
150  $this->tpl->setPermanentLink("stys", $_GET["ref_id"], "_" . $_GET["node_id"] . "_"
151  . $_GET["skin_id"] . "_" . $_GET["style_id"]);
152  }
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ executeCommand()

ilSystemStyleDocumentationGUI::executeCommand ( )

Execute command.

Definition at line 60 of file class.ilSystemStyleDocumentationGUI.php.

References addGotoLink(), and show().

61  {
62  $cmd = $this->ctrl->getCmd();
63 
64  switch ($cmd) {
65  case 'parseEntries':
66  $this->$cmd();
67  $this->show();
68  break;
69  default:
70  if ($this->is_read_only) {
71  $this->resetForReadOnly();
72  }
73  $this->addGotoLink();
74  $this->show();
75  break;
76  }
77  }
+ Here is the call graph for this function:

◆ isReadOnly()

ilSystemStyleDocumentationGUI::isReadOnly ( )
Returns
bool

Definition at line 186 of file class.ilSystemStyleDocumentationGUI.php.

References $is_read_only.

Referenced by show().

+ Here is the caller graph for this function:

◆ parseEntries()

ilSystemStyleDocumentationGUI::parseEntries ( )
protected
Returns
Crawler
Exceptions
Crawler

Definition at line 158 of file class.ilSystemStyleDocumentationGUI.php.

References ilUtil\sendSuccess().

159  {
160  $crawler = new Crawler\FactoriesCrawler();
161  $entries = $crawler->crawlFactory(self::ROOT_FACTORY_PATH);
162  file_put_contents(self::$DATA_PATH, json_encode($entries));
163  ilUtil::sendSuccess($this->lng->txt("entries_reloaded"), true);
164  return $entries;
165  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:

◆ readEntries()

ilSystemStyleDocumentationGUI::readEntries ( )
protected
Returns
Crawler

Definition at line 170 of file class.ilSystemStyleDocumentationGUI.php.

Referenced by show().

171  {
172  $entries_array = json_decode(file_get_contents(self::$DATA_PATH), true);
173 
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);
178  }
179 
180  return $entries;
181  }
+ Here is the caller graph for this function:

◆ setIsReadOnly()

ilSystemStyleDocumentationGUI::setIsReadOnly (   $is_read_only)
Parameters
bool$is_read_only

Definition at line 194 of file class.ilSystemStyleDocumentationGUI.php.

References $is_read_only.

Referenced by __construct().

195  {
196  $this->is_read_only = $is_read_only;
197  }
+ Here is the caller graph for this function:

◆ show()

ilSystemStyleDocumentationGUI::show ( )

Definition at line 79 of file class.ilSystemStyleDocumentationGUI.php.

References $_GET, $DIC, $style, ilSystemStyleSkinContainer\generateFromId(), ilLinkButton\getInstance(), isReadOnly(), readEntries(), and ilKSDocumentationEntryGUI\renderEntry().

Referenced by executeCommand().

80  {
81  $entries = $this->readEntries();
82  $content = "";
83 
84  //The button to parse the entries from code should only be shown in DEVMODE. Other users do not need that.
85  if (DEVMODE == 1 && !$this->isReadOnly()) {
86  $toolbar = new ilToolbarGUI();
87  $reload_btn = ilLinkButton::getInstance();
88  $reload_btn->setCaption($this->lng->txt('refresh_entries'), false);
89  if ($_GET["node_id"]) {
90  $this->ctrl->saveParameter($this, "node_id");
91  }
92  $reload_btn->setUrl($this->ctrl->getLinkTarget($this, 'parseEntries'));
93  $toolbar->addButtonInstance($reload_btn);
94  $content .= $toolbar->getHTML();
95  }
96 
97  $explorer = new ilKSDocumentationExplorerGUI($this, "entries", $entries, $_GET["node_id"]);
98  $this->tpl->setLeftNavContent($explorer->getHTML());
99  $entry_gui = new ilKSDocumentationEntryGUI($this, $explorer->getCurrentOpenedNode(), $entries);
100  $content .= $entry_gui->renderEntry();
101 
102  $this->tpl->setContent($content);
103  }
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilSystemStyleDocumentationGUI::$ctrl
protected

Definition at line 23 of file class.ilSystemStyleDocumentationGUI.php.

◆ $DATA_PATH

ilSystemStyleDocumentationGUI::$DATA_PATH
static

Definition at line 38 of file class.ilSystemStyleDocumentationGUI.php.

◆ $is_read_only

ilSystemStyleDocumentationGUI::$is_read_only = false
protected

Definition at line 33 of file class.ilSystemStyleDocumentationGUI.php.

Referenced by isReadOnly(), and setIsReadOnly().

◆ $lng

ilSystemStyleDocumentationGUI::$lng
protected

Definition at line 28 of file class.ilSystemStyleDocumentationGUI.php.

◆ $tpl

ilSystemStyleDocumentationGUI::$tpl
protected

Definition at line 19 of file class.ilSystemStyleDocumentationGUI.php.

◆ DATA_DIRECTORY

const ilSystemStyleDocumentationGUI::DATA_DIRECTORY = "./Services/Style/System/data"

Definition at line 36 of file class.ilSystemStyleDocumentationGUI.php.

◆ DATA_FILE

const ilSystemStyleDocumentationGUI::DATA_FILE = "data.json"

Definition at line 37 of file class.ilSystemStyleDocumentationGUI.php.

◆ ROOT_FACTORY_PATH

const ilSystemStyleDocumentationGUI::ROOT_FACTORY_PATH = "./Services/Style/System/data/abstractDataFactory.php"

Definition at line 35 of file class.ilSystemStyleDocumentationGUI.php.


The documentation for this class was generated from the following file: