r63261 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63260‎ | r63261 | r63262 >
Date:00:27, 5 March 2010
Author:demon
Status:ok
Tags:
Comment:
Revert r63197 '(bug 12797) Allow adjusting of default gallery display options' Breaks gallery parser test, also I don't really like introducing 5 new globals for this...maybe 1 array with keys?
Modified paths:
  • /trunk/phase3/CREDITS (modified) (history)
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/DefaultSettings.php (modified) (history)
  • /trunk/phase3/includes/ImageGallery.php (modified) (history)

Diff [purge]

Index: trunk/phase3/CREDITS
@@ -117,7 +117,6 @@
118118 * Stefano Codari
119119 * Str4nd
120120 * svip
121 -* Zachary Hauri
122121
123122 == Translators ==
124123 * Anders Wegge Jakobsen
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3040,31 +3040,6 @@
30413041 $wgThumbUpright = 0.75;
30423042
30433043 /**
3044 - * Adjust the default number of images per-row in the gallery.
3045 - */
3046 -$wgGalleryImagesPerRow = 3;
3047 -
3048 -/**
3049 - * Adjust the width of the cells containing images in galleries (in "px")
3050 - */
3051 -$wgGalleryImageWidth = 200;
3052 -
3053 -/**
3054 - * Adjust the height of the cells containing images in galleries (in "px")
3055 - */
3056 -$wgGalleryImageHeight = 200;
3057 -
3058 -/**
3059 - * The length of caption to truncate to by default (in characters)
3060 - */
3061 -$wgGalleryCaptionLength = 10;
3062 -
3063 -/**
3064 - * Should the gallerys in categoryes show the filesize in bytes?
3065 - */
3066 -$wgGalleryShowBytes = true;
3067 -
3068 -/**
30693044 * On category pages, show thumbnail gallery for images belonging to that
30703045 * category instead of listing them as articles.
30713046 */
Index: trunk/phase3/includes/ImageGallery.php
@@ -32,22 +32,20 @@
3333 */
3434 private $contextTitle = false;
3535
 36+ private $mPerRow = 4; // How many images wide should the gallery be?
 37+ private $mWidths = 120, $mHeights = 120; // How wide/tall each thumbnail should be
 38+
3639 private $mAttribs = array();
3740
3841 /**
3942 * Create a new image gallery object.
4043 */
4144 function __construct( ) {
42 - global $wgGalleryImagesPerRow, $wgGalleryImageWidth, $wgGalleryImageHeight, $wgGalleryShowBytes, $wgGalleryCaptionLength;
4345 $this->mImages = array();
44 - $this->mShowBytes = $wgGalleryShowBytes;
 46+ $this->mShowBytes = true;
4547 $this->mShowFilename = true;
4648 $this->mParser = false;
4749 $this->mHideBadImages = false;
48 - $this->mPerRow = $wgGalleryImagesPerRow;
49 - $this->mWidths = $wgGalleryImageWidth;
50 - $this->mHeights = $wgGalleryImageHeight;
51 - $this->mCaptionLength = $wgGalleryCaptionLength;
5250 }
5351
5452 /**
@@ -310,7 +308,7 @@
311309 $textlink = $this->mShowFilename ?
312310 $sk->link(
313311 $nt,
314 - htmlspecialchars( $wgLang->truncate( $nt->getText(), $this->mCaptionLength ) ),
 312+ htmlspecialchars( $wgLang->truncate( $nt->getText(), 20 ) ),
315313 array(),
316314 array(),
317315 array( 'known', 'noclasses' )
Index: trunk/phase3/RELEASE-NOTES
@@ -19,9 +19,6 @@
2020 it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
2121
2222 === Configuration changes in 1.17 ===
23 -* (bug 12797) Allow adjusting of default gallery display options:
24 - $wgGalleryImagesPerRow, $wgGalleryImageWidth, $wgGalleryImageHeight
25 - $wgGalleryCaptionLength, $wgGalleryShowBytes
2623 * DatabaseFunctions.php that was needed for compatibility with pre-1.3 extensions
2724 has been removed.
2825

Follow-up revisions

RevisionCommit summaryAuthorDate
r63672* (bug 12797) Add $wgGalleryOptions for adjusting of default gallery display ...raymond11:42, 13 March 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r63197(bug 12797) Allow adjusting of default gallery display optionsraymond13:07, 3 March 2010

Status & tagging log