Author: jmorliaguet
Date: Sun Oct 30 18:31:48 2005
New Revision: 28825

Modified:
   z3lab/cpsskins/branches/jmo-perspectives/browser/rendering/engine.py
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js
   z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/jsonrpc.py
   z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml
   
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
   
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt
Log:

- we set the current location to the local (or the global) site's folder when
  working in page designer or in layout designer



Modified: z3lab/cpsskins/branches/jmo-perspectives/browser/rendering/engine.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/browser/rendering/engine.py        
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/browser/rendering/engine.py        
Sun Oct 30 18:31:48 2005
@@ -17,6 +17,7 @@
 """
 __docformat__ = "reStructuredText"
 
+from zope.app import zapi
 from zope.app.pagetemplate import ViewPageTemplateFile
 from zope.app.publisher.browser import BrowserView
 from zope.app.traversing.api import getParent
@@ -155,6 +156,11 @@
             'request': request,
             })
 
+        # set the current location unless specified
+        if globals.location is None:
+            site = zapi.getSiteManager(element)
+            globals.location = zapi.getParent(site)
+
         # build the tree and store it in the request
         contexts['tree'] = _updateTreeInfo(node=element, globals=globals)
 

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/authoring.js     
Sun Oct 30 18:31:48 2005
@@ -87,9 +87,7 @@
 
 /* VIEWS */
 function render_element(id) {
-  var rendered = themeEditor.renderElement(
-    id = id,
-    engine = 'page-designer');
+  var rendered = themeEditor.renderElement(id=id);
   var tag = getFirstTag(rendered);
   var wrapper = document.createElement(tag);
   replaceHTML(wrapper, rendered);

Modified: z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/jsonrpc.py
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/jsonrpc.py       
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/authoring/jsonrpc.py       
Sun Oct 30 18:31:48 2005
@@ -50,15 +50,14 @@
         tmutil = getThemeManager()
         return tmutil.getElementById(id)
 
-    def renderElement(self, id, engine='default', canvas_mode=''):
+    def renderElement(self, id, engine='default'):
         """Render the element and return the markup
         """
         element = self._getElementById(id)
         request = self.request
 
-        tmutil = getThemeManager()
         viewer = getMultiAdapter((element, request), IViewer)
-        return viewer(location=element, engine=engine, canvas_mode=canvas_mode)
+        return viewer(engine=engine)
 
     def editElement(self, id, name, value):
         """Edit the element: assign a value to an attribute (name).

Modified: z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml
==============================================================================
--- z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml     
(original)
+++ z3lab/cpsskins/branches/jmo-perspectives/engines/configure.zcml     Sun Oct 
30 18:31:48 2005
@@ -8,14 +8,14 @@
   <include package=".authoring" />
 
 
-  <!-- layout designer -->
+  <!-- page designer -->
 
-  <include package=".layoutdesigner" />
+  <include package=".pagedesigner" />
 
 
-  <!-- page designer -->
+  <!-- layout designer -->
 
-  <include package=".pagedesigner" />
+  <include package=".layoutdesigner" />
 
 
   <!-- content author -->

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
  (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/layoutdesigner/layout_designer.pt
  Sun Oct 30 18:31:48 2005
@@ -35,9 +35,7 @@
     <div id="editSpace">
       <metal:block use-macro="context/@@authoring_macros/themetabs" />
       <metal:block use-macro="context/@@authoring_macros/pagetabs" />
-      <tal:block content="structure python: view.draw(
-                          location=context,
-                          engine='layout-designer')" />
+      <tal:block content="structure python: 
view.draw(engine='layout-designer')" />
     </div>
 
     <metal:block use-macro="context/@@authoring_macros/authoring_footer" />

Modified: 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt
==============================================================================
--- 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt  
    (original)
+++ 
z3lab/cpsskins/branches/jmo-perspectives/engines/pagedesigner/page_designer.pt  
    Sun Oct 30 18:31:48 2005
@@ -35,9 +35,7 @@
     <div id="editSpace">
       <metal:block use-macro="context/@@authoring_macros/themetabs" />
       <metal:block use-macro="context/@@authoring_macros/pagetabs" />
-      <tal:block content="structure python: view.draw(
-                          location=context,
-                          engine='page-designer')" />
+      <tal:block content="structure python: view.draw(engine='page-designer')" 
/>
     </div>
 
     <metal:block use-macro="context/@@authoring_macros/authoring_footer" />
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to