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

Organisation Unit Tree. More...

+ Collaboration diagram for ilOrgUnitTreeExplorerGUI:

Public Member Functions

 __construct (ilOrgUnit $a_root_unit)
 getHTML ()

Private Member Functions

 renderUnit (ilOrgUnit $a_unit, $a_depth)

Private Attributes

 $tpl = null

Detailed Description

Organisation Unit Tree.

Author
Bjoern Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 14 of file class.ilOrgUnitTreeExplorerGUI.php.

Constructor & Destructor Documentation

ilOrgUnitTreeExplorerGUI::__construct ( ilOrgUnit  $a_root_unit)

Definition at line 18 of file class.ilOrgUnitTreeExplorerGUI.php.

{
$this->root_unit = $a_root_unit;
$this->tpl = new ilTemplate('tpl.org_unit_tree_explorer.html', true, true, 'Services/OrgUnit');
}

Member Function Documentation

ilOrgUnitTreeExplorerGUI::getHTML ( )

Definition at line 146 of file class.ilOrgUnitTreeExplorerGUI.php.

References renderUnit().

{
$depth = 1;
$this->tpl->setCurrentBlock('exp_list_begin');
$this->tpl->setVariable('CLASSNAME', 'depth_'.$depth);
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
$this->renderUnit($this->root_unit, $depth);
$this->tpl->setCurrentBlock('exp_list_end');
$this->tpl->touchBlock('exp_list_end');
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
$html = $this->tpl->get();
return $html;
}

+ Here is the call graph for this function:

ilOrgUnitTreeExplorerGUI::renderUnit ( ilOrgUnit  $a_unit,
  $a_depth 
)
private

Definition at line 25 of file class.ilOrgUnitTreeExplorerGUI.php.

References $lng, ilOrgUnit\getChilds(), ilOrgUnit\getId(), ilUtil\getImagePath(), ilObjectFactory\getInstanceByObjId(), ilOrgUnit\getSubTitle(), ilOrgUnit\getTitle(), ilOrgUnit\hasChilds(), ilOrgUnit\initAssigns(), and ilOrgUnitTree\ROOT_UNIT_ID.

Referenced by getHTML().

{
global $lng;
$a_unit->initAssigns();
$this->tpl->setCurrentBlock('exp_item_begin');
$this->tpl->setVariable('CLASSNAME', 'depth_'.$a_depth);
$this->tpl->parseCurrentBlock();
for($i = 1; $i < $a_depth; $i++)
{
$this->tpl->setCurrentBlock('exp_item_indent');
$this->tpl->touchBlock('exp_item_indent');
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('exp_item_icon');
$this->tpl->setVariable('ITEM_ICON_SRC', ilUtil::getImagePath('icon_root_s.png'));
$this->tpl->parseCurrentBlock();
{
$this->tpl->setCurrentBlock('exp_item_title');
$this->tpl->setVariable('ITEM_TITLE', $lng->txt('org_unit_tree_root'));
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setCurrentBlock('exp_item_title');
$this->tpl->setVariable('ITEM_TITLE', $a_unit->getTitle());
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('exp_item_subtitle');
$this->tpl->setVariable('ITEM_SUBTITLE', $a_unit->getSubTitle());
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
#$assigned_users = $a_unit->getAssignedUsers();
$assigned_users = array();
if( count($assigned_users) )
{
$this->tpl->setCurrentBlock('exp_list_begin');
$this->tpl->setVariable('CLASSNAME', 'depth_'.($a_depth + 1));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
foreach($assigned_users as $user_id => $properties)
{
$this->tpl->setCurrentBlock('exp_item_begin');
$this->tpl->setVariable('CLASSNAME', 'depth_'.($a_depth + 1));
$this->tpl->parseCurrentBlock();
for($i = 1; $i < ($a_depth + 1); $i++)
{
$this->tpl->setCurrentBlock('exp_item_indent');
$this->tpl->touchBlock('exp_item_indent');
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('exp_item_icon');
$this->tpl->setVariable('ITEM_ICON_SRC', ilUtil::getImagePath('icon_usr_s.png'));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('exp_item_title');
$this->tpl->setVariable('ITEM_TITLE', $user->getLastName().', '.$user->getFirstName());
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('exp_item_end');
$this->tpl->touchBlock('exp_item_end');
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('exp_list_end');
$this->tpl->touchBlock('exp_list_end');
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
}
if( $a_unit->hasChilds() )
{
$this->tpl->setCurrentBlock('exp_list_begin');
$this->tpl->setVariable('CLASSNAME', 'depth_'.($a_depth + 1));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
foreach($a_unit->getChilds() as $child_unit)
{
$this->renderUnit( $child_unit, ($a_depth + 1) );
}
$this->tpl->setCurrentBlock('exp_list_end');
$this->tpl->touchBlock('exp_list_end');
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock('exp_item_end');
$this->tpl->touchBlock('exp_item_end');
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock('explorer');
$this->tpl->parseCurrentBlock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ilOrgUnitTreeExplorerGUI::$tpl = null
private

Definition at line 16 of file class.ilOrgUnitTreeExplorerGUI.php.


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