[Zope-Checkins] CVS: Zope3/lib/python/Zope/App/ZopePublication - ZopePublication.py:1.1.2.23

Andreas Jung andreas@digicool.com
Thu, 10 Jan 2002 15:02:25 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/ZopePublication
In directory cvs.zope.org:/tmp/cvs-serv24951/Zope/App/ZopePublication

Modified Files:
      Tag: Zope-3x-branch
	ZopePublication.py 
Log Message:
added logic to check for skins specifications anywhere inside the URL


=== Zope3/lib/python/Zope/App/ZopePublication/ZopePublication.py 1.1.2.22 => 1.1.2.23 ===
 
     def traverseName(self, request, ob, name, check_auth=1):
+
+        # check for skin specification
+        # XXX: replace that by a regex
+
+        if name.find(';skin=') > -1:
+            l1 = name.find(';skin=')
+            l2 = name.find(';', l1+1)
+            if l2 < 0:
+                l2 = len(name)
+           
+            request.setViewSkin( name[ l1+6: l2] )
+            name = name[ :l1 ]   + name[ l2: ] 
+            
+
         if IBrowserPublisher.isImplementedBy(ob):
             ob2 = ob.browser_traverse(request, name)
         else: