[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container -
adding.py:1.24
The Unidentified User
cvs-admin at zope.org
Tue Dec 9 02:36:07 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv18854/src/zope/app/browser/container
Modified Files:
adding.py
Log Message:
we have added method called renderAddButton in adding.py
Its a method for renderig Add button in Add form
=== Zope3/src/zope/app/browser/container/adding.py 1.23 => 1.24 ===
--- Zope3/src/zope/app/browser/container/adding.py:1.23 Wed Dec 3 00:40:49 2003
+++ Zope3/src/zope/app/browser/container/adding.py Tue Dec 9 02:35:36 2003
@@ -61,10 +61,12 @@
name = self.contentName
chooser = zapi.getAdapter(container, INameChooser)
+
if IContainerNamesContainer.isImplementedBy(container):
# The container pick's it's own names.
# We need to ask it to pick one.
name = chooser.chooseName(self.contentName or '', content)
+
else:
chooser.checkName(name, container)
@@ -82,6 +84,17 @@
request = None # set in BrowserView.__init__
context = None # set in BrowserView.__init__
+
+
+ def renderAddButton(self):
+ """To Render Add button with or without Inputbox"""
+ container = self.context
+
+ if IContainerNamesContainer.isImplementedBy(container):
+ return "<input type='submit' value=' Add '>"
+ else:
+ return ("<input type='submit' value=' Add '>"
+ "<input type='text' name='add_input_name' value=''>")
def publishTraverse(self, request, name):
"""See zope.app.interfaces.container.IAdding"""
More information about the Zope3-Checkins
mailing list