9ca0494701883d55cce42003a24980081f107f13
1 ##parameters=batch, searchArgs
2 from ZTUtils
import make_query
as mq
3 try : searchArgs
.pop('ajax')
7 sd
= context
.session_data_manager
.getSessionData(create
= 1)
8 selDict
= sd
.get('objects_selection_dict', {})
10 for index
, b
in enumerate(batch
) :
11 uid
= b
.cmf_uid
or None
13 selected
= selDict
.has_key(uid
)
16 className
= 'selected'
17 if b
.hiddenForAnonymous
:
18 className
= 'hidden-slide'
21 ,'thumbUrl' : '%s/getThumbnail' % absUrl
22 ,'thumbSize' : b
.getThumbnailSize
24 ,'selected' : selected
25 ,'cmf_uid' : b
.cmf_uid
26 ,'className' : className
32 def toggleSelection(b
, selected
) :
34 return '%s/remove_to_selection' % b
.getURL()
36 return '%s/add_to_selection' % b
.getURL()
38 features
['select'] = toggleSelection
40 return {'infos':infos
, 'features':features
}