Back to index

plone3  3.1.7
tool.py
Go to the documentation of this file.
00001 from five.customerize.interfaces import IViewTemplateContainer
00002 from zope.interface import implements
00003 from OFS.Folder import Folder
00004 
00005 
00006 class ViewTemplateContainer(Folder):
00007     """ a local utility storing all ttw view templates provided
00008         by five.customerize in a folder """
00009     implements(IViewTemplateContainer)
00010 
00011     id  = 'portal_view_customizations'
00012     title = 'Manages view customizations'
00013     meta_type = 'Plone View Customizations'
00014 
00015     manage_options = (
00016         dict(label='Registrations', action='registrations.html'),
00017         ) + Folder.manage_options[0:1] + Folder.manage_options[2:]
00018 
00019     def addTemplate(self, id, template):
00020         """ add the given ttw view template to the container """
00021         self._setObject(id, template)
00022         return getattr(self, id)
00023