Set $wgGalleryOptions in Setup.php
authorMatthias Mullie <git@mullie.eu>
Fri, 23 Jun 2017 11:31:49 +0000 (13:31 +0200)
committerMatthias Mullie <git@mullie.eu>
Fri, 23 Jun 2017 11:33:23 +0000 (13:33 +0200)
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

includes/DefaultSettings.php
includes/Setup.php

index 00e26d9..852ccc6 100644 (file)
@@ -1439,26 +1439,20 @@ $wgUploadThumbnailRenderHttpCustomDomain = false;
 $wgUseTinyRGBForJPGThumbnails = false;
 
 /**
- * Default parameters for the "<gallery>" tag
- */
-$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',
-];
+ * 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 = [];
 
 /**
  * Adjust width of upright images when parameter 'upright' is used
index b10cf23..5795517 100644 (file)
@@ -181,6 +181,20 @@ $wgLockManagers[] = [
        'class' => 'NullLockManager',
 ];
 
+/**
+ * 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
  */