Commit 4e69c9ad authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added layout property getter with explicit acquisition.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@19953 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent a094eab8
......@@ -117,6 +117,19 @@ class WebSection(Domain, PermanentURLMixIn):
return PermanentURLMixIn.__bobo_traverse__(self, request, name)
security.declareProtected(Permissions.AccessContentsInformation, 'getLayoutProperty')
def getLayoutProperty(self, default):
"""
A simple method to get a property of the current by
acquiring it from the current section or its parents
"""
section = aq_inner(self)
while section.getPortalType() in ('Web Section', 'Web Site'):
result = section.getProperty(default)
if result:
return result
section = section.aq_parent
security.declareProtected(Permissions.AccessContentsInformation, 'getWebSectionValue')
def getWebSectionValue(self):
"""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment