Commit 6af6531f authored by Sebastien Robin's avatar Sebastien Robin

allow to get the redirect script


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2316 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent bed0bfd8
......@@ -79,6 +79,12 @@ class FolderMixIn(ExtensionClass.Base):
if immediate_reindex: new_instance.immediateReindexObject()
return new_instance
security.declareProtected(Permissions.View, 'getRedirectScriptAfterNewContent')
def getRedirectScriptAfterNewContent(self,portal_type=None,**kw):
"""
"""
return self.portal_types.getTypeInfo(portal_type).getRedirectScript()
security.declareProtected(Permissions.DeletePortalContent, 'deleteContent')
def deleteContent(self, id):
# id is string or list
......
......@@ -30,6 +30,8 @@ from Products.CMFCore.interfaces.portal_types import ContentTypeInformation as I
from Products.ERP5Type import _dtmldir
from Products.ERP5Type import Permissions as ERP5Permissions
from zLOG import LOG
class ERP5TypeInformation( FactoryTypeInformation ):
"""
ERP5 Types are based on FactoryTypeInformation
......@@ -53,6 +55,11 @@ class ERP5TypeInformation( FactoryTypeInformation ):
'label':'Product factory method'},
{'id':'init_script', 'type': 'string', 'mode':'w',
'label':'Init Script'},
{'id':'redirect_script'
, 'type': 'string'
, 'mode':'w'
, 'label':'Redirect Script'
},
{'id':'filter_content_types', 'type': 'boolean', 'mode':'w',
'label':'Filter content types?'},
{'id':'allowed_content_types'
......@@ -78,6 +85,7 @@ class ERP5TypeInformation( FactoryTypeInformation ):
property_sheet_list = ()
base_category_list = ()
init_script = ''
redirect_script = ''
product = 'ERP5Type'
immediate_view = 'view'
......@@ -130,6 +138,15 @@ class ERP5TypeInformation( FactoryTypeInformation ):
result.sort()
return result
security.declareProtected(ERP5Permissions.AccessContentsInformation, 'getRedirectScript')
def getRedirectScript( self ):
"""
return the redirect script
"""
if self.redirect_script == '':
return None
return self.redirect_script
def manage_editProperties(self, REQUEST):
"""
Method overload
......
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