lib/menu.py
changeset 185 7a5821865c29
parent 169 26bf8b8bc3cc
parent 184 a3d9aa76790d
child 186 96f9e4382d94
equal deleted inserted replaced
169:26bf8b8bc3cc 185:7a5821865c29
     1 """
       
     2     Handling the list of available pages
       
     3 """
       
     4 
       
     5 # for page_list
       
     6 from page_tree import page_tree
       
     7 
       
     8 class Menu (object) :
       
     9     """
       
    10         Contains info needed to render the menu
       
    11     """
       
    12 
       
    13     def __init__ (self, page) :
       
    14         """
       
    15             Gather the menu information for the given page
       
    16         """
       
    17 
       
    18         # the selected page
       
    19         self.page = page_tree.get_page(page.url)
       
    20 
       
    21         # the selected pagen's inheritance
       
    22         self.ancestry = self.page.get_ancestry() if self.page else []
       
    23         
       
    24         # list of menu items == root children, since we always show the full menu...
       
    25         self.items = page_tree.root.children
       
    26