Class ModuleMenu
License: GNU General Public License v2.0 only **********************************************************************************************
Brief:
Class manages display of menus in modules
This class manage the presentation of a module menu. You can add as many items to the menu and the class tries to display them in the perfect way for the module. If there are to many items to display all than it will create a menu button where you can find all the other menu items. The position of the items is important. Only the first items will display permanently in the module. The other items are summarized in a submenu.
Class: ModuleMenu
Code:
// get module menu $myModuleMenu = new ModuleMenu('admMenuMyModule');
// show link to create new announcement $myModuleMenu->addItem('admMenuItemNewEntry', $g_root_path.'/adm_program/modules/mymodule/mymodule_new.php', $gL10n->get('SYS_CREATE'), 'add.png'); $myModuleMenu->show(); @endcode
Par: Examples
Located at modulemenu.php
Methods summary
public
|
#
__construct( string $id, integer $maxMenuLinkItem = 6 )
creates the object of the module menu and initialize all class parameters |
public
|
#
addCategoryItem( string $id, string $categoryType, string $defaultCategory, string $link, string $text, boolean $admin = false )
Creates a selectbox with all categories of a category type. If an category of this selectbox is selected than the link is called and where you can select entries of this category |
public
|
#
addCssClass( string $className )
This method adds an additional css class to the main nav tag of the menu. |
private
|
|
public
|
|
public
|
|
public
|
|
public
integer
|
|
private
string
|
|
public
integer|false
|
|
public
|
#
insertItem( integer $position, string $id, string $link, string $text, string $icon, string $desc = '' )
inserts a new menu entry before the named position |
private
array<string,string|array>
|
|
public
string|false
|
Properties summary
protected
|
$id
|
|
protected
|
$items
|
|
protected
|
$ddItemCnt
|
|
protected
|
$rootPath
|
|
protected
|
$customCssClass
|
|
protected
|
$maxMenuLinkItem
|
|
protected
|
$ddJS
|