Location: PHPKode > scripts > Tree > tree/Tree.html
<HTML>
<HEAD>
<TITLE> Tree Class </TITLE>
</HEAD>
<BODY> <HR color="NAVY">
<H1><FONT COLOR="RED" >Tree Class </FONT></H1>
<HR color="NAVY">
<H2><FONT COLOR="NAVY">Description:</FONT> </H2>
<FONT COLOR="NAVY">This class displays data on a hierarchical tree. It can be used to represent an organizational chart.</FONT>
<H2><FONT COLOR="NAVY">Methods:</FONT> </H2>
<TABLE BORDER="1">
<TR><TD>
<H3><FONT COLOR="NAVY"><PRE>AddNode($node, $owner)</FONT> </H3>
</TD><TD><FONT COLOR="NAVY"> This method add a node to the istance of the class. The first parameter is the node name, the second is the father's  name, that is the name of the node which the node you want to add belongs to.
The node name must be unique.</FONT>
</TD>
</TR>
<TR><TD>
<H3><FONT COLOR="NAVY"><PRE>isUnique($nodename)</FONT> </H3>
</TD><TD><FONT COLOR="NAVY"> This method checks if the node name you want to add is unique. The parameter is the node name. It returns the string value "yes" or "not".
</FONT>
</TD>
</TR>
<TR><TD>
<H3><FONT COLOR="NAVY"><PRE>GetChild($owner)</FONT> </H3>
</TD><TD><FONT COLOR="NAVY"> This method returns the child/children of a node. The parameter is the node name you want to examine. 
</FONT>
</TD>
</TR>
<TR><TD>
<H3><FONT COLOR="NAVY"><PRE>Parents()</FONT> </H3>
</TD><TD><FONT COLOR="NAVY"> This method returns an array containing the nodes which are parents of other nodes.  
</FONT>
</TD>
</TR>
<TR><TD>
<H3><FONT COLOR="NAVY"><PRE>isFirstLevel($nodename)</FONT> </H3>
</TD><TD><FONT COLOR="NAVY"> This method checks if a node is First Level, that is it has no parent. The parameter is the node name. It returns the string value "yes" or "not". 
</FONT>
</TD>
</TR>
<TR><TD>
<H3><FONT COLOR="NAVY"><PRE>getFather($node)</FONT> </H3>
</TD><TD><FONT COLOR="NAVY"> This method returns a string value containing the name of the parent of the node you specified. The parameter is the node name.  
</FONT>
</TD>
</TR>
<TR><TD>
<H3><FONT COLOR="NAVY"><PRE>drawTree()</FONT> </H3>
</TD><TD><FONT COLOR="NAVY"> This method displays the hierarchical tree you have built. Override this method (or alter the last part of it) if you want to change the way the tree is displayed.  
</FONT>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
Return current item: Tree