# -*- coding: utf-8 # Copyright 2005 by Vahur Rebas from Products.CMFCore.utils import getToolByName from Products.Archetypes.Extensions.utils import install_subskin, installTypes from Products.Archetypes.public import listTypes #from Products.CMFCore.DirectoryView import addDirectoryviews from StringIO import StringIO import string from Products.CMFTimeTable.config import GLOBALS, PROJECT_NAME def install(self): """ install. """ out = StringIO() install_subskin(self, out, GLOBALS) installTypes(self, out, listTypes(PROJECT_NAME), PROJECT_NAME) portal = getToolByName(self,'portal_url').getPortalObject() if not hasattr(self, 'time_tool'): addTool = portal.manage_addProduct[PROJECT_NAME].manage_addTool addTool(type='Time Table Tool') cp = self.portal_controlpanel cp.addAction( id = 'Time Table Tool', name = 'Time Table Tool', action = 'string: ${portal_url}/prefs_time_tool', permission = 'View', category = 'Products', imageUrl = 'tt_icon.gif', appId = PROJECT_NAME) return out.getvalue() def uninstall(self): """ uninstall """ out = StringIO() self.portal_controlpanel.unregisterApplication(PROJECT_NAME) return out.getvalue()