diff MoinMoin/theme/__init__.py @ 3541:8ff53b14fc44

UP icon is back in the iconbar for themes not using clickable title navigation
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Sun, 27 Apr 2008 14:36:07 +0200
parents 7bf83cd8da79
children 2b577967030b
line wrap: on
line diff
--- a/MoinMoin/theme/__init__.py	Sun Apr 27 00:48:03 2008 +0200
+++ b/MoinMoin/theme/__init__.py	Sun Apr 27 14:36:07 2008 +0200
@@ -545,7 +545,7 @@
         @return: html link tag
         """
         qs = {}
-        querystr, title, icon = self.cfg.page_icons_table[which]
+        pagekey, querystr, title, icon = self.cfg.page_icons_table[which]
         qs.update(querystr) # do not modify the querystr dict in the cfg!
         d['icon-alt-text'] = d['title'] = title % d
         d['i18ntitle'] = self.request.getText(d['title'])
@@ -554,7 +554,11 @@
         if rev and which in ['raw', 'print', ]:
             qs['rev'] = str(rev)
         attrs = {'rel': 'nofollow', 'title': d['i18ntitle'], }
-        page = d['page']
+        page = d[pagekey]
+        if isinstance(page, unicode):
+            # e.g. d['page_parent_page'] is just the unicode pagename
+            # while d['page'] will give a page object
+            page = Page(self.request, page)
         return page.link_to_raw(self.request, text=img_src, querystr=qs, **attrs)
 
     def msg(self, d):