Added $wgShowArchiveThumbnails, may be useful for file store backend load reduction.
authorTim Starling <tstarling@users.mediawiki.org>
Sun, 12 Jul 2009 05:37:12 +0000 (05:37 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Sun, 12 Jul 2009 05:37:12 +0000 (05:37 +0000)
RELEASE-NOTES
includes/DefaultSettings.php
includes/ImagePage.php

index 374c17c..18805dd 100644 (file)
@@ -122,6 +122,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * Removed name attribute from <a id="top"></a>.
 * Parser::setFunctionTagHook now can be used to add a new tag which is parsed at
   preprocesor level.
+* Added $wgShowArchiveThumbnails, allowing sysadmins to disable thumbnail 
+  display for old versions of images.
 
 === Bug fixes in 1.16 ===
 
index 9ed3d5e..5e9811f 100644 (file)
@@ -2190,6 +2190,11 @@ $wgIgnoreImageErrors = false;
  */
 $wgGenerateThumbnailOnParse = true;
 
+/**
+ * Show thumbnails for old images on the image description page
+ */
+$wgShowArchiveThumbnails = true;
+
 /** Whether or not to use image resizing */
 $wgUseImageResize = true;
 
index a02ba6c..ccfd01d 100644 (file)
@@ -780,15 +780,16 @@ EOT
  */
 class ImageHistoryList {
 
-       protected $imagePage, $img, $skin, $title, $repo;
+       protected $imagePage, $img, $skin, $title, $repo, $showThumb;
 
        public function __construct( $imagePage ) {
-               global $wgUser;
+               global $wgUser, $wgShowArchiveThumbnails;
                $this->skin = $wgUser->getSkin();
                $this->current = $imagePage->getFile();
                $this->img = $imagePage->getDisplayedFile();
                $this->title = $imagePage->getTitle();
                $this->imagePage = $imagePage;
+               $this->showThumb = $wgShowArchiveThumbnails;
        }
 
        public function getImagePage() {
@@ -813,7 +814,7 @@ class ImageHistoryList {
                        . '<tr><td></td>'
                        . ( $this->current->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ? '<td></td>' : '' )
                        . '<th>' . wfMsgHtml( 'filehist-datetime' ) . '</th>'
-                       . '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>'
+                       . ( $this->showThumb ? '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>' : '' )
                        . '<th>' . wfMsgHtml( 'filehist-dimensions' ) . '</th>'
                        . '<th>' . wfMsgHtml( 'filehist-user' ) . '</th>'
                        . '<th>' . wfMsgHtml( 'filehist-comment' ) . '</th>'
@@ -933,7 +934,9 @@ class ImageHistoryList {
                $row .= "</td>";
 
                // Thumbnail
-               $row .= '<td>' . $this->getThumbForLine( $file ) . '</td>';
+               if ( $this->showThumb ) {
+                       $row .= '<td>' . $this->getThumbForLine( $file ) . '</td>';
+               }
 
                // Image dimensions + size
                $row .= '<td>';