|
| __construct (&$objectArr, $myId, $parentId, $rootId=null) |
|
& | getTree () |
|
& | getByKey ($key) |
|
| getFirstChild ($key) |
|
| getAllChild ($key, $ret=array()) |
|
| getAllParent ($key, $ret=array(), $upLevel=1) |
|
| makeSelBox ( $name, $fieldName, $prefix='-', $selected='', $addEmptyOption=false, $key=0, $extra='') |
|
| makeSelectElement ( $name, $fieldName, $prefix='-', $selected='', $addEmptyOption=false, $key=0, $extra='', $caption='') |
|
| __get ($name) |
|
◆ __construct()
__construct |
( |
& |
$objectArr, |
|
|
|
$myId, |
|
|
|
$parentId, |
|
|
|
$rootId = null |
|
) |
| |
Constructor
- Paramètres
-
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 |
◆ __get()
Magic __get method
Some modules did not respect the leading underscore is private convention and broke when code was modernized. This will keep them running for now.
- Paramètres
-
string | $name | unknown variable name requested currently only '_tree' is supported |
- Renvoie
- mixed value
◆ addSelectOptions()
addSelectOptions |
( |
|
$element, |
|
|
|
$fieldName, |
|
|
|
$key, |
|
|
|
$prefix_orig, |
|
|
|
$prefix_curr = '' |
|
) |
| |
|
protected |
Make options for a select box from
- Paramètres
-
XoopsFormSelect | $element | form element to receive tree values as options |
string | $fieldName | Name of the member variable from the node objects that should be used as the title for the options. |
int | $key | ID of the object to display as the root of select options |
string | $prefix_orig | String to indent items at deeper levels |
string | $prefix_curr | String to indent the current item |
- Renvoie
- void @access private
◆ getAllChild()
getAllChild |
( |
|
$key, |
|
|
|
$ret = array() |
|
) |
| |
returns an array of all child objects of an object specified by its id
- Paramètres
-
string | $key | ID of the parent |
array | $ret | (Empty when called from client) Array of children from previous recursions. |
- Renvoie
- array Array of child nodes.
◆ getAllParent()
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
- Paramètres
-
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 |
- Renvoie
- array Array of parent nodes.
◆ getByKey()
returns an object from the tree specified by its id
- Paramètres
-
string | $key | ID of the object to retrieve |
- Renvoie
- object Object within the tree
◆ getFirstChild()
returns an array of all the first child object of an object specified by its id
- Paramètres
-
string | $key | ID of the parent object |
- Renvoie
- array Array of children of the parent
◆ getTree()
Get the tree
- Renvoie
- array Associative array comprising the tree
◆ initialize()
Initialize the object
@access private
◆ makeSelBox()
makeSelBox |
( |
|
$name, |
|
|
|
$fieldName, |
|
|
|
$prefix = '-' , |
|
|
|
$selected = '' , |
|
|
|
$addEmptyOption = false , |
|
|
|
$key = 0 , |
|
|
|
$extra = '' |
|
) |
| |
Make a select box with options from the tree
- Paramètres
-
string | $name | Name of the select box |
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 | |
- Renvoie
- string HTML select box
- Obsolète:
- since 2.5.9, please use makeSelectElement()
◆ makeSelBoxOptions()
makeSelBoxOptions |
( |
|
$fieldName, |
|
|
|
$selected, |
|
|
|
$key, |
|
|
& |
$ret, |
|
|
|
$prefix_orig, |
|
|
|
$prefix_curr = '' |
|
) |
| |
|
protected |
Make options for a select box from
- Paramètres
-
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 |
- Renvoie
- void
- Obsolète:
- since 2.5.9, please use makeSelectElement() functionality
◆ makeSelectElement()
makeSelectElement |
( |
|
$name, |
|
|
|
$fieldName, |
|
|
|
$prefix = '-' , |
|
|
|
$selected = '' , |
|
|
|
$addEmptyOption = false , |
|
|
|
$key = 0 , |
|
|
|
$extra = '' , |
|
|
|
$caption = '' |
|
) |
| |
Make a select box with options from the tree
- Paramètres
-
string | $name | Name of the select box |
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 | extra content to add to the element |
string | $caption | optional caption for form element |
- Renvoie
- XoopsFormSelect form element
◆ $myId
◆ $objects
◆ $parentId
◆ $rootId
◆ $tree
La documentation de cette classe a été générée à partir du fichier suivant :
- XoopsCore25-2.5.11-Beta1/htdocs/class/tree.php