9103a5b603712cfa8d148dcc67bdd981c98140da
1 # (c) 2003 Centre de Recherche en Informatique ENSMP Fontainebleau <http://cri.ensmp.fr>
2 # (c) 2003 BenoƮt PIN <mailto:pin@cri.ensmp.fr>
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License version 2 as published
6 # by the Free Software Foundation.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 from Globals
import InitializeClass
21 from Products
.CMFCore
.permissions
import View
, ModifyPortalContent
22 from BaseSlot
import BaseSlot
23 from OFS
.SimpleItem
import SimpleItem
25 factory_type_information
= ( {'id' : 'Spacer Slot',
26 'meta_type' : 'Spacer Slot',
27 'description' : "Spacer Slot for Mosaic Document",
28 'icon' : 'mosaic_tool/spacer_icon.gif',
29 'product' : 'MosaicDocument',
30 'factory' : 'addSpacerSlot',
31 'immediate_view' : 'view',
35 'action' : 'slot_spacer_view',
36 'permissions' : (View
, )
41 'action' : 'slot_spacer_form',
42 'permissions' : (ModifyPortalContent
, )
49 class SpacerSlot(BaseSlot
, SimpleItem
) :
51 meta_type
= 'Spacer Slot'
53 _editableFields
= ('nbOfSpaces',)
56 def __init__(self
, id, nbOfSpaces
= 3) :
58 self
.nbOfSpaces
= nbOfSpaces
60 InitializeClass(SpacerSlot
)
62 def addSpacerSlot(dispatcher
, id, nbOfSpaces
= 3) :
63 """Add a new SpacerSlot object"""
65 o
= SpacerSlot(id, nbOfSpaces
)
66 dispatcher
.Destination()._setObject
(id, o
)