ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilSystemStyleDocumentationGUI Class Reference
+ Collaboration diagram for ilSystemStyleDocumentationGUI:

Public Member Functions

 __construct ($skin_id="", $style_id="")
 ilSystemStyleDocumentationGUI constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 show ()
 

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

 parseEntries ()
 
 readEntries ()
 

Protected Attributes

 $tpl
 
 $ctrl
 
 $lng
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilSystemStyleDocumentationGUI::__construct (   $skin_id = "",
  $style_id = "" 
)

ilSystemStyleDocumentationGUI constructor.

Parameters
string$skin_id
string$style_id

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

40 {
41 global $DIC;
42
43 $this->ctrl = $DIC->ctrl();
44 $this->lng = $DIC->language();
45 $this->tpl = $DIC["tpl"];
46
47 self::$DATA_PATH= self::DATA_DIRECTORY."/".self::DATA_FILE;
48
49 }
global $DIC

References $DIC, and DATA_FILE.

Member Function Documentation

◆ executeCommand()

ilSystemStyleDocumentationGUI::executeCommand ( )

Execute command.

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

55 {
56 $cmd = $this->ctrl->getCmd();
57
58 switch ($cmd)
59 {
60 case 'parseEntries':
61 $this->$cmd();
62 $this->show();
63 break;
64 default:
65 $this->show();
66 break;
67 }
68 }
$cmd
Definition: sahs_server.php:35

References $cmd, and show().

+ Here is the call graph for this function:

◆ parseEntries()

ilSystemStyleDocumentationGUI::parseEntries ( )
protected
Returns
Crawler\Entry\ComponentEntries
Exceptions
Crawler

Exception\CrawlerException

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

99 {
100 $crawler = new Crawler\FactoriesCrawler();
101 $entries = $crawler->crawlFactory(self::ROOT_FACTORY_PATH);
102 file_put_contents(self::$DATA_PATH, json_encode($entries));
103 ilUtil::sendSuccess($this->lng->txt("entries_reloaded"),true);
104 return $entries;
105 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References ilUtil\sendSuccess().

+ Here is the call graph for this function:

◆ readEntries()

ilSystemStyleDocumentationGUI::readEntries ( )
protected
Returns
Crawler\Entry\ComponentEntries

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

110 {
111 $entries_array = json_decode(file_get_contents(self::$DATA_PATH),true);
112
113 $entries = new Crawler\Entry\ComponentEntries();
114 foreach($entries_array as $entry_array){
115 $entry = new Crawler\Entry\ComponentEntry($entry_array);
116 $entries->addEntry($entry);
117 }
118
119 return $entries;
120 }

Referenced by show().

+ Here is the caller graph for this function:

◆ show()

ilSystemStyleDocumentationGUI::show ( )

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

70 {
71 $entries = $this->readEntries();
72 $content = "";
73
74 //The button to parse the entries from code should only be shown in DEVMODE. Other users do not need that.
75 if(DEVMODE == 1){
76 $toolbar = new ilToolbarGUI();
77 $reload_btn = ilLinkButton::getInstance();
78 $reload_btn->setCaption($this->lng->txt('refresh_entries'),false);
79 if($_GET["node_id"]){
80 $this->ctrl->saveParameter($this,"node_id");
81 }
82 $reload_btn->setUrl($this->ctrl->getLinkTarget($this, 'parseEntries'));
83 $toolbar->addButtonInstance($reload_btn);
84 $content .= $toolbar->getHTML();
85 }
86
87 $explorer = new ilKSDocumentationExplorerGUI($this, "entries", $entries, $_GET["node_id"]);
88 $this->tpl->setLeftNavContent($explorer->getHTML());
89 $entry_gui = new ilKSDocumentationEntryGUI($this,$explorer->getCurrentOpenedNode(), $entries);
90 $content .= $entry_gui->renderEntry();
91
92 $this->tpl->setContent($content);
93 }
$_GET["client_id"]
static getInstance()
Factory.

References $_GET, ilLinkButton\getInstance(), and readEntries().

Referenced by executeCommand().

+ 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 22 of file class.ilSystemStyleDocumentationGUI.php.

◆ $DATA_PATH

ilSystemStyleDocumentationGUI::$DATA_PATH
static

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

◆ $lng

ilSystemStyleDocumentationGUI::$lng
protected

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

◆ $tpl

ilSystemStyleDocumentationGUI::$tpl
protected

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

◆ DATA_DIRECTORY

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

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

◆ DATA_FILE

const ilSystemStyleDocumentationGUI::DATA_FILE = "data.json"

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

Referenced by __construct().

◆ ROOT_FACTORY_PATH

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

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


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