ILIAS  Release_4_1_x_branch Revision 61804
 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
 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

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

References $lng, and $tree.

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

Member Function Documentation

ilPathGUI::enableTextOnly (   $a_status)

render path as text only

Parameters
bool$a_text_onlypath as text only true/false
Returns

Definition at line 75 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 112 of file class.ilPathGUI.php.

References $ref_id, $title, $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);
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 './classes/class.ilLink.php';
$tpl = new ilTemplate('tpl.locator.html',true,true);
$first = true;
foreach($this->getPathIds() as $ref_id)
{
$obj_id = ilObject::_lookupObjId($ref_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 62 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 190 of file class.ilPathGUI.php.

References $path.

Referenced by getHTML().

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

+ Here is the caller graph for this function:

ilPathGUI::getUseImages ( )

get use images

Returns

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

References $useImages.

Referenced by getHTML().

{
}

+ Here is the caller graph for this function:

ilPathGUI::setUseImages (   $a_status)

set use images

Parameters
bool
Returns

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

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

show text only

Returns

Definition at line 84 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::$lng = null
protected

Definition at line 41 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 42 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: