include/contextMenus/contextMenu.php
\contextMenu
Properties
Methods
addMenuItem(
string $text, string $action, $module
=
null, $aclAction
=
null, array $params
=
null
)
:
void
adds a menu item to the current contextMenu
Name | Type | Description |
---|---|---|
$text | string | text of the item |
$action | string | function or pointer to the javascript function to call |
$module | ||
$aclAction | ||
$params | array | other parameters includes: url - The URL for the MenuItem's anchor's "href" attribute. target - The value to be used for the MenuItem's anchor's "target" attribute. helptext - Additional instructional text to accompany the text for a MenuItem. Example: If the text is "Copy" you might want to add the help text "Ctrl + C" to inform the user there is a keyboard shortcut for the item. emphasis - If set to true the text for the MenuItem will be rendered with emphasis (using ). strongemphasis - If set to true the text for the MenuItem will be rendered with strong emphasis (using ). disabled - If set to true the MenuItem will be dimmed and will not respond to user input or fire events. selected - If set to true the MenuItem will be highlighted. submenu - Appends / removes a menu (and it's associated DOM elements) to / from the MenuItem. checked - If set to true the MenuItem will be rendered with a checkmark. |
loadFromDef(
string $name, array $defs
)
:
void
Loads up menu items from def
Name | Type | Description |
---|---|---|
$name | string | name of the object type |
$defs | array | menu item definitions |