Commit ce213537 authored by Sebastien Robin's avatar Sebastien Robin

newCellContent should support a portal_type


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2410 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 72a08bdc
...@@ -461,18 +461,21 @@ class XMLMatrix(Folder): ...@@ -461,18 +461,21 @@ class XMLMatrix(Folder):
if cell is not None: if cell is not None:
return cell return cell
else: else:
return self.newCellContent(cell_id) return self.newCellContent(cell_id,**kwd)
security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' ) security.declareProtected( Permissions.ModifyPortalContent, 'newCellContent' )
def newCellContent(self, id): def newCellContent(self, id,**kw):
""" """
This method can be overriden This method can be overriden
""" """
content_types = self.allowedContentTypes() if kw.has_key('portal_type'):
if len(content_types) >= 1: type_name = kw['portal_type']
type_name = content_types[0].id
else: else:
type_name = self.portal_type content_types = self.allowedContentTypes()
if len(content_types) >= 1:
type_name = content_types[0].id
else:
type_name = self.portal_type
self.invokeFactory(type_name=type_name,id=id) self.invokeFactory(type_name=type_name,id=id)
return self.get(id) return self.get(id)
......
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