dolibarr 20.0.2
treeview.lib.php File Reference

Libraries for tree views. More...

Go to the source code of this file.

Functions

 tree_showpad (&$fulltree, $key, $silent=0)
 Show indent and picto of a tree line.
 
 tree_recur ($tab, $pere, $rang, $iddivjstree='iddivjstree', $donoresetalreadyloaded=0, $showfk=0, $moreparam='')
 Recursive function to output a tree.
 

Detailed Description

Libraries for tree views.

Definition in file treeview.lib.php.

Function Documentation

◆ tree_recur()

tree_recur ( $tab,
$pere,
$rang,
$iddivjstree = 'iddivjstree',
$donoresetalreadyloaded = 0,
$showfk = 0,
$moreparam = '' )

Recursive function to output a tree.

  • ...

It is also used for the tree of categories. Note: To have this function working, check you have loaded the js and css for treeview. $arrayofjs=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.js', '/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js'); $arrayofcss=array('/includes/jquery/plugins/jquerytreeview/jquery.treeview.css'); TODO Replace with jstree plugin instead of treeview plugin.

Parameters
array$tabArray of all elements
array$pereArray with parent ids ('rowid'=>,'mainmenu'=>,'leftmenu'=>,'fk_mainmenu'=>,'fk_leftmenu'=>)
int$rangLevel of element
string$iddivjstreeId to use for parent ul element
int$donoresetalreadyloadedDo not reset global array $donoresetalreadyloaded used to avoid to go down on an already processed record
int$showfk1=show fk_links to parent into label (used by menu editor only)
string$moreparamAdd more param on url of elements
Returns
void

Definition at line 120 of file treeview.lib.php.

References dol_syslog(), newToken(), and tree_recur().

Referenced by tree_recur().

◆ tree_showpad()

tree_showpad ( & $fulltree,
$key,
$silent = 0 )

Show indent and picto of a tree line.

Return array with information of line.

Parameters
array$fulltreeArray of entries in correct order
string$keyKey of entry into fulltree to show picto
int$silentDo not output indent and picto, returns only value
Returns
array{0:int,1:int,2:int} array(0 or 1 if at least one of this level after, 0 or 1 if at least one of higher level after, nbofdirinsub, nbofdocinsub)

Definition at line 37 of file treeview.lib.php.

References img_picto_common().

Referenced by treeOutputForAbsoluteDir().