X-Git-Url: https://scm.cri.ensmp.fr/git/Plinn.git/blobdiff_plain/3c4367d8e03450e9a73e61f4247145d2b6c86a33..959d888c17d1403d2eeecc19bc4b5e2c8d1debf6:/Products/Plinn/skins/custom_content/link_edit_form.py diff --git a/Products/Plinn/skins/custom_content/link_edit_form.py b/Products/Plinn/skins/custom_content/link_edit_form.py new file mode 100755 index 0000000..cac3ae5 --- /dev/null +++ b/Products/Plinn/skins/custom_content/link_edit_form.py @@ -0,0 +1,25 @@ +##parameters=change='', change_and_view='', ajax='' +## +form = context.REQUEST.form +if change and \ + context.link_edit_control(**form) and \ + context.setRedirect(context, 'object/edit', ajax=ajax): + return +elif change_and_view and \ + context.link_edit_control(**form) and \ + context.setRedirect(context, 'object/view', ajax=ajax): + return + + +options = {} + +buttons = [] +target = context.getActionInfo('object/edit')['url'] +#buttons.append( {'name': 'change', 'value': 'Change'} ) +buttons.append( {'name': 'change_and_view', 'value': 'Change and View'} ) +options['form'] = { 'action': target, + 'listButtonInfos': tuple(buttons) } + +options['ajax'] = ajax + +return context.link_edit_template(**options)