source: products/qLocalSkin/trunk/layer.py

Last change on this file was 482, checked in by gerrykirk, 15 years ago

created first .pot files

  • Property svn:eol-style set to native
File size: 906 bytes
Line 
1from zope.component import queryUtility, queryMultiAdapter
2
3from zope.publisher.interfaces.browser import IBrowserSkinType
4from zope.publisher.browser import applySkin
5
6from adapters.interfaces import ISkinNameExtractor, IRequestPortalUrlAnnotator
7
8def mark_layer(context, event):
9    """Mark the request with a layer corresponding to the current marked object.
10    """
11
12    skin_name = None
13    extractor = ISkinNameExtractor(context, None)
14    if extractor is not None:
15        skin_name = extractor.getSkinName()
16    if skin_name is not None:
17        skin = queryUtility(IBrowserSkinType, name=skin_name)
18        if skin is not None:
19            applySkin(event.request, skin)
20            context.changeSkin(skin_name, event.request)
21            annotator = IRequestPortalUrlAnnotator(event.request, None)
22            if annotator is not None:
23                annotator.annotate(context.absolute_url())
Note: See TracBrowser for help on using the repository browser.