Back to index

moin  1.9.0~rc2
modern.py
Go to the documentation of this file.
00001 # -*- coding: iso-8859-1 -*-
00002 """
00003     MoinMoin - modern theme
00004 
00005     @copyright: 2003-2005 Nir Soffer, Thomas Waldmann
00006     @license: GNU GPL, see COPYING for details.
00007 """
00008 
00009 from MoinMoin.theme import ThemeBase
00010 
00011 class Theme(ThemeBase):
00012 
00013     name = "modern"
00014 
00015     def header(self, d, **kw):
00016         """ Assemble wiki header
00017 
00018         @param d: parameter dictionary
00019         @rtype: unicode
00020         @return: page header html
00021         """
00022         html = [
00023             # Pre header custom html
00024             self.emit_custom_html(self.cfg.page_header1),
00025 
00026             # Header
00027             u'<div id="header">',
00028             self.logo(),
00029             self.searchform(d),
00030             self.username(d),
00031             u'<div id="locationline">',
00032             self.interwiki(d),
00033             self.title(d),
00034             u'</div>',
00035             self.trail(d),
00036             self.navibar(d),
00037             #u'<hr id="pageline">',
00038             u'<div id="pageline"><hr style="display:none;"></div>',
00039             self.msg(d),
00040             self.editbar(d),
00041             u'</div>',
00042 
00043             # Post header custom html (not recommended)
00044             self.emit_custom_html(self.cfg.page_header2),
00045 
00046             # Start of page
00047             self.startPage(),
00048         ]
00049         return u'\n'.join(html)
00050 
00051     def editorheader(self, d, **kw):
00052         """ Assemble wiki header for editor
00053 
00054         @param d: parameter dictionary
00055         @rtype: unicode
00056         @return: page header html
00057         """
00058         html = [
00059             # Pre header custom html
00060             self.emit_custom_html(self.cfg.page_header1),
00061 
00062             # Header
00063             u'<div id="header">',
00064             self.title(d),
00065             self.msg(d),
00066             u'</div>',
00067 
00068             # Post header custom html (not recommended)
00069             self.emit_custom_html(self.cfg.page_header2),
00070 
00071             # Start of page
00072             self.startPage(),
00073         ]
00074         return u'\n'.join(html)
00075 
00076     def footer(self, d, **keywords):
00077         """ Assemble wiki footer
00078 
00079         @param d: parameter dictionary
00080         @keyword ...:...
00081         @rtype: unicode
00082         @return: page footer html
00083         """
00084         page = d['page']
00085         html = [
00086             # End of page
00087             self.pageinfo(page),
00088             self.endPage(),
00089 
00090             # Pre footer custom html (not recommended!)
00091             self.emit_custom_html(self.cfg.page_footer1),
00092 
00093             # Footer
00094             u'<div id="footer">',
00095             self.editbar(d),
00096             self.credits(d),
00097             self.showversion(d, **keywords),
00098             u'</div>',
00099 
00100             # Post footer custom html
00101             self.emit_custom_html(self.cfg.page_footer2),
00102             ]
00103         return u'\n'.join(html)
00104 
00105 
00106 def execute(request):
00107     """
00108     Generate and return a theme object
00109 
00110     @param request: the request object
00111     @rtype: MoinTheme
00112     @return: Theme object
00113     """
00114     return Theme(request)
00115