Package Products :: Package ZenWidgets |
[hide private]
[frames] | no frames]

# Source Code for Package Products.ZenWidgets

     1  ###########################################################################
     2  #
     3  # This program is part of Zenoss Core, an open source monitoring platform.
     4  # Copyright (C) 2007, Zenoss Inc.
     5  #
     6  # This program is free software; you can redistribute it and/or modify it
     7  # under the terms of the GNU General Public License version 2 as published by
     8  # the Free Software Foundation.
     9  #
    10  # For complete information please visit: http://www.zenoss.com/oss/
    11  #
    12  ###########################################################################
    13
    14  """__init__
    15
    16  Initializer for ZenTableManager
    17
    18  $Id: __init__.py,v 1.3 2004/04/04 23:56:49 edahl Exp $"""
    19
    20  __version__ = 0.5
    21  __revision__ = "$Revision: 1.3 $"[11:-2]
    22
    23
    24  from Products.Five.browser import BrowserView
    25  from ZenTableManager import ZenTableManager
    26  from ZenTableManager import manage_addZenTableManager
    27
    28  try:
    29      from Products.CMFCore.DirectoryView import registerDirectory
    30      registerDirectory('skins', globals())
    31  except ImportError: pass
    32
    33  from ZenossPortlets.ZenossPortlets import register_default_portlets
    34
    35 -def update_portlets(app):
    36      """
    37      Reread in portlet source on startup. If this is the initial load, and
    38      objects don't exist yet, don't do anything.
    39      """
    40      if hasattr(app, 'zport') and hasattr(app.zport, 'ZenPortletManager'):
    41          register_default_portlets(app.zport.ZenPortletManager)
    42
    43 -def initialize(registrar):
    44      registrar.registerClass(
    45          ZenTableManager,
    46          permission="Add ZenTableManager",
    47          constructors = (manage_addZenTableManager,),
    48          icon = "ZenTableManager_icon.gif"
    49      )
    50      update_portlets(registrar._ProductContext__app)
    51
    52  # Enable gzip compression of static files
    53  import FileGzipper
    54  if 0:
    55      FileGzipper = None                  # pyflakes
    56
    57 -class ExtJSShortcut(BrowserView):
    58 -    def __getitem__(self, name):
    59          return self.context.unrestrictedTraverse('++resource++extjs')[name]
    60