Merge "Rename autonym for 'no' from 'norsk bokmål' to 'norsk'"
[lhc/web/wiklou.git] / includes / gallery / ImageGalleryBase.php
index 6884f65..eeb8a8f 100644 (file)
@@ -38,6 +38,11 @@ abstract class ImageGalleryBase extends ContextSource {
         */
        protected $mShowBytes;
 
+       /**
+        * @var bool Whether to show the dimensions in categories
+        */
+       protected $mShowDimensions;
+
        /**
         * @var bool Whether to show the filename. Default: true
         */
@@ -136,6 +141,7 @@ abstract class ImageGalleryBase extends ContextSource {
                $galleryOptions = $this->getConfig()->get( 'GalleryOptions' );
                $this->mImages = [];
                $this->mShowBytes = $galleryOptions['showBytes'];
+               $this->mShowDimensions = $galleryOptions['showDimensions'];
                $this->mShowFilename = true;
                $this->mParser = false;
                $this->mHideBadImages = false;
@@ -283,6 +289,16 @@ abstract class ImageGalleryBase extends ContextSource {
                return empty( $this->mImages );
        }
 
+       /**
+        * Enable/Disable showing of the dimensions of an image in the gallery.
+        * Enabled by default.
+        *
+        * @param bool $f Set to false to disable
+        */
+       function setShowDimensions( $f ) {
+               $this->mShowDimensions = (bool)$f;
+       }
+
        /**
         * Enable/Disable showing of the file size of an image in the gallery.
         * Enabled by default.