dolibarr 21.0.0-alpha
|
Class to manage menu entries. More...
Public Member Functions | |
__construct ($db, $menu_handler='') | |
Constructor. | |
create ($user=null) | |
Create menu entry into database. | |
update ($user=null, $notrigger=0) | |
Update menu entry into database. | |
fetch ($id, $user=null) | |
Load object in memory from database. | |
delete ($user) | |
Delete object in database. | |
initAsSpecimen () | |
Initialise an instance with random values. | |
menuTopCharger ($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) | |
Load tabMenu array with top menu entries found into database. | |
menuLeftCharger ($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) | |
Load entries found from database (and stored into $tabMenu) in $this->newmenu array. | |
menuLoad ($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu) | |
Load entries found in database into variable $tabMenu. | |
Private Member Functions | |
recur ($tab, $pere, $level) | |
Complete this->newmenu with menu entry found in $tab. | |
Class to manage menu entries.
Definition at line 31 of file menubase.class.php.
Menubase::__construct | ( | $db, | |
$menu_handler = '' ) |
Constructor.
Definition at line 166 of file menubase.class.php.
Menubase::create | ( | $user = null | ) |
Create menu entry into database.
Definition at line 179 of file menubase.class.php.
References dol_print_error(), dol_syslog(), position, type, and user.
Menubase::delete | ( | $user | ) |
Delete object in database.
Definition at line 459 of file menubase.class.php.
References dol_syslog().
Menubase::fetch | ( | $id, | |
$user = null ) |
Load object in memory from database.
Definition at line 387 of file menubase.class.php.
References dol_syslog(), position, type, and user.
Menubase::initAsSpecimen | ( | ) |
Menubase::menuLeftCharger | ( | $newmenu, | |
$mymainmenu, | |||
$myleftmenu, | |||
$type_user, | |||
$menu_handler, | |||
& | $tabMenu ) |
Load entries found from database (and stored into $tabMenu) in $this->newmenu array.
Warning: Entries in $tabMenu must have child after parent
Menu | $newmenu | Menu array to complete (in most cases, it's empty, may be already initialized with some menu manager like eldy) |
string | $mymainmenu | Value for mainmenu to filter menu to load (often $_SESSION["mainmenu"]) |
string | $myleftmenu | Value for leftmenu to filter menu to load (always '') |
int | $type_user | 0=Menu for backoffice, 1=Menu for front office |
string | $menu_handler | Filter on name of menu_handler used (auguria, eldy...) |
array<array{rowid:string,fk_menu:string,module:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> | $tabMenu Array with menu entries already loaded |
Definition at line 548 of file menubase.class.php.
References dol_syslog(), and recur().
Menubase::menuLoad | ( | $mymainmenu, | |
$myleftmenu, | |||
$type_user, | |||
$menu_handler, | |||
& | $tabMenu ) |
Load entries found in database into variable $tabMenu.
Note that only "database menu entries" are loaded here, hardcoded will not be present into output.
string | $mymainmenu | Value for mainmenu that defined mainmenu |
string | $myleftmenu | Value for left that defined leftmenu |
int | $type_user | Looks for menu entry for 0=Internal users, 1=External users |
string | $menu_handler | Name of menu_handler used ('auguria', 'eldy'...) |
array<array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> | $tabMenu Array to store new entries found (in most cases, it's empty, but may be already filled) |
Definition at line 630 of file menubase.class.php.
References dol_print_error(), make_substitutions(), and verifCond().
Menubase::menuTopCharger | ( | $mymainmenu, | |
$myleftmenu, | |||
$type_user, | |||
$menu_handler, | |||
& | $tabMenu ) |
Load tabMenu array with top menu entries found into database.
string | $mymainmenu | Value for mainmenu to filter menu to load (always '') |
string | $myleftmenu | Value for leftmenu to filter menu to load (always '') |
int | $type_user | 0=Menu for backoffice, 1=Menu for front office |
string | $menu_handler | Filter on name of menu_handler used (auguria, eldy...) |
array<array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> | $tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty) |
Definition at line 518 of file menubase.class.php.
|
private |
Complete this->newmenu with menu entry found in $tab.
array<array{rowid:string,fk_menu:string,langs:string,enabled:int<0,2>,type:string,fk_mainmenu:string,fk_leftmenu:string,url:string,titre:string,perms:string,target:string,mainmenu:string,leftmenu:string,position:int,level?:int,prefix:string}> | $tab Tab array with all menu entries | |
int | $pere | Id of parent |
int | $level | Level |
Definition at line 763 of file menubase.class.php.
References recur().
Referenced by menuLeftCharger(), and recur().
Menubase::update | ( | $user = null, | |
$notrigger = 0 ) |
Update menu entry into database.
Definition at line 322 of file menubase.class.php.
References dol_syslog(), position, type, and user.