ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPathGUI Class Reference

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

+ Collaboration diagram for ilPathGUI:

Public Member Functions

 __construct ()
 Constructor.
 getPath ($a_startnode, $a_endnode)
 get path
 enableTextOnly ($a_status)
 render path as text only
 textOnly ()
 show text only
 enableHideLeaf ($a_status)
 Hide leaf node in path.
 hideLeaf ()
 setUseImages ($a_status)
 set use images
 getUseImages ()
 get use images

Protected Member Functions

 getHTML ()
 get html
 getPathIds ()

Protected Attributes

 $lng = null
 $tree = null

Private Attributes

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

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

ilPathGUI::__construct ( )

Constructor.

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

References $lng, and $tree.

{
global $tree,$lng;
$this->tree = $tree;
$this->lng = $lng;
}

Member Function Documentation

ilPathGUI::enableHideLeaf (   $a_status)

Hide leaf node in path.

Parameters
type$a_status

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

{
$this->hide_leaf = $a_status;
}
ilPathGUI::enableTextOnly (   $a_status)

render path as text only

Parameters
bool$a_text_onlypath as text only true/false
Returns

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

References textOnly().

{
$this->textOnly = $a_status;
}

+ Here is the call graph for this function:

ilPathGUI::getHTML ( )
protected

get html

Returns

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

References $ref_id, $tpl, ilLink\_getLink(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObject\_lookupType(), getPathIds(), ilUtil\getTypeIconPath(), getUseImages(), and textOnly().

Referenced by getPath().

{
if($this->textOnly())
{
$tpl = new ilTemplate('tpl.locator_text_only.html',true,true, "Services/Locator");
$first = true;
foreach($this->getPathIds() as $ref_id)
{
$obj_id = ilObject::_lookupObjId($ref_id);
$title = ilObject::_lookupTitle($obj_id);
if($first)
{
if($ref_id == ROOT_FOLDER_ID)
{
$title = $this->lng->txt('repository');
}
}
else
{
$tpl->touchBlock('locator_separator_prefix');
}
$tpl->setCurrentBlock('locator_item');
$tpl->setVariable('ITEM',$title);
$tpl->parseCurrentBlock();
$first = false;
}
return $tpl->get();
}
else
{
// With images and links
include_once './Services/Link/classes/class.ilLink.php';
$tpl = new ilTemplate('tpl.locator.html',true,true,'Services/Locator');
$first = true;
foreach($this->getPathIds() as $ref_id)
{
$obj_id = ilObject::_lookupObjId($ref_id);
$title = ilObject::_lookupTitle($obj_id);
$type = ilObject::_lookupType($obj_id);
if($first)
{
if($ref_id == ROOT_FOLDER_ID)
{
$title = $this->lng->txt('repository');
}
}
else
{
$tpl->touchBlock('locator_separator_prefix');
}
if($this->getUseImages())
{
$tpl->setCurrentBlock('locator_img');
$tpl->setVariable('IMG_SRC',ilUtil::getTypeIconPath($type,$obj_id));
$tpl->setVariable('IMG_ALT',$this->lng->txt('obj_'.$type));
$tpl->parseCurrentBlock();
}
$tpl->setCurrentBlock('locator_item');
$tpl->setVariable('LINK_ITEM',ilLink::_getLink($ref_id,$type));
$tpl->setVariable('ITEM',$title);
$tpl->parseCurrentBlock();
$first = false;
}
return $tpl->get();
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

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 63 of file class.ilPathGUI.php.

References getHTML().

{
$this->startnode = $a_startnode;
$this->endnode = $a_endnode;
return $this->getHTML();
}

+ Here is the call graph for this function:

ilPathGUI::getPathIds ( )
protected
Parameters
@return

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

References $path, and hideLeaf().

Referenced by getHTML().

{
$path = $this->tree->getPathId($this->endnode,$this->startnode);
if($this->hideLeaf())
{
unset($path[count($path) - 1]);
}
return $path ? $path : array();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPathGUI::getUseImages ( )

get use images

Returns

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

References $useImages.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilPathGUI::hideLeaf ( )

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

References $hide_leaf.

Referenced by getPathIds().

{
}

+ Here is the caller graph for this function:

ilPathGUI::setUseImages (   $a_status)

set use images

Parameters
bool
Returns

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

{
$this->useImages = $a_status;
}
ilPathGUI::textOnly ( )

show text only

Returns

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

References $textOnly.

Referenced by enableTextOnly(), and getHTML().

{
}

+ Here is the caller graph for this function:

Field Documentation

ilPathGUI::$endnode = ROOT_FOLDER_ID
private

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

ilPathGUI::$hide_leaf = true
private

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

Referenced by hideLeaf().

ilPathGUI::$lng = null
protected

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

Referenced by __construct().

ilPathGUI::$startnode = ROOT_FOLDER_ID
private

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

ilPathGUI::$textOnly = true
private

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

Referenced by textOnly().

ilPathGUI::$tree = null
protected

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

Referenced by __construct().

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: