X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Fgallery%2FImageGalleryBase.php;h=6884f65626dd66f8485885feb2de0e9ad376b145;hb=af7ffaeeecd1908351863c0e928b8c5dcfb033fc;hp=9ea97029c3d2cebad6d40ec06afb28b44ec4e08d;hpb=ea9fcc1e4d3b572199d82c426024e3e5efe23879;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/gallery/ImageGalleryBase.php b/includes/gallery/ImageGalleryBase.php index 9ea97029c3..6884f65626 100644 --- a/includes/gallery/ImageGalleryBase.php +++ b/includes/gallery/ImageGalleryBase.php @@ -70,7 +70,7 @@ abstract class ImageGalleryBase extends ContextSource { protected $contextTitle = false; /** @var array */ - protected $mAttribs = array(); + protected $mAttribs = []; /** @var bool */ static private $modeMapping = false; @@ -91,8 +91,8 @@ abstract class ImageGalleryBase extends ContextSource { $context = RequestContext::getMainAndWarn( __METHOD__ ); } if ( !$mode ) { - $galleryOpions = $context->getConfig()->get( 'GalleryOptions' ); - $mode = $galleryOpions['mode']; + $galleryOptions = $context->getConfig()->get( 'GalleryOptions' ); + $mode = $galleryOptions['mode']; } $mode = $wgContLang->lc( $mode ); @@ -107,15 +107,16 @@ abstract class ImageGalleryBase extends ContextSource { private static function loadModes() { if ( self::$modeMapping === false ) { - self::$modeMapping = array( + self::$modeMapping = [ 'traditional' => 'TraditionalImageGallery', 'nolines' => 'NolinesImageGallery', 'packed' => 'PackedImageGallery', 'packed-hover' => 'PackedHoverImageGallery', 'packed-overlay' => 'PackedOverlayImageGallery', - ); + 'slideshow' => 'SlideshowImageGallery', + ]; // Allow extensions to make a new gallery format. - Hooks::run( 'GalleryGetModes', array( &self::$modeMapping ) ); + Hooks::run( 'GalleryGetModes', [ &self::$modeMapping ] ); } } @@ -133,7 +134,7 @@ abstract class ImageGalleryBase extends ContextSource { } $galleryOptions = $this->getConfig()->get( 'GalleryOptions' ); - $this->mImages = array(); + $this->mImages = []; $this->mShowBytes = $galleryOptions['showBytes']; $this->mShowFilename = true; $this->mParser = false; @@ -239,12 +240,12 @@ abstract class ImageGalleryBase extends ContextSource { * @param string $link Override image link (optional) * @param array $handlerOpts Array of options for image handler (aka page number) */ - function add( $title, $html = '', $alt = '', $link = '', $handlerOpts = array() ) { + function add( $title, $html = '', $alt = '', $link = '', $handlerOpts = [] ) { if ( $title instanceof File ) { // Old calling convention $title = $title->getTitle(); } - $this->mImages[] = array( $title, $html, $alt, $link, $handlerOpts ); + $this->mImages[] = [ $title, $html, $alt, $link, $handlerOpts ]; wfDebug( 'ImageGallery::add ' . $title->getText() . "\n" ); } @@ -258,12 +259,12 @@ abstract class ImageGalleryBase extends ContextSource { * @param string $link Override image link (optional) * @param array $handlerOpts Array of options for image handler (aka page number) */ - function insert( $title, $html = '', $alt = '', $link = '', $handlerOpts = array() ) { + function insert( $title, $html = '', $alt = '', $link = '', $handlerOpts = [] ) { if ( $title instanceof File ) { // Old calling convention $title = $title->getTitle(); } - array_unshift( $this->mImages, array( &$title, $html, $alt, $link, $handlerOpts ) ); + array_unshift( $this->mImages, [ &$title, $html, $alt, $link, $handlerOpts ] ); } /**