changeset 872:b0f7ec792299

updated ImageLink macro (port to 1.6)
author Thomas Waldmann <tw AT waldmann-edv DOT de>
date Thu, 22 Jun 2006 22:30:02 +0200
parents 8ad0dad8c515
children 5019723cb7d4
files MoinMoin/macro/ImageLink.py docs/CHANGES
diffstat 2 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/macro/ImageLink.py	Thu Jun 22 22:29:51 2006 +0200
+++ b/MoinMoin/macro/ImageLink.py	Thu Jun 22 22:30:02 2006 +0200
@@ -79,6 +79,9 @@
 
       Thomas Waldmann
             2006-03-10 code refactored
+            
+      Reimar Bauer
+             2006-05-01 bug fix of image linked to attachment   
 
     @copyright: 2001 by Jeff Kunce,
                 2004 by Marcin Zalewski,
@@ -124,6 +127,9 @@
     image = args[0]
     if argc >= 2 and args[1]:
         target = args[1]
+    elif argc == 1:
+        pagename, attname = AttachFile.absoluteName(image, formatter.page.page_name)
+        target = AttachFile.getAttachUrl(pagename, image, request)
     else:
         target = None
         
@@ -153,6 +159,11 @@
 
     if target is None:
         target = kw['src']
+       
+    if argc == 1:
+        return "%s%s%s" % (formatter.url(1, kw['src']),
+                           formatter.image(**kw),
+                           formatter.url(0))    
 
     if _is_URL(target):
         return "%s%s%s" % (formatter.url(1, target),
--- a/docs/CHANGES	Thu Jun 22 22:29:51 2006 +0200
+++ b/docs/CHANGES	Thu Jun 22 22:30:02 2006 +0200
@@ -164,6 +164,7 @@
     * cfg.editor_quickhelp was not parsed with the wiki parser when customized
     * fixed MoinMoin:MoinMoinBugs/GuiEditorDeletesNewBulletText
     * fixed MoinMoin:MoinMoinBugs/HtmlTextConvertTables
+    * updated ImageLink macro
 
   Other changes:
     * we use (again) the same browser compatibility check as FCKeditor uses