20 $this->root_unit = $a_root_unit;
22 $this->tpl =
new ilTemplate(
'tpl.org_unit_tree_explorer.html',
true,
true,
'Services/OrgUnit');
31 $this->tpl->setCurrentBlock(
'exp_item_begin');
32 $this->tpl->setVariable(
'CLASSNAME',
'depth_'.$a_depth);
33 $this->tpl->parseCurrentBlock();
35 for($i = 1; $i < $a_depth; $i++)
37 $this->tpl->setCurrentBlock(
'exp_item_indent');
38 $this->tpl->touchBlock(
'exp_item_indent');
39 $this->tpl->parseCurrentBlock();
42 $this->tpl->setCurrentBlock(
'exp_item_icon');
44 $this->tpl->parseCurrentBlock();
48 $this->tpl->setCurrentBlock(
'exp_item_title');
49 $this->tpl->setVariable(
'ITEM_TITLE', $lng->txt(
'org_unit_tree_root'));
50 $this->tpl->parseCurrentBlock();
54 $this->tpl->setCurrentBlock(
'exp_item_title');
55 $this->tpl->setVariable(
'ITEM_TITLE', $a_unit->
getTitle());
56 $this->tpl->parseCurrentBlock();
58 $this->tpl->setCurrentBlock(
'exp_item_subtitle');
59 $this->tpl->setVariable(
'ITEM_SUBTITLE', $a_unit->
getSubTitle());
60 $this->tpl->parseCurrentBlock();
63 $this->tpl->setCurrentBlock(
'explorer');
64 $this->tpl->parseCurrentBlock();
66 #$assigned_users = $a_unit->getAssignedUsers();
67 $assigned_users = array();
68 if( count($assigned_users) )
70 $this->tpl->setCurrentBlock(
'exp_list_begin');
71 $this->tpl->setVariable(
'CLASSNAME',
'depth_'.($a_depth + 1));
72 $this->tpl->parseCurrentBlock();
74 $this->tpl->setCurrentBlock(
'explorer');
75 $this->tpl->parseCurrentBlock();
77 foreach($assigned_users as $user_id => $properties)
81 $this->tpl->setCurrentBlock(
'exp_item_begin');
82 $this->tpl->setVariable(
'CLASSNAME',
'depth_'.($a_depth + 1));
83 $this->tpl->parseCurrentBlock();
85 for($i = 1; $i < ($a_depth + 1); $i++)
87 $this->tpl->setCurrentBlock(
'exp_item_indent');
88 $this->tpl->touchBlock(
'exp_item_indent');
89 $this->tpl->parseCurrentBlock();
92 $this->tpl->setCurrentBlock(
'exp_item_icon');
94 $this->tpl->parseCurrentBlock();
96 $this->tpl->setCurrentBlock(
'exp_item_title');
97 $this->tpl->setVariable(
'ITEM_TITLE', $user->getLastName().
', '.$user->getFirstName());
98 $this->tpl->parseCurrentBlock();
100 $this->tpl->setCurrentBlock(
'exp_item_end');
101 $this->tpl->touchBlock(
'exp_item_end');
102 $this->tpl->parseCurrentBlock();
104 $this->tpl->setCurrentBlock(
'explorer');
105 $this->tpl->parseCurrentBlock();
108 $this->tpl->setCurrentBlock(
'exp_list_end');
109 $this->tpl->touchBlock(
'exp_list_end');
110 $this->tpl->parseCurrentBlock();
112 $this->tpl->setCurrentBlock(
'explorer');
113 $this->tpl->parseCurrentBlock();
118 $this->tpl->setCurrentBlock(
'exp_list_begin');
119 $this->tpl->setVariable(
'CLASSNAME',
'depth_'.($a_depth + 1));
120 $this->tpl->parseCurrentBlock();
122 $this->tpl->setCurrentBlock(
'explorer');
123 $this->tpl->parseCurrentBlock();
125 foreach($a_unit->
getChilds() as $child_unit)
127 $this->
renderUnit( $child_unit, ($a_depth + 1) );
130 $this->tpl->setCurrentBlock(
'exp_list_end');
131 $this->tpl->touchBlock(
'exp_list_end');
132 $this->tpl->parseCurrentBlock();
134 $this->tpl->setCurrentBlock(
'explorer');
135 $this->tpl->parseCurrentBlock();
138 $this->tpl->setCurrentBlock(
'exp_item_end');
139 $this->tpl->touchBlock(
'exp_item_end');
140 $this->tpl->parseCurrentBlock();
142 $this->tpl->setCurrentBlock(
'explorer');
143 $this->tpl->parseCurrentBlock();
150 $this->tpl->setCurrentBlock(
'exp_list_begin');
151 $this->tpl->setVariable(
'CLASSNAME',
'depth_'.$depth);
152 $this->tpl->parseCurrentBlock();
154 $this->tpl->setCurrentBlock(
'explorer');
155 $this->tpl->parseCurrentBlock();
159 $this->tpl->setCurrentBlock(
'exp_list_end');
160 $this->tpl->touchBlock(
'exp_list_end');
161 $this->tpl->parseCurrentBlock();
163 $this->tpl->setCurrentBlock(
'explorer');
164 $this->tpl->parseCurrentBlock();
166 $html = $this->tpl->get();