1 # -*- coding: utf-8 -*-
2 # (c) 2003 Centre de Recherche en Informatique ENSMP Fontainebleau <http://cri.ensmp.fr>
3 # (c) 2003 Benoît PIN <mailto:pin@cri.ensmp.fr>
5 from Products
.CMFCore
.DirectoryView
import registerDirectory
6 from Products
.CMFCore
import utils
7 from Products
.CMFCore
.permissions
import AddPortalContent
, ManagePortal
12 import ImageSlot
, StringSlot
, FileSlot
, SpacerSlot
15 from MosaicBlockInformation
import \
16 MosaicBlockInformation
, addMosaicBlockInformationForm
, addMosaicBlockInformation
, \
17 SlotInfo
, addSlotInfo
, \
21 MosaicDocument
.MosaicDocument
,
22 MosaicBlock
.MosaicBlock
,
24 StringSlot
.StringSlot
,
29 contentConstructors
= (
30 MosaicDocument
.addMosaicDocument
,
31 MosaicBlock
.addMosaicBlock
,
32 ImageSlot
.addImageSlot
,
33 StringSlot
.addStringSlot
,
35 SpacerSlot
.addSpacerSlot
39 MosaicDocument
.factory_type_information
+
40 ImageSlot
.factory_type_information
+
41 StringSlot
.factory_type_information
+
42 FileSlot
.factory_type_information
+
43 SpacerSlot
.factory_type_information
+
47 for path
in ('default_blocks', 'default_slots', 'skins') :
48 registerDirectory(path
, globals())
50 def initialize(registrar
) :
53 content_types
= contentClasses
,
54 permission
= AddPortalContent
,
55 extra_constructors
= contentConstructors
,
57 ).initialize(registrar
)
61 tools
= (MosaicTool
.MosaicTool
, ),
63 ).initialize(registrar
)
65 registrar
.registerClass(
66 MosaicBlockInformation
,
67 constructors
= (addMosaicBlockInformationForm
, addMosaicBlockInformation
),
68 icon
= 'dtml/block_icon.gif')
70 registrar
.registerClass(
72 constructors
=(addSlotInfo
,)
75 registrar
.registerClass(
77 constructors
=(addRuleInfo
,)
81 ## monkey patching ZPublisher.Converters
82 from ZPublisher
.Converters
import type_converters
83 type_converters
.update({'expr' : MosaicDocument
.Expression
})