ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilKSDocumentationExplorerGUI.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 include_once("Services/UIComponent/Explorer2/classes/class.ilExplorerBaseGUI.php");
5 
7 
12 {
16  protected $ctrl;
17 
21  protected $id = "ksDocumentationExplorer";
22 
26  protected $parentLink = "";
27 
31  protected $entries = null;
32 
36  protected $current_opened_node_id = "";
37 
45  public function __construct(ilSystemStyleDocumentationGUI $a_parent_obj, $a_parent_cmd, Entry\ComponentEntries $entries, $current_opened_node_id)
46  {
47 
48  global $ilCtrl;
49  $this->ctrl = $ilCtrl;
50  parent::__construct($this->id, $a_parent_obj, $a_parent_cmd);
51 
52  $this->setParentLink($this->ctrl->getLinkTarget($this->parent_obj, $this->parent_cmd));
53 
54  $this->setEntries($entries);
55  $this->setOfflineMode(true);
56 
58  $this->setCurrentOpenedNodeId($this->getEntries()->getRootEntryId());
59  }else{
61  }
62 
64  }
65 
70  protected function openNodesRecursively($id){
71  $this->setNodeOpen($id);
72  $parent_id = $this->getEntries()->getEntryById($id)->getParent();
73 
74  if($parent_id){
75  $this->openNodesRecursively($parent_id);
76  }
77  }
83  function getRootNode()
84  {
85  return $this->getEntries()->getRootEntry();
86  }
87 
92  function getChildsOfNode($a_parent_node_id)
93  {
94 
95  $entry = $this->getEntries()->getEntryById($a_parent_node_id);
96 
100  $children = array();
101  foreach ($entry->getChildren() as $child_id)
102  {
103  $children[$child_id] = $this->getEntries()->getEntryById($child_id);
104  }
105  return $children;
106  }
107 
113  function getNodeById($a_entry_id)
114  {
115  return $this->getEntries()->getEntryById($a_entry_id);
116  }
117 
122  function getNodeContent($entry)
123  {
124  return $entry->getTitle();
125  }
126 
131  function getNodeHref($entry)
132  {
133  return $this->getParentLink()."&node_id=".$entry->getId();
134  }
135 
140  function isNodeHighlighted($entry)
141  {
142  return $entry->getId() == $this->getCurrentOpenedNode()->getId();
143  }
148  function getNodeId($entry)
149  {
150  return $entry->getId();
151  }
152 
156  public function getParentLink()
157  {
158  return $this->parentLink;
159  }
160 
164  public function setParentLink($parentLink)
165  {
166  $this->parentLink = $parentLink;
167  }
168 
172  public function getEntries()
173  {
174  return $this->entries;
175  }
176 
180  public function setEntries($entries)
181  {
182  $this->entries = $entries;
183  }
184 
188  public function getCurrentOpenedNodeId()
189  {
191  }
192 
197  {
198  $this->current_opened_node_id = $current_opened_node_id;
199  }
200 
205  public function getCurrentOpenedNode(){
206  return $this->getEntries()->getEntryById($this->getCurrentOpenedNodeId());
207  }
208 
209 }
setOfflineMode($a_val)
Set offline mode.
setNodeOpen($a_id)
Set node to be opened (additional custom opened node, not standard expand behaviour) ...
global $ilCtrl
Definition: ilias.php:18
Explorer base GUI class.
Create styles array
The data for the language used.
getChildsOfNode($a_parent_node_id)
Get childs of node.
__construct(ilSystemStyleDocumentationGUI $a_parent_obj, $a_parent_cmd, Entry\ComponentEntries $entries, $current_opened_node_id)
ilKSDocumentationExplorerGUI constructor.