r91218 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91217‎ | r91218 | r91219 >
Date:20:31, 30 June 2011
Author:awjrichards
Status:ok
Tags:
Comment:
MFT r91118-r91217 for special/SpecialBannerLoader.php and special/SpecialBannerController.php
Modified paths:
  • /branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerController.php (modified) (history)
  • /branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerLoader.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerController.php
@@ -54,12 +54,11 @@
5555 'getVars': {}
5656 },
5757 'fn': {
58 - 'loadBanner': function( bannerName, fundraising, landingPages, campaign ) {
 58+ 'loadBanner': function( bannerName, campaign ) {
5959 // Get the requested banner
6060 var bannerPageQuery = $.param( {
6161 'banner': bannerName, 'campaign': campaign, 'userlang': wgUserLanguage,
62 - 'db': wgDBname, 'sitename': wgSiteName, 'country': Geo.country,
63 - 'fundraising': fundraising, 'landingpages': landingPages
 62+ 'db': wgDBname, 'sitename': wgSiteName, 'country': Geo.country
6463 } );
6564 var bannerPage = '?title=Special:BannerLoader&' + bannerPageQuery;
6665 JAVASCRIPT;
@@ -119,8 +118,6 @@
120119 // Load a random banner from our groomed list
121120 $.centralNotice.fn.loadBanner(
122121 groomedBannerList[pointer].name,
123 - groomedBannerList[pointer].fundraising,
124 - groomedBannerList[pointer].landing_pages,
125122 groomedBannerList[pointer].campaign
126123 );
127124 },
Property changes on: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerController.php
___________________________________________________________________
Added: svn:mergeinfo
128125 Merged /branches/wmf-deployment/extensions/CentralNotice/special/SpecialBannerController.php:r60970
129126 Merged /branches/wmf/1.16wmf4/extensions/CentralNotice/special/SpecialBannerController.php:r67177,69199,76243,77266
130127 Merged /trunk/extensions/CentralNotice/special/SpecialBannerController.php:r62820-67552,67557,67559-71720,71725-71731,71734-71739,71748-71753,71774-71997,72058-72131,72136-73830,73847,73850,73852,73855,73959,73963,73973,73980,73983,73991,73994-73995,74000-74321,74325-74406,75376-75470,75567,75643,75646,75674,75680,75726,75849,75889,75908,75973,76141,76145,76333,76347,76351,76356-76358,76361,76363,76462,76543,76763,77622-79761,79780,79783-80145,80147-80148,80150,80152-80602,81461-83563,83565-91217
131128 Merged /trunk/phase3/extensions/CentralNotice/special/SpecialBannerController.php:r63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573
Index: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerLoader.php
@@ -23,9 +23,7 @@
2424 // Get values from the query string
2525 $this->language = $wgRequest->getText( 'userlang', 'en' );
2626 $this->siteName = $wgRequest->getText( 'sitename', 'Wikipedia' );
27 - $this->campaign = $wgRequest->getText( 'campaign', 'unknown' );
28 - $this->fundraising = $wgRequest->getBool( 'fundraising', false );
29 - $this->landingPages = $wgRequest->getText( 'landingpages' );
 27+ $this->campaign = $wgRequest->getText( 'campaign', 'undefined' );
3028
3129 if ( $wgRequest->getText( 'banner' ) ) {
3230 $bannerName = $wgRequest->getText( 'banner' );
@@ -76,8 +74,8 @@
7775 'bannerName' => $bannerName,
7876 'bannerHtml' => $bannerHtml,
7977 'campaign' => $this->campaign,
80 - 'fundraising' => $this->fundraising,
81 - 'landingPages' => $this->landingPages
 78+ 'fundraising' => $this->getFundraising( $bannerName ),
 79+ 'landingPages' => $this->getLandingPages( $bannerName )
8280 );
8381 $bannerJs = 'insertBanner('.FormatJson::encode( $bannerArray ).');';
8482 return $bannerJs;
@@ -196,6 +194,22 @@
197195 }
198196 return $count;
199197 }
 198+
 199+ function getFundraising( $bannerName ) {
 200+ global $wgCentralDBname;
 201+ $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
 202+ $eBannerName = htmlspecialchars( $bannerName );
 203+ $row = $dbr->selectRow( 'cn_templates', 'tmp_fundraising', array( 'tmp_name' => $eBannerName ) );
 204+ return $row->tmp_fundraising;
 205+ }
 206+
 207+ function getLandingPages( $bannerName ) {
 208+ global $wgCentralDBname;
 209+ $dbr = wfGetDB( DB_SLAVE, array(), $wgCentralDBname );
 210+ $eBannerName = htmlspecialchars( $bannerName );
 211+ $row = $dbr->selectRow( 'cn_templates', 'tmp_landing_pages', array( 'tmp_name' => $eBannerName ) );
 212+ return $row->tmp_landing_pages;
 213+ }
200214 }
201215 /**
202216 * @defgroup Exception Exception
Property changes on: branches/wmf/1.17wmf1/extensions/CentralNotice/special/SpecialBannerLoader.php
___________________________________________________________________
Added: svn:mergeinfo
203217 Merged /trunk/phase3/extensions/CentralNotice/special/SpecialBannerLoader.php:r63545-63546,63549,63643,63764,63897-63901,64113,64509,65387,65391,65555,65590,65650,65816,77555,77558-77560,77563-77565,77573
204218 Merged /branches/wmf-deployment/extensions/CentralNotice/special/SpecialBannerLoader.php:r60970
205219 Merged /branches/wmf/1.16wmf4/extensions/CentralNotice/special/SpecialBannerLoader.php:r67177,69199,76243,77266
206220 Merged /trunk/extensions/CentralNotice/special/SpecialBannerLoader.php:r62820-67552,67557,67559-71720,71725-71731,71734-71739,71748-71753,71774-71997,72058-72131,72136-73830,73847,73850,73852,73855,73959,73963,73973,73980,73983,73991,73994-73995,74000-74321,74325-74406,75376-75470,75567,75643,75646,75674,75680,75726,75849,75889,75908,75973,76141,76145,76333,76347,76351,76356-76358,76361,76363,76462,76543,76763,77622-79761,79780,79783-80145,80147-80148,80150,80152-80602,81461-83563,83565-91217

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r91118MFT r83564-91107awjrichards21:57, 29 June 2011
r91217Needs some field munging due to ambiguous selectsreedy20:23, 30 June 2011

Status & tagging log