File: __init__.py

package info (click to toggle)
zope-ttwtype 0.9.1-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 108 kB
  • ctags: 58
  • sloc: python: 272; makefile: 47
file content (44 lines) | stat: -rw-r--r-- 1,344 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# (C) 2003 by Christian Scholz/MrTopf of COM.lounge

from Products.CMFCore.TypesTool import TypesTool, typeClasses
from Products.CMFCore.DirectoryView import registerDirectory
from ttwtypeinformation import TTWTypeInformation
from ttwtypeinformation import manage_addTTWTypeInformationForm
from ttwtypeinformation import manage_addTTWTypeInformation
from ttwobject import TTWObject, manage_addTTWObject

ttwtype_globals=globals()

def initialize(context):

    # register skin directory
    registerDirectory('skins', globals())

    # add our type to the typeClasses list
    typeClasses.append(
	{'class'	    : TTWTypeInformation,
	 'name'	    : TTWTypeInformation.meta_type,
	 'action'	    : 'manage_addTTWTypeInformationForm',
	 'permission'   : 'Manage portal'}
	)

    ### now some patching (don't see any other possibility)
    # add the form to the types tool as it's no product
    TypesTool.manage_addTTWTypeInformationForm= \
	manage_addTTWTypeInformationForm
    TypesTool.manage_addTTWTypeInformation= \
	manage_addTTWTypeInformation

    ### register the class for copysupport
    context.registerClass(
	TTWObject,
	constructors=(manage_addTTWObject,)
	)

    ### register the icon
    from Products.CMFCore import utils, cmfcore_globals
    utils.registerIcon(TTWTypeInformation,
	    'images/typeinfo.gif', cmfcore_globals)