[Zope3-checkins] CVS: Zope3/src/zope/app/publisher/browser - meta.zcml:1.17 metadirectives.py:1.14

Philipp von Weitershausen philikon at philikon.de
Mon Mar 1 05:52:46 EST 2004


Update of /cvs-repository/Zope3/src/zope/app/publisher/browser
In directory cvs.zope.org:/tmp/cvs-serv21283

Modified Files:
	meta.zcml metadirectives.py 
Log Message:
The AddMenuItem directive was not i18n ready. Made life a bit easier by
defining an IMenuItem interface which specific menu item directives
extend.


=== Zope3/src/zope/app/publisher/browser/meta.zcml 1.16 => 1.17 ===
--- Zope3/src/zope/app/publisher/browser/meta.zcml:1.16	Sun Dec  7 05:04:53 2003
+++ Zope3/src/zope/app/publisher/browser/meta.zcml	Mon Mar  1 05:52:45 2004
@@ -148,7 +148,7 @@
 
     <meta:directive
         name="addMenuItem"
-        schema=".metadirectives.IAddMenuItem"
+        schema=".metadirectives.IAddMenuItemDirective"
         handler=".metaconfigure.addMenuItem"
         />
     


=== Zope3/src/zope/app/publisher/browser/metadirectives.py 1.13 => 1.14 ===
--- Zope3/src/zope/app/publisher/browser/metadirectives.py:1.13	Fri Feb 13 17:35:39 2004
+++ Zope3/src/zope/app/publisher/browser/metadirectives.py	Mon Mar  1 05:52:45 2004
@@ -396,19 +396,10 @@
         required=False
         )
 
-class IMenuItemSubdirective(Interface):
-    """
-    Define a menu item within a group of menu items
+class IMenuItem(Interface):
+    """Common menu item configuration
     """
 
-    action = TextLine(
-        title=u"The relative url to use if the item is selected",
-        description=u"""
-        The url is relative to the object the menu is being displayed
-        for.""",
-        required=True
-        )
-
     title = MessageID(
         title=u"Title",
         description=u"The text to be displayed for the menu item",
@@ -451,11 +442,47 @@
         required=False
         )
 
+class IMenuItemSubdirective(IMenuItem):
+    """
+    Define a menu item within a group of menu items
+    """
+
+    action = TextLine(
+        title=u"The relative url to use if the item is selected",
+        description=u"""
+        The url is relative to the object the menu is being displayed
+        for.""",
+        required=True
+        )
+
 class IMenuItemDirective(IMenuItemsDirective, IMenuItemSubdirective):
     """
     Define one menu item
     """
 
+class IAddMenuItemDirective(IMenuItem):
+    """Define an add-menu item
+    """
+
+    class_ = GlobalObject(
+        title=u"Class",
+        description=u"""
+        A class to be used as a factory for creating new objects""",
+        required=False
+        )
+
+    factory = Id(
+        title=u"Factory",
+        description=u"A factory id for creating new objects",
+        required = False,
+        )
+
+    view = TextLine(
+        title=u"Custom view name",
+        description=u"The name of a custom add view",
+        required = False,
+        )
+
 #
 # misc. directives
 #
@@ -531,8 +558,7 @@
         required=False
         )
 
-    # XXX this ought to be renamed title
-    alt = TextLine(
+    title = MessageID(
         title=u"Title",
         description=u"Descriptive title",
         required=False
@@ -544,70 +570,4 @@
         For information on layers, see the documentation for the skin
         directive. Defaults to "default".""",
         required=False
-        )
-
-class IAddMenuItem(Interface):
-    """Define an add-menu item
-    """
-
-    class_ = GlobalObject(
-        __doc__ = """Class
-
-                 A class to be used as a factory for creating new objects
-                 """,
-        required = False,
-        )
-
-    factory = Id(
-        __doc__ = """Factory
-
-                 A factory id for creating new objects
-                 """,
-        required = False,
-        )
-
-    title = TextLine(
-        __doc__ = """Title
-
-                  A one-line description of the objects to be added
-                  """,
-        required = True,
-        )
-
-    description = Text(
-        __doc__ = """Text
-
-                  A multi-line description of the objects to be added
-                  """,
-        required = False,
-        )
-
-    permission = Id(
-        title=u"The permission needed to add an object.",
-        required=False,
-        )
-
-    filter = TextLine(
-        title=u"A condition for displaying the menu item",
-        description=u"""
-        The condition is given as a TALES expression. The expression
-        has access to the variables:
-
-        context -- The object the menu is being displayed for
-
-        request -- The browser request
-
-        nothing -- None
-
-        The menu item will not be displayed if there is a filter and
-        the filter evaluates to a false value.""",
-        required=False
-        )
-
-    view = TextLine(
-        __doc__ = """Custom view name
-
-                  The name of a custom add view
-                  """,
-        required = False,
         )




More information about the Zope3-Checkins mailing list