Back to index

plone3  3.1.7
folder_cut_control.py
Go to the documentation of this file.
00001 ##parameters=ids, **kw
00002 ##title=Cut objects from a folder and copy to the clipboard
00003 ##
00004 from Products.CMFDefault.exceptions import CopyError
00005 from Products.CMFDefault.exceptions import zExceptions_Unauthorized
00006 from Products.CMFDefault.utils import Message as _
00007 
00008 try:
00009     context.manage_cutObjects(ids, context.REQUEST)
00010     if len(ids) == 1:
00011         return context.setStatus(True, _(u'Item cut.'))
00012     else:
00013         return context.setStatus(True, _(u'Items cut.'))
00014 except CopyError:
00015     return context.setStatus(False, _(u'CopyError: Cut failed.'))
00016 except zExceptions_Unauthorized:
00017     return context.setStatus(False, _(u'Unauthorized: Cut failed.'))