From 8ea782202d0ffd3e51fdc5b7d8a64043dc090db0 Mon Sep 17 00:00:00 2001 From: Matthias Mullie Date: Fri, 23 Jun 2017 13:31:49 +0200 Subject: [PATCH] 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 --- includes/DefaultSettings.php | 34 ++++++++++++++-------------------- includes/Setup.php | 14 ++++++++++++++ 2 files changed, 28 insertions(+), 20 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 00e26d9f07..852ccc6c27 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1439,26 +1439,20 @@ $wgUploadThumbnailRenderHttpCustomDomain = false; $wgUseTinyRGBForJPGThumbnails = false; /** - * Default parameters for the "" 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 "" 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 diff --git a/includes/Setup.php b/includes/Setup.php index b10cf23809..579551770e 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -181,6 +181,20 @@ $wgLockManagers[] = [ 'class' => 'NullLockManager', ]; +/** + * Default parameters for the "" 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 */ -- 2.20.1