sites/www.qmsk.net/menu.py
branchsites
changeset 34 09196d5b2a39
parent 31 107062ebb6f9
equal deleted inserted replaced
33:19ea04f4b0cd 34:09196d5b2a39
       
     1 """
       
     2     Handling the list of available pages
       
     3 """
       
     4 
       
     5 class Menu (object) :
       
     6     """
       
     7         Contains info needed to render the menu
       
     8     """
       
     9 
       
    10     def __init__ (self, fs, page) :
       
    11         """
       
    12             Gather the menu information for the given page, as part of the given FilesystemMapper
       
    13         """
       
    14 
       
    15         # the selected page
       
    16         self.page = fs.tree.get_page(page.url)
       
    17 
       
    18         # the selected pagen's inheritance
       
    19         self.ancestry = self.page.get_ancestry() if self.page else []
       
    20         
       
    21         # list of menu items == root children, since we always show the full menu...
       
    22         self.items = fs.tree.root.children
       
    23