source: products/qPloneDropDownMenu/tags/0.2.1/skins/qPloneDropDownMenu/dropdownmenu_edit.cpy @ 1141

Last change on this file since 1141 was 372, checked in by chervol, 18 years ago

fixed interfaces

File size: 1.1 KB
Line 
1## Controller Python Script "dropdownmenu_edit"
2##bind container=container
3##bind context=context
4##bind namespace=
5##bind script=script
6##bind state=state
7##bind subpath=traverse_subpath
8##parameters=menu
9##title=
10##
11
12from Products.CMFCore.utils import getToolByName
13
14# some checks whether dropdown properties exist
15pp = getToolByName(context, 'portal_properties')
16if 'dropdownmenu_properties' not in pp.objectIds():
17    context.plone_utils.addPortalMessage('Dropdown menu property sheet does not exist. Please, firstly regenerate menu before editing it.',
18                                         type='error')
19    return state.set(status='failure')
20
21
22properties = pp.dropdownmenu_properties
23if not properties.hasProperty('menu'):
24    context.plone_utils.addPortalMessage('menu field does not exist in dropdown menu property sheet. Please, firstly regenerate menu before editing it.',
25                                         type='error')
26    return state.set(status='failure')
27
28# do actual work
29properties.manage_changeProperties(menu=menu)
30context.plone_utils.addPortalMessage('DropDown Menu updated.')
31return state.set(status='success')
Note: See TracBrowser for help on using the repository browser.