Author: jmorliaguet
Date: Wed Oct 26 16:12:35 2005
New Revision: 28659

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py
   
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/presentation_editor.pt
   z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py
Log:

- more robust code for setting perspectives



Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py      
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/__init__.py      
Wed Oct 26 16:12:35 2005
@@ -84,7 +84,7 @@
         pkg_id = 'cpsskins'
         session = ISession(self.request)[pkg_id]
 
-        if perspective == '':
+        if not perspective:
             del session['perspective']
         else:
             tmutil = getThemeManager()

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/presentation_editor.pt
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/presentation_editor.pt
   (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/browser/authoring/presentation_editor.pt
   Wed Oct 26 16:12:35 2005
@@ -91,8 +91,9 @@
 
               <td style="background-color: #fff">
                 <tal:block condition="perspective_is_current">&lArr; current 
view</tal:block>
-                <a href="" tal:condition="not:perspective_is_current"
-                   style="display:block; width: auto"
+                <a href="" style="display:block; width: auto"
+                   tal:condition="not:perspective_is_current"
+                   tal:define="perspective python: perspective and perspective 
or ''"
                    tal:attributes="href 
string:@@setPerspective?perspective=$perspective">&nbsp;</a>
               </td>
             </tr>

Modified: z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py  (original)
+++ z3lab/cpsskins/branches/jmo-perspectives/elements/theme.py  Wed Oct 26 
16:12:35 2005
@@ -18,7 +18,7 @@
 __docformat__ = "reStructuredText"
 
 from zope.app.container.interfaces import INameChooser
-from zope.component import adapts, getUtility, getUtilitiesFor
+from zope.component import adapts, queryUtility, getUtilitiesFor
 from zope.interface import implements
 
 from cpsskins.elements import InnerNode
@@ -89,7 +89,7 @@
         for p in perspectives.values():
             if str(p) == id:
                 return p
-        return getUtility(IPerspective, id)
+        return queryUtility(IPerspective, id)
 
     def addPerspective(self, object):
         """Add a perspective to the perspective storage
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to