PUT webdav -> on crée un fichier pour le tout venant.
[Plinn.git] / skins / custom_content / document_edit_form.py
1 ##parameters=change='', change_and_view='', ajax=''
2 ##
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]})
10
11 if change and \
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}):
16 return
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}):
22 return
23
24
25 options = {}
26
27 buttons = []
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) }
33
34 return context.document_edit_template(**options)