Back to index

moin  1.9.0~rc2
Functions | Variables
MoinMoin.macro.SystemAdmin Namespace Reference

Functions

def macro_SystemAdmin

Variables

list Dependencies = ["time"]

Function Documentation

Definition at line 16 of file SystemAdmin.py.

00016 
00017 def macro_SystemAdmin(macro):
00018     _ = macro.request.getText
00019     request = macro.request
00020 
00021     # do not show system admin to users not in superuser list
00022     if not request.user.isSuperUser():
00023         return ''
00024 
00025     _MENU = {
00026         'attachments': (_("File attachment browser"), do_admin_browser),
00027         'users': (_("User account browser"), do_user_browser),
00028     }
00029     choice = request.values.get('sysadm')
00030 
00031     # create menu
00032     menuitems = [(label, fnid) for fnid, (label, handler) in _MENU.items()]
00033     menuitems.sort()
00034     result = []
00035     f = macro.formatter
00036     for label, fnid in menuitems:
00037         if fnid == choice:
00038             result.append(f.strong(1))
00039             result.append(f.text(label))
00040             result.append(f.strong(0))
00041         else:
00042             #result.append(wikiutil.link_tag(request, "%s?sysadm=%s" % (macro.formatter.page.page_name, id), label))
00043             result.append(f.page.link_to(request, label, querystr={'sysadm': fnid}))
00044         result.append(f.linebreak())
00045     result.append(f.linebreak())
00046 
00047     # add chosen content
00048     if choice in _MENU:
00049         result.append(f.rawHTML(_MENU[choice][1](request)))
00050 
00051     return ''.join(result)
00052 

Variable Documentation

Definition at line 14 of file SystemAdmin.py.