Separate content from presentation for user tools list
[lhc/web/wiklou.git] / includes / gallery / TraditionalImageGallery.php
index a87322d..9de7eb8 100644 (file)
@@ -72,11 +72,9 @@ class TraditionalImageGallery extends ImageGalleryBase {
                $lang = $this->getRenderLang();
                # Output each image...
                foreach ( $this->mImages as $pair ) {
+                       // "text" means "caption" here
                        /** @var Title $nt */
-                       $nt = $pair[0];
-                       $text = $pair[1]; # "text" means "caption" here
-                       $alt = $pair[2];
-                       $link = $pair[3];
+                       list( $nt, $text, $alt, $link ) = $pair;
 
                        $descQuery = false;
                        if ( $nt->getNamespace() === NS_FILE ) {
@@ -170,8 +168,8 @@ class TraditionalImageGallery extends ImageGalleryBase {
                        }
 
                        // @todo Code is incomplete.
-                       // $linkTarget = Title::newFromText( $wgContLang->getNsText( MWNamespace::getUser() ) .
-                       // ":{$ut}" );
+                       // $linkTarget = Title::newFromText( MediaWikiServices::getInstance()->
+                       // getContentLanguage()->getNsText( MWNamespace::getUser() ) . ":{$ut}" );
                        // $ul = Linker::link( $linkTarget, $ut );
 
                        $meta = [];
@@ -226,7 +224,7 @@ class TraditionalImageGallery extends ImageGalleryBase {
                        $nt,
                        htmlspecialchars(
                                is_int( $this->getCaptionLength() ) ?
-                                       $lang->truncate( $nt->getText(), $this->getCaptionLength() ) :
+                                       $lang->truncateForVisual( $nt->getText(), $this->getCaptionLength() ) :
                                        $nt->getText()
                        ),
                        [
@@ -286,7 +284,7 @@ class TraditionalImageGallery extends ImageGalleryBase {
        }
 
        /**
-        * Length to truncate filename to in caption when using "showfilename" (if int).
+        * Length (in characters) to truncate filename to in caption when using "showfilename" (if int).
         * A value of 'true' will truncate the filename to one line using CSS, while
         * 'false' will disable truncating.
         *