Author: jmorliaguet
Date: Tue Dec 13 16:24:20 2005
New Revision: 2029

Modified:
   cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py
   cpsskins/branches/jmo-perspectives/engines/sitedesigner/configure.zcml
   cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt
Log:

- added option to remove (local) settings



Modified: cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py
==============================================================================
--- cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py  
(original)
+++ cpsskins/branches/jmo-perspectives/engines/sitedesigner/browser.py  Tue Dec 
13 16:24:20 2005
@@ -72,6 +72,16 @@
         target = self.request.get('HTTP_REFERER', '.')
         self.request.response.redirect(target)
 
+    def removeSetting(self, name=u''):
+        if not name:
+            raise KeyError("Must specify a setting's name.")
+
+        resources = getUtility(IResourceManager)
+        resources.unregister(name=name, context=self.context)
+
+        target = self.request.get('HTTP_REFERER', '.')
+        self.request.response.redirect(target)
+
     def exportSetting(self, name=u''):
         """Export the setting as an XML file.
         """

Modified: cpsskins/branches/jmo-perspectives/engines/sitedesigner/configure.zcml
==============================================================================
--- cpsskins/branches/jmo-perspectives/engines/sitedesigner/configure.zcml      
(original)
+++ cpsskins/branches/jmo-perspectives/engines/sitedesigner/configure.zcml      
Tue Dec 13 16:24:20 2005
@@ -46,6 +46,11 @@
     />
 
     <page
+        name="removeSetting"
+        attribute="removeSetting"
+    />
+
+    <page
         name="exportSetting"
         attribute="exportSetting"
     />

Modified: 
cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt    
(original)
+++ cpsskins/branches/jmo-perspectives/engines/sitedesigner/site_designer.pt    
Tue Dec 13 16:24:20 2005
@@ -53,6 +53,8 @@
                                    custom info/custom">
                   <a tal:attributes="href string:@@customizeSetting?name=$name"
                      tal:condition="readonly">[customize]</a>
+                  <a tal:attributes="href string:@@removeSetting?name=$name"
+                     tal:condition="python: not custom and not 
readonly">[remove]</a>
                   <a tal:attributes="href 
string:@@decustomizeSetting?name=$name"
                      tal:condition="custom">[remove customization]</a>
                   <a tal:attributes="href string:@@exportSetting?name=$name"
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to