X-Git-Url: https://scm.cri.minesparis.psl.eu/git/Portfolio.git/blobdiff_plain/2da869b2b46179d64c05eaac4081226fdbbbc9ff..e73353500c67453ef9663d67eaeee7dd46c358ee:/skins/getPhotoInfo.py diff --git a/skins/getPhotoInfo.py b/skins/getPhotoInfo.py deleted file mode 100755 index bb4391d..0000000 --- a/skins/getPhotoInfo.py +++ /dev/null @@ -1,60 +0,0 @@ -##parameters= -from Products.CMFCore.utils import getToolByName -from Products.CMFCore.permissions import ReviewPortalContent, ModifyPortalContent -mtool = getToolByName(context, 'portal_membership') -pptool = getToolByName(context, 'portal_photo_print', None) -uidtool = getToolByName(context, 'portal_uidhandler') - -features = {} -def toggleSelection(o, selected) : - if selected : - return '%s/remove_to_selection' % o.absolute_url() - else : - return '%s/add_to_selection' % o.absolute_url() - -features['select'] = toggleSelection -features['cart'] = lambda o : '%s/get_slide_buyable_items' % o.absolute_url() - -if mtool.checkPermission(ReviewPortalContent, context) : - features['hideAnonymous'] = True -if mtool.checkPermission(ModifyPortalContent, context) : - features['checkbox'] = True - - -sd = context.session_data_manager.getSessionData(create = 1) -selDict = sd.get('objects_selection_dict', {}) -cart = sd.get('cart', None) - -p = context -className = '' -uid = getattr(p, 'cmf_uid', None) -if uid is not None : - uid = uid() -absUrl = p.absolute_url() -selected = selDict.has_key(uid) -hiddenForAnonymous = p.hiddenForAnonymous() -if pptool : - buyable = bool(pptool.getPrintingOptionsFor(p)) - if cart and cart.locked : - buyable = False -else : - buyable = False - -if selected : - className = 'selected' -if hiddenForAnonymous : - className = 'hidden-slide' - -d = {'href' : absUrl - ,'thumbUrl' : '%s/getThumbnail' % absUrl - ,'thumbSize': p.getThumbnailSize() - ,'title' : ('%s - %s' % (p.Title(), p.Description())).strip(' -') - ,'selected' : selected - ,'hiddenForAnonymous' : hiddenForAnonymous - ,'cmf_uid' : uidtool.register(p) - ,'buyable' : buyable - ,'className': className - ,'o' : p - } - -return {'info' : d, 'features' : features}