Back to index

plone3  3.1.7
plone.css.py
Go to the documentation of this file.
00001 ## Script (Python) "plone.css"
00002 ##bind container=container
00003 ##bind context=context
00004 ##bind namespace=
00005 ##bind script=script
00006 ##bind subpath=traverse_subpath
00007 ##parameters=
00008 ##title=Rendered version of the Plone CSS for use from external tools
00009 ##
00010 
00011 portal_css = context.portal_css
00012 stylesheets = portal_css.getEvaluatedResources(context);
00013 current_skin = context.getCurrentSkinName()
00014 
00015 for stylesheet in stylesheets:
00016   if stylesheet.getRendering() in ['import','inline']:
00017     print portal_css.restrictedTraverse('%s/%s' % (current_skin, stylesheet.getId()))
00018  
00019 duration = 1
00020 seconds = float(duration)*24.0*3600.0
00021 response = context.REQUEST.RESPONSE
00022 #response.setHeader('Expires',rfc1123_date((DateTime() + duration).timeTime()))
00023 response.setHeader('Cache-Control', 'max-age=%d' % int(seconds))
00024 response.setHeader('Content-Type', 'text/css')
00025  
00026 return printed