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