remove unnecessary discussion-check utility code.
svn path=/plone.app.discussion/trunk/; revision=29436
This commit is contained in:
		
							parent
							
								
									96e2899955
								
							
						
					
					
						commit
						a69f2baf01
					
				@ -109,13 +109,4 @@
 | 
			
		||||
        permission="cmf.ManagePortal"
 | 
			
		||||
        />
 | 
			
		||||
 | 
			
		||||
    <!-- Utility view - use in portal_css or similar as portal/@@xdv-check/enabled" -->
 | 
			
		||||
    <browser:page
 | 
			
		||||
        name="discussion-check"
 | 
			
		||||
        for="Products.CMFPlone.interfaces.IPloneSiteRoot"
 | 
			
		||||
        class=".controlpanel.Utility"
 | 
			
		||||
        permission="zope.Public"
 | 
			
		||||
        allowed_attributes="globally_enabled"
 | 
			
		||||
        />
 | 
			
		||||
 | 
			
		||||
</configure>
 | 
			
		||||
 | 
			
		||||
@ -40,28 +40,3 @@ class DiscussionSettingsEditForm(controlpanel.RegistryEditForm):
 | 
			
		||||
 | 
			
		||||
class DiscussionSettingsControlPanel(controlpanel.ControlPanelFormWrapper):
 | 
			
		||||
    form = DiscussionSettingsEditForm
 | 
			
		||||
 | 
			
		||||
class Utility(BrowserView):
 | 
			
		||||
    """Utility view to determine ...
 | 
			
		||||
    """
 | 
			
		||||
 | 
			
		||||
    def globally_enabled(self):
 | 
			
		||||
        """Determine if the utility is enabled and we are in an enabled domain
 | 
			
		||||
        """
 | 
			
		||||
 | 
			
		||||
        registry = queryUtility(IRegistry)
 | 
			
		||||
        if registry is None:
 | 
			
		||||
            return False
 | 
			
		||||
 | 
			
		||||
        settings = None
 | 
			
		||||
        try:
 | 
			
		||||
            settings = registry.forInterface(IDiscussionSettings)
 | 
			
		||||
        except KeyError:
 | 
			
		||||
            return False
 | 
			
		||||
 | 
			
		||||
        if not settings.globally_enabled:
 | 
			
		||||
            return False
 | 
			
		||||
        else:
 | 
			
		||||
            return True
 | 
			
		||||
 | 
			
		||||
        return False
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user