30 protected array
$nr = array();
36 $this->list_class[0] =
"il_Explorer";
37 $this->childs[0] = array();
43 $this->item_class = $a_val;
52 public function setListClass(
string $a_val,
int $a_depth = 0): void
54 $this->list_class[$a_depth] = $a_val;
59 return $this->list_class[$a_depth] ??
"";
67 $this->nodes[$a_id] = $a_content;
68 $this->childs[$a_parent][] = $a_id;
73 $this->auto_numbering = $a_val;
88 $tpl =
new ilTemplate(
"tpl.nested_list.html",
true,
true,
"components/ILIAS/UIComponent/NestedList");
92 if (isset($this->childs[0]) && count($this->childs[0]) > 0) {
94 foreach ($this->childs[0] as $child) {
109 if (!isset($nr[$depth])) {
117 for ($i = 1; $i <= $depth; $i++) {
118 $nr_str .= $sep . $nr[$i];
125 $tpl->
setVariable(
"CONTENT", $nr_str .
" " . $this->nodes[$a_id]);
126 $this->nr[$a_id] = $nr_str;
131 if (isset($this->childs[$a_id]) && count($this->childs[$a_id]) > 0) {
133 foreach ($this->childs[$a_id] as $child) {
134 $this->
renderNode($child, $tpl, $depth + 1, $nr);
138 unset($nr[$depth + 1]);
171 $tpl->
setVariable(
"UL_CLASS",
' class="' . $class .
'" ');
parseCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
listItemStart(ilTemplate $tpl)
setListClass(string $a_val, int $a_depth=0)
renderNode( $a_id, ilTemplate $tpl, int $depth, array &$nr)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
addListNode(string $a_content, string $a_id, $a_parent=0)
touchBlock(string $block)
setAutoNumbering(bool $a_val)
setVariable($variable, $value='')
Sets a variable value.
listStart(ilTemplate $tpl, int $depth)
listItemEnd(ilTemplate $tpl)
setCurrentBlock(string $part=ilGlobalTemplateInterface::DEFAULT_BLOCK)
getListClass(int $a_depth=0)
setItemClass(string $a_val)