16 protected $nr = array();
26 $this->list_class[0] =
"il_Explorer";
27 $this->childs[0] = array();
37 $this->item_class = $a_val;
58 $this->list_class[$a_depth] = $a_val;
68 return $this->list_class[$a_depth];
79 $this->nodes[$a_id] = $a_content;
80 $this->childs[$a_parent][] = $a_id;
90 $this->auto_numbering = $a_val;
122 $tpl =
new ilTemplate(
"tpl.nested_list.html",
true,
true,
"Services/UIComponent/NestedList");
126 if (is_array($this->childs[0]) && count($this->childs[0]) > 0)
129 foreach ($this->childs[0] as $child)
147 if (!isset(
$nr[$depth]))
159 for($i = 1; $i <= $depth; $i++)
161 $nr_str.= $sep.$nr[$i];
167 $tpl->setCurrentBlock(
"content");
168 $tpl->setVariable(
"CONTENT", $nr_str.
" ".$this->nodes[$a_id]);
169 $this->nr[$a_id] = $nr_str;
171 $tpl->parseCurrentBlock();
172 $tpl->touchBlock(
"tag");
174 if (is_array($this->childs[$a_id]) && count($this->childs[$a_id]) > 0)
177 foreach ($this->childs[$a_id] as $child)
183 unset(
$nr[$depth + 1]);
198 $tpl->setCurrentBlock(
"list_item_start");
200 $tpl->parseCurrentBlock();
204 $tpl->touchBlock(
"list_item_start");
206 $tpl->touchBlock(
"tag");
217 $tpl->touchBlock(
"list_item_end");
218 $tpl->touchBlock(
"tag");
237 $tpl->setCurrentBlock(
"list_start");
238 $tpl->setVariable(
"UL_CLASS",
' class="'.$class.
'" ');
239 $tpl->parseCurrentBlock();
243 $tpl->touchBlock(
"list_start");
245 $tpl->touchBlock(
"tag");
257 $tpl->touchBlock(
"list_end");
258 $tpl->touchBlock(
"tag");