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

Public Member Functions

 __construct (ilSystemStyleDocumentationGUI $parent, Entry\ComponentEntry $entry, Entry\ComponentEntries $entries)
 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
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilKSDocumentationEntryGUI::__construct ( ilSystemStyleDocumentationGUI  $parent,
Entry\ComponentEntry  $entry,
Entry\ComponentEntries  $entries 
)

ilKSDocumentationEntryGUI constructor.

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

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

References $DIC, $ilCtrl, setEntries(), setEntry(), and setParent().

53  {
54  global $ilCtrl,$DIC;
55 
56  $this->f = $DIC->ui()->factory();
57  $this->r = $DIC->ui()->renderer();
58 
59  $this->setEntry($entry);
60  $this->setEntries($entries);
61  $this->setParent($parent);
62  $this->ctrl = $ilCtrl;
63  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
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 164 of file class.ilKSDocumentationEntryGUI.php.

References $entries.

◆ getEntry()

ilKSDocumentationEntryGUI::getEntry ( )
Returns
Entry

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

References $entry.

◆ getParent()

ilKSDocumentationEntryGUI::getParent ( )

◆ renderEntry()

ilKSDocumentationEntryGUI::renderEntry ( )
Returns
string

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

References $code, $name, $path, $title, and array.

Referenced by ilSystemStyleDocumentationGUI\show().

69  {
70  $sub_panels = array();
71 
72  $feature_wiki_links = array();
73  foreach ($this->entry->getFeatureWikiReferences()as $href) {
74  $feature_wiki_links[] = $href;
75  }
76 
77  $sub_panels[] = $this->f->panel()->sub(
78  "Description",
79  array(
80  $this->f->listing()->descriptive(
81  array(
82  "Purpose" => $this->entry->getDescription()->getProperty("purpose"),
83  "Composition" => $this->entry->getDescription()->getProperty("composition"),
84  "Effect" => $this->entry->getDescription()->getProperty("effect"),
85  "Rivals" => $this->f->listing()->ordered(
86  $this->entry->getDescription()->getProperty("rivals")
87  )
88  )
89  ),
90  $this->f->listing()->descriptive(
91  array(
92  "Background" => $this->entry->getBackground(),
93  "Feature Wiki References" => $this->f->listing()->ordered($feature_wiki_links)
94  )
95  )
96  )
97  );
98 
99  $rule_listings = array();
100  foreach ($this->entry->getRulesAsArray() as $categoery => $category_rules) {
101  $rule_listings[ucfirst($categoery)] = $this->f->listing()->ordered($category_rules);
102  }
103 
104  $sub_panels[] = $this->f->panel()->sub(
105  "Rules",
106  $this->f->listing()->descriptive($rule_listings)
107  );
108 
109  if ($this->entry->getExamples()) {
110  $nr = 1;
111  foreach ($this->entry->getExamples() as $name => $path) {
112  include_once($path);
113  $title = "Example " . $nr . ": " . ucfirst(str_replace("_", " ", $name));
114  $nr++;
115  $example = "<div class='well'>" . $name() . "</div>"; //Executes function loaded in file indicated by 'path'
116  $content_part_1 = $this->f->legacy($example);
117  $code = str_replace("<?php\n", "", file_get_contents($path));
118  $geshi = new GeSHi($code, "php");
119  $content_part_2 = $this->f->legacy($geshi->parse_code());
120  $content = array($content_part_1,$content_part_2);
121  $sub_panels[] = $this->f->panel()->sub($title, $content);
122  }
123  }
124 
125  $sub_panels[] = $this->f->panel()->sub(
126  "Relations",
127  $this->f->listing()->descriptive(
128  array(
129  "Parents" => $this->f->listing()->ordered(
130  $this->entries->getParentsOfEntryTitles($this->entry->getId())
131  ),
132  "Descendants" => $this->f->listing()->unordered(
133  $this->entries->getDescendantsOfEntryTitles($this->entry->getId())
134  )
135  )
136  )
137  );
138 
139  $report = $this->f->panel()->report($this->entry->getTitle(), $sub_panels);
140 
141  return $this->r->render($report);
142  }
$code
Definition: example_050.php:99
Definition: geshi.php:226
if($format !==null) $name
Definition: metadata.php:146
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ setEntries()

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

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

References $entries.

Referenced by __construct().

173  {
174  $this->entries = $entries;
175  }
+ Here is the caller graph for this function:

◆ setEntry()

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

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

References $entry.

Referenced by __construct().

157  {
158  $this->entry = $entry;
159  }
+ Here is the caller graph for this function:

◆ setParent()

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

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

References $parent.

Referenced by __construct().

189  {
190  $this->parent = $parent;
191  }
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilKSDocumentationEntryGUI::$ctrl
protected

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

◆ $entries

ilKSDocumentationEntryGUI::$entries = null
protected

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

Referenced by getEntries(), and setEntries().

◆ $entry

ilKSDocumentationEntryGUI::$entry = null
protected

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

Referenced by getEntry(), and setEntry().

◆ $f

ilKSDocumentationEntryGUI::$f = null
protected

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

◆ $parent

ilKSDocumentationEntryGUI::$parent
protected

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

Referenced by getParent(), and setParent().

◆ $r

ilKSDocumentationEntryGUI::$r = null
protected

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


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