sites/www.qmsk.net/menu.py
author Tero Marttila <terom@fixme.fi>
Sat, 07 Feb 2009 17:10:06 +0200
branchsites
changeset 34 09196d5b2a39
parent 31 lib/filesystem/menu.py@107062ebb6f9
permissions -rw-r--r--
move lib.filesystem code to sites/www.qmsk.net, part one
"""
    Handling the list of available pages
"""

class Menu (object) :
    """
        Contains info needed to render the menu
    """

    def __init__ (self, fs, page) :
        """
            Gather the menu information for the given page, as part of the given FilesystemMapper
        """

        # the selected page
        self.page = fs.tree.get_page(page.url)

        # the selected pagen's inheritance
        self.ancestry = self.page.get_ancestry() if self.page else []
        
        # list of menu items == root children, since we always show the full menu...
        self.items = fs.tree.root.children