Commit e5ff0528 authored by Sebastien Robin's avatar Sebastien Robin

add a list of types that should not be displayed to the user


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@2511 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 4cf09ca2
...@@ -57,17 +57,18 @@ class ERP5TypeInformation( FactoryTypeInformation ): ...@@ -57,17 +57,18 @@ class ERP5TypeInformation( FactoryTypeInformation ):
'label':'Init Script'}, 'label':'Init Script'},
{'id':'filter_content_types', 'type': 'boolean', 'mode':'w', {'id':'filter_content_types', 'type': 'boolean', 'mode':'w',
'label':'Filter content types?'}, 'label':'Filter content types?'},
{'id':'hide_from_add_menu'
, 'type': 'boolean'
, 'mode':'w'
, 'label':'Hide From Had Menu'
},
{'id':'allowed_content_types' {'id':'allowed_content_types'
, 'type': 'multiple selection' , 'type': 'multiple selection'
, 'mode':'w' , 'mode':'w'
, 'label':'Allowed content types' , 'label':'Allowed content types'
, 'select_variable':'listContentTypes' , 'select_variable':'listContentTypes'
}, },
{'id':'hidden_content_type_list'
, 'type': 'multiple selection'
, 'mode':'w'
, 'label':'Hidden content types'
, 'select_variable':'listContentTypes'
},
{'id':'property_sheet_list' {'id':'property_sheet_list'
, 'type': 'multiple selection' , 'type': 'multiple selection'
, 'mode':'w' , 'mode':'w'
...@@ -87,7 +88,7 @@ class ERP5TypeInformation( FactoryTypeInformation ): ...@@ -87,7 +88,7 @@ class ERP5TypeInformation( FactoryTypeInformation ):
init_script = '' init_script = ''
product = 'ERP5Type' product = 'ERP5Type'
immediate_view = 'view' immediate_view = 'view'
hide_from_add_menu = False hidden_content_type_list = ()
# #
# Acquisition editing interface # Acquisition editing interface
...@@ -96,12 +97,12 @@ class ERP5TypeInformation( FactoryTypeInformation ): ...@@ -96,12 +97,12 @@ class ERP5TypeInformation( FactoryTypeInformation ):
_actions_form = DTMLFile( 'editToolsActions', _dtmldir ) _actions_form = DTMLFile( 'editToolsActions', _dtmldir )
security.declarePublic('hideFromAddMenu') security.declarePublic('hideFromAddMenu')
def hideFromAddMenu(self): def hidenFromAddMenu(self):
""" """
Return only true or false if we should Return only true or false if we should
hide from add menu hide from add menu
""" """
return self.hide_from_add_menu return self.hiden_from_add_menu
# #
...@@ -132,6 +133,13 @@ class ERP5TypeInformation( FactoryTypeInformation ): ...@@ -132,6 +133,13 @@ class ERP5TypeInformation( FactoryTypeInformation ):
result.sort() result.sort()
return result return result
security.declareProtected(ERP5Permissions.AccessContentsInformation, 'getHiddenContentTypeList')
def getHiddenContentTypeList( self ):
"""
Return list of content types.
"""
return self.hidden_content_type_list
security.declareProtected(ERP5Permissions.AccessContentsInformation, 'getBaseCategoryList') security.declareProtected(ERP5Permissions.AccessContentsInformation, 'getBaseCategoryList')
def getBaseCategoryList( self ): def getBaseCategoryList( self ):
result = self.portal_categories.getBaseCategoryList() result = self.portal_categories.getBaseCategoryList()
......
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