ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilKSDocumentationEntryGUI Class Reference
+ Collaboration diagram for ilKSDocumentationEntryGUI:

Public Member Functions

 __construct (ilSystemStyleDocumentationGUI $parent)
 ilKSDocumentationEntryGUI constructor. More...
 
 renderEntry ()
 
 getEntry ()
 
 setEntry (Entry\ComponentEntry $entry)
 
 getEntries ()
 
 setEntries (Entry\ComponentEntries $entries)
 
 getParent ()
 
 setParent ($parent)
 

Protected Attributes

 $entry = null
 
 $entries = null
 
 $ctrl
 
 $parent
 
 $f = null
 
 $r = null
 
 $explorer
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilKSDocumentationEntryGUI::__construct ( ilSystemStyleDocumentationGUI  $parent)

ilKSDocumentationEntryGUI constructor.

Parameters
ilSystemStyleDocumentationGUI$parent
Entry\ComponentEntry$entry
Entry\ComponentEntries$entries

Definition at line 58 of file class.ilKSDocumentationEntryGUI.php.

References $_GET, ilSystemStyleDocumentationGUI\$DATA_PATH, $DIC, $entries, setEntries(), setEntry(), and setParent().

60  {
61  global $DIC;
62 
63  $this->f = $DIC->ui()->factory();
64  $this->r = $DIC->ui()->renderer();
65 
66 
67  $entries = Crawler\Entry\ComponentEntries::createFromArray(include ilSystemStyleDocumentationGUI::$DATA_PATH);
68  $current_opened_node_id = $_GET["node_id"];
69 
70  if ($current_opened_node_id) {
71  $DIC->ctrl()->setParameterByClass("ilsystemstyledocumentationgui", "node_id", $current_opened_node_id);
72  $this->setEntry($entries->getEntryById($_GET["node_id"]));
73  } else {
74  $this->setEntry($entries->getRootEntry());
75  }
76  $this->setEntries($entries);
77  $this->setParent($parent);
78  $this->ctrl = $DIC->ctrl();
79  }
$_GET["client_id"]
global $DIC
Definition: goto.php:24
setEntries(Entry\ComponentEntries $entries)
setEntry(Entry\ComponentEntry $entry)
+ Here is the call graph for this function:

Member Function Documentation

◆ getEntries()

ilKSDocumentationEntryGUI::getEntries ( )
Returns
Entry

Definition at line 199 of file class.ilKSDocumentationEntryGUI.php.

References $entries.

◆ getEntry()

ilKSDocumentationEntryGUI::getEntry ( )
Returns
Entry

Definition at line 183 of file class.ilKSDocumentationEntryGUI.php.

References $entry.

◆ getParent()

ilKSDocumentationEntryGUI::getParent ( )

◆ renderEntry()

ilKSDocumentationEntryGUI::renderEntry ( )
Returns
string

Definition at line 84 of file class.ilKSDocumentationEntryGUI.php.

References Vendor\Package\$e, and $name.

85  {
86  $sub_panels = array();
87 
88  $feature_wiki_links = array();
89  foreach ($this->entry->getFeatureWikiReferences()as $href) {
90  $feature_wiki_links[] = $href;
91  }
92 
93 
94  $sub_panels[] = $this->f->panel()->sub(
95  "Description",
96  array(
97  $this->f->listing()->descriptive(
98  array(
99  "Purpose" => $this->entry->getDescription()->getProperty("purpose"),
100  "Composition" => $this->entry->getDescription()->getProperty("composition"),
101  "Effect" => $this->entry->getDescription()->getProperty("effect"),
102 
103  )
104  ),
105  $this->f->listing()->descriptive(
106  array(
107  "Background" => $this->entry->getBackground(),
108  "Context" => $this->f->listing()->ordered($this->entry->getContext()),
109  "Feature Wiki References" => $this->f->listing()->ordered($feature_wiki_links)
110  )
111  )
112  )
113  );
114 
115  if (sizeof($this->entry->getDescription()->getProperty("rivals"))) {
116  $sub_panels[] = $this->f->panel()->sub(
117  "Rivals",
118  $this->f->listing()->descriptive(
119  $this->entry->getDescription()->getProperty("rivals")
120  )
121  );
122  }
123 
124  if ($this->entry->getRules()->hasRules()) {
125  $rule_listings = array();
126  foreach ($this->entry->getRulesAsArray() as $categoery => $category_rules) {
127  $rule_listings[ucfirst($categoery)] = $this->f->listing()->ordered($category_rules);
128  }
129 
130 
131  $sub_panels[] = $this->f->panel()->sub(
132  "Rules",
133  $this->f->listing()->descriptive($rule_listings)
134  );
135  }
136 
137 
138  if ($this->entry->getExamples()) {
139  $nr = 1;
140  foreach ($this->entry->getExamples() as $name => $path) {
141  include_once($path);
142  $title = "Example " . $nr . ": " . ucfirst(str_replace("_", " ", $name));
143  $nr++;
144  try{
145  $example = "<div class='well'>" . $name() . "</div>"; //Executes function loaded in file indicated by 'path'
146  }catch(\ILIAS\UI\NotImplementedException $e){
147  $example = "<div class='well'>This component is not yet fully implemented.</div>";
148  }
149  $content_part_1 = $this->f->legacy($example);
150  $code = str_replace("<?php\n", "", file_get_contents($path));
151  $geshi = new GeSHi($code, "php");
152  //@Todo: we need a code container UI Component
153  $code_html = "<div class='code-container'>" . $geshi->parse_code() . "</div>";
154  $content_part_2 = $this->f->legacy($code_html);
155  $content = array($content_part_1,$content_part_2);
156  $sub_panels[] = $this->f->panel()->sub($title, $content);
157  }
158  }
159  $sub_panels[] = $this->f->panel()->sub('Relations', [
160  $this->f->listing()->descriptive(
161  array(
162  "Parents" => $this->f->listing()->ordered(
163  $this->entries->getParentsOfEntryTitles($this->entry->getId())
164  ),
165  "Descendants" => $this->f->listing()->unordered(
166  $this->entries->getDescendantsOfEntryTitles($this->entry->getId())
167  )
168  )
169  )
170  ]);
171 
172 
173  $report = $this->f->panel()
174  ->report($this->entry->getTitle(), $sub_panels);
175 
176  return $this->r->render($report);
177  }
Class Factory.
Class ChatMainBarProvider .
if($format !==null) $name
Definition: metadata.php:230

◆ setEntries()

ilKSDocumentationEntryGUI::setEntries ( Entry\ComponentEntries  $entries)
Parameters
Entry\ComponentEntries$entries

Definition at line 207 of file class.ilKSDocumentationEntryGUI.php.

References $entries.

Referenced by __construct().

208  {
209  $this->entries = $entries;
210  }
+ Here is the caller graph for this function:

◆ setEntry()

ilKSDocumentationEntryGUI::setEntry ( Entry\ComponentEntry  $entry)
Parameters
Entry\ComponentEntry$entry

Definition at line 191 of file class.ilKSDocumentationEntryGUI.php.

References $entry.

Referenced by __construct().

192  {
193  $this->entry = $entry;
194  }
+ Here is the caller graph for this function:

◆ setParent()

ilKSDocumentationEntryGUI::setParent (   $parent)
Parameters
ilSystemStyleDocumentationGUI$parent

Definition at line 223 of file class.ilKSDocumentationEntryGUI.php.

References $parent.

Referenced by __construct().

224  {
225  $this->parent = $parent;
226  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilKSDocumentationEntryGUI::$ctrl
protected

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

◆ $entries

ilKSDocumentationEntryGUI::$entries = null
protected

Definition at line 25 of file class.ilKSDocumentationEntryGUI.php.

Referenced by __construct(), getEntries(), and setEntries().

◆ $entry

ilKSDocumentationEntryGUI::$entry = null
protected

Definition at line 20 of file class.ilKSDocumentationEntryGUI.php.

Referenced by getEntry(), and setEntry().

◆ $explorer

ilKSDocumentationEntryGUI::$explorer
protected

Definition at line 50 of file class.ilKSDocumentationEntryGUI.php.

◆ $f

ilKSDocumentationEntryGUI::$f = null
protected

Definition at line 40 of file class.ilKSDocumentationEntryGUI.php.

◆ $parent

ilKSDocumentationEntryGUI::$parent
protected

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

Referenced by getParent(), and setParent().

◆ $r

ilKSDocumentationEntryGUI::$r = null
protected

Definition at line 45 of file class.ilKSDocumentationEntryGUI.php.


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