849f840d4d1200ebe0c57b1fcbb12e4e3244a952
1 ##parameters=load='',unload='',**kw
2 from Products
.CMFCore
.utils
import getToolByName
3 from Products
.Plinn
.PloneMisc
import Batch
6 lightboxSelected
= False
8 sd
= context
.session_data_manager
.getSessionData(create
= 1)
9 path
= context
.getPhysicalPath()
12 sd
.set('lightboxpath', path
)
13 selection
= context
.getUidList()
14 sd
.set('objects_selection', selection
)
15 sd
.set('objects_selection_dict', dict([(uid
, True) for uid
in selection
]))
17 sd
.set('lightboxpath', None)
18 sd
.set('objects_selection', [])
19 sd
.set('objects_selection_dict', {})
21 sessionpath
= sd
.get('lightboxpath', None)
22 if sessionpath
== path
:
23 lightboxSelected
= True
24 buttons
.append({'name': 'unload', 'value': 'Unload from my selection'})
26 buttons
.append({'name':'load', 'value': 'Load in my selection'})
29 options
['buttons'] = buttons
30 options
['lightboxSelected'] = lightboxSelected
31 options
['container_type'] = 'lightbox'
32 options
.update(context
.getLightboxPhotosInfos(context
))
34 return context
.lightbox_view_template(**options
)