Back to index

plone3  3.1.7
TypesTool.py
Go to the documentation of this file.
00001 from Products.CMFCore.TypesTool import TypesTool as BaseTool
00002 from Products.CMFPlone import ToolNames
00003 from AccessControl import ClassSecurityInfo
00004 from Globals import InitializeClass
00005 from Products.CMFPlone.PloneBaseTool import PloneBaseTool
00006 
00007 class TypesTool(PloneBaseTool, BaseTool):
00008 
00009     meta_type = ToolNames.TypesTool
00010     security = ClassSecurityInfo()
00011     toolicon = 'skins/plone_images/document_icon.gif'
00012 
00013     __implements__ = (PloneBaseTool.__implements__, BaseTool.__implements__, )
00014 
00015     security.declarePublic('listTypeTitles')
00016     def listTypeTitles(self, container=None):
00017         """ Return a dictionary of id/Title combinations """
00018         typenames = {}
00019         for t in self.listTypeInfo( container ):
00020             name = t.getId()
00021             if name:
00022                 typenames[ name ] = t.title_or_id()
00023 
00024         return typenames
00025 
00026 TypesTool.__doc__ = BaseTool.__doc__
00027 
00028 InitializeClass(TypesTool)