Author: jmorliaguet
Date: Sat Jun 17 10:16:34 2006
New Revision: 3429

Modified:
   cpsskins/branches/paris-sprint-2006/browser/tree/slot.py
   cpsskins/branches/paris-sprint-2006/elements/interfaces.py
   cpsskins/branches/paris-sprint-2006/elements/slot.py

Log:

- slots can override the perspective from which portlets are looked up.
  If the specified perspective is '*' then we ignore it.



Modified: cpsskins/branches/paris-sprint-2006/browser/tree/slot.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/browser/tree/slot.py    (original)
+++ cpsskins/branches/paris-sprint-2006/browser/tree/slot.py    Sat Jun 17 
10:16:34 2006
@@ -48,6 +48,12 @@
         context = self.context
         relations = getRelationStorage(context)
 
+        # The slot can override the perspective from which portlets are looked
+        # up. If the specified perspective is '*' then we ignore it.
+        slot_perspective = context.perspective
+        if slot_perspective != u'*':
+            perspective = slot_perspective
+
         if perspective is None:
             portlets = relations.getSeconds(predicate=hasPortlet, 
first=context)
         else:

Modified: cpsskins/branches/paris-sprint-2006/elements/interfaces.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/interfaces.py  (original)
+++ cpsskins/branches/paris-sprint-2006/elements/interfaces.py  Sat Jun 17 
10:16:34 2006
@@ -120,6 +120,11 @@
             "inside a theme. Slot names must be unique on a same page."),
         required=True)
 
+    perspective = TextLine(
+        title=_(u"Perspective"),
+        description=_(u"The perspective used to look up portlets"),
+        required=False)
+
     def __str__():
         """Returns the slot's name."""
 

Modified: cpsskins/branches/paris-sprint-2006/elements/slot.py
==============================================================================
--- cpsskins/branches/paris-sprint-2006/elements/slot.py        (original)
+++ cpsskins/branches/paris-sprint-2006/elements/slot.py        Sat Jun 17 
10:16:34 2006
@@ -40,11 +40,12 @@
     """
     implements(ISlot)
 
-    def __init__(self, title=u'', description=u'', name=u''):
+    def __init__(self, title=u'', description=u'', name=u'', perspective=u''):
         super(Slot, self).__init__()
         self.title = title
         self.description = description
         self.name = name
+        self.perspective = perspective
 
     def __str__(self):
         return self.name
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to