diff MoinMoin/theme/__init__.py @ 483:a594780d5e64

Login macro, login/logout/UserPreferences actions imported from: moin--main--1.5--patch-487
author Thomas Waldmann <tw@waldmann-edv.de>
date Sun, 19 Mar 2006 01:21:38 +0000
parents 9b6ba709da88
children ca35d9e6d63e
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Sat Mar 18 22:24:02 2006 +0000
+++ b/MoinMoin/theme/__init__.py	Sun Mar 19 01:21:38 2006 +0000
@@ -203,7 +203,6 @@
         """
         request = self.request
         _ = request.getText
-        preferencesPage = wikiutil.getSysPage(request, 'UserPreferences')
         
         userlinks = []
         # Add username/homepage link for registered users. We don't care
@@ -219,20 +218,14 @@
                         request.formatter.text(name) +
                         request.formatter.interwikilink(0))
             userlinks.append(homelink)        
-            # Set pref page to localized Preferences page
-            title = preferencesPage.split_title(request)
-            userlinks.append(preferencesPage.link_to(request, text=title, id="userprefs"))
             
         if request.cfg.show_login:
             if request.user.valid:
-                userlinks.append("""\
-<form id="logout" action="" method="POST">
-<input type="hidden" name="action" value="userform">
-<input type="submit" name="logout" value="%(logout)s">
-</form>
-""" % { 'logout': _('Logout') })
+                userlinks.append(d['page'].link_to(request, text=_('Logout', formatted=False),
+                                                   querystr={'action': 'logout', 'logout': 'logout'}, id="logout"))
             else:
-                userlinks.append(preferencesPage.link_to(request, text=_("Login"), id="login"))
+                userlinks.append(d['page'].link_to(request, text=_("Login", formatted=False),
+                                                   querystr={'action': 'login'}, id="login"))
 
         userlinks = [u'<li>%s</li>' % link for link in userlinks]
         html = u'<ul id="username">%s</ul>' % ''.join(userlinks)