############################################################################## # # Copyright (c) 2002, 2003 Zope Corporation and Contributors. # All Rights Reserved. # # This software is subject to the provisions of the Zope Public License, # Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution. # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS # FOR A PARTICULAR PURPOSE. # ############################################################################## """`OnlineHelp` tree view $Id: tree.py 67630 2006-04-27 00:54:03Z jim $ """ __docformat__ = 'restructuredtext' from zope.i18n import translate from zope.publisher.browser import BrowserView from zope.app import zapi from zope.app.onlinehelp.interfaces import IOnlineHelp class OnlineHelpTopicTreeView(BrowserView): """Online help topic tree view.""" def __init__(self, context, request): super(OnlineHelpTopicTreeView, self).__init__(context, request) self.onlinehelp = zapi.getUtility(IOnlineHelp, "OnlineHelp") def getTopicTree(self): """Return the tree of help topics. We build a flat list of tpoics info dict. Iterate this dict oan build from the level info a navigation tree in the page tmeplate. Each time you get a level 0 means this is a subitem of the Onlinehelp itself:: >>> info = [('id',{infoDict}),(),()]