ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilPathGUI Class Reference

Creates a path for a start and endnode. More...

+ Inheritance diagram for ilPathGUI:
+ Collaboration diagram for ilPathGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 getPath ($a_startnode, $a_endnode)
 get path More...
 
 enableTextOnly ($a_status)
 render path as text only More...
 
 textOnly ()
 show text only More...
 
 enableHideLeaf ($a_status)
 Hide leaf node in path. More...
 
 hideLeaf ()
 
 setUseImages ($a_status)
 set use images More...
 
 getUseImages ()
 get use images More...
 
 enableDisplayCut ($a_status)
 Display a cut with "...". More...
 
 displayCut ()
 Display a cut with "...". More...
 

Protected Member Functions

 getHTML ()
 get html More...
 
 buildTitle ($a_obj_id)
 
 getPathIds ()
 

Protected Attributes

 $lng = null
 
 $tree = null
 

Private Attributes

 $startnode = ROOT_FOLDER_ID
 
 $endnode = ROOT_FOLDER_ID
 
 $textOnly = true
 
 $useImages = false
 
 $hide_leaf = true
 
 $display_cut = false
 

Detailed Description

Creates a path for a start and endnode.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 33 of file class.ilPathGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPathGUI::__construct ( )

Constructor.

Definition at line 53 of file class.ilPathGUI.php.

References $DIC, $lng, and $tree.

54  {
55  global $DIC;
56 
57  $tree = $DIC['tree'];
58  $lng = $DIC['lng'];
59 
60  $this->tree = $tree;
61  $this->lng = $lng;
62  }
$DIC
Definition: xapitoken.php:46

Member Function Documentation

◆ buildTitle()

ilPathGUI::buildTitle (   $a_obj_id)
protected
Parameters
$a_obj_id
Returns
string

Definition at line 243 of file class.ilPathGUI.php.

References ilObject\_lookupTitle().

Referenced by getHTML().

244  {
245  return ilObject::_lookupTitle($a_obj_id);
246  }
static _lookupTitle($a_id)
lookup object title
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ displayCut()

ilPathGUI::displayCut ( )

Display a cut with "...".

Returns
bool

Definition at line 142 of file class.ilPathGUI.php.

References $display_cut.

Referenced by getHTML().

143  {
144  return $this->display_cut;
145  }
+ Here is the caller graph for this function:

◆ enableDisplayCut()

ilPathGUI::enableDisplayCut (   $a_status)

Display a cut with "...".

Parameters
$a_statusbool

Definition at line 133 of file class.ilPathGUI.php.

134  {
135  $this->display_cut = $a_status;
136  }

◆ enableHideLeaf()

ilPathGUI::enableHideLeaf (   $a_status)

Hide leaf node in path.

Parameters
type$a_status

Definition at line 101 of file class.ilPathGUI.php.

Referenced by ilSessionClassificationPathGUI\getPathIds().

102  {
103  $this->hide_leaf = $a_status;
104  }
+ Here is the caller graph for this function:

◆ enableTextOnly()

ilPathGUI::enableTextOnly (   $a_status)

render path as text only

Parameters
bool$a_text_onlypath as text only true/false
Returns

Definition at line 83 of file class.ilPathGUI.php.

References textOnly().

Referenced by ilObjectCopyCourseGroupSelectionTableGUI\customizePath().

84  {
85  $this->textOnly = $a_status;
86  }
textOnly()
show text only
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getHTML()

ilPathGUI::getHTML ( )
protected

get html

Returns

Definition at line 151 of file class.ilPathGUI.php.

References $tpl, $type, ilLink\_getLink(), ilObject\_lookupObjId(), ilObject\_lookupType(), buildTitle(), displayCut(), getPathIds(), ilUtil\getTypeIconPath(), getUseImages(), ilUtil\secureLink(), and textOnly().

Referenced by getPath().

152  {
153  if ($this->textOnly()) {
154  $tpl = new ilTemplate('tpl.locator_text_only.html', true, true, "Services/Locator");
155 
156  $first = true;
157 
158  // Display cut
159  if ($this->displayCut() && $this->startnode != ROOT_FOLDER_ID) {
160  $tpl->setCurrentBlock('locator_item');
161  $tpl->setVariable('ITEM', "...");
162  $tpl->parseCurrentBlock();
163 
164  $first = false;
165  }
166 
167  foreach ($this->getPathIds() as $ref_id) {
168  $obj_id = ilObject::_lookupObjId($ref_id);
169  $title = $this->buildTitle($obj_id);
170 
171  if ($first) {
172  if ($ref_id == ROOT_FOLDER_ID) {
173  $title = $this->lng->txt('repository');
174  }
175  } else {
176  $tpl->touchBlock('locator_separator_prefix');
177  }
178 
179  $tpl->setCurrentBlock('locator_item');
180  $tpl->setVariable('ITEM', $title);
181  $tpl->parseCurrentBlock();
182  $first = false;
183  }
184  return $tpl->get();
185  } else {
186  // With images and links
187  include_once './Services/Link/classes/class.ilLink.php';
188 
189  $tpl = new ilTemplate('tpl.locator.html', true, true, 'Services/Locator');
190 
191  $first = true;
192 
193  // Display cut
194  if ($this->displayCut() && $this->startnode != ROOT_FOLDER_ID) {
195  $tpl->setCurrentBlock('locator_item');
196  $tpl->setVariable('ITEM', "...");
197  $tpl->parseCurrentBlock();
198 
199  $first = false;
200  }
201 
202  foreach ($this->getPathIds() as $ref_id) {
203  $obj_id = ilObject::_lookupObjId($ref_id);
204  $title = $this->buildTitle($obj_id);
205  $type = ilObject::_lookupType($obj_id);
206 
207  if ($first) {
208  if ($ref_id == ROOT_FOLDER_ID) {
209  $title = $this->lng->txt('repository');
210  }
211  } else {
212  $tpl->touchBlock('locator_separator_prefix');
213  }
214  if ($this->getUseImages()) {
215  $tpl->setCurrentBlock('locator_img');
216  $tpl->setVariable('IMG_SRC', ilUtil::getTypeIconPath($type, $obj_id));
217  $tpl->setVariable('IMG_ALT', $this->lng->txt('obj_' . $type));
218  $tpl->parseCurrentBlock();
219  }
220 
221  if (!$this->tree->isDeleted($ref_id)) {
222  $tpl->setCurrentBlock('locator_item');
223  $tpl->setVariable('LINK_ITEM', ilUtil::secureLink(ilLink::_getLink($ref_id, $type)));
224  $tpl->setVariable('ITEM', $title);
225  $tpl->parseCurrentBlock();
226  } else {
227  $tpl->setCurrentBlock('locator_item');
228  $tpl->setVariable('ITEM_READ_ONLY', $title);
229  $tpl->parseCurrentBlock();
230  }
231 
232  $first = false;
233  }
234  $tpl->setVariable("TXT_BREADCRUMBS", $this->lng->txt("breadcrumb_navigation"));
235  return $tpl->get();
236  }
237  }
getUseImages()
get use images
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
$type
displayCut()
Display a cut with "...".
textOnly()
show text only
static getTypeIconPath($a_type, $a_obj_id, $a_size='small')
Get type icon path path Return image path for icon_xxx.pngs Or (if enabled) path to custom icon Depre...
static _lookupObjId($a_id)
buildTitle($a_obj_id)
static _lookupType($a_id, $a_reference=false)
lookup object type
static secureLink($a_str)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPath()

ilPathGUI::getPath (   $a_startnode,
  $a_endnode 
)

get path

Parameters
int$a_startnoderef_id of startnode
int$a_endnoderef_id of endnode
Returns
string html

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

References getHTML().

71  {
72  $this->startnode = $a_startnode;
73  $this->endnode = $a_endnode;
74 
75  return $this->getHTML();
76  }
getHTML()
get html
+ Here is the call graph for this function:

◆ getPathIds()

ilPathGUI::getPathIds ( )
protected
Parameters

Definition at line 253 of file class.ilPathGUI.php.

References ilLoggerFactory\getLogger(), and hideLeaf().

Referenced by getHTML().

254  {
255  $path = $this->tree->getPathId($this->endnode, $this->startnode);
256 
257  \ilLoggerFactory::getLogger('tree')->dump($path);
258  \ilLoggerFactory::getLogger('tree')->dump($this->endnode);
259  \ilLoggerFactory::getLogger('tree')->dump($this->startnode);
260 
261  if ($this->hideLeaf()) {
262  unset($path[count($path) - 1]);
263  }
264  return $path ? $path : array();
265  }
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUseImages()

ilPathGUI::getUseImages ( )

get use images

Returns

Definition at line 124 of file class.ilPathGUI.php.

References $useImages.

Referenced by getHTML().

125  {
126  return $this->useImages;
127  }
+ Here is the caller graph for this function:

◆ hideLeaf()

ilPathGUI::hideLeaf ( )

Definition at line 106 of file class.ilPathGUI.php.

References $hide_leaf.

Referenced by getPathIds().

107  {
108  return $this->hide_leaf;
109  }
+ Here is the caller graph for this function:

◆ setUseImages()

ilPathGUI::setUseImages (   $a_status)

set use images

Parameters
bool
Returns

Definition at line 115 of file class.ilPathGUI.php.

Referenced by ilObjectCopyCourseGroupSelectionTableGUI\customizePath().

116  {
117  $this->useImages = $a_status;
118  }
+ Here is the caller graph for this function:

◆ textOnly()

ilPathGUI::textOnly ( )

show text only

Returns

Definition at line 92 of file class.ilPathGUI.php.

References $textOnly.

Referenced by enableTextOnly(), and getHTML().

93  {
94  return $this->textOnly;
95  }
+ Here is the caller graph for this function:

Field Documentation

◆ $display_cut

ilPathGUI::$display_cut = false
private

Definition at line 41 of file class.ilPathGUI.php.

Referenced by displayCut().

◆ $endnode

ilPathGUI::$endnode = ROOT_FOLDER_ID
private

Definition at line 36 of file class.ilPathGUI.php.

◆ $hide_leaf

ilPathGUI::$hide_leaf = true
private

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

Referenced by hideLeaf().

◆ $lng

ilPathGUI::$lng = null
protected

Definition at line 43 of file class.ilPathGUI.php.

Referenced by __construct().

◆ $startnode

ilPathGUI::$startnode = ROOT_FOLDER_ID
private

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

◆ $textOnly

ilPathGUI::$textOnly = true
private

Definition at line 38 of file class.ilPathGUI.php.

Referenced by textOnly().

◆ $tree

ilPathGUI::$tree = null
protected

Definition at line 48 of file class.ilPathGUI.php.

Referenced by __construct().

◆ $useImages

ilPathGUI::$useImages = false
private

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

Referenced by getUseImages().


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