changeset 2967:a310264ad186

Added a few add_msg calls (by Federico Lorenzi).
author Alexander Schremmer <alex AT alexanderweb DOT de>
date Mon, 24 Dec 2007 00:16:48 +0100
parents ba14d391c2ba
children 690f64f95f91
files MoinMoin/PageEditor.py MoinMoin/action/fullsearch.py MoinMoin/action/newaccount.py MoinMoin/action/recoverpass.py MoinMoin/action/userprefs.py MoinMoin/request/__init__.py
diffstat 6 files changed, 16 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/PageEditor.py	Sun Dec 23 23:52:43 2007 +0100
+++ b/MoinMoin/PageEditor.py	Mon Dec 24 00:16:48 2007 +0100
@@ -194,7 +194,8 @@
 
         # Did one of the prechecks fail?
         if msg:
-            self.send_page(msg=msg)
+            request.theme.add_msg(msg, "error")
+            self.send_page()
             return
 
         # Emmit http_headers after checks (send_page)
--- a/MoinMoin/action/fullsearch.py	Sun Dec 23 23:52:43 2007 +0100
+++ b/MoinMoin/action/fullsearch.py	Mon Dec 24 00:16:48 2007 +0100
@@ -162,9 +162,9 @@
     # check for sensible search term
     stripped = needle.strip()
     if len(stripped) == 0:
-+        request.theme.add_msg(_('Please use a more selective search term instead '
-+                'of {{{"%s"}}}') % wikiutil.escape(needle), "error")
-+        Page(request, pagename).send_page()
+        request.theme.add_msg(_('Please use a more selective search term instead '
+                'of {{{"%s"}}}') % wikiutil.escape(needle), "error")
+        Page(request, pagename).send_page()
         return
     needle = stripped
 
@@ -226,7 +226,7 @@
     request.setContentLanguage(request.lang)
 
     request.theme.send_title(title % wikiutil.escape(needle), form=request.form,
-            pagename=pagename, msg=msg)
+            pagename=pagename)
 
     # Start content (important for RTL support)
     request.write(request.formatter.startContent("content"))
--- a/MoinMoin/action/newaccount.py	Sun Dec 23 23:52:43 2007 +0100
+++ b/MoinMoin/action/newaccount.py	Mon Dec 24 00:16:48 2007 +0100
@@ -149,8 +149,8 @@
     submitted = form.has_key('create_only') or form.has_key('create_and_mail')
 
     if submitted: # user pressed create button
-        error = _create_user(request)
-        return page.send_page(msg=error)
+        request.theme.add_msg(_create_user(request), "dialog")
+        return page.send_page()
     else: # show create form
         request.emit_http_headers()
         request.theme.send_title(_("Create Account"), pagename=pagename)
--- a/MoinMoin/action/recoverpass.py	Sun Dec 23 23:52:43 2007 +0100
+++ b/MoinMoin/action/recoverpass.py	Mon Dec 24 00:16:48 2007 +0100
@@ -66,7 +66,8 @@
 
     if submitted: # user pressed create button
         msg = _do_recover(request)
-        page.send_page(msg=msg)
+        request.theme.add_msg(msg, "dialog")
+        page.send_page()
     else: # show create form
         request.emit_http_headers()
         request.theme.send_title(_("Lost password"), pagename=pagename)
--- a/MoinMoin/action/userprefs.py	Sun Dec 23 23:52:43 2007 +0100
+++ b/MoinMoin/action/userprefs.py	Mon Dec 24 00:16:48 2007 +0100
@@ -94,7 +94,8 @@
         lnk = unicode(lnk)
         title = _("Settings") + "/" + title
     request.emit_http_headers()
-    request.theme.send_title(title, page=request.page, pagename=pagename, msg=msg)
+    request.theme.add_msg(msg, "dialog")
+    request.theme.send_title(title, page=request.page, pagename=pagename)
     # Start content (important for RTL support)
     request.write(request.formatter.startContent("content"))
     request.write(text)
--- a/MoinMoin/request/__init__.py	Sun Dec 23 23:52:43 2007 +0100
+++ b/MoinMoin/request/__init__.py	Mon Dec 24 00:16:48 2007 +0100
@@ -1192,8 +1192,8 @@
                         msg += " " + _("Login and try again.", formatted=0)
 
                 if msg:
-                    self.page.send_page(msg=msg)
-
+                    self.request.theme.add_msg(msg, "error")
+                    self.page.send_page()
                 # Try action
                 else:
                     from MoinMoin import action
@@ -1204,7 +1204,8 @@
                         if not self.user.valid:
                             # Suggest non valid user to login
                             msg += " " + _("Login and try again.", formatted=0)
-                        self.page.send_page(msg=msg)
+                        self.request.theme.add_msg(msg, "error")
+                        self.page.send_page()
                     else:
                         handler(self.page.page_name, self)