|
| __construct (&$objectArr, $myId, $parentId, $rootId=null) |
|
| _makeArrayTreeOptions ($fieldName, $key, &$ret, $prefix_orig, $prefix_curr= '') |
|
| getAllChild ($key, $ret=array()) |
|
| getAllParent ($key, $ret=array(), $uplevel=1) |
|
| getByKey ($key) |
|
| getFirstChild ($key) |
|
| getTree () |
|
| makeArrayTree ($fieldName, $prefix= '-', $key=0) |
|
| makeSelBox ($name, $fieldName, $prefix= '-', $selected= '', $addEmptyOption=false, $key=0, $extra= '') |
|
Definition at line 30 of file tree.php.
XoopsObjectTree::__construct |
( |
& |
$objectArr, |
|
|
|
$myId, |
|
|
|
$parentId, |
|
|
|
$rootId = null |
|
) |
| |
Constructor
- Parameters
-
array | $objectArr | Array of XoopsObjects |
string | $myId | field name of object ID |
string | $parentId | field name of parent object ID |
string | $rootId | field name of root object ID |
Definition at line 65 of file tree.php.
References _initialize().
XoopsObjectTree::_initialize |
( |
| ) |
|
|
private |
XoopsObjectTree::_makeArrayTreeOptions |
( |
|
$fieldName, |
|
|
|
$key, |
|
|
& |
$ret, |
|
|
|
$prefix_orig, |
|
|
|
$prefix_curr = '' |
|
) |
| |
Make a array with options from the tree
- Parameters
-
string | $fieldName | Name of the member variable from the node objects that should be used as the column. |
integer | $key | ID of the object to display as the root of the array |
string | $prefix_orig | String to indent deeper levels (origin) |
string | $prefix_curr | String to indent deeper levels (current) |
- Returns
- void
Definition at line 258 of file tree.php.
Referenced by makeArrayTree().
XoopsObjectTree::_makeSelBoxOptions |
( |
|
$fieldName, |
|
|
|
$selected, |
|
|
|
$key, |
|
|
& |
$ret, |
|
|
|
$prefix_orig, |
|
|
|
$prefix_curr = '' |
|
) |
| |
|
private |
Make options for a select box from
- Parameters
-
string | $fieldName | Name of the member variable from the node objects that should be used as the title for the options. |
string | $selected | Value to display as selected |
int | $key | ID of the object to display as the root of select options |
string | $ret | (reference to a string when called from outside) Result from previous recursions |
string | $prefix_orig | String to indent items at deeper levels |
string | $prefix_curr | String to indent the current item |
- Returns
- void
Definition at line 189 of file tree.php.
Referenced by makeSelBox().
XoopsObjectTree::getAllChild |
( |
|
$key, |
|
|
|
$ret = array() |
|
) |
| |
returns an array of all child objects of an object specified by its id
- Parameters
-
string | $key | ID of the parent |
array | $ret | (Empty when called from client) Array of children from previous recursions. |
- Returns
- array Array of child nodes.
Definition at line 141 of file tree.php.
XoopsObjectTree::getAllParent |
( |
|
$key, |
|
|
|
$ret = array() , |
|
|
|
$uplevel = 1 |
|
) |
| |
returns an array of all parent objects. the key of returned array represents how many levels up from the specified object
- Parameters
-
string | $key | ID of the child object |
array | $ret | (empty when called from outside) Result from previous recursions |
int | $uplevel | (empty when called from outside) level of recursion |
- Returns
- array Array of parent nodes.
Definition at line 164 of file tree.php.
XoopsObjectTree::getByKey |
( |
|
$key | ) |
|
returns an object from the tree specified by its id
- Parameters
-
string | $key | ID of the object to retrieve |
- Returns
- object Object within the tree
Definition at line 112 of file tree.php.
XoopsObjectTree::getFirstChild |
( |
|
$key | ) |
|
returns an array of all the first child object of an object specified by its id
- Parameters
-
string | $key | ID of the parent object |
- Returns
- array Array of children of the parent
Definition at line 123 of file tree.php.
XoopsObjectTree::getTree |
( |
| ) |
|
Get the tree
- Returns
- array Associative array comprising the tree
Definition at line 101 of file tree.php.
References $_tree.
XoopsObjectTree::makeArrayTree |
( |
|
$fieldName, |
|
|
|
$prefix = '-' , |
|
|
|
$key = 0 |
|
) |
| |
Make options for a array
- Parameters
-
string | $fieldName | Name of the member variable from the node objects that should be used as the column. |
string | $prefix | String to indent deeper levels |
integer | $key | ID of the object to display as the root of the array |
- Returns
- array
Definition at line 241 of file tree.php.
References _makeArrayTreeOptions().
XoopsObjectTree::makeSelBox |
( |
|
$name, |
|
|
|
$fieldName, |
|
|
|
$prefix = '-' , |
|
|
|
$selected = '' , |
|
|
|
$addEmptyOption = false , |
|
|
|
$key = 0 , |
|
|
|
$extra = '' |
|
) |
| |
Make a select box with options from the tree
- Parameters
-
string | $fieldName | Name of the member variable from the node objects that should be used as the title for the options. |
string | $prefix | String to indent deeper levels |
string | $selected | Value to display as selected |
bool | $addEmptyOption | Set TRUE to add an empty option with value "0" at the top of the hierarchy |
integer | $key | ID of the object to display as the root of select options |
string | $extra | |
string | $name | |
- Returns
- string HTML select box
Definition at line 222 of file tree.php.
References $name, and _makeSelBoxOptions().
XoopsObjectTree::$_objects |
|
private |
XoopsObjectTree::$_parentId |
|
private |
XoopsObjectTree::$_rootId = null |
|
private |
XoopsObjectTree::$_tree = array() |
|
private |
The documentation for this class was generated from the following file: