Admidio API
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Packages

  • com
    • tecnick
      • tcpdf
  • None
  • PHPMailer
    • easypeasyics
  • PHPWavUtils
  • Securimage
    • classes

Classes

  • AutoLogin
  • Component
  • ComponentUpdate
  • ConditionParser
  • Database
  • DateTimeExtended
  • Email
  • Folder
  • FormValidation
  • FunctionClass
  • Htaccess
  • HtmlDiv
  • HtmlElement
  • HtmlForm
  • HtmlFormBasic
  • HtmlFormInstallation
  • HtmlList
  • HtmlNavbar
  • HtmlPage
  • HtmlTable
  • HtmlTableBasic
  • Image
  • Inventory
  • InventoryFields
  • Language
  • LanguageData
  • ListConfiguration
  • Menu
  • Message
  • ModuleAnnouncements
  • ModuleDates
  • ModuleLists
  • ModuleMenu
  • ModuleMessages
  • Modules
  • ModuleWeblinks
  • MyFiles
  • Navigation
  • ntlm_sasl_client_class
  • Organization
  • Participants
  • PasswordHash
  • PasswordHashing
  • ProfileFields
  • RoleDependency
  • RolesRights
  • RSSfeed
  • Session
  • SystemMail
  • TableAccess
  • TableAnnouncement
  • TableCategory
  • TableDate
  • TableFile
  • TableFolder
  • TableGuestbook
  • TableGuestbookComment
  • TableInventory
  • TableInventoryField
  • TableLists
  • TableMembers
  • TableMessage
  • TablePhotos
  • TableRoles
  • TableRooms
  • TableText
  • TableUserField
  • TableUsers
  • TableWeblink
  • UploadHandlerDownload
  • UploadHandlerPhoto
  • User
  • UserRegistration

Exceptions

  • AdmException
  • WavFileException
  • WavFormatException

Functions

  • admFuncAutoload
  • admFuncGeneratePagination
  • admFuncGetBytesFromSize
  • admFuncGetDirectoryEntries
  • admFuncMaxUploadSize
  • admFuncProcessableImageSize
  • admFuncShowCreateChangeInfoById
  • admFuncShowCreateChangeInfoByName
  • admFuncVariableIsValid
  • admReadTemplateFile
  • admStrIsValidFileName
  • admStrStripTagsSpecial
  • admStrToLower
  • admStrToUpper
  • bzip2Version
  • checkDatabaseVersion
  • checkPhpVersion
  • EmailAttachment
  • FileSizeNiceDisplay
  • FormattedTimeRemaining
  • FunctionIsDisabled
  • getFormerRolesFromDatabase
  • getFutureRolesFromDatabase
  • getmicrotime
  • getRoleMemberships
  • getRolesFromDatabase
  • gzipVersion
  • hasRole
  • hl_attrval
  • hl_bal
  • hl_cmtcd
  • hl_ent
  • hl_prot
  • hl_regex
  • hl_spec
  • hl_tag
  • hl_tag2
  • hl_tidy
  • hl_version
  • htmLawed
  • HTMLFilter
  • isGroupLeader
  • isMember
  • kses
  • kses_hook
  • MySQLdumpVersion
  • OutputInformation
  • SafeExec
  • showNotice
  • strAddSlashesDeep
  • strNextLetter
  • strStripSlashesDeep
  • strStripTags
  • strValidCharacters
  • tln_body2div
  • tln_casenormalize
  • tln_deent
  • tln_defang
  • tln_findnxreg
  • tln_findnxstr
  • tln_fixatts
  • tln_fixstyle
  • tln_fixurl
  • tln_getnxtag
  • tln_sanitize
  • tln_skipspace
  • tln_tagprint
  • tln_unspace
  • version_compare_replacement
  • version_compare_replacement_sub

Class ModuleMenu

Copyright: 2004-2016 The Admidio Team
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

creates the object of the module menu and initialize all class parameters

Parameters

$id
Html id of the module menu
$maxMenuLinkItem
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

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

Parameters

$id
Html id of the element
$categoryType
Type of category ('DAT', 'LNK', 'ROL', 'USF') that should be shown
$defaultCategory
Id of selected category (if id = -1 then no default category will be selected)
$link

Link to the page that will be called if menu item is clicked. At the end of this link the ID if the category will be added automatically, so you can add a category parameter at last

$text
Text of the selectbox
$admin

Set to @b true if user has admin rights in this category, than a link to administrate the categories is shown.

public
# addCssClass( string $className )

This method adds an additional css class to the main nav tag of the menu.

This method adds an additional css class to the main nav tag of the menu.

Parameters

$className
The name of a css class that should be add to the main nav tag of the manu
private
# addDropDownItem( array & $menuEntry, boolean $selected = false )

add a drop down item

add a drop down item

Parameters

$menuEntry
menu entry element which was added with addItem
$selected
determines if drop down element should be pre selected
public
# addForm( string $id, string $formHtml )

add a new entry to menu that contains the html as content

add a new entry to menu that contains the html as content

Parameters

$id
Html id of the element
$formHtml
A html code that will be added to the menu
public
# addHtml( string $id, string $html )

add a new entry to menu that contains the html as content

add a new entry to menu that contains the html as content

Parameters

$id
Html id of the element
$html
A html code that will be added to the menu
public
# addItem( string $id, string $link, string $text, string $icon, string $js = '' )

add new entry to menu

add new entry to menu

Parameters

$id
Html id of the element
$link
Link to the page that will be called if menu item is clicked
$text
Link text
$icon
Icon of the menu item, that will also be linked
$js
Javascript to be executed
public integer
# countItems( )

Count the number of menu items.

Count the number of menu items.

Returns

integer
Returns the number of menu items.
private string
# createIconTextLink( array & $menuEntry )

creates an text link icon

creates an text link icon

Parameters

$menuEntry
menu entry element which was added with addItem

Returns

string
HTML of created item
public integer|false
# getPosition( string $id )

gets the position of a given ID in the menu

gets the position of a given ID in the menu

Parameters

$id

Returns

integer|false
Position of the element; Returns false of no element is found
public
# insertItem( integer $position, string $id, string $link, string $text, string $icon, string $desc = '' )

inserts a new menu entry before the named position

inserts a new menu entry before the named position

Parameters

$position
$id
$link
$text
$icon
$desc
private array<string,string|array>
# mkItem( string $id, string $type, string $link, string $text, string $icon, string $js = '' )

add new entry to array and do some checks before so that link and icon get a valid url

add new entry to array and do some checks before so that link and icon get a valid url

Parameters

$id
Html id of the element
$type
The different type of menu that should be shown: @b link normal link with icon; @b category category select box
$link
Link to the page that will be called if menu item is clicked
$text
Link text
$icon
Icon of the menu item, that will also be linked
$js
Javascript to be executed

Returns

array<string,string|array>
public string|false
# show( )

Creates the html output of the module menu. Each added menu item will be displayed. If there are more menu items then in @b maxMenuLinkItem defined a dropdown menu will be displayed and all other items will be displayed there.

Creates the html output of the module menu. Each added menu item will be displayed. If there are more menu items then in @b maxMenuLinkItem defined a dropdown menu will be displayed and all other items will be displayed there.

Returns

string|false
Returns the html output for the complete menu

Properties summary

protected $id
#
protected $items
#
protected $ddItemCnt
#
protected $rootPath
#
protected $customCssClass
#
protected $maxMenuLinkItem
#
protected $ddJS
#
Admidio API API documentation generated by ApiGen