[Zope3-checkins] CVS: Zope3/src/zope/app/browser/container -
add.pt:1.15 adding.py:1.25
The Unidentified User
cvs-admin at zope.org
Tue Dec 9 05:46:19 EST 2003
Update of /cvs-repository/Zope3/src/zope/app/browser/container
In directory cvs.zope.org:/tmp/cvs-serv18730/src/zope/app/browser/container
Modified Files:
add.pt adding.py
Log Message:
- modified renderAddButton method in adding.py
- modified add form add.pt to display add button with or without input box
- renderAddButton returns add button with or without input box
=== Zope3/src/zope/app/browser/container/add.pt 1.14 => 1.15 ===
--- Zope3/src/zope/app/browser/container/add.pt:1.14 Sun Dec 7 05:04:47 2003
+++ Zope3/src/zope/app/browser/container/add.pt Tue Dec 9 05:45:48 2003
@@ -45,6 +45,7 @@
</tbody>
</table>
+
</form>
</div>
=== Zope3/src/zope/app/browser/container/adding.py 1.24 => 1.25 ===
--- Zope3/src/zope/app/browser/container/adding.py:1.24 Tue Dec 9 02:35:36 2003
+++ Zope3/src/zope/app/browser/container/adding.py Tue Dec 9 05:45:48 2003
@@ -60,6 +60,7 @@
container = self.context
name = self.contentName
+
chooser = zapi.getAdapter(container, INameChooser)
if IContainerNamesContainer.isImplementedBy(container):
@@ -68,6 +69,8 @@
name = chooser.chooseName(self.contentName or '', content)
else:
+ request = self.request
+ name = request.get('add_input_name',name)
chooser.checkName(name, container)
container[name] = content
@@ -91,10 +94,12 @@
container = self.context
if IContainerNamesContainer.isImplementedBy(container):
- return "<input type='submit' value=' Add '>"
+ return "<input type='submit' name='UPDATE_SUBMIT' value=' Add '>"
else:
- return ("<input type='submit' value=' Add '>"
- "<input type='text' name='add_input_name' value=''>")
+ contentName = self.contentName or ''
+ return ("<input type='submit' name='UPDATE_SUBMIT' value=' Add '>"
+ "<input type='text' name='add_input_name' value='%s'>"
+ % contentName)
def publishTraverse(self, request, name):
"""See zope.app.interfaces.container.IAdding"""
More information about the Zope3-Checkins
mailing list