XOOPS API 2.5.11 Beta1  UI v0.5
Réalisé par monxoops.fr
Référence de la classe XoopsObjectTree

Fonctions membres publiques

 __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)
 

Fonctions membres protégées

 initialize ()
 
 makeSelBoxOptions ($fieldName, $selected, $key, &$ret, $prefix_orig, $prefix_curr='')
 
 addSelectOptions ($element, $fieldName, $key, $prefix_orig, $prefix_curr='')
 

Attributs protégés

 $parentId
 
 $myId
 
 $rootId
 
 $tree = array()
 
 $objects
 

Documentation des constructeurs et destructeur

◆ __construct()

__construct ( $objectArr,
  $myId,
  $parentId,
  $rootId = null 
)

Constructor

Paramètres
array$objectArrArray of XoopsObjects
string$myIdfield name of object ID
string$parentIdfield name of parent object ID
string$rootIdfield name of root object ID
+ Voici le graphe d'appel pour cette fonction :

Documentation des fonctions membres

◆ __get()

__get (   $name)

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$nameunknown 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$elementform element to receive tree values as options
string$fieldNameName of the member variable from the node objects that should be used as the title for the options.
int$keyID of the object to display as the root of select options
string$prefix_origString to indent items at deeper levels
string$prefix_currString to indent the current item
Renvoie
void @access private
+ Voici le graphe des appelants de cette fonction :

◆ getAllChild()

getAllChild (   $key,
  $ret = array() 
)

returns an array of all child objects of an object specified by its id

Paramètres
string$keyID 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$keyID 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()

& getByKey (   $key)

returns an object from the tree specified by its id

Paramètres
string$keyID of the object to retrieve
Renvoie
object Object within the tree

◆ getFirstChild()

getFirstChild (   $key)

returns an array of all the first child object of an object specified by its id

Paramètres
string$keyID of the parent object
Renvoie
array Array of children of the parent

◆ getTree()

& getTree ( )

Get the tree

Renvoie
array Associative array comprising the tree

◆ initialize()

initialize ( )
protected

Initialize the object

@access private

+ Voici le graphe des appelants de cette fonction :

◆ makeSelBox()

makeSelBox (   $name,
  $fieldName,
  $prefix = '-',
  $selected = '',
  $addEmptyOption = false,
  $key = 0,
  $extra = '' 
)

Make a select box with options from the tree

Paramètres
string$nameName of the select box
string$fieldNameName of the member variable from the node objects that should be used as the title for the options.
string$prefixString to indent deeper levels
string$selectedValue to display as selected
bool$addEmptyOptionSet TRUE to add an empty option with value "0" at the top of the hierarchy
integer$keyID 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()
+ Voici le graphe d'appel pour cette fonction :

◆ makeSelBoxOptions()

makeSelBoxOptions (   $fieldName,
  $selected,
  $key,
$ret,
  $prefix_orig,
  $prefix_curr = '' 
)
protected

Make options for a select box from

Paramètres
string$fieldNameName of the member variable from the node objects that should be used as the title for the options.
string$selectedValue to display as selected
int$keyID 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_origString to indent items at deeper levels
string$prefix_currString to indent the current item
Renvoie
void
Obsolète:
since 2.5.9, please use makeSelectElement() functionality
+ Voici le graphe des appelants de cette fonction :

◆ makeSelectElement()

makeSelectElement (   $name,
  $fieldName,
  $prefix = '-',
  $selected = '',
  $addEmptyOption = false,
  $key = 0,
  $extra = '',
  $caption = '' 
)

Make a select box with options from the tree

Paramètres
string$nameName of the select box
string$fieldNameName of the member variable from the node objects that should be used as the title for the options.
string$prefixString to indent deeper levels
string$selectedValue to display as selected
bool$addEmptyOptionSet TRUE to add an empty option with value "0" at the top of the hierarchy
integer$keyID of the object to display as the root of select options
string$extraextra content to add to the element
string$captionoptional caption for form element
Renvoie
XoopsFormSelect form element
+ Voici le graphe d'appel pour cette fonction :

Documentation des champs

◆ $myId

$myId
protected

◆ $objects

$objects
protected

◆ $parentId

$parentId
protected

@access private

◆ $rootId

$rootId
protected

◆ $tree

$tree = array()
protected

La documentation de cette classe a été générée à partir du fichier suivant :