r59049 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59048‎ | r59049 | r59050 >
Date:02:06, 14 November 2009
Author:nimishg
Status:deferred
Tags:
Comment:
Generalized links
Modified paths:
  • /trunk/extensions/ContributionReporting/ContributionReporting.php (modified) (history)
  • /trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ContributionReporting/ContributionReporting.php
@@ -9,6 +9,8 @@
1010 exit( 1 );
1111 }
1212
 13+$wgContributionReportingBaseURL = "http://meta.wikimedia.org/w/index.php?title=Special:NoticeTemplate/view&template=";
 14+
1315 // Override these with appropriate DB settings for the CiviCRM database...
1416 $wgContributionReportingDBserver = $wgDBserver;
1517 $wgContributionReportingDBuser = $wgDBuser;
Index: trunk/extensions/ContributionReporting/ContributionTrackingStatistics_body.php
@@ -11,13 +11,6 @@
1212
1313 public static $number_of_days_to_show = 7;
1414
15 - //URL for templates
16 - public static $templateURLs = array(
17 - '2009_Notice1' => "http://meta.wikimedia.org/w/index.php?title=Special:NoticeTemplate/view&template=2009_Notice1",
18 - '2009_EM1Notice'=> "http://meta.wikimedia.org/w/index.php?title=Special:NoticeTemplate/view&template=2009_EM1Notice",
19 - '2009_Notice11' => "http://meta.wikimedia.org/w/index.php?title=Special:NoticeTemplate/view&template=2009_Notice11",
20 - '2009_Notice10' => "http://meta.wikimedia.org/w/index.php?title=Special:NoticeTemplate/view&template=2009_Notice10",
21 - );
2215 /* Functions */
2316
2417 public function __construct() {
@@ -62,7 +55,7 @@
6356 // Html out for the days total
6457 public function showDayTotals( $is_now = true, $timestamp = 0 ) {
6558 global $wgOut,$wgLang;
66 - global $wgAllowedTemplates, $wgAllowedSupport, $wgAllowedPaymentMethod;
 59+ global $wgAllowedTemplates, $wgAllowedSupport, $wgAllowedPaymentMethod, $wgContributionReportingBaseURL;
6760
6861 $totals = $this->getDayTotals($is_now, $timestamp);
6962
@@ -110,14 +103,9 @@
111104 $conversion_rate = ( $template[1] == 0 ) ? 0 : ( $template[2] / $template[1] ) * 100;
112105 $amount = ( $template[3] == 0 ) ? 0 : $template[3];
113106
114 - //if the template has a URL associated, create a href to it
115 - $template_link = $expanded_template[0];
116 - if(isset(SpecialContributionTrackingStatistics::$templateURLs["{$expanded_template[0]}"])){
117 - $link = SpecialContributionTrackingStatistics::$templateURLs["{$expanded_template[0]}"];
118 - $template_link = Xml::element('a', array('href' =>"$link"), $expanded_template[0]);
119 - }
 107+ $link = $wgContributionReportingBaseURL.$expanded_template[0];
 108+ $template_link = Xml::element('a', array('href' =>"$link"), $expanded_template[0]);
120109
121 -
122110 //average donations
123111 $average = 0;
124112 if($template[2] != 0){

Follow-up revisions

RevisionCommit summaryAuthorDate
r59050picking up r59049tomasz02:13, 14 November 2009

Status & tagging log