Index: trunk/phase3/CREDITS |
— | — | @@ -118,6 +118,7 @@ |
119 | 119 | * Stefano Codari |
120 | 120 | * Str4nd |
121 | 121 | * svip |
| 122 | +* Zachary Hauri |
122 | 123 | |
123 | 124 | == Translators == |
124 | 125 | * Anders Wegge Jakobsen |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -3040,6 +3040,18 @@ |
3041 | 3041 | $wgThumbUpright = 0.75; |
3042 | 3042 | |
3043 | 3043 | /** |
| 3044 | + * Default parameters for the <gallery> tag |
| 3045 | + */ |
| 3046 | + |
| 3047 | +$wgGalleryOptions = array ( |
| 3048 | + 'imagesPerRow' => 4, // Default number of images per-row in the gallery |
| 3049 | + 'imageWidth' => 120, // Width of the cells containing images in galleries (in "px") |
| 3050 | + 'imageHeight' => 120, // Height of the cells containing images in galleries (in "px") |
| 3051 | + 'captionLength' => 20, // Length of caption to truncate (in characters) |
| 3052 | + 'showBytes' => true, // Show the filesize in bytes in categories |
| 3053 | +); |
| 3054 | + |
| 3055 | +/** |
3044 | 3056 | * On category pages, show thumbnail gallery for images belonging to that |
3045 | 3057 | * category instead of listing them as articles. |
3046 | 3058 | */ |
Index: trunk/phase3/includes/ImageGallery.php |
— | — | @@ -32,20 +32,22 @@ |
33 | 33 | */ |
34 | 34 | private $contextTitle = false; |
35 | 35 | |
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 | | - |
39 | 36 | private $mAttribs = array(); |
40 | 37 | |
41 | 38 | /** |
42 | 39 | * Create a new image gallery object. |
43 | 40 | */ |
44 | 41 | function __construct( ) { |
| 42 | + global $wgGalleryOptions; |
45 | 43 | $this->mImages = array(); |
46 | | - $this->mShowBytes = true; |
| 44 | + $this->mShowBytes = $wgGalleryOptions['showBytes']; |
47 | 45 | $this->mShowFilename = true; |
48 | 46 | $this->mParser = false; |
49 | 47 | $this->mHideBadImages = false; |
| 48 | + $this->mPerRow = $wgGalleryOptions['imagesPerRow']; |
| 49 | + $this->mWidths = $wgGalleryOptions['imageWidth']; |
| 50 | + $this->mHeights = $wgGalleryOptions['imageHeight']; |
| 51 | + $this->mCaptionLength = $wgGalleryOptions['captionLength']; |
50 | 52 | } |
51 | 53 | |
52 | 54 | /** |
— | — | @@ -308,7 +310,7 @@ |
309 | 311 | $textlink = $this->mShowFilename ? |
310 | 312 | $sk->link( |
311 | 313 | $nt, |
312 | | - htmlspecialchars( $wgLang->truncate( $nt->getText(), 20 ) ), |
| 314 | + htmlspecialchars( $wgLang->truncate( $nt->getText(), $this->mCaptionLength ) ), |
313 | 315 | array(), |
314 | 316 | array(), |
315 | 317 | array( 'known', 'noclasses' ) |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -28,6 +28,8 @@ |
29 | 29 | * (bug 22748) Add anchors on Special:ListGroupRights |
30 | 30 | * (bug 21981) Add parameter 'showfilename' to <gallery> to automatically apply |
31 | 31 | the names of the individual files within the gallery |
| 32 | +* (bug 12797) Add $wgGalleryOptions for adjusting of default gallery display |
| 33 | + options |
32 | 34 | |
33 | 35 | === Bug fixes in 1.17 === |
34 | 36 | * (bug 17560) Half-broken deletion moved image files to deletion archive without |