diff MoinMoin/theme/__init__.py @ 1382:c3c8ff25e979

make more use of formatter / link_to for link rendering
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Mon, 21 Aug 2006 01:30:06 +0200
parents 26949e36ca0b
children f7f415cc1332
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Sun Aug 20 23:50:40 2006 +0200
+++ b/MoinMoin/theme/__init__.py	Mon Aug 21 01:30:06 2006 +0200
@@ -326,7 +326,9 @@
         for scheme in self.linkSchemas:
             if pagename.startswith(scheme):
                 title = wikiutil.escape(title)
-                link = '<a href="%s">%s</a>' % (pagename, title)
+                link = self.request.formatter.url(1, pagename) + \
+                       self.request.formatter.text(title) +\
+                       self.request.formatter.url(0)
                 return pagename, link
 
         # remove wiki: url prefix
@@ -845,8 +847,10 @@
         @rtype: unicode
         @return: rss href
         """
-        return (u'%s/RecentChanges?action=rss_rc&amp;ddiffs=1&amp;unique=1'
-                % self.request.getScriptname())
+        request = self.request
+        url = Page(request, 'RecentChanges').url(request, querystr={
+                'action':'rss_rc', 'ddiffs': '1', 'unique': '1', }, escape=0, relative=False)
+        return url
 
     def rsslink(self):
         """ Create rss link in head, used by FireFox
@@ -1345,9 +1349,9 @@
         if self.shouldUseRSS():
             link = [
                 u'<div class="rcrss">',
-                u'<a href="%s">' % self.rsshref(),
-                self.make_icon("rss"),
-                u'</a>',
+                self.request.formatter.url(1, self.rsshref()),
+                self.request.formatter.rawHTML(self.make_icon("rss")),
+                self.request.formatter.url(0),
                 u'</div>',
                 ]
             html += ''.join(link)