ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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().

52  {
53  global $ilCtrl,$DIC;
54 
55  $this->f = $DIC->ui()->factory();
56  $this->r = $DIC->ui()->renderer();
57 
58  $this->setEntry($entry);
59  $this->setEntries($entries);
60  $this->setParent($parent);
61  $this->ctrl = $ilCtrl;
62 
63  }
global $ilCtrl
Definition: ilias.php:18
setEntries(Entry\ComponentEntries $entries)
setEntry(Entry\ComponentEntry $entry)
global $DIC
+ Here is the call graph for this function:

Member Function Documentation

◆ getEntries()

ilKSDocumentationEntryGUI::getEntries ( )
Returns
Entry

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

References $entries.

◆ getEntry()

ilKSDocumentationEntryGUI::getEntry ( )
Returns
Entry

Definition at line 145 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, $geshi, $path, $title, and array.

Referenced by ilSystemStyleDocumentationGUI\show().

68  {
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("Description",
78  array(
79  $this->f->listing()->descriptive(
80  array(
81  "Purpose" => $this->entry->getDescription()->getProperty("purpose"),
82  "Composition" => $this->entry->getDescription()->getProperty("composition"),
83  "Effect" => $this->entry->getDescription()->getProperty("effect"),
84  "Rivals" => $this->f->listing()->ordered(
85  $this->entry->getDescription()->getProperty("rivals")
86  )
87  )
88  ),
89  $this->f->listing()->descriptive(
90  array(
91  "Background" => $this->entry->getBackground(),
92  "Feature Wiki References" => $this->f->listing()->ordered($feature_wiki_links)
93  )
94  )
95  )
96  );
97 
98  $rule_listings = array();
99  foreach($this->entry->getRulesAsArray() as $categoery => $category_rules){
100  $rule_listings[ucfirst($categoery)] = $this->f->listing()->ordered($category_rules);
101  }
102 
103  $sub_panels[] = $this->f->panel()->sub("Rules",
104  $this->f->listing()->descriptive($rule_listings)
105  );
106 
107  if($this->entry->getExamples()){
108  $nr = 1;
109  foreach($this->entry->getExamples() as $name => $path){
110  include_once($path);
111  $title = "Example ".$nr.": ".ucfirst(str_replace("_"," ",$name));
112  $nr++;
113  $example = "<div class='well'>".$name()."</div>"; //Executes function loaded in file indicated by 'path'
114  $content_part_1 = $this->f->legacy($example);
115  $code = str_replace("<?php\n","",file_get_contents ($path));
116  $geshi = new GeSHi($code, "php");
117  $content_part_2 = $this->f->legacy($geshi->parse_code());
118  $content = array($content_part_1,$content_part_2);
119  $sub_panels[] = $this->f->panel()->sub($title, $content);
120  }
121  }
122 
123  $sub_panels[] = $this->f->panel()->sub("Relations",
124  $this->f->listing()->descriptive(
125  array(
126  "Parents" => $this->f->listing()->ordered(
127  $this->entries->getParentsOfEntryTitles($this->entry->getId())
128  ),
129  "Descendants" => $this->f->listing()->unordered(
130  $this->entries->getDescendantsOfEntryTitles($this->entry->getId())
131  )
132  )
133  )
134  );
135 
136  $report = $this->f->panel()->report($this->entry->getTitle(),$sub_panels);
137 
138  return $this->r->render($report);
139  }
$path
Definition: aliased.php:25
if(strncmp($real_path, SOURCE_ROOT, $base_path_len)) if(!file_exists($path)) $geshi
Definition: aliased.php:40
$code
Definition: example_050.php:99
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 169 of file class.ilKSDocumentationEntryGUI.php.

References $entries.

Referenced by __construct().

170  {
171  $this->entries = $entries;
172  }
+ Here is the caller graph for this function:

◆ setEntry()

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

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

References $entry.

Referenced by __construct().

154  {
155  $this->entry = $entry;
156  }
+ Here is the caller graph for this function:

◆ setParent()

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

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

References $parent.

Referenced by __construct().

+ 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: