jslint
[Portfolio.git] / skins / portfolio_move_photos.py
1 ##parameters=
2 req = context.REQUEST
3 form = req.form
4 fg = form.get
5
6 container_type = fg('container_type')
7 if container_type == 'portfolio' :
8 from Products.CMFCore.utils import getUtilityByInterfaceName
9 uidh = getUtilityByInterfaceName('Products.CMFUid.interfaces.IUniqueIdHandler')
10 ctool = getUtilityByInterfaceName('Products.CMFCore.interfaces.ICatalogTool')
11 dropId = uidh.getBrain(int(fg('afterUid'))).getId
12 uids = fg('uids', [])
13 ids = [uidh.getBrain(uid).getId for uid in uids]
14 context.REQUEST.RESPONSE.setHeader('Content-Type', 'text/xml;;charset=utf-8')
15 try :
16 context.moveObjectsAfter(ids, dropId)
17 return '<ok/>'
18 except NotImplementedError :
19 raise
20
21 return printed
22