Callback ajax après déplacement.
[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.moveObjectsAfter(ids, dropId)
15
16 return printed
17