dolibarr 20.0.0
Menu Class Reference

Class to manage left menus. More...

Public Member Functions

 __construct ()
 Constructor.
 
 clear ()
 Clear property ->liste.
 
 add ($url, $titre, $level=0, $enabled=1, $target='', $mainmenu='', $leftmenu='', $position=0, $id='', $idsel='', $classname='', $prefix='')
 Add a menu entry into this->liste (at end)
 
 insert ($idafter, $url, $titre, $level=0, $enabled=1, $target='', $mainmenu='', $leftmenu='', $position=0, $id='', $idsel='', $classname='', $prefix='')
 Insert a menu entry into this->liste (after $idafter)
 
 remove_last ()
 Remove a menu entry from this->liste.
 
 getNbOfVisibleMenuEntries ()
 Return number of visible entries (gray or not)
 

Detailed Description

Class to manage left menus.

Definition at line 30 of file menu.class.php.

Member Function Documentation

◆ add()

Menu::add ( $url,
$titre,
$level = 0,
$enabled = 1,
$target = '',
$mainmenu = '',
$leftmenu = '',
$position = 0,
$id = '',
$idsel = '',
$classname = '',
$prefix = '' )

Add a menu entry into this->liste (at end)

Parameters
string$urlUrl to follow on click (does not include DOL_URL_ROOT)
string$titreLabel of menu to add. The value must already be translated.
integer$levelLevel of menu to add
int$enabledMenu active or not (0=Not active, 1=Active, 2=Active but grey)
string$targetTarget link
string$mainmenuMain menu ('home', 'companies', 'products', ...)
string$leftmenuLeft menu ('setup', 'system', 'admintools', ...)
int$positionPosition (not used yet)
string$idId
string$idselId sel
string$classnameClass name
string$prefixPrefix to title (image or picto)
Returns
void

Definition at line 74 of file menu.class.php.

◆ clear()

Menu::clear ( )

Clear property ->liste.

Returns
void

Definition at line 52 of file menu.class.php.

◆ getNbOfVisibleMenuEntries()

Menu::getNbOfVisibleMenuEntries ( )

Return number of visible entries (gray or not)

Returns
int Number of visible (gray or not) menu entries

Definition at line 124 of file menu.class.php.

◆ insert()

Menu::insert ( $idafter,
$url,
$titre,
$level = 0,
$enabled = 1,
$target = '',
$mainmenu = '',
$leftmenu = '',
$position = 0,
$id = '',
$idsel = '',
$classname = '',
$prefix = '' )

Insert a menu entry into this->liste (after $idafter)

Parameters
int$idafterArray key after which inserting new entry
string$urlUrl to follow on click
string$titreLabel of menu to add. The value must already be translated.
integer$levelLevel of menu to add
int$enabledMenu active or not
string$targetTarget link
string$mainmenuMain menu ('home', 'companies', 'products', ...)
string$leftmenuLeft menu ('setup', 'system', 'admintools', ...)
int$positionPosition (not used yet)
string$idId
string$idselId sel
string$classnameClass name
string$prefixPrefix to title (image or picto)
Returns
void

Definition at line 97 of file menu.class.php.

◆ remove_last()

Menu::remove_last ( )

Remove a menu entry from this->liste.

Returns
void

Definition at line 111 of file menu.class.php.


The documentation for this class was generated from the following file: