X-Git-Url: https://scm.cri.ensmp.fr/git/MosaicDocument.git/blobdiff_plain/155c6ba3d7e8e9693d30b3cf70f591f0153610b6..99b3ba92670e19c1f86f5de83b8e6bbe4fdc297f:/Products/MosaicDocument/MosaicTool.py?ds=inline diff --git a/Products/MosaicDocument/MosaicTool.py b/Products/MosaicDocument/MosaicTool.py new file mode 100755 index 0000000..86ef932 --- /dev/null +++ b/Products/MosaicDocument/MosaicTool.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# (c) 2003 Centre de Recherche en Informatique ENSMP Fontainebleau +# (c) 2003 Benoît PIN +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License version 2 as published +# by the Free Software Foundation. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# + +""" + Mosaic Tool +""" + +from Globals import InitializeClass +from Products.CMFCore.TypesTool import TypesTool +from Products.CMFCore.permissions import ManagePortal +from MosaicBlockInformation import MosaicBlockInformation +from AccessControl import ClassSecurityInfo + + +allowedTypes = ['Mosaic Block Information'] + +class MosaicTool(TypesTool): + """ + Mosaic Tool + """ + + id = 'mosaic_tool' + meta_type = 'Mosaic Tool' + + def filtered_meta_types(self, user=None): + # Filters the list of available meta types. + allowed = {} + for name in allowedTypes: + allowed[name] = 1 + + all = TypesTool.inheritedAttribute('filtered_meta_types')(self) + meta_types = [] + for meta_type in self.all_meta_types(): + if allowed.get(meta_type['name']): + meta_types.append(meta_type) + return meta_types + + +InitializeClass(MosaicTool) \ No newline at end of file