Back to index

plone3  3.1.7
folder_paste_control.py
Go to the documentation of this file.
00001 ##parameters=**kw
00002 ##title=Paste objects to a folder from 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     result = context.manage_pasteObjects(context.REQUEST['__cp'])
00010     if len(result) == 1:
00011         return context.setStatus(True, _(u'Item pasted.'))
00012     else:
00013         return context.setStatus(True, _(u'Items pasted.'))
00014 except CopyError:
00015     return context.setStatus(False, _(u'CopyError: Paste failed.'))
00016 except zExceptions_Unauthorized:
00017     return context.setStatus(False, _(u'Unauthorized: Paste failed.'))