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