dolibarr  16.0.5
Public Member Functions | List of all members
Menu Class Reference

Class to manage left menus. More...

Public Member Functions

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

Detailed Description

Class to manage left menus.

Definition at line 29 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 68 of file menu.class.php.

◆ clear()

Menu::clear ( )

Clear property ->liste.

Returns
void

Definition at line 46 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 118 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.

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 91 of file menu.class.php.

◆ remove_last()

Menu::remove_last ( )

Remove a menu entry from this->liste.

Returns
void

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


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