[Zope3-checkins] CVS: Zope3/src/zope/app/browser/services - pagefolder.py:1.2

Jim Fulton jim@zope.com
Wed, 2 Jul 2003 18:11:03 -0400


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

Modified Files:
	pagefolder.py 
Log Message:
Added a class with a changed hook to apply default configuration
updates if the "apply" field is set in the default config.


=== Zope3/src/zope/app/browser/services/pagefolder.py 1.1 => 1.2 ===
--- Zope3/src/zope/app/browser/services/pagefolder.py:1.1	Sun Mar 23 11:45:43 2003
+++ Zope3/src/zope/app/browser/services/pagefolder.py	Wed Jul  2 18:10:59 2003
@@ -15,17 +15,17 @@
 
 Revision information: $Id$
 """
-from zope.app.browser.container.contents import Contents
 from zope.app.interfaces.services.pagefolder import IPageFolder
-from zope.app.pagetemplate import ViewPageTemplateFile
-from zope.app.services.zpt import ZPTTemplate
 
-class PageFolderContents(Contents):
+class PageFolderDefaultConfiguration:
 
-    __used_for__ = IPageFolder
+    def changed(self):
+        """Apply changes to existing configurations
+        """
+        __used_for__ = IPageFolder
 
-    index = ViewPageTemplateFile('pagefolder_contents.pt')
+        folder = self.context
+        if folder.apply:
+            folder.applyDefaults()
 
-    def add(self, name):
-        self.context.setObject(name, ZPTTemplate())
-        self.request.response.redirect('@@contents.html')
+