diff MoinMoin/action/AttachFile.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 48a1f6b6b6c5
children 7b0aadb97d01
line wrap: on
line diff
--- a/MoinMoin/action/AttachFile.py	Sun Dec 23 23:51:55 2007 +0100
+++ b/MoinMoin/action/AttachFile.py	Sun Dec 23 23:52:43 2007 +0100
@@ -415,7 +415,8 @@
     return names #Returns dict of {origname: safename}
 
 def error_msg(pagename, request, msg):
-    Page(request, pagename).send_page(msg=msg)
+    request.theme.add_msg(msg, "error")
+    Page(request, pagename).send_page()
 
 
 #############################################################################
@@ -641,7 +642,8 @@
     request.emit_http_headers()
     # Use user interface language for this generated page
     request.setContentLanguage(request.lang)
-    request.theme.send_title(_('Attachments for "%(pagename)s"') % {'pagename': pagename}, pagename=pagename, msg=msg)
+    request.theme.add_msg(msg, "dialog")
+    request.theme.send_title(_('Attachments for "%(pagename)s"') % {'pagename': pagename}, pagename=pagename)
     request.write('<div id="content">\n') # start content div
     send_uploadform(pagename, request)
     request.write('</div>\n') # end content div
@@ -846,7 +848,8 @@
 </table>
 </form>''' % d
     thispage = Page(request, pagename)
-    return thispage.send_page(msg=formhtml)
+    request.theme.add_msg(formhtml, "dialog")
+    return thispage.send_page()
 
 def get_file(pagename, request):
     import shutil