r104278 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104277‎ | r104278 | r104279 >
Date:16:48, 26 November 2011
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Add total of all projects in all languages (excluding specials) at the bottom of the list of wikimedia wikis
Modified paths:
  • /trunk/extensions/SiteMatrix/SiteMatrix_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SiteMatrix/SiteMatrix_body.php
@@ -255,7 +255,7 @@
256256 * @static
257257 * @param ApiQuerySiteinfo $module
258258 * @param array $results
259 - * @return void
 259+ * @return bool
260260 */
261261 public static function APIQuerySiteInfoGeneralInfo( $module, &$results ) {
262262 global $wgDBname, $wgConf;
@@ -357,13 +357,21 @@
358358 }
359359
360360 # Total
361 - $s .= '<tr style="font-weight: bold"><th><a id="total" name="total"></a>' . wfMsgHtml( 'sitematrix-sitetotal' ) . '</th>';
 361+ $totalCount = 0;
 362+ $s .= '<tr style="font-weight: bold"><th rowspan="2"><a id="total" name="total"></a>' . wfMsgHtml( 'sitematrix-sitetotal' ) . '</th>';
362363 foreach( $matrix->getNames() as $site => $name ) {
363364 $url = $matrix->getSiteUrl( $site );
364365 $count = $matrix->getCountPerSite( $site );
 366+ $totalCount += $count;
365367 $s .= "<th><a href=\"{$url}\">{$count}</a></th>";
366368 }
367369 $s .= '</tr>';
 370+
 371+ $s .= '<tr style="font-weight: bold">';
 372+ $noProjects = count( $matrix->getNames() );
 373+ $s .= "<th colspan=\"{$noProjects }\">{$totalCount}</th>";
 374+ $s .= '</tr>';
 375+
368376 $s .= Xml::closeElement( 'table' ) . "\n";
369377
370378 # Specials

Follow-up revisions

RevisionCommit summaryAuthorDate
r104280Per Raymond on r104278, run numbers through formatNum()...reedy17:20, 26 November 2011

Comments

#Comment by Raymond (talk | contribs)   17:10, 26 November 2011

All numbers $totalCount, $count, $matrix->getCount() need a run through $wgLang->formatNum() I would do it myself but I have this extension not installed.

Status & tagging log