1d0a2a8fb613b867f408d3fdedcdefa69d9348a5
1 ##parameters=change='', change_and_view='', ajax=''
3 form
= context
.REQUEST
.form
4 description
= form
.get('description')
5 if description
and same_type(description
, []) :
6 # when javascript is disabled,
7 # there's a hidden textarea from epoz
8 # and an other from <noscript> tag
9 form
.update({'description' : description
[1],
10 'text' : form
['text'][1]})
13 context
.validateHTML(**form
) and \
14 context
.newsitem_edit_control(**form
) and \
15 context
.setRedirect(context
, 'object/edit', **{'ajax':ajax
}):
17 elif change_and_view
and \
18 context
.validateHTML(**form
) and \
19 context
.newsitem_edit_control(**form
) and \
20 context
.setRedirect(context
, 'object/view', **{'ajax':ajax
}):
27 target
= context
.getActionInfo('object/edit')['url']
28 buttons
.append( {'name': 'change', 'value': 'Change'} )
29 buttons
.append( {'name': 'change_and_view', 'value': 'Change and View'} )
30 options
['form'] = { 'action': target
,
31 'listButtonInfos': tuple(buttons
) }
33 return context
.newsitem_edit_template(**options
)