diff MoinMoin/action/quicklink.py @ 2966:ba14d391c2ba

Refactor all modules to use the new add_msg interface in 1.7 (done by Frederico Lorenzi). Should not be backported to 1.6 but instead the separate patch from http://code.google.com/p/google-highly-open-participation-moinmoin/issues/detail?id=51 should be used.
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Sun, 23 Dec 2007 23:52:43 +0100
parents bb2e053067fb
children 036fc4dce2ee
line wrap: on
line diff
--- a/MoinMoin/action/quicklink.py	Sun Dec 23 23:51:55 2007 +0100
+++ b/MoinMoin/action/quicklink.py	Sun Dec 23 23:52:43 2007 +0100
@@ -11,20 +11,19 @@
 def execute(pagename, request):
     """ Add the current wiki page to the user quicklinks """
     _ = request.getText
-    msg = None
 
     if not request.user.valid:
-        msg = _("You must login to add a quicklink.")
+        request.theme.add_msg(_("You must login to add a quicklink."), "error")
     elif request.user.isQuickLinkedTo([pagename]):
         if request.user.removeQuicklink(pagename):
-            msg = _('Your quicklink to this page has been removed.')
+            request.theme.add_msg(_('Your quicklink to this page has been removed.'), "info")
         else: # should not happen
-            msg = _('Your quicklink to this page could not be removed.')
+            request.theme.add_msg(_('Your quicklink to this page could not be removed.'), "error")
     else:
         if request.user.addQuicklink(pagename):
-            msg = _('A quicklink to this page has been added for you.')
+            request.theme.add_msg(_('A quicklink to this page has been added for you.'), "info")
         else: # should not happen
-            msg = _('A quicklink to this page could not be added for you.')
+            request.theme.add_msg(_('A quicklink to this page could not be added for you.'), "error")
 
-    Page(request, pagename).send_page(msg=msg)
+    Page(request, pagename).send_page()