Last change
on this file was
372,
checked in by chervol, 18 years ago
|
fixed interfaces
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1] | 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 |
---|
[372] | 8 | ##parameters=menu |
---|
[1] | 9 | ##title= |
---|
| 10 | ## |
---|
| 11 | |
---|
[372] | 12 | from Products.CMFCore.utils import getToolByName |
---|
[1] | 13 | |
---|
[372] | 14 | # some checks whether dropdown properties exist |
---|
| 15 | pp = getToolByName(context, 'portal_properties') |
---|
| 16 | if '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') |
---|
[1] | 20 | |
---|
[372] | 21 | |
---|
| 22 | properties = pp.dropdownmenu_properties |
---|
| 23 | if 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 |
---|
| 29 | properties.manage_changeProperties(menu=menu) |
---|
| 30 | context.plone_utils.addPortalMessage('DropDown Menu updated.') |
---|
| 31 | return state.set(status='success') |
---|
Note: See
TracBrowser
for help on using the repository browser.