source: ZMS/trunk/ZMSFormatProvider.py @ 1831

Revision 1831, 3.8 KB checked in by zmsdev, 2 months ago (diff)

ZMS2Go: prepared support for new simplified content-object model

Line 
1################################################################################
2# ZMSFormatProvider.py
3#
4# This program is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License
6# as published by the Free Software Foundation; either version 2
7# of the License, or (at your option) any later version.
8#
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.
13#
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  02111-1307, USA.
17################################################################################
18
19
20# Imports.
21from App.special_dtml import HTMLFile
22import copy
23import zope.interface
24# Product Imports.
25import IZMSConfigurationProvider
26import IZMSFormatProvider, ZMSTextformatManager, ZMSCharformatManager
27import ZMSItem
28
29
30################################################################################
31################################################################################
32###
33###   Class
34###
35################################################################################
36################################################################################
37class ZMSFormatProvider(
38        ZMSItem.ZMSItem,
39        ZMSTextformatManager.ZMSTextformatManager,
40        ZMSCharformatManager.ZMSCharformatManager):
41    zope.interface.implements(
42        IZMSConfigurationProvider.IZMSConfigurationProvider,
43        IZMSFormatProvider.IZMSFormatProvider)
44
45    # Properties.
46    # -----------
47    meta_type = 'ZMSFormatProvider'
48    icon = "misc_/zms/ZMSFormatProvider.gif"
49
50    # Management Options.
51    # -------------------
52    manage_options_default_action = '../manage_customize'
53    def manage_options(self):
54      return map( lambda x: self.operator_setitem( x, 'action', '../'+x['action']), copy.deepcopy(self.aq_parent.manage_options()))
55
56    def manage_sub_options(self):
57      return (
58        {'label': 'TAB_TEXTFORMATS','action': 'manage_textformats'},
59        {'label': 'TAB_CHARFORMATS','action': 'manage_charformats'},
60        )
61
62    # Management Interface.
63    # ---------------------
64    manage = HTMLFile('dtml/ZMSFormatProvider/manage_textformats', globals())
65    manage_main = HTMLFile('dtml/ZMSFormatProvider/manage_textformats', globals()) # -"-
66    manage_textformats = HTMLFile('dtml/ZMSFormatProvider/manage_textformats', globals()) # -"-
67    manage_charformats = HTMLFile('dtml/ZMSFormatProvider/manage_charformats', globals())
68
69    # Management Permissions.
70    # -----------------------
71    __administratorPermissions__ = (
72                'manage_changeTextformat', 'manage_textformats',
73                'manage_changeCharformat', 'manage_charformats',
74                )
75    __ac_permissions__=(
76                ('ZMS Administrator', __administratorPermissions__),
77                )
78
79    """
80    ############################################################################
81    #
82    #   Constructor
83    #
84    ############################################################################
85    """
86
87    ############################################################################
88    #  ZMSFormatProvider.__init__:
89    #
90    #  Initialise a new instance.
91    ############################################################################
92    def __init__(self, textformats=[], charformats=[]):
93      self.id = 'format_manager'
94      self.textformats = copy.deepcopy(textformats)
95      self.charformats = copy.deepcopy(charformats)
96
97################################################################################
Note: See TracBrowser for help on using the repository browser.