TreeView
Version 2.0
Description:
This component class is used to create a tree with
expandable nodes.
Usage:
e.g. include(“path/to/tree_view.php”)
e.g. $TreeView = new TreeView;
The name of the style sheet class
that defines the styles for the tree.
The relative path to the tree images.
If true, checkboxes will be
written for use in submitting a form.
The query string to append to each of the expand node
URLs.
0 = Text only
1 = Defined icons and text
2 = Plus\minus images and text
3 = Plus\minus images, icons, and
text
4 = Tree lines, plus\minus images,
text
5 = Tree lines, plus\minus images,
icons, text
If true, the entire tree will be output to the browser and
DHTML will be used to expand and collapse the tree, without refreshing the
page.
If true, the tree uses PHP session variables instead of
query string variables to keep track of the nodes that are open in the tree.
e.g.
$TreeView->Nodes-> addNode
($strParentKey,
$intRelationship, $strKey,
$strText, $strImage, $strExpandedImage, $strURL, $strTarget, $strCaption);
Where the given variables are defined as the following:
strParentKey the parent node key of which this
node is a child
intRelationship (1) if root, (2) otherwise
strKey the unique key of this node
strText the node's text string or title to display in the
tree
strImage the filename and extension of the image
strExpandedImage the
filename and extension of the image when the node is expanded
strURL the address of the file to
retrieve when the node is clicked
strTarget the frame name for the URL to be
displayed
strCaption the text to display when the mouse
hovers over the link
NOTE: This must be done before each node that is
desired to change style is added.
The hexadecimal
color code for the text of the node.
The hexadecimal
color code for the text of the node.
If true, the node’s text will be
bolded.
e.g.
$TreeView->Show();