Mass conversion of $wgContLang to service
[lhc/web/wiklou.git] / includes / gallery / TraditionalImageGallery.php
index cd6aab0..5ede631 100644 (file)
@@ -35,7 +35,7 @@ class TraditionalImageGallery extends ImageGalleryBase {
        function toHTML() {
                if ( $this->mPerRow > 0 ) {
                        $maxwidth = $this->mPerRow * ( $this->mWidths + $this->getAllPadding() );
-                       $oldStyle = isset( $this->mAttribs['style'] ) ? $this->mAttribs['style'] : '';
+                       $oldStyle = $this->mAttribs['style'] ?? '';
                        # _width is ignored by any sane browser. IE6 doesn't know max-width
                        # so it uses _width instead
                        $this->mAttribs['style'] = "max-width: {$maxwidth}px;_width: {$maxwidth}px;" .
@@ -170,8 +170,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 +226,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 +286,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.
         *