source: products/qPingTool/trunk/__init__.py @ 1061

Last change on this file since 1061 was 1, checked in by myroslav, 18 years ago

Building directory structure

  • Property svn:eol-style set to native
File size: 1.3 KB
Line 
1from Globals import package_home
2from Products.Archetypes.public import process_types, listTypes
3from Products.CMFCore import utils
4from Products.CMFCore.DirectoryView import registerDirectory
5import os, os.path
6import PingInfo, PingTool
7from config import *
8
9try:
10    from adapter import registerAdapter
11    registerAdapter()
12except:
13    from Products.CMFCore.utils import getToolByName
14    from Products.CMFPlone.URLTool import URLTool
15    def getCanonicalURL(self):
16        portal = getToolByName(self, 'portal_url').getPortalObject()
17        return portal.getProperty('canonical_url', None)
18    #URLTool.security.declarePublic('getCanonicalURL')
19    URLTool.getCanonicalURL = getCanonicalURL
20
21
22registerDirectory(SKINS_DIR, GLOBALS)
23tools = ( PingTool.PingTool, )
24
25def initialize(context):
26    from AccessControl import allow_module
27    allow_module('Products.qPingTool.util')
28
29    utils.ToolInit("PingTool", tools=tools, product_name=PROJECTNAME, icon=TOOL_ICON,
30                  ).initialize(context)
31
32    content_types, constructors, ftis = process_types(listTypes(PROJECTNAME), PROJECTNAME)
33
34    utils.ContentInit(
35        PROJECTNAME + ' Content',
36        content_types      = content_types,
37        permission         = ADD_PERMISSION,
38        extra_constructors = constructors,
39        fti                = ftis,
40        ).initialize(context)
41
Note: See TracBrowser for help on using the repository browser.