r102036 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r102035‎ | r102036 | r102037 >
Date:20:11, 4 November 2011
Author:mah
Status:ok (Comments)
Tags:
Comment:
Fix Bug #25430 -- "Fundraising-related Special pages need header and
footer messages"

Patch from David Baumgarten.
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionReporting.i18n.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionStatistics_body.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php (modified) (history)
  • /trunk/extensions/ContributionReporting/FundraiserStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionReporting.i18n.php
@@ -53,6 +53,8 @@
5454 'contribstats-value-under' => 'Under $1',
5555 'contribstats-value-from' => 'From $1 - $2',
5656 'contribstats-value-over' => 'Over $1',
 57+ 'contribstats-header' => '',
 58+ 'contribstats-footer' => '',
5759
5860 // Tracking Statistics
5961 'contributiontrackingstatistics' => 'Contribution tracking statistics',
Index: trunk/extensions/ContributionReporting/ContributionStatistics_body.php
@@ -23,7 +23,7 @@
2424 }
2525
2626 public function execute( $sub ) {
27 - global $egContributionStatisticsViewDays;
 27+ global $wgOut,$egContributionStatisticsViewDays;
2828
2929 $this->evalDateRange();
3030
@@ -53,6 +53,7 @@
5454 // Begin output
5555 $this->setHeaders();
5656
 57+ $wgOut->addWikiText(wfMsg('contribstats-header'));
5758 // Show daily totals if the range includes today
5859 if( $this->mEndDate > time() && $this->mStartDate < time() ) {
5960 $this->showDailyTotals( $egContributionStatisticsViewDays );
@@ -66,6 +67,7 @@
6768
6869 // Show contribution breakdown
6970 $this->showContributionBreakdown();
 71+ $wgOut->addWikiText(wfMsg('contribstats-footer'));
7072 }
7173
7274 /* Display Functions */
Index: trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php
@@ -27,6 +27,7 @@
2828 // Begin output
2929 $this->setHeaders();
3030
 31+ $wgOut->addWikiText(wfMsg('contribstats-header'));
3132 // Build Header
3233 $htmlOut = Xml::openElement( 'table',
3334 array(
@@ -65,6 +66,7 @@
6667 $offset = SpecialContributionTrackingStatistics::$number_of_days_to_show * 24 * 60 * 60;
6768 $this->showTotalsForRange( array( ( $end - $offset ), $end ), $format );
6869 }
 70+ $wgOut->addWikiText(wfMsg('contribstats-footer'));
6971 }
7072
7173 /* Display Functions */
Index: trunk/extensions/ContributionReporting/FundraiserStatistics_body.php
@@ -87,6 +87,7 @@
8888
8989 /* Display */
9090
 91+ $wgOut->addWikiText(wfMsg('contribstats-header'));
9192 // Chart maximums
9293 foreach ( $egFundraiserStatisticsFundraisers as $fundraiser ) {
9394 foreach ( $charts as $name => $chart ) {
@@ -260,6 +261,7 @@
261262 Xml::tags( 'tr', null, Xml::tags( 'td', null, $htmlViews ) )
262263 )
263264 );
 265+ $wgOut->addWikiText(wfMsg('contribstats-footer'));
264266 }
265267
266268 /* Private Functions */

Follow-up revisions

RevisionCommit summaryAuthorDate
r102059r102036: Ignore empty messages for translatewiki.netraymond22:24, 4 November 2011
r102211re r102036: s/addWikiText.wfMag/addWikiMsg/;mah23:55, 6 November 2011
r102697MFT r45856, r71558, r71962, r73304, r73309, r75671, r75680, r75726, r76542, r...awjrichards22:02, 10 November 2011

Comments

#Comment by Nikerabbit (talk | contribs)   14:17, 5 November 2011

Where does this addWikiText( wfMsg() ) come from? I've been trying to kill it for years. Also, are you sure you don't want to use content language here (the use case is not explained)?

#Comment by MarkAHershberger (talk | contribs)   21:22, 6 November 2011

Since this is for the fundraising appeal, I'm not sure why you'd want to use the content language.

> Where does this addWikiText( wfMsg() ) come from? I've been trying to kill it for years.

Could you suggest an alternative so that, in the future, when I see the same form in a patch, I can redirect them?

#Comment by Nikerabbit (talk | contribs)   21:44, 6 November 2011

addWikiMsg()

Status & tagging log