[Checkins] SVN: z3ext.skintool/trunk/ Added INoSkinSwitching for skin that does not allow skin switching

Nikolay Kim fafhrd at datacom.kz
Thu Aug 7 08:10:59 EDT 2008


Log message for revision 89494:
  Added INoSkinSwitching for skin that does not allow skin switching

Changed:
  U   z3ext.skintool/trunk/CHANGES.txt
  U   z3ext.skintool/trunk/src/z3ext/skintool/interfaces.py
  U   z3ext.skintool/trunk/src/z3ext/skintool/subscribers.py

-=-
Modified: z3ext.skintool/trunk/CHANGES.txt
===================================================================
--- z3ext.skintool/trunk/CHANGES.txt	2008-08-07 10:14:58 UTC (rev 89493)
+++ z3ext.skintool/trunk/CHANGES.txt	2008-08-07 12:10:58 UTC (rev 89494)
@@ -2,6 +2,12 @@
 CHANGES
 =======
 
+1.0.2 (2008-08-07)
+------------------
+
+- Added INoSkinSwitching for skin that does not allow skin switching
+
+
 1.0.1 (2008-05-16)
 ------------------
 

Modified: z3ext.skintool/trunk/src/z3ext/skintool/interfaces.py
===================================================================
--- z3ext.skintool/trunk/src/z3ext/skintool/interfaces.py	2008-08-07 10:14:58 UTC (rev 89493)
+++ z3ext.skintool/trunk/src/z3ext/skintool/interfaces.py	2008-08-07 12:10:58 UTC (rev 89494)
@@ -25,6 +25,10 @@
     """ marker interface for skinable objects """
 
 
+class INoSkinSwitching(interface.Interface):
+    """ if default skin provide this interface, do not switch skin """
+
+
 class IDefaultLayer(interface.interfaces.IInterface):
     """ default layer (automaticlly added to skin) """
 

Modified: z3ext.skintool/trunk/src/z3ext/skintool/subscribers.py
===================================================================
--- z3ext.skintool/trunk/src/z3ext/skintool/subscribers.py	2008-08-07 10:14:58 UTC (rev 89493)
+++ z3ext.skintool/trunk/src/z3ext/skintool/subscribers.py	2008-08-07 12:10:58 UTC (rev 89494)
@@ -22,7 +22,7 @@
 from zope.app.component.interfaces import ISite
 from zope.app.publication.interfaces import IBeforeTraverseEvent
 
-from interfaces import ISkinTool, ISkinable
+from interfaces import ISkinTool, ISkinable, INoSkinSwitching
 
 
 @component.adapter(ISite, IBeforeTraverseEvent)
@@ -30,6 +30,10 @@
                             ISkinable = ISkinable,
                             removeAllProxies=removeAllProxies,
                             directlyProvides=directlyProvides):
+
+    if INoSkinSwitching.providedBy(event.request):
+        return
+    
     site = removeAllProxies(site)
 
     if not ISkinable.providedBy(site):



More information about the Checkins mailing list