app/soc/views/sitemap/sidebar.py
changeset 2069 08b13ca90666
parent 1308 35b75ffcbb37
child 2333 221482a54238
equal deleted inserted replaced
2068:f5e8fbbd3bea 2069:08b13ca90666
    20 __authors__ = [
    20 __authors__ = [
    21     '"Sverre Rabbelier" <sverre@rabbelier.nl>',
    21     '"Sverre Rabbelier" <sverre@rabbelier.nl>',
    22   ]
    22   ]
    23 
    23 
    24 
    24 
    25 import operator
       
    26 
       
    27 from soc.views import out_of_band
    25 from soc.views import out_of_band
    28 from soc.views.helper import access
       
    29 
    26 
    30 import soc.cache.sidebar
    27 import soc.cache.sidebar
    31 
    28 
    32 
    29 
    33 SIDEBAR = []
    30 SIDEBAR = []
    38 def addMenu(callback):
    35 def addMenu(callback):
    39   """Adds a callback to the menu builder.
    36   """Adds a callback to the menu builder.
    40 
    37 
    41   The callback should return a list of menu's when called.
    38   The callback should return a list of menu's when called.
    42   """
    39   """
    43 
       
    44   global SIDEBAR
    40   global SIDEBAR
    45   SIDEBAR.append(callback)
    41   SIDEBAR.append(callback)
    46 
    42 
    47 
    43 
    48 @soc.cache.sidebar.cache
    44 @soc.cache.sidebar.cache
   135 
   131 
   136   rights = params['rights']
   132   rights = params['rights']
   137 
   133 
   138   submenus = []
   134   submenus = []
   139 
   135 
   140   args = SIDEBAR_ACCESS_ARGS
   136   # args = SIDEBAR_ACCESS_ARGS
   141   kwargs = SIDEBAR_ACCESS_KWARGS
   137   kwargs = SIDEBAR_ACCESS_KWARGS
   142 
   138 
   143   # reset and pre-fill the Checker's cache
   139   # reset and pre-fill the Checker's cache
   144   rights.setCurrentUser(id, user)
   140   rights.setCurrentUser(id, user)
   145 
   141