* (bug 11243) Show thumbnail on image description page previews
authorRaimond Spekking <raymond@users.mediawiki.org>
Wed, 12 Sep 2007 18:36:24 +0000 (18:36 +0000)
committerRaimond Spekking <raymond@users.mediawiki.org>
Wed, 12 Sep 2007 18:36:24 +0000 (18:36 +0000)
RELEASE-NOTES
includes/EditPage.php

index 23f5f63..bb8b3a4 100644 (file)
@@ -22,6 +22,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 
 === New features in 1.12 ===
 * Add a warning for non-descriptive filenames at Special:Upload
+* (bug 11243) Show thumbnail on image description page previews
 
 === Bug fixes in 1.12 ===
 
index e878617..e9ae573 100644 (file)
@@ -1424,7 +1424,18 @@ END
                        wfProfileOut( $fname );
                        return $previewhead;
                } else {
-                       $toparse = $this->textbox1;
+                       # If an image description page is edited, show a thumbnail at time of edit preview
+                       # <gallery> format used as it handles all non image files (.ogg, .pdf, ...) very nice.
+                       if ( $wgTitle->mNamespace == NS_IMAGE ) {
+                               global $wgContLang;
+                               $align = $wgContLang->isRtl() ? 'left' : 'right';
+                               $imageLink = "<div class=\"mw-image-edit-preview\" style=\"float:$align\"><gallery>" . 
+                                       $wgTitle->mPrefixedText. "|" . $wgTitle->mPrefixedText .
+                                       "</gallery></div>\n";
+                               $toparse = $imageLink . $this->textbox1;
+                       } else {
+                               $toparse = $this->textbox1;
+                       }
 
                        # If we're adding a comment, we need to show the
                        # summary as the headline
@@ -2086,5 +2097,3 @@ END
        }
        
 }
-
-