Back to index

moin  1.9.0~rc2
dialog.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - dialog
00004 
00005     @copyright: 2004 Nir Soffer <nirs@freeshell.org>
00006     @license: GNU GPL, see COPYING for details.
00007 """
00008 
00009 from MoinMoin.widget import base
00010 
00011 
00012 class Dialog(base.Widget):
00013     """ Dialog for user interaction.
00014 
00015     Use a dialog when you want to present and get data to the user.
00016 
00017     Currently this is little more than wrapper around a string.
00018     """
00019 
00020     def __init__(self, request, **kw):
00021         """ Initialize a dialog
00022 
00023         @param request: current request
00024         @keyword content: dialong content
00025         """
00026         base.Widget.__init__(self, request, **kw)
00027         self.content = kw.get('content', '')
00028 
00029     def render(self):
00030         return u'<div class="dialog">\n%s\n</div>\n' % unicode(self.content)
00031 
00032 
00033 class Status(base.Widget):
00034     """ Status widget
00035 
00036     Use Status when you want to present to the user status information,
00037     and no interaction needed.
00038 
00039     A user might choose to turn of status display in his user pref (not
00040     implemented yet).
00041 
00042     Currently this is little more than wrapper around a string.
00043     """
00044 
00045     def __init__(self, request, **kw):
00046         """ Initialize a dialog
00047 
00048         @param request: current request
00049         @keyword content: status message content
00050         """
00051         base.Widget.__init__(self, request, **kw)
00052         self.content = kw.get('content', '')
00053 
00054     def render(self):
00055         return u'<p class="status">%s</p>\n' % unicode(self.content)
00056