- $this->formatRow( wfMsgExt( 'statistics-articles', array( 'parseinline' ) ),
- $wgLang->formatNum( $this->good ),
- array( 'class' => 'mw-statistics-articles' ) ) .
- $this->formatRow( wfMsgExt( 'statistics-pages', array( 'parseinline' ) ),
- $wgLang->formatNum( $this->total ),
- array( 'class' => 'mw-statistics-pages' ),
- 'statistics-pages-desc' ) .
- $this->formatRow( wfMsgExt( 'statistics-files', array( 'parseinline' ) ),
- $wgLang->formatNum( $this->images ),
- array( 'class' => 'mw-statistics-files' ) );
+ $this->formatRow( $linkRenderer->makeKnownLink(
+ $specialAllPagesTitle,
+ $this->msg( 'statistics-articles' )->text(),
+ [], [ 'hideredirects' => 1 ] ),
+ $this->getLanguage()->formatNum( $this->good ),
+ [ 'class' => 'mw-statistics-articles' ],
+ 'statistics-articles-desc' ) .
+ $this->formatRow( $linkRenderer->makeKnownLink( $specialAllPagesTitle,
+ $this->msg( 'statistics-pages' )->text() ),
+ $this->getLanguage()->formatNum( $this->total ),
+ [ 'class' => 'mw-statistics-pages' ],
+ 'statistics-pages-desc' );
+
+ // Show the image row only, when there are files or upload is possible
+ if ( $this->images !== 0 || $this->getConfig()->get( 'EnableUploads' ) ) {
+ $pageStatsHtml .= $this->formatRow(
+ $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'MediaStatistics' ),
+ $this->msg( 'statistics-files' )->text() ),
+ $this->getLanguage()->formatNum( $this->images ),
+ [ 'class' => 'mw-statistics-files' ] );
+ }
+
+ return $pageStatsHtml;