From b3a382a0d544bcce99fe430380d35fb6f118cc1b Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Fri, 5 Mar 2010 00:27:20 +0000 Subject: [PATCH] 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? --- CREDITS | 1 - RELEASE-NOTES | 3 --- includes/DefaultSettings.php | 25 ------------------------- includes/ImageGallery.php | 12 +++++------- 4 files changed, 5 insertions(+), 36 deletions(-) diff --git a/CREDITS b/CREDITS index 76bc980d7f..05fe9ea102 100644 --- a/CREDITS +++ b/CREDITS @@ -117,7 +117,6 @@ following names for their contribution to the product. * Stefano Codari * Str4nd * svip -* Zachary Hauri == Translators == * Anders Wegge Jakobsen diff --git a/RELEASE-NOTES b/RELEASE-NOTES index b07eb6869c..8f469d906f 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -19,9 +19,6 @@ Those wishing to use the latest code instead of a branch release can obtain it from source control: http://www.mediawiki.org/wiki/Download_from_SVN === Configuration changes in 1.17 === -* (bug 12797) Allow adjusting of default gallery display options: - $wgGalleryImagesPerRow, $wgGalleryImageWidth, $wgGalleryImageHeight - $wgGalleryCaptionLength, $wgGalleryShowBytes * DatabaseFunctions.php that was needed for compatibility with pre-1.3 extensions has been removed. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 21085334ba..45221aa3f1 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -3039,31 +3039,6 @@ $wgThumbLimits = array( */ $wgThumbUpright = 0.75; -/** - * Adjust the default number of images per-row in the gallery. - */ -$wgGalleryImagesPerRow = 3; - -/** - * Adjust the width of the cells containing images in galleries (in "px") - */ -$wgGalleryImageWidth = 200; - -/** - * Adjust the height of the cells containing images in galleries (in "px") - */ -$wgGalleryImageHeight = 200; - -/** - * The length of caption to truncate to by default (in characters) - */ -$wgGalleryCaptionLength = 10; - -/** - * Should the gallerys in categoryes show the filesize in bytes? - */ -$wgGalleryShowBytes = true; - /** * On category pages, show thumbnail gallery for images belonging to that * category instead of listing them as articles. diff --git a/includes/ImageGallery.php b/includes/ImageGallery.php index 64fa9cb269..c76c8e5779 100644 --- a/includes/ImageGallery.php +++ b/includes/ImageGallery.php @@ -32,22 +32,20 @@ class ImageGallery */ private $contextTitle = false; + private $mPerRow = 4; // How many images wide should the gallery be? + private $mWidths = 120, $mHeights = 120; // How wide/tall each thumbnail should be + private $mAttribs = array(); /** * Create a new image gallery object. */ function __construct( ) { - global $wgGalleryImagesPerRow, $wgGalleryImageWidth, $wgGalleryImageHeight, $wgGalleryShowBytes, $wgGalleryCaptionLength; $this->mImages = array(); - $this->mShowBytes = $wgGalleryShowBytes; + $this->mShowBytes = true; $this->mShowFilename = true; $this->mParser = false; $this->mHideBadImages = false; - $this->mPerRow = $wgGalleryImagesPerRow; - $this->mWidths = $wgGalleryImageWidth; - $this->mHeights = $wgGalleryImageHeight; - $this->mCaptionLength = $wgGalleryCaptionLength; } /** @@ -310,7 +308,7 @@ class ImageGallery $textlink = $this->mShowFilename ? $sk->link( $nt, - htmlspecialchars( $wgLang->truncate( $nt->getText(), $this->mCaptionLength ) ), + htmlspecialchars( $wgLang->truncate( $nt->getText(), 20 ) ), array(), array(), array( 'known', 'noclasses' ) -- 2.20.1