Copie depuis le svn du cri à l'état :
[Plinn.git] / skins / custom_content / newsitem_edit_control.py
1 ##parameters=text, text_format, SafetyBelt='', **kw
2 ##
3 from Products.CMFDefault.exceptions import EditingConflict
4 from Products.CMFDefault.exceptions import ResourceLockedError
5
6 if text_format != context.text_format or text != context.text:
7 try:
8 context.edit(text, text_format = text_format)#, safety_belt=SafetyBelt)
9 return context.setStatus(True, 'Document changed.')
10 except (ResourceLockedError, EditingConflict), errmsg:
11 return context.setStatus(False, errmsg)
12 else:
13 return context.setStatus(False, 'Nothing to change.')