From b6d61f557b43c250bec69c2e0778a796e8b22438 Mon Sep 17 00:00:00 2001 From: helmutm Date: Sun, 14 Aug 2005 17:25:06 +0000 Subject: [PATCH] make Menu a local utility git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@545 fd906abe-77d9-0310-91a1-e0d9ade77398 --- browser/configure.zcml | 32 ++++++++++++++++++++++++++++++++ configure.zcml | 28 +++++++++++++++++++++++++--- interfaces.py | 19 ++++++++++++++++++- 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/browser/configure.zcml b/browser/configure.zcml index 9f9b759..4b92714 100644 --- a/browser/configure.zcml +++ b/browser/configure.zcml @@ -5,7 +5,39 @@ xmlns="http://namespaces.zope.org/browser" i18n_domain="zope" > + + + + + + + + diff --git a/configure.zcml b/configure.zcml index be9c44a..8c0c4be 100644 --- a/configure.zcml +++ b/configure.zcml @@ -5,11 +5,33 @@ i18n_domain="zope" > - - - + + + + + + + + + + + + + + + diff --git a/interfaces.py b/interfaces.py index ffaafe0..f910d4f 100644 --- a/interfaces.py +++ b/interfaces.py @@ -24,6 +24,7 @@ $Id$ from zope.interface import Interface from zope.app.container.interfaces import IOrderedContainer +from zope.app.component.interfaces.registration import IRegisterable from zope.schema import Text, TextLine, List, Object, Int @@ -32,6 +33,12 @@ class IBaseMenuItem(IOrderedContainer): """ Base interface with common methods for IMenu and IMenuItem. """ + title = TextLine( + title=u'Title', + description=u'Title of the menu or text that will appear on the menu item', + default=u'', + required=True) + def getMenuItems(): """ Return sub-menu items contained in this menu or menu item. """ @@ -59,7 +66,7 @@ class IBaseMenuItem(IOrderedContainer): """ -class IMenu(IBaseMenuItem): +class IMenu(IBaseMenuItem, IRegisterable): """ A Menu is a container for MenuItems and will be shown in a menu portlet. """ @@ -88,6 +95,16 @@ class IMenuItem(IBaseMenuItem): with other MenuItem objects in a menu portlet. """ + target = Object(Interface, + title=u'Target', + description=u'Target object this menu item should link to.',) + + urlPath = TextLine( + title=u'URL or Path', + description=u'URL or path that this menu item should link to.', + default=u'', + required=True) + def getItemUrl(): """ Return the target URL of this menu item. """