[Zope-CVS] CVS: Products/CompositePage - __init__.py:1.4.2.3 composite.py:1.9.2.3 designuis.py:1.1.2.3

Shane Hathaway shane at zope.com
Tue Feb 24 17:34:42 EST 2004


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

Modified Files:
      Tag: composite-flat-ui-branch
	__init__.py composite.py designuis.py 
Log Message:
The manual slotting interface now renders.


=== Products/CompositePage/__init__.py 1.4.2.2 => 1.4.2.3 ===
--- Products/CompositePage/__init__.py:1.4.2.2	Fri Feb 20 17:31:35 2004
+++ Products/CompositePage/__init__.py	Tue Feb 24 17:34:11 2004
@@ -20,6 +20,7 @@
 tool.registerUI("common", designuis.CommonUI())
 tool.registerUI("zmi", designuis.ZMIUI())
 tool.registerUI("cmf", designuis.CMFUI())
+tool.registerUI("manual", designuis.ManualUI())
 
 
 def initialize(context):


=== Products/CompositePage/composite.py 1.9.2.2 => 1.9.2.3 ===
--- Products/CompositePage/composite.py:1.9.2.2	Fri Feb 20 17:31:35 2004
+++ Products/CompositePage/composite.py	Tue Feb 24 17:34:11 2004
@@ -60,7 +60,7 @@
                 s._p_jar = jar
             return s.__of__(slots)
 
-    def _startCollection(self):
+    def _beginCollection(self):
         """Starts collecting the names of slots used.
         """
         self._v_used_slots = []
@@ -204,14 +204,31 @@
         """
         contents = []  # [{name, slot_info}]
         seen = {}
+        names = self.getSlotNames()
         for name in names:
             if seen.has_key(name):
                 # Don't show duplicate uses of a slot.
                 continue
             seen[name] = 1
+            slot = self.slots[name]
+            elements = []
+            index = 0
+            for element in slot.objectValues():
+                element_info = {
+                    'title': element.title_or_id(),
+                    'source_path': '/'.join(element.getPhysicalPath()),
+                    'index': index,
+                    'next_index': index + 1,
+                    'view': 'xxx',
+                    'available_views': ('yyy', 'zzz'),
+                    }
+                elements.append(element_info)
+                index += 1
             slot_info = {
                 'title': name,  # XXX need to get a real slot title somehow.
-                'slot': composite.slots[name],
+                'slot': slot,
+                'target_path': '/'.join(slot.getPhysicalPath()),
+                'elements': elements,
                 }
             contents.append(slot_info)
         return contents


=== Products/CompositePage/designuis.py 1.1.2.2 => 1.1.2.3 ===
--- Products/CompositePage/designuis.py:1.1.2.2	Fri Feb 20 17:31:35 2004
+++ Products/CompositePage/designuis.py	Tue Feb 24 17:34:11 2004
@@ -270,3 +270,25 @@
                         ) + CommonUI.bottom_templates
 
 Globals.InitializeClass(CMFUI)
+
+
+
+class ManualUI (CommonUI):
+    """Non-WYSIWYG page design UI.
+    """
+    security = ClassSecurityInfo()
+
+    page = PageTemplateFile("page.pt", _manual)
+    manual_styles_css = InterpolatedFile(
+        "manual_styles.css", "text/css", _manual)
+    header_templates = (PageTemplateFile("header.pt", _manual),)
+    manual_js = RawFile("manual.js", "text/javascript", _manual)
+
+    security.declarePrivate("render")
+    def render(self, composite):
+        """Renders a composite, adding scripts and styles.
+        """
+        pt = self.page.__of__(composite)
+        return pt()
+
+Globals.InitializeClass(ManualUI)




More information about the Zope-CVS mailing list