Back to index

plone3  3.1.7
layer.py
Go to the documentation of this file.
00001 from zope.interface import alsoProvides
00002 from zope.component import queryUtility
00003 
00004 from zope.publisher.interfaces.browser import IBrowserSkinType
00005 from zope.publisher.browser import applySkin
00006 
00007 from Products.CMFCore.utils import getToolByName
00008 
00009 def mark_layer(site, event):
00010     """Mark the request with a layer corresponding to the current skin,
00011     as set in the portal_skins tool.
00012     """
00013     portal_skins = getToolByName(site, 'portal_skins', None)
00014     if portal_skins is not None:
00015         skin_name = site.getCurrentSkinName()
00016         skin = queryUtility(IBrowserSkinType, name=skin_name)
00017         if skin is not None:
00018             applySkin(event.request, skin)