Back to index

plone3  3.1.7
Public Member Functions
plone.app.contentmenu.menu.ActionsMenu Class Reference
Inheritance diagram for plone.app.contentmenu.menu.ActionsMenu:
Inheritance graph
[legend]
Collaboration diagram for plone.app.contentmenu.menu.ActionsMenu:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def getMenuItems

Detailed Description

Definition at line 79 of file menu.py.


Member Function Documentation

def plone.app.contentmenu.menu.ActionsMenu.getMenuItems (   self,
  context,
  request 
)
Return menu item entries in a TAL-friendly form.

Definition at line 82 of file menu.py.

00082 
00083     def getMenuItems(self, context, request):
00084         """Return menu item entries in a TAL-friendly form."""
00085         results = []
00086 
00087         portal_state = getMultiAdapter((context, request), name='plone_portal_state')
00088 
00089         actions_tool = getToolByName(aq_inner(context), 'portal_actions')
00090         editActions = actions_tool.listActionInfos(object=aq_inner(context), categories=('object_buttons',))
00091 
00092         if not editActions:
00093             return []
00094 
00095         plone_utils = getToolByName(context, 'plone_utils')
00096         portal_url = portal_state.portal_url()
00097 
00098         for action in editActions:
00099             if action['allowed']:
00100                 cssClass = 'actionicon-object_buttons-%s' % action['id']
00101                 icon = plone_utils.getIconFor('object_buttons', action['id'], None)
00102                 if icon:
00103                     icon = '%s/%s' % (portal_url, icon)
00104 
00105                 results.append({ 'title'       : action['title'],
00106                                  'description' : '',
00107                                  'action'      : action['url'],
00108                                  'selected'    : False,
00109                                  'icon'        : icon,
00110                                  'extra'       : {'id': action['id'], 'separator': None, 'class': cssClass},
00111                                  'submenu'     : None,
00112                                  })
00113 
00114         return results
00115 

Here is the call graph for this function:


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