From d4f355c2c9490ba574d17fd11ec0d403f8b1d9db Mon Sep 17 00:00:00 2001 From: helmutm Date: Tue, 23 Sep 2008 07:19:03 +0000 Subject: [PATCH] work in progress: layout management git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@2899 fd906abe-77d9-0310-91a1-e0d9ade77398 --- composer/layout/README.txt | 3 +++ composer/layout/base.py | 8 +++++--- composer/layout/browser/configure.zcml | 5 +++++ composer/layout/browser/default.py | 4 ++++ composer/layout/browser/main.pt | 22 ---------------------- composer/layout/browser/standard.pt | 24 ++++++++++++++++++++++++ composer/layout/browser/view.py | 18 ++++-------------- 7 files changed, 45 insertions(+), 39 deletions(-) delete mode 100644 composer/layout/browser/main.pt diff --git a/composer/layout/README.txt b/composer/layout/README.txt index db4308e..e9af1a2 100644 --- a/composer/layout/README.txt +++ b/composer/layout/README.txt @@ -28,6 +28,9 @@ manager. The layouts themselves are also specified as utilities. + >>> from cybertools.composer.layout.browser.default import page + >>> component.provideUtility(page, ILayout, name='page') + >>> from cybertools.composer.layout.browser.liquid.default import css >>> component.provideUtility(css, ILayout, name='css.liquid') diff --git a/composer/layout/base.py b/composer/layout/base.py index 3523d49..c0a9824 100644 --- a/composer/layout/base.py +++ b/composer/layout/base.py @@ -59,7 +59,8 @@ class Layout(Template): title = description = u'' category = 'default' renderer = None - order = 0 + order = 50 + sublayouts = None def __init__(self, name, regionName, **kw): self.name = name @@ -84,5 +85,6 @@ class LayoutInstance(object): def getLayouts(self, region): if region is None: return [] - return region.layouts - + sublayouts = self.template.sublayouts + return [l for l in region.layouts + if sublayouts is None or l.name in sublayouts] diff --git a/composer/layout/browser/configure.zcml b/composer/layout/browser/configure.zcml index d0897de..062ec12 100644 --- a/composer/layout/browser/configure.zcml +++ b/composer/layout/browser/configure.zcml @@ -5,6 +5,11 @@ xmlns:browser="http://namespaces.zope.org/browser" i18n_domain="cybertools.composer"> + + - - - - - Powered by Zope 3 - - - - - - - - - - - - - - diff --git a/composer/layout/browser/standard.pt b/composer/layout/browser/standard.pt index a0e90d3..376b817 100644 --- a/composer/layout/browser/standard.pt +++ b/composer/layout/browser/standard.pt @@ -1,3 +1,27 @@ + + + + + + Powered by Zope 3 + + + + + + + + + + + + + + + +