r53130 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r53129‎ | r53130 | r53131 >
Date:05:37, 12 July 2009
Author:tstarling
Status:ok
Tags:
Comment:
Added $wgShowArchiveThumbnails, may be useful for file store backend load reduction.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -780,15 +780,16 @@
781781 */
782782 class ImageHistoryList {
783783
784 - protected $imagePage, $img, $skin, $title, $repo;
 784+ protected $imagePage, $img, $skin, $title, $repo, $showThumb;
785785
786786 public function __construct( $imagePage ) {
787 - global $wgUser;
 787+ global $wgUser, $wgShowArchiveThumbnails;
788788 $this->skin = $wgUser->getSkin();
789789 $this->current = $imagePage->getFile();
790790 $this->img = $imagePage->getDisplayedFile();
791791 $this->title = $imagePage->getTitle();
792792 $this->imagePage = $imagePage;
 793+ $this->showThumb = $wgShowArchiveThumbnails;
793794 }
794795
795796 public function getImagePage() {
@@ -813,7 +814,7 @@
814815 . '<tr><td></td>'
815816 . ( $this->current->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ? '<td></td>' : '' )
816817 . '<th>' . wfMsgHtml( 'filehist-datetime' ) . '</th>'
817 - . '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>'
 818+ . ( $this->showThumb ? '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>' : '' )
818819 . '<th>' . wfMsgHtml( 'filehist-dimensions' ) . '</th>'
819820 . '<th>' . wfMsgHtml( 'filehist-user' ) . '</th>'
820821 . '<th>' . wfMsgHtml( 'filehist-comment' ) . '</th>'
@@ -933,7 +934,9 @@
934935 $row .= "</td>";
935936
936937 // Thumbnail
937 - $row .= '<td>' . $this->getThumbForLine( $file ) . '</td>';
 938+ if ( $this->showThumb ) {
 939+ $row .= '<td>' . $this->getThumbForLine( $file ) . '</td>';
 940+ }
938941
939942 // Image dimensions + size
940943 $row .= '<td>';
Index: trunk/phase3/includes/DefaultSettings.php
@@ -2190,6 +2190,11 @@
21912191 */
21922192 $wgGenerateThumbnailOnParse = true;
21932193
 2194+/**
 2195+ * Show thumbnails for old images on the image description page
 2196+ */
 2197+$wgShowArchiveThumbnails = true;
 2198+
21942199 /** Whether or not to use image resizing */
21952200 $wgUseImageResize = true;
21962201
Index: trunk/phase3/RELEASE-NOTES
@@ -122,6 +122,8 @@
123123 * Removed name attribute from <a id="top"></a>.
124124 * Parser::setFunctionTagHook now can be used to add a new tag which is parsed at
125125 preprocesor level.
 126+* Added $wgShowArchiveThumbnails, allowing sysadmins to disable thumbnail
 127+ display for old versions of images.
126128
127129 === Bug fixes in 1.16 ===
128130

Status & tagging log