Copie de MosaicDocument à partir de :
[MosaicDocument.git] / MosaicTool.py
1 # (c) 2003 Centre de Recherche en Informatique ENSMP Fontainebleau <http://cri.ensmp.fr>
2 # (c) 2003 Benoît PIN <mailto:pin@cri.ensmp.fr>
3 #
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 2 as published
6 # by the Free Software Foundation.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
16 # 02111-1307, USA.
17 #
18
19 """
20 Mosaic Tool
21 """
22
23 from Globals import InitializeClass
24 from Products.CMFCore.TypesTool import TypesTool
25 from Products.CMFCore.permissions import ManagePortal
26 from MosaicBlockInformation import MosaicBlockInformation
27 from AccessControl import ClassSecurityInfo
28
29
30 allowedTypes = ['Mosaic Block Information']
31
32 class MosaicTool(TypesTool):
33 """
34 Mosaic Tool
35 """
36
37 id = 'mosaic_tool'
38 meta_type = 'Mosaic Tool'
39
40 def filtered_meta_types(self, user=None):
41 # Filters the list of available meta types.
42 allowed = {}
43 for name in allowedTypes:
44 allowed[name] = 1
45
46 all = TypesTool.inheritedAttribute('filtered_meta_types')(self)
47 meta_types = []
48 for meta_type in self.all_meta_types():
49 if allowed.get(meta_type['name']):
50 meta_types.append(meta_type)
51 return meta_types
52
53
54 InitializeClass(MosaicTool)