Last change
on this file was
1,
checked in by myroslav, 18 years ago
|
Building directory structure
|
-
Property svn:eol-style set to
native
|
File size:
577 bytes
|
Rev | Line | |
---|
[1] | 1 | ## Script (Python) "qpdm_edit" |
---|
| 2 | ##bind container=container |
---|
| 3 | ##bind context=context |
---|
| 4 | ##bind namespace= |
---|
| 5 | ##bind script=script |
---|
| 6 | ##bind subpath=traverse_subpath |
---|
| 7 | ##parameters= submenu_path, idx |
---|
| 8 | ##title= |
---|
| 9 | ## |
---|
| 10 | |
---|
| 11 | req = context.REQUEST |
---|
| 12 | params = {} |
---|
| 13 | fields = ['title', 'url'] |
---|
| 14 | |
---|
| 15 | for item in fields: |
---|
| 16 | params[item] = str(req.get('i'+idx+'_'+item, None)) |
---|
| 17 | |
---|
| 18 | from Products.CMFCore.utils import getToolByName |
---|
| 19 | |
---|
| 20 | menu_tool = getToolByName(context, 'portal_dropdownmenu') |
---|
| 21 | menuitem = menu_tool.getMenuItemByPath(submenu_path) |
---|
| 22 | |
---|
| 23 | menuitem.setTitle(params['title']) |
---|
| 24 | menuitem.setUrl(params['url']) |
---|
| 25 | |
---|
| 26 | return params |
---|
Note: See
TracBrowser
for help on using the repository browser.