Back to index

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

List of all members.

Public Member Functions

def getMenuItems

Detailed Description

Definition at line 512 of file menu.py.


Member Function Documentation

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

Definition at line 515 of file menu.py.

00515 
00516     def getMenuItems(self, context, request):
00517         """Return menu item entries in a TAL-friendly form."""
00518         factories_view = getMultiAdapter((context, request), name='folder_factories')
00519 
00520         haveMore = False
00521         include = None
00522 
00523         addContext = factories_view.add_context()
00524         allowedTypes = _allowedTypes(request, addContext)
00525 
00526         constraints = IConstrainTypes(addContext, None)
00527         if constraints is not None:
00528             include = constraints.getImmediatelyAddableTypes()
00529             if len(include) < len(allowedTypes):
00530                 haveMore = True
00531 
00532         results = factories_view.addable_types(include=include)
00533 
00534         if haveMore:
00535             url = '%s/folder_factories' % (addContext.absolute_url(),)
00536             results.append({ 'title'       : _(u'folder_add_more', default=u'More\u2026'),
00537                              'description' : _(u'Show all available content types'),
00538                              'action'      : url,
00539                              'selected'    : False,
00540                              'icon'        : None,
00541                              'extra'       : {'id': 'more', 'separator': None, 'class': ''},
00542                              'submenu'     : None,
00543                             })
00544 
00545         constraints = ISelectableConstrainTypes(addContext, None)
00546         if constraints is not None:
00547             if constraints.canSetConstrainTypes() and constraints.getDefaultAddableTypes():
00548                 url = '%s/folder_constraintypes_form' % (addContext.absolute_url(),)
00549                 results.append({'title'       : _(u'folder_add_settings', default=u'Restrictions\u2026'),
00550                                 'description' : _(u'title_configure_addable_content_types', default=u'Configure which content types can be added here'),
00551                                 'action'      : url,
00552                                 'selected'    : False,
00553                                 'icon'        : None,
00554                                 'extra'       : {'id': 'settings', 'separator': None, 'class': ''},
00555                                 'submenu'     : None,
00556                                 })
00557 
00558         return results
00559 

Here is the call graph for this function:


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