def isUrlAllowed(self): allowed_url_paths = get_config_setting('allowed_url_paths') if allowed_url_paths: obj_path, browser_path = self.getCurrentPaths() return (obj_path in allowed_url_paths) or \ (browser_path in allowed_url_paths) else: return getMultiAdapter( (self.context, self.request), name='plone_context_state').is_portal_root()
def javascriptvars(self): """ It overlaps settings which was set up by static/add2home.js """ return "var addToHomeConfig = %s" % json.dumps( { # Show the message only to returning visitors # (ie: don't show it the first time) 'returningVisitor': True, 'message': get_config_setting('message'), # Show the message only once every 12 hours 'expire': 720 } )