Commit 95eb2db4 authored by Jean-Paul Smets's avatar Jean-Paul Smets

Added templates and layout support


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@5207 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ea1e482d
......@@ -2156,6 +2156,33 @@ class Base( CopyContainer, PortalContent, ActiveObject, ERP5PropertyManager ):
return history[-1].get('time', None)
return None
# Layout management
security.declareProtected(Permissions.AccessContentsInformation, 'getApplicableLayout')
def getApplicableLayout(self):
"""
Return applicable layout in this acquisition context by
browsing context parents.
We have to take into account context before containment. This
is why standard acquisition must be circumvented here.
"""
current = self
while current is not None:
if current.hasLayout():
return current.getLayout()
current = current.getParentValue()
if not hasattr(current, 'getApplicableLayout'):
return None
return None
security.declareProtected(Permissions.View, 'getDocumentTemplateList')
def getDocumentTemplateList(self) :
"""
Returns an empty list of allowed templates
(this is not a folder)
"""
return []
InitializeClass(Base)
class TempBase(Base):
......
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