source: publico/ILSAAL/trunk/SAAL.py @ 1125

Última Alteração nesse arquivo desde 1125 foi 1125, incluída por jeanferri, 14 anos atrás

Implementada a posição do menu no container principal do SAAL

File size: 3.6 KB
Linha 
1# File: SAAL.py
2#
3# Copyright (c) 2005 by Interlegis
4# Generator: ArchGenXML Version 1.4.0-RC1 devel
5#            http://plone.org/products/archgenxml
6#
7# GNU General Public Licence (GPL)
8#
9# This program is free software; you can redistribute it and/or modify it under
10# the terms of the GNU General Public License as published by the Free Software
11# Foundation; either version 2 of the License, or (at your option) any later
12# version.
13# This program is distributed in the hope that it will be useful, but WITHOUT
14# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
16# details.
17# You should have received a copy of the GNU General Public License along with
18# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19# Place, Suite 330, Boston, MA  02111-1307  USA
20#
21__author__  = '''STC Interlegis <stc@interlegis.gov.br>'''
22__docformat__ = 'plaintext'
23
24
25from AccessControl import ClassSecurityInfo
26from Products.Archetypes.atapi import *
27from Products.CMFCore.utils import UniqueObject
28from Products.ILSAAL.interfaces.ISAAL import ISAAL
29
30
31from Products.Archetypes.SQLStorage import *
32from Products.ILSAAL.config import *
33##code-section module-header #fill in your manual code here
34
35from Products.CMFCore.utils import getToolByName
36
37##/code-section module-header
38
39schema=Schema((
40),
41)
42
43
44##code-section after-local-schema #fill in your manual code here
45##/code-section after-local-schema
46
47SAAL_schema = OrderedBaseFolderSchema + \
48    getattr(UniqueObject,'schema',Schema(())) + \
49    schema
50
51##code-section after-schema #fill in your manual code here
52##/code-section after-schema
53
54class SAAL(UniqueObject,OrderedBaseFolder):
55    """
56    Container geral de objetos do sistema Interlegis SAAL.
57    """
58    security = ClassSecurityInfo()
59    __implements__ = (getattr(UniqueObject,'__implements__',()),) + (getattr(OrderedBaseFolder,'__implements__',()),) + (ISAAL,)
60
61
62    # This name appears in the 'add' box
63    archetype_name             = 'SAAL'
64
65    meta_type                  = 'SAAL'
66    portal_type                = 'SAAL'
67    allowed_content_types      = [] + list(getattr(UniqueObject, 'allowed_content_types', []))
68    filter_content_types       = 1
69    global_allow               = 0
70    allow_discussion           = 0
71    content_icon               = 'saal_icon.gif'
72    immediate_view             = 'base_view'
73    default_view               = 'base_view'
74    suppl_views                = ()
75    typeDescription            = "Sistema SAAL"
76    typeDescMsgId              = 'description_edit_saal'
77
78    schema = SAAL_schema
79
80    ##code-section class-header #fill in your manual code here
81
82    if self.getPosicaoMenu() != 'Direita':
83        left_slots = CONTEUDO_MENU
84        right_slots = []
85    else:
86        left_slots = []
87        right_slots = CONTEUDO_MENU
88
89    ##/code-section class-header
90
91
92    #Methods
93
94    # Use class/module security defaults
95    def __init__(self,id=None):
96        """
97        Construtor da classe. Fixa o id para nao ser mais alterado.
98        """
99       
100        OrderedBaseFolder.__init__(self, 'saal')
101
102
103    #methods from Interface ISAAL
104
105    security.declarePublic('getPosicaoMenu')
106    def getPosicaoMenu(self):
107        """
108        Retorna a posicao do menu do saal (Direita ou Esquerda). Esta
109        opcao pode ser selecionada na tool portal_saal.
110        """
111       
112        portal_saal = getToolByName(self, 'portal_saal')
113        return portal_saal.getPos_menu()
114
115
116registerType(SAAL,PROJECTNAME)
117# end of class SAAL
118
119##code-section module-footer #fill in your manual code here
120##/code-section module-footer
121
122
123
Note: Veja TracBrowser para ajuda no uso do navegador do trac.
 

The contents and data of this website are published under license:
Creative Commons 4.0 Brasil - Atribuir Fonte - Compartilhar Igual.