f302d9fb0e63cfa4365f03ff7d417bbf1063c8c5
2 ##title=Paste objects to a folder from the clipboard
4 from Products
.CMFDefault
.exceptions
import CopyError
5 from Products
.CMFDefault
.exceptions
import zExceptions_Unauthorized
7 if context
.cb_dataValid
:
9 result
= context
.manage_pasteObjects(context
.REQUEST
['__cp'])
10 return context
.setStatus( True, 'Item%s pasted.' %
11 ( len(result
) != 1 and 's' or '' ) )
13 return context
.setStatus(False, 'CopyError: Paste failed.')
14 except zExceptions_Unauthorized
:
15 return context
.setStatus(False, 'Unauthorized: Paste failed.')
17 return context
.setStatus(False, 'Please copy or cut one or more items to paste first.')
19 return context
.setStatus(False, 'Please copy or cut one or more items to paste first.')