[Zope3-checkins] CVS: Zope3/src/zope/app/interfaces/publisher -
browser.py:1.8.8.1
Christian Zagrodnick
cvs-admin at zope.org
Sat Dec 6 13:29:50 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/interfaces/publisher
In directory cvs.zope.org:/tmp/cvs-serv16289/src/zope/app/interfaces/publisher
Modified Files:
Tag: gotcha-usage-branch
browser.py
Log Message:
finished the support of 'usage' in page templates (or better views)
- repaired editForm
- added to addForm
- added <usage name=.. /> zcml directive
- directives that rely on usage check for existing usages
- asserting that a usage can only be defined once
- tried use of usage in container/add.pt
=== Zope3/src/zope/app/interfaces/publisher/browser.py 1.8 => 1.8.8.1 ===
--- Zope3/src/zope/app/interfaces/publisher/browser.py:1.8 Wed Sep 24 13:22:06 2003
+++ Zope3/src/zope/app/interfaces/publisher/browser.py Sat Dec 6 13:29:19 2003
@@ -22,6 +22,25 @@
from zope.schema import TextLine, Text
+
+class IUsage(Interface):
+
+ usage = TextLine(
+ title=u"The template usage top-level variable",
+ description=u"""
+ See the usage documentation in the README.txt in the
+ zope/app/browser/skins directory.
+ If this view is associated with a menu item, this attribute should
+ not be supplied as the view will get its usage from the menu the
+ menu item is registered to.
+ This attribute is available for views not associated with a menu
+ item.
+ """,
+ required=False,
+ default=u""
+ )
+
+
class IBrowserMenuItem(Interface):
"""A menu item represents one view. These views might be conditioned
(using a filter) or being selected to be the default view of the menu."""
@@ -75,7 +94,7 @@
required=False)
-class IBrowserMenu(Interface):
+class IBrowserMenu(IUsage):
"""A menu can contain a set of views that a represented asa
collective."""
@@ -88,14 +107,6 @@
title=_("A longer explanation of the menu"),
description=_("A UI may display this with the item or display it "
"when the user requests more assistance."),
- required=False)
-
- usage = TextLine(
- title=_("The templates usage top-level variable"),
- description=_("See the usage documentation in the README.txt in the "
- "zope/app/browser/skins directory. If a view is "
- "associated with a menu item, the view will get its "
- "usage from the menu the menu item is registered to."),
required=False)
def getMenuItems(object=None):
More information about the Zope3-Checkins
mailing list