Ajout fonction utilitaire pour encoder de manière sécurisé les en-tête des mails.
[Plinn.git] / skins / control / emptyClipboard.py
1 ##parameters=delete='', empty='', indexes=[], ajax=''
2 from ZTUtils import make_query
3 request = context.REQUEST
4 response = request.RESPONSE
5
6 if empty :
7 message = 'Clipboard emptied.'
8 response.expireCookie('__cp', path=request['BASEPATH1'] or "/")
9 elif delete :
10 if not indexes :
11 message = 'Please select one or more items first.'
12 elif len(indexes) == 1 :
13 message = 'Item removed from clipboard.'
14 else :
15 message = 'Items removed from clipboard.'
16 context.popCP(indexes)
17
18
19 if not ajax:
20 redirUrl = request['HTTP_REFERER'].split('?')[0] + \
21 '?' + make_query(portal_status_message=message)
22 response.redirect(redirUrl)
23 else :
24 return "..."