e8daf01f580534e1bb93f4654fbbff5393516c2f
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 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License version 2 as published
7 # by the Free Software Foundation.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21 from Globals
import InitializeClass
22 from Products
.CMFCore
.permissions
import View
, ModifyPortalContent
23 from BaseSlot
import BaseSlot
24 from OFS
.SimpleItem
import SimpleItem
26 factory_type_information
= ( {'id' : 'Spacer Slot',
27 'meta_type' : 'Spacer Slot',
28 'description' : "Spacer Slot for Mosaic Document",
29 'icon' : 'mosaic_tool/spacer_icon.gif',
30 'product' : 'MosaicDocument',
31 'factory' : 'addSpacerSlot',
32 'immediate_view' : 'view',
36 'action' : 'slot_spacer_view',
37 'permissions' : (View
, )
42 'action' : 'slot_spacer_form',
43 'permissions' : (ModifyPortalContent
, )
50 class SpacerSlot(BaseSlot
, SimpleItem
) :
52 meta_type
= 'Spacer Slot'
54 _editableFields
= ('nbOfSpaces',)
57 def __init__(self
, id, nbOfSpaces
= 3) :
59 self
.nbOfSpaces
= nbOfSpaces
61 InitializeClass(SpacerSlot
)
63 def addSpacerSlot(dispatcher
, id, nbOfSpaces
= 3) :
64 """Add a new SpacerSlot object"""
66 o
= SpacerSlot(id, nbOfSpaces
)
67 dispatcher
.Destination()._setObject
(id, o
)