Back to index

plone3  3.1.7
topic_edit_form.py
Go to the documentation of this file.
00001 ##parameters=change='', change_and_view=''
00002 ##
00003 from Products.CMFDefault.utils import decode
00004 from Products.CMFDefault.utils import Message as _
00005 
00006 form = context.REQUEST.form
00007 if change and \
00008         context.topic_edit_control(**form) and \
00009         context.setRedirect(context, 'object/edit'):
00010     return
00011 elif change_and_view and \
00012         context.topic_edit_control(**form) and \
00013         context.setRedirect(context, 'object/view'):
00014     return
00015 
00016 
00017 options = {}
00018 
00019 options['title'] = form.get('title', context.Title())
00020 options['description'] = form.get('description', context.Description())
00021 options['acquireCriteria'] = form.get('acquireCriteria',
00022                                       context.acquireCriteria)
00023 
00024 buttons = []
00025 target = context.getActionInfo('object/edit')['url']
00026 buttons.append( {'name': 'change', 'value': _(u'Change')} )
00027 buttons.append( {'name': 'change_and_view', 'value': _(u'Change and View')} )
00028 options['form'] = { 'action': target,
00029                     'listButtonInfos': tuple(buttons) }
00030 
00031 return context.topic_edit_template(**decode(options, script))