diff MoinMoin/macro/SystemAdmin.py @ 1384:d1ceb31f3d02

make more use of formatter
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 21 Aug 2006 09:59:57 +0200
parents 4eb66637ccd0
children 6dd2e29acffe
line wrap: on
line diff
--- a/MoinMoin/macro/SystemAdmin.py	Mon Aug 21 02:07:13 2006 +0200
+++ b/MoinMoin/macro/SystemAdmin.py	Mon Aug 21 09:59:57 2006 +0200
@@ -23,7 +23,6 @@
     if not request.user.isSuperUser():
         return ''
 
-    result = []
     _MENU = {
         'attachments': (("File attachment browser"), do_admin_browser),
         'users': (("User account browser"), do_user_browser),
@@ -31,21 +30,24 @@
     choice = request.form.get('sysadm', [None])[0]
 
     # create menu
-    menuitems = [(label, id) for id, (label, handler) in _MENU.items()]
+    menuitems = [(label, fnid) for fnid, (label, handler) in _MENU.items()]
     menuitems.sort()
-    for label, id in menuitems:
-        if id == choice:
-            result.append(macro.formatter.strong(1))
-            result.append(macro.formatter.text(label))
-            result.append(macro.formatter.strong(0))
+    result = []
+    f = macro.formatter
+    for label, fnid in menuitems:
+        if fnid == choice:
+            result.append(f.strong(1))
+            result.append(f.text(label))
+            result.append(f.strong(0))
         else:
-            result.append(wikiutil.link_tag(request, "%s?sysadm=%s" % (macro.formatter.page.page_name, id), label))
-        result.append('<br>')
-    result.append('<br>')
+            #result.append(wikiutil.link_tag(request, "%s?sysadm=%s" % (macro.formatter.page.page_name, id), label))
+            result.append(f.page.link_to(request, label, querystr={'sysadm': fnid}))
+        result.append(f.linebreak())
+    result.append(f.linebreak())
 
     # add chosen content
     if _MENU.has_key(choice):
-        result.append(_MENU[choice][1](request))
+        result.append(f.rawHTML(_MENU[choice][1](request)))
 
-    return macro.formatter.rawHTML(''.join(result))
+    return ''.join(result)