source: ZMS/trunk/ZMSItem.py @ 1557

Revision 1557, 5.1 KB checked in by zmsdev, 11 months ago (diff)

removed old zms artefacts

Line 
1################################################################################
2# ZMSItem.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# Imports.
20from DateTime.DateTime import DateTime
21from App.special_dtml import HTMLFile
22from Persistence import Persistent
23from Acquisition import Implicit
24import OFS.SimpleItem, OFS.ObjectManager
25import string
26
27
28################################################################################
29################################################################################
30###
31###   Abstract Class ZMSItem
32###
33################################################################################
34################################################################################
35class ZMSItem(
36        OFS.ObjectManager.ObjectManager,
37        OFS.SimpleItem.Item,
38        Persistent,                             # Persistent.
39        Implicit,                               # Acquisition.
40        ):
41
42    # Documentation string.
43    __doc__ = """ZMS product module."""
44    # Version string.
45    __version__ = '0.1'
46   
47    # Management Permissions.
48    # -----------------------
49    __authorPermissions__ = (
50                'manage_dtpref', 'manage_page_request', 'manage_page_header', 'manage_page_footer', 'manage_tabs', 'manage_tabs_sub', 'manage_bodyTop', 'manage_main_iframe'
51                )
52    __viewPermissions__ = (
53                'manage_menu',
54                )
55    __ac_permissions__=(
56                ('ZMS Author', __authorPermissions__),
57                ('View', __viewPermissions__),
58                )
59
60    # Templates.
61    # ----------
62    f_bodyContent = HTMLFile('dtml/object/f_bodycontent', globals()) # Template: Body-Content / Element
63    manage = HTMLFile('dtml/object/manage', globals())
64    manage_workspace = HTMLFile('dtml/object/manage', globals()) # ZMI Manage
65    manage_main = HTMLFile('dtml/ZMSObject/manage_main', globals())
66    manage_menu = HTMLFile('dtml/object/manage_menu', globals()) # ZMI Menu
67    manage_tabs = HTMLFile('dtml/object/manage_tabs', globals()) # ZMI Tabulators
68    manage_tabs_sub = HTMLFile('dtml/object/manage_tabs_sub', globals()) # ZMI Tabulators (Sub)
69    manage_bodyTop = HTMLFile('dtml/object/manage_bodytop', globals()) # ZMI bodyTop
70    manage_page_request = HTMLFile('dtml/object/manage_page_request', globals()) # ZMI Page Request
71    manage_page_header = HTMLFile('dtml/object/manage_page_header', globals()) # ZMI Page Header
72    manage_page_footer = HTMLFile('dtml/object/manage_page_footer', globals()) # ZMI Page Footer
73    manage_main_iframe = HTMLFile('dtml/ZMSObject/manage_main_iframe', globals()) # ZMI Iframe
74
75    # --------------------------------------------------------------------------
76    #  ZMSItem.display_icon:
77    #
78    #  @param REQUEST
79    # --------------------------------------------------------------------------
80    def display_icon(self, REQUEST, meta_type=None, key='icon'):
81      if meta_type is None:
82        return self.icon
83      else:
84        return self.aq_parent.display_icon( REQUEST, meta_type, key)
85
86
87    # --------------------------------------------------------------------------
88    #  ZMSItem.getTitlealt
89    # --------------------------------------------------------------------------
90    def getTitlealt( self, REQUEST):
91      return self.getZMILangStr( self.meta_type)
92
93
94    # --------------------------------------------------------------------------
95    #  ZMSItem.breadcrumbs_obj_path:
96    # --------------------------------------------------------------------------
97    def breadcrumbs_obj_path(self, portalMaster=True):
98      return self.aq_parent.breadcrumbs_obj_path(portalMaster)
99
100
101    ############################################################################
102    ###
103    ###  Sitemap
104    ###
105    ############################################################################
106
107    ############################################################################
108    #  ZMSObject.manage_dtpref:
109    #
110    #  De-/Activate Document-Template preference.
111    ############################################################################
112    def manage_dtpref(self, key, lang, REQUEST, RESPONSE):
113      """ ZMSObject.manage_dtpref """
114      v = 1
115      if REQUEST.has_key(key):
116        v = int(not string.atoi(REQUEST[key]))
117      e=(DateTime('GMT')+365).rfc822()
118      RESPONSE.setCookie(key,str(v),path='/',expires=e)
119      return RESPONSE.redirect('manage?lang=%s'%lang)
120
121################################################################################
Note: See TracBrowser for help on using the repository browser.