Matthias Mullie has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/361054 )

Change subject: Set $wgGalleryOptions in Setup.php
......................................................................

Set $wgGalleryOptions in Setup.php

Defaults will be added to the config array at a later point,
without overriding any that have already been set.
This'll make it less prone to errors in case $wgGalleryOptions
is incomplete.

Bug: T168479
Change-Id: I5f127e5ac8c8a1583301dd7aed2ae8e434987950
---
M includes/DefaultSettings.php
M includes/Setup.php
2 files changed, 27 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/54/361054/1

diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php
index 00e26d9..852ccc6 100644
--- a/includes/DefaultSettings.php
+++ b/includes/DefaultSettings.php
@@ -1439,26 +1439,20 @@
 $wgUseTinyRGBForJPGThumbnails = false;
 
 /**
- * Default parameters for the "<gallery>" tag
+ * Parameters for the "<gallery>" tag.
+ * Fields are:
+ *   - imagesPerRow:   Default number of images per-row in the gallery. 0 -> 
Adapt to screensize
+ *   - imageWidth:     Width of the cells containing images in galleries (in 
"px")
+ *   - imageHeight:    Height of the cells containing images in galleries (in 
"px")
+ *   - captionLength:  Length to truncate filename to in caption when using 
"showfilename".
+ *                     A value of 'true' will truncate the filename to one 
line using CSS
+ *                     and will be the behaviour after deprecation.
+ *                     @deprecated since 1.28
+ *   - showBytes:      Show the filesize in bytes in categories
+ *   - showDimensions: Show the dimensions (width x height) in categories
+ *   - mode:           Gallery mode
  */
-$wgGalleryOptions = [
-       // Default number of images per-row in the gallery. 0 -> Adapt to 
screensize
-       'imagesPerRow' => 0,
-       // Width of the cells containing images in galleries (in "px")
-       'imageWidth' => 120,
-       // Height of the cells containing images in galleries (in "px")
-       'imageHeight' => 120,
-       // Length to truncate filename to in caption when using "showfilename".
-       // A value of 'true' will truncate the filename to one line using CSS
-       // and will be the behaviour after deprecation.
-       // @deprecated since 1.28
-       'captionLength' => true,
-       // Show the filesize in bytes in categories
-       'showBytes' => true,
-       // Show the dimensions (width x height) in categories
-       'showDimensions' => true,
-       'mode' => 'traditional',
-];
+$wgGalleryOptions = [];
 
 /**
  * Adjust width of upright images when parameter 'upright' is used
diff --git a/includes/Setup.php b/includes/Setup.php
index b10cf23..5795517 100644
--- a/includes/Setup.php
+++ b/includes/Setup.php
@@ -182,6 +182,20 @@
 ];
 
 /**
+ * Default parameters for the "<gallery>" tag.
+ * @see DefaultSettings.php for description of the fields.
+ */
+$wgGalleryOptions += [
+       'imagesPerRow' => 0,
+       'imageWidth' => 120,
+       'imageHeight' => 120,
+       'captionLength' => true,
+       'showBytes' => true,
+       'showDimensions' => true,
+       'mode' => 'traditional',
+];
+
+/**
  * Initialise $wgLocalFileRepo from backwards-compatible settings
  */
 if ( !$wgLocalFileRepo ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/361054
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f127e5ac8c8a1583301dd7aed2ae8e434987950
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to