r57491 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57490‎ | r57491 | r57492 >
Date:21:34, 7 October 2009
Author:siebrand
Status:deferred
Tags:
Comment:
Add options 'legenddetail' and 'legendsummary' to allow adding of legends.
Modified paths:
  • /trunk/extensions/Translate/scripts/groupStatistics.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Translate/scripts/groupStatistics.php
@@ -84,7 +84,7 @@
8585 )
8686 );
8787
88 -$optionsWithArgs = array( 'groups', 'output', 'skiplanguages' );
 88+$optionsWithArgs = array( 'groups', 'output', 'skiplanguages', 'legenddetail', 'legendsummary' );
8989 require( dirname( __FILE__ ) . '/cli.inc' );
9090
9191 class TranslateStatsOutput extends wikiStatsOutput {
@@ -95,6 +95,10 @@
9696 function summaryheading() {
9797 echo "\n" . '{| class="sortable wikitable" border="2" cellpadding="4" cellspacing="0" style="background-color: #F9F9F9; border: 1px #AAAAAA solid; border-collapse: collapse; clear:both;"' . "\n";
9898 }
 99+
 100+ function addFreeText( $freeText ) {
 101+ echo $freeText;
 102+ }
99103 }
100104
101105 if ( isset( $options['help'] ) ) showUsage();
@@ -138,6 +142,10 @@
139143 'wiki' or not specified.
140144 --summary : add a summary with counts and scores per continent category
141145 and totals. Only available for a valid 'most' value.
 146+ --legenddetail : Page name for legend to be transcluded at the top of
 147+ the details table
 148+ --legendsummary : Page name for legend to be transcluded at the top of
 149+ the summary table
142150
143151 END;
144152 STDERR( $msg );
@@ -214,6 +222,10 @@
215223 // Default sorting order by language code, users can sort wiki output.
216224 ksort( $languages );
217225
 226+if( $options['legenddetail'] ) {
 227+ $out->addFreeText( "{{" . $options['legenddetail'] . "}}\n" );
 228+}
 229+
218230 // Output headers
219231 $out->heading();
220232 $out->blockstart();
@@ -421,6 +433,10 @@
422434 $out->footer();
423435
424436 if( $reportScore && isset( $options['summary'] ) ) {
 437+ if( $reportScore && $options['legendsummary'] ) {
 438+ $out->addFreeText( "{{" . $options['legendsummary'] . "}}\n" );
 439+ }
 440+
425441 $out->summaryheading();
426442
427443 $out->blockstart();

Status & tagging log