r63197 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63196‎ | r63197 | r63198 >
Date:13:07, 3 March 2010
Author:raymond
Status:reverted
Tags:
Comment:
(bug 12797) Allow adjusting of default gallery display options
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,6 +117,7 @@
118118 * Stefano Codari
119119 * Str4nd
120120 * svip
 121+* Zachary Hauri
121122
122123 == Translators ==
123124 * Anders Wegge Jakobsen
Index: trunk/phase3/includes/DefaultSettings.php
@@ -3040,6 +3040,31 @@
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+/**
30443069 * On category pages, show thumbnail gallery for images belonging to that
30453070 * category instead of listing them as articles.
30463071 */
Index: trunk/phase3/includes/ImageGallery.php
@@ -32,20 +32,22 @@
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 -
3936 private $mAttribs = array();
4037
4138 /**
4239 * Create a new image gallery object.
4340 */
4441 function __construct( ) {
 42+ global $wgGalleryImagesPerRow, $wgGalleryImageWidth, $wgGalleryImageHeight, $wgGalleryShowBytes, $wgGalleryCaptionLength;
4543 $this->mImages = array();
46 - $this->mShowBytes = true;
 44+ $this->mShowBytes = $wgGalleryShowBytes;
4745 $this->mShowFilename = true;
4846 $this->mParser = false;
4947 $this->mHideBadImages = false;
 48+ $this->mPerRow = $wgGalleryImagesPerRow;
 49+ $this->mWidths = $wgGalleryImageWidth;
 50+ $this->mHeights = $wgGalleryImageHeight;
 51+ $this->mCaptionLength = $wgGalleryCaptionLength;
5052 }
5153
5254 /**
@@ -308,7 +310,7 @@
309311 $textlink = $this->mShowFilename ?
310312 $sk->link(
311313 $nt,
312 - htmlspecialchars( $wgLang->truncate( $nt->getText(), 20 ) ),
 314+ htmlspecialchars( $wgLang->truncate( $nt->getText(), $this->mCaptionLength ) ),
313315 array(),
314316 array(),
315317 array( 'known', 'noclasses' )
Index: trunk/phase3/RELEASE-NOTES
@@ -19,7 +19,12 @@
2020 it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
2121
2222 === Configuration changes in 1.17 ===
23 -
 23+* (bug 12797) Allow adjusting of default gallery display options:
 24+ $wgGalleryImagesPerRow, $wgGalleryImageWidth, $wgGalleryImageHeight
 25+ $wgGalleryCaptionLength, $wgGalleryShowBytes
 26+
 27+=== New features in 1.17 ===
 28+
2429 === Bug fixes in 1.17 ===
2530 * (bug 17560) Half-broken deletion moved image files to deletion archive without
2631 updating DB

Follow-up revisions

RevisionCommit summaryAuthorDate
r63261Revert r63197 '(bug 12797) Allow adjusting of default gallery display options...demon00:27, 5 March 2010
r63672* (bug 12797) Add $wgGalleryOptions for adjusting of default gallery display ...raymond11:42, 13 March 2010

Status & tagging log