ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilNestedList Class Reference

Nested List. More...

+ Collaboration diagram for ilNestedList:

Public Member Functions

 __constructor ()
 Constructor.
 setItemClass ($a_val)
 Set li class.
 getItemClass ()
 Get li class.
 setListClass ($a_val)
 Set list class.
 getListClass ()
 Get list class.
 addListNode ($a_content, $a_id, $a_parent=0)
 Add list node.
 getHTML ()
 Get HTML.
 renderNode ($a_id, $tpl)
 Render node.
 listItemStart ($tpl)
 List item start.
 listItemEnd ($tpl)
 List item end.
 listStart ($tpl)
 List start.
 listEnd ($tpl)
 List end.

Data Fields

 $item_class = "il_Explorer"
 $list_class = "il_Explorer"

Detailed Description

Nested List.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 11 of file class.ilNestedList.php.

Member Function Documentation

ilNestedList::__constructor ( )

Constructor.

Parameters
@return

Definition at line 22 of file class.ilNestedList.php.

{
$this->childs[0] = array();
}
ilNestedList::addListNode (   $a_content,
  $a_id,
  $a_parent = 0 
)

Add list node.

Parameters
@return

Definition at line 73 of file class.ilNestedList.php.

{
$this->nodes[$a_id] = $a_content;
$this->childs[$a_parent][] = $a_id;
}
ilNestedList::getHTML ( )

Get HTML.

Parameters
@return

Definition at line 85 of file class.ilNestedList.php.

References $tpl, listEnd(), listStart(), and renderNode().

{
$tpl = new ilTemplate("tpl.nested_list.html", true, true, "Services/UIComponent/NestedList");
if (is_array($this->childs[0]) && count($this->childs[0]) > 0)
{
$this->listStart($tpl);
foreach ($this->childs[0] as $child)
{
$this->renderNode($child, $tpl);
}
$this->listEnd($tpl);
}
return $tpl->get();
}

+ Here is the call graph for this function:

ilNestedList::getItemClass ( )

Get li class.

Returns
string li class

Definition at line 42 of file class.ilNestedList.php.

References $item_class.

Referenced by listItemStart().

{
}

+ Here is the caller graph for this function:

ilNestedList::getListClass ( )

Get list class.

Returns
string list class

Definition at line 62 of file class.ilNestedList.php.

References $list_class.

Referenced by listStart().

{
}

+ Here is the caller graph for this function:

ilNestedList::listEnd (   $tpl)

List end.

Parameters
@return

Definition at line 191 of file class.ilNestedList.php.

References $tpl.

Referenced by getHTML(), and renderNode().

{
//echo "<br>listEnd";
$tpl->touchBlock("list_end");
$tpl->touchBlock("tag");
}

+ Here is the caller graph for this function:

ilNestedList::listItemEnd (   $tpl)

List item end.

Parameters
@return

Definition at line 157 of file class.ilNestedList.php.

References $tpl.

Referenced by renderNode().

{
$tpl->touchBlock("list_item_end");
$tpl->touchBlock("tag");
}

+ Here is the caller graph for this function:

ilNestedList::listItemStart (   $tpl)

List item start.

Parameters
@return

Definition at line 136 of file class.ilNestedList.php.

References $tpl, and getItemClass().

Referenced by renderNode().

{
if ($this->getItemClass() != "")
{
$tpl->setCurrentBlock("list_item_start");
$tpl->setVariable("LI_CLASS", ' class="'.$this->getItemClass().'" ');
$tpl->parseCurrentBlock();
}
else
{
$tpl->touchBlock("list_item_start");
}
$tpl->touchBlock("tag");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNestedList::listStart (   $tpl)

List start.

Parameters
@return

Definition at line 169 of file class.ilNestedList.php.

References $tpl, and getListClass().

Referenced by getHTML(), and renderNode().

{
//echo "<br>listStart";
if ($this->getListClass() != "")
{
$tpl->setCurrentBlock("list_start");
$tpl->setVariable("UL_CLASS", ' class="'.$this->getListClass().'" ');
$tpl->parseCurrentBlock();
}
else
{
$tpl->touchBlock("list_start");
}
$tpl->touchBlock("tag");
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNestedList::renderNode (   $a_id,
  $tpl 
)

Render node.

Parameters
@return

Definition at line 108 of file class.ilNestedList.php.

References $tpl, listEnd(), listItemEnd(), listItemStart(), and listStart().

Referenced by getHTML().

{
$tpl->setCurrentBlock("content");
$tpl->setVariable("CONTENT", $this->nodes[$a_id]);
//echo "<br>".$this->nodes[$a_id];
$tpl->parseCurrentBlock();
$tpl->touchBlock("tag");
if (is_array($this->childs[$a_id]) && count($this->childs[$a_id]) > 0)
{
$this->listStart($tpl);
foreach ($this->childs[$a_id] as $child)
{
$this->renderNode($child, $tpl);
}
$this->listEnd($tpl);
}
$this->listItemEnd($tpl);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilNestedList::setItemClass (   $a_val)

Set li class.

Parameters
stringli class

Definition at line 32 of file class.ilNestedList.php.

{
$this->item_class = $a_val;
}
ilNestedList::setListClass (   $a_val)

Set list class.

Parameters
stringlist class

Definition at line 52 of file class.ilNestedList.php.

{
$this->list_class = $a_val;
}

Field Documentation

ilNestedList::$item_class = "il_Explorer"

Definition at line 13 of file class.ilNestedList.php.

Referenced by getItemClass().

ilNestedList::$list_class = "il_Explorer"

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

Referenced by getListClass().


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