Refactoring, commentaires.
[Plinn.git] / skins / custom_content / link_edit_form.py
1 ##parameters=change='', change_and_view='', ajax=''
2 ##
3 form = context.REQUEST.form
4 if change and \
5 context.link_edit_control(**form) and \
6 context.setRedirect(context, 'object/edit', ajax=ajax):
7 return
8 elif change_and_view and \
9 context.link_edit_control(**form) and \
10 context.setRedirect(context, 'object/view', ajax=ajax):
11 return
12
13
14 options = {}
15
16 buttons = []
17 target = context.getActionInfo('object/edit')['url']
18 #buttons.append( {'name': 'change', 'value': 'Change'} )
19 buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} )
20 options['form'] = { 'action': target,
21 'listButtonInfos': tuple(buttons) }
22
23 options['ajax'] = ajax
24
25 return context.link_edit_template(**options)