From 20e131c3a2fa8d84e8335d23adc607914d064e84 Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Sat, 13 Mar 2010 09:43:37 +0000 Subject: [PATCH] * (bug 21981) Add parameter 'showfilename' to to automatically apply the names of the individual files within the gallery --- CREDITS | 1 + RELEASE-NOTES | 2 + includes/parser/Parser.php | 5 ++ maintenance/parserTests.txt | 91 +++++++++++++++++++++++++++++++++++++ 4 files changed, 99 insertions(+) diff --git a/CREDITS b/CREDITS index 05fe9ea102..3aa4ba42fa 100644 --- a/CREDITS +++ b/CREDITS @@ -68,6 +68,7 @@ following names for their contribution to the product. * Ahmad Sherif * Antonio Ospite * Azliq7 +* Bawolff * Borislav Manolov * Brad Jorsch * Brent G diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 03d011223f..a7dbc5a792 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -26,6 +26,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 10183) Users can now add personal styles and scripts to all skins via User:/common.css and /common.js (if user css/js is enabled) * (bug 22748) Add anchors on Special:ListGroupRights +* (bug 21981) Add parameter 'showfilename' to to automatically apply + the names of the individual files within the gallery === Bug fixes in 1.17 === * (bug 17560) Half-broken deletion moved image files to deletion archive without diff --git a/includes/parser/Parser.php b/includes/parser/Parser.php index e2173fd02a..9260a8061f 100644 --- a/includes/parser/Parser.php +++ b/includes/parser/Parser.php @@ -4372,6 +4372,11 @@ class Parser $ig->useSkin( $this->mOptions->getSkin() ); $ig->mRevisionId = $this->mRevisionId; + if( isset( $params['showfilename'] ) ) { + $ig->setShowFilename( true ); + } else { + $ig->setShowFilename( false ); + } if( isset( $params['caption'] ) ) { $caption = $params['caption']; $caption = htmlspecialchars( $caption ); diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index f46a19134b..4dc5732ab8 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -6351,6 +6351,97 @@ image4 |300px| centre !! end +!! test +Gallery (with options) +!! input + +File:Nonexistant.jpg|caption +File:Nonexistant.jpg +image:foobar.jpg|some '''caption''' [[Main Page]] +image:foobar.jpg + +!! result + + + + + + + + + + + + +!! end + +!! test +gallery (with showfilename option) +!! input + +File:Nonexistant.jpg|caption +File:Nonexistant.jpg +image:foobar.jpg|some '''caption''' [[Main Page]] +File:Foobar.jpg + +!! result + + + + + + + + + +!! end + !! test HTML Hex character encoding (spells the word "JavaScript") !! input -- 2.20.1