Merge image gallery fixlets from 1.4
authorBrion Vibber <brion@users.mediawiki.org>
Thu, 9 Dec 2004 02:13:00 +0000 (02:13 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Thu, 9 Dec 2004 02:13:00 +0000 (02:13 +0000)
includes/ImageGallery.php
includes/Parser.php

index 33be587..44177d6 100644 (file)
@@ -33,10 +33,10 @@ class ImageGallery
         * Add an image to the gallery.
         *
         * @param Image  $image  Image object that is added to the gallery
-        * @param string $text   Additional text to be shown. The name and size of the image are always shown.
+        * @param string $html   Additional HTML text to be shown. The name and size of the image are always shown.
         */
-       function add( $image, $text='' ) {
-               $this->mImages[] = array( &$image, $text );
+       function add( $image, $html='' ) {
+               $this->mImages[] = array( &$image, $html );
        }
 
        /**
@@ -123,7 +123,7 @@ class ImageGallery
                                '<table width="100%" height="150px">'.
                                '<tr><td align="center" valign="center" style="background-color:#F8F8F8;border:solid 1px #888888;">' .
                                $sk->makeKnownLinkObj( $nt, '<img  src="'.$img->createThumb(120,120).'" alt="" />' ) . '</td></tr></table> ' .
-                               $textlink . htmlspecialchars( $text ) . $nb; 
+                               $textlink . $text . $nb; 
 
                        $s .= "</td>\n" .  (($i%4==3) ? "</tr>\n" : '');
 
index 9477b66..0e911d6 100644 (file)
@@ -3106,7 +3106,12 @@ class Parser
                        } else {
                                $label = '';
                        }
-                       $ig->add( Image::newFromTitle( $nt ), $label );
+                       
+                       # FIXME: Use the full wiki parser and add its links
+                       # to the page's links.
+                       $html = $this->mOptions->mSkin->formatComment( $label );
+                       
+                       $ig->add( Image::newFromTitle( $nt ), $html );
                        $wgLinkCache->addImageLinkObj( $nt );
                }
                return $ig->toHTML();