lib/menu.py
changeset 44 d09cc8b3709c
parent 28 b68145b5ce24
parent 43 fc11c4e86a82
child 45 e94ab812c0c8
equal deleted inserted replaced
28:b68145b5ce24 44:d09cc8b3709c
     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