2 from Products
.CMFCore
.utils
import getUtilityByInterfaceName
3 from Products
.Portfolio
.utils
import translate
4 _
= lambda msg
: translate(msg
, context
)
6 uidh
= getUtilityByInterfaceName('Products.CMFUid.interfaces.IUniqueIdHandler')
8 form
= context
.REQUEST
.form
11 context
.REQUEST
.RESPONSE
.setHeader('Content-Type', 'text/xml;;charset=utf-8')
13 if fg('delete.x') or form
.has_key('delete') :
14 ids
= [uidh
.getBrain(uid
).getId
for uid
in fg('uids', [])]
17 msg
= _('Photo deleted.')
19 msg
= _('Deleted photos.')
20 context
.manage_delObjects(ids
)
22 msg
= _('Nothing to delete.')
25 context
.setStatus(True, msg
)
26 return context
.setRedirect(context
, 'object/view')
29 return '<deleted>%s</deleted>' % msg
30 if fg('set_sorting') :
31 context
.setDefaultSorting(fg('sort_on'), False)
33 return context
.setRedirect(context
, 'object/view')