iPopupMenuExtension
api
New extension to add menu items in the "popup" menus inside iTop. Provides a greater flexibility thaniApplicationUIExtension::EnumAllowedActions.
To add some menus into iTop, declare a class that implements this interface, it will be called automatically by the application, as long as the class definition is included somewhere in the code
Tags
since | 2.0 |
---|
Public methods
EnumItems
public static
Get the list of items to be added to a menu.
This method is called by the framework for each menu. The items will be inserted in the menu in the order of the returned array.
public static EnumItems($iMenuId, $param)
Parameters
types | name | default | description |
---|---|---|---|
integer | $iMenuId | The identifier of the type of menu, as listed by the constants MENU_xxx | |
mixed | $param | Depends on $iMenuId, see the constants defined above |
Returns
array<mixed,object> An array of ApplicationPopupMenuItem or an empty array if no action is to be added to the menu
Constants
MENU_DASHBOARD_ACTIONS
Insert an item into the Dashboard menu
The dashboad menu is shown on the top right corner when a dashboard is being displayed.
$param is a Dashboard instance: the dashboard currently displayed
MENU_OBJDETAILS_ACTIONS
Insert an item into the Actions menu on an object details page
$param is a DBObject instance: the object currently displayed
MENU_OBJLIST_ACTIONS
Insert an item into the Actions menu of a list
$param is a DBObjectSet containing the list of objects
MENU_OBJLIST_TOOLKIT
Insert an item into the Toolkit menu of a list
$param is a DBObjectSet containing the list of objects
MENU_USER_ACTIONS
Insert an item into the User menu (upper right corner)
$param is null
PORTAL_MENU_ACTIONS
Insert an item into the navigation menu of the portalNote: This is not implemented yet !
$param is the portal id
PORTAL_OBJDETAILS_ACTIONS
Insert an item into the Action menu on an object details page in the portal
$param is an array('portal_id' => $sPortalId, 'object' => $oObject) containing the portal id and a DBObject instance (the object currently displayed)
PORTAL_OBJLIST_ACTIONS
Insert an item into the Actions menu of a list in the portalNote: This is not implemented yet !
$param is an array('portal_id' => $sPortalId, 'object_set' => $oSet) containing DBObjectSet containing the list of objects
PORTAL_OBJLISTITEM_ACTIONS
Insert an item into the Action menu on an object item in an objects list in the portal
$param is an array('portal_id' => $sPortalId, 'object' => $oObject) containing the portal id and a DBObject instance (the object on the current line)
PORTAL_USER_ACTIONS
Insert an item into the user menu of the portalNote: This is not implemented yet !
$param is the portal id