[Zope-CVS] CVS: Products/PageDesign - PageDesign.py:1.6 ReferencedElement.py:1.3 zopetop_design.zexp:1.4

Shane Hathaway shane@cvs.zope.org
Wed, 14 Aug 2002 23:15:47 -0400


Update of /cvs-repository/Products/PageDesign
In directory cvs.zope.org:/tmp/cvs-serv30067

Modified Files:
	PageDesign.py ReferencedElement.py zopetop_design.zexp 
Log Message:
More experiments with ZopeTop


=== Products/PageDesign/PageDesign.py 1.5 => 1.6 ===
--- Products/PageDesign/PageDesign.py:1.5	Tue Aug 13 14:01:02 2002
+++ Products/PageDesign/PageDesign.py	Wed Aug 14 23:15:46 2002
@@ -349,6 +349,7 @@
             editable = kw.get('editable', 0)
             sp = SlotProvider(editable, layered_slots).__of__(self)
             kw['slots'] = sp
+            kw['design'] = self
             res = template(**kw)
             if editable:
                 res = self.insertEditScripts(res)


=== Products/PageDesign/ReferencedElement.py 1.2 => 1.3 ===
--- Products/PageDesign/ReferencedElement.py:1.2	Mon Aug 12 10:39:29 2002
+++ Products/PageDesign/ReferencedElement.py	Wed Aug 14 23:15:46 2002
@@ -39,10 +39,10 @@
         if getattr(aq_base(ob), 'isDocTemp', 0):
             # DTML
             s = ob(self, aq_get(self, 'REQUEST'),
-                   editable=editable, index=index)
+                   design=design, editable=editable, index=index)
         elif hasattr(ob, '__call__'):
             # Other kinds of callable objects
-            s = ob(editable=editable, index=index)
+            s = ob(design=design, editable=editable, index=index)
         else:
             s = str(ob)
         return s
@@ -50,7 +50,10 @@
     def getIconURL(self):
         """Returns an URL to an icon for this element if available.
         """
-        ob = self._deref()
+        try:
+            ob = self._deref()
+        except:
+            return ''
         icon = None
         if hasattr(aq_base(ob), 'getIcon'):
             icon = ob.getIcon()
@@ -64,7 +67,10 @@
     def getTitle(self):
         """Returns the title of this element.
         """
-        ob = self._deref()
+        try:
+            ob = self._deref()
+        except:
+            return '/'.join(self._path)
         # It's altogether silly to have to look at four attributes. :-)
         if hasattr(aq_base(ob), 'Title'):
             s = ob.Title()
@@ -82,7 +88,10 @@
         Returns None or a blank string if it is not editable.
         """
         if hasattr(Application, 'externalEdit_'):
-            ob = self._deref()
+            try:
+                ob = self._deref()
+            except:
+                return None
             folder = aq_parent(aq_inner(ob))
             if hasattr(aq_base(ob), 'getId'):
                 id = ob.getId()


=== Products/PageDesign/zopetop_design.zexp 1.3 => 1.4 ===