[Zope-CVS] CVS: Products/CompositePage - slot.py:1.21

Godefroid Chapelle gotcha at swing.be
Mon Apr 26 05:30:26 EDT 2004


Update of /cvs-repository/Products/CompositePage
In directory cvs.zope.org:/tmp/cvs-serv6924

Modified Files:
	slot.py 
Log Message:
 added _render_editing method to allow subclassing


=== Products/CompositePage/slot.py 1.20 => 1.21 ===
--- Products/CompositePage/slot.py:1.20	Wed Apr 14 12:15:29 2004
+++ Products/CompositePage/slot.py	Mon Apr 26 05:30:25 2004
@@ -170,13 +170,9 @@
             except:
                 text = formatException(self, editing)
 
+
             if editing:
-                o2 = obj.dereference()
-                icon = getIconURL(o2, icon_base_url)
-                title = o2.title_and_id()
-                path = escape('/'.join(obj.getPhysicalPath()))
-                res.append(edit_tag % (path,
-                                       escape(icon), escape(title), text))
+                res.append(self._render_editing(obj, text, icon_base_url))
             else:
                 res.append(view_tag % text)
 
@@ -185,6 +181,14 @@
             res.append(target_tag % (myid, index, mypath, index))
 
         return res
+
+    def _render_editing(self, obj, text, icon_base_url):
+        o2 = obj.dereference()
+        icon = getIconURL(o2, icon_base_url)
+        title = o2.title_and_id()
+        path = escape('/'.join(obj.getPhysicalPath()))
+        return edit_tag % (path,
+                               escape(icon), escape(title), text)
 
 Globals.InitializeClass(Slot)
 




More information about the Zope-CVS mailing list