Index: trunk/extensions/CentralNotice/special/SpecialCentralNotice.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | * Handle different types of page requests |
19 | 19 | */ |
20 | 20 | function execute( $sub ) { |
21 | | - global $wgOut, $wgUser, $wgRequest, $wgExtensionAssetsPath; |
| 21 | + global $wgOut, $wgUser, $wgRequest; |
22 | 22 | |
23 | 23 | // Begin output |
24 | 24 | $this->setHeaders(); |
— | — | @@ -319,7 +319,7 @@ |
320 | 320 | |
321 | 321 | // Get connection |
322 | 322 | $dbr = wfGetDB( DB_SLAVE ); |
323 | | - $sk = $wgUser->getSkin(); |
| 323 | + $sk = $this->getSkin(); |
324 | 324 | if ( $this->editable ) { |
325 | 325 | $readonly = array(); |
326 | 326 | } else { |
— | — | @@ -480,7 +480,7 @@ |
481 | 481 | $htmlOut .= Xml::closeElement( 'table' ); |
482 | 482 | |
483 | 483 | if ( $this->editable ) { |
484 | | - $htmlOut .= Html::hidden( 'authtoken', $wgUser->editToken() ); |
| 484 | + $htmlOut .= Html::hidden( 'authtoken', $wgUser->getEditToken() ); |
485 | 485 | $htmlOut .= Xml::openElement( 'div', array( 'class' => 'cn-buttons' ) ); |
486 | 486 | $htmlOut .= Xml::submitButton( wfMsg( 'centralnotice-modify' ), |
487 | 487 | array( |
— | — | @@ -576,7 +576,7 @@ |
577 | 577 | |
578 | 578 | $htmlOut .= Xml::closeElement( 'table' ); |
579 | 579 | $htmlOut .= Html::hidden( 'change', 'weight' ); |
580 | | - $htmlOut .= Html::hidden( 'authtoken', $wgUser->editToken() ); |
| 580 | + $htmlOut .= Html::hidden( 'authtoken', $wgUser->getEditToken() ); |
581 | 581 | |
582 | 582 | // Submit button |
583 | 583 | $htmlOut .= Xml::tags( 'div', |
— | — | @@ -758,7 +758,7 @@ |
759 | 759 | $htmlOut .= wfMsg( 'centralnotice-no-templates' ); |
760 | 760 | $htmlOut .= Xml::element( 'p' ); |
761 | 761 | $newPage = $this->getTitleFor( 'NoticeTemplate', 'add' ); |
762 | | - $sk = $wgUser->getSkin(); |
| 762 | + $sk = $this->getSkin(); |
763 | 763 | $htmlOut .= $sk->makeLinkObj( $newPage, wfMsgHtml( 'centralnotice-add-template' ) ); |
764 | 764 | $htmlOut .= Xml::element( 'p' ); |
765 | 765 | } elseif ( $output_assigned == '' ) { |
— | — | @@ -775,7 +775,7 @@ |
776 | 776 | } |
777 | 777 | } |
778 | 778 | if ( $this->editable ) { |
779 | | - $htmlOut .= Html::hidden( 'authtoken', $wgUser->editToken() ); |
| 779 | + $htmlOut .= Html::hidden( 'authtoken', $wgUser->getEditToken() ); |
780 | 780 | |
781 | 781 | // Submit button |
782 | 782 | $htmlOut .= Xml::tags( 'div', |
— | — | @@ -951,8 +951,7 @@ |
952 | 952 | * Create form for managing banners assigned to a campaign |
953 | 953 | */ |
954 | 954 | function assignedTemplatesForm( $notice ) { |
955 | | - global $wgUser; |
956 | | - $sk = $wgUser->getSkin(); |
| 955 | + $sk = $this->getSkin(); |
957 | 956 | |
958 | 957 | $dbr = wfGetDB( DB_SLAVE ); |
959 | 958 | $res = $dbr->select( |
— | — | @@ -977,7 +976,7 @@ |
978 | 977 | |
979 | 978 | // No banners found |
980 | 979 | if ( $dbr->numRows( $res ) < 1 ) { |
981 | | - return; |
| 980 | + return ''; |
982 | 981 | } |
983 | 982 | |
984 | 983 | // Build Assigned banners HTML |
— | — | @@ -1067,9 +1066,10 @@ |
1068 | 1067 | $dbr = wfGetDB( DB_SLAVE ); |
1069 | 1068 | $res = $dbr->select( 'cn_templates', 'tmp_name', '', '', array( 'ORDER BY' => 'tmp_id' ) ); |
1070 | 1069 | |
| 1070 | + $htmlOut = ''; |
1071 | 1071 | if ( $dbr->numRows( $res ) > 0 ) { |
1072 | 1072 | // Build HTML |
1073 | | - $htmlOut = Xml::fieldset( wfMsg( "centralnotice-available-templates" ) ); |
| 1073 | + $htmlOut = Xml::fieldset( wfMsg( "centralnotice-available-templates" ) ); |
1074 | 1074 | |
1075 | 1075 | // Show paginated list of banners |
1076 | 1076 | $htmlOut .= Xml::tags( 'div', |
— | — | @@ -1081,9 +1081,6 @@ |
1082 | 1082 | $pager->getNavigationBar() ); |
1083 | 1083 | |
1084 | 1084 | $htmlOut .= Xml::closeElement( 'fieldset' ); |
1085 | | - } else { |
1086 | | - // Nothing found |
1087 | | - return; |
1088 | 1085 | } |
1089 | 1086 | return $htmlOut; |
1090 | 1087 | } |
Index: trunk/extensions/CentralNotice/special/SpecialBannerAllocation.php |
— | — | @@ -14,10 +14,8 @@ |
15 | 15 | * Handle different types of page requests |
16 | 16 | */ |
17 | 17 | function execute( $sub ) { |
18 | | - global $wgOut, $wgLang, $wgRequest, $wgExtensionAssetsPath, $wgNoticeProjects, $wgLanguageCode, $wgNoticeProject; |
| 18 | + global $wgOut, $wgLang, $wgRequest, $wgNoticeProjects, $wgLanguageCode, $wgNoticeProject; |
19 | 19 | |
20 | | - $locationSubmitted = false; |
21 | | - |
22 | 20 | $this->project = $wgRequest->getText( 'project', $wgNoticeProject ); |
23 | 21 | $this->language = $wgRequest->getText( 'language', $wgLanguageCode ); |
24 | 22 | |
— | — | @@ -208,9 +206,9 @@ |
209 | 207 | } |
210 | 208 | |
211 | 209 | function getTable( $type, $banners, $weight ) { |
212 | | - global $wgUser, $wgLang; |
| 210 | + global $wgLang; |
213 | 211 | |
214 | | - $sk = $wgUser->getSkin(); |
| 212 | + $sk = $this->getSkin(); |
215 | 213 | $viewBanner = $this->getTitleFor( 'NoticeTemplate', 'view' ); |
216 | 214 | $viewCampaign = $this->getTitleFor( 'CentralNotice' ); |
217 | 215 | |
Index: trunk/extensions/CentralNotice/special/SpecialBannerLoader.php |
— | — | @@ -81,6 +81,7 @@ |
82 | 82 | $bannerJs = 'insertBanner('.FormatJson::encode( $bannerArray ).');'; |
83 | 83 | return $bannerJs; |
84 | 84 | } |
| 85 | + return ''; |
85 | 86 | } |
86 | 87 | |
87 | 88 | /** |
— | — | @@ -99,6 +100,7 @@ |
100 | 101 | ); |
101 | 102 | return $bannerHtml; |
102 | 103 | } |
| 104 | + return ''; |
103 | 105 | } |
104 | 106 | |
105 | 107 | /** |
Index: trunk/extensions/CentralNotice/special/SpecialNoticeTemplate.php |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | * Handle different types of page requests |
19 | 19 | */ |
20 | 20 | function execute( $sub ) { |
21 | | - global $wgOut, $wgUser, $wgRequest, $wgExtensionAssetsPath; |
| 21 | + global $wgOut, $wgUser, $wgRequest; |
22 | 22 | |
23 | 23 | // Begin output |
24 | 24 | $this->setHeaders(); |
— | — | @@ -166,9 +166,9 @@ |
167 | 167 | * Show a list of available banners. Newer banners are shown first. |
168 | 168 | */ |
169 | 169 | function showList() { |
170 | | - global $wgOut, $wgUser; |
| 170 | + global $wgOut; |
171 | 171 | |
172 | | - $sk = $wgUser->getSkin(); |
| 172 | + $sk = $this->getSkin(); |
173 | 173 | $pager = new TemplatePager( $this ); |
174 | 174 | |
175 | 175 | // Begin building HTML |
— | — | @@ -305,7 +305,7 @@ |
306 | 306 | |
307 | 307 | $htmlOut .= Xml::textarea( 'templateBody', $body, 60, 20 ); |
308 | 308 | $htmlOut .= Html::closeElement( 'fieldset' ); |
309 | | - $htmlOut .= Html::hidden( 'authtoken', $wgUser->editToken() ); |
| 309 | + $htmlOut .= Html::hidden( 'authtoken', $wgUser->getEditToken() ); |
310 | 310 | |
311 | 311 | // Submit button |
312 | 312 | $htmlOut .= Xml::tags( 'div', |
— | — | @@ -328,7 +328,7 @@ |
329 | 329 | $wgNoticeEnableFundraising; |
330 | 330 | |
331 | 331 | $scriptPath = "$wgExtensionAssetsPath/CentralNotice"; |
332 | | - $sk = $wgUser->getSkin(); |
| 332 | + $sk = $this->getSkin(); |
333 | 333 | |
334 | 334 | if ( $this->editable ) { |
335 | 335 | $readonly = array(); |
— | — | @@ -490,7 +490,7 @@ |
491 | 491 | |
492 | 492 | if ( $this->editable ) { |
493 | 493 | $htmlOut .= Html::hidden( 'wpUserLanguage', $wpUserLang ); |
494 | | - $htmlOut .= Html::hidden( 'authtoken', $wgUser->editToken() ); |
| 494 | + $htmlOut .= Html::hidden( 'authtoken', $wgUser->getEditToken() ); |
495 | 495 | $htmlOut .= Xml::tags( 'div', |
496 | 496 | array( 'class' => 'cn-buttons' ), |
497 | 497 | Xml::submitButton( |
— | — | @@ -640,7 +640,7 @@ |
641 | 641 | if ( $this->editable ) { |
642 | 642 | // Indicate which form was submitted |
643 | 643 | $htmlOut .= Html::hidden( 'mainform', 'true' ); |
644 | | - $htmlOut .= Html::hidden( 'authtoken', $wgUser->editToken() ); |
| 644 | + $htmlOut .= Html::hidden( 'authtoken', $wgUser->getEditToken() ); |
645 | 645 | $htmlOut .= Xml::tags( 'div', |
646 | 646 | array( 'class' => 'cn-buttons' ), |
647 | 647 | Xml::submitButton( wfMsg( 'centralnotice-save-banner' ) ) |
— | — | @@ -670,7 +670,7 @@ |
671 | 671 | |
672 | 672 | $htmlOut .= Html::closeElement( 'tr' ); |
673 | 673 | $htmlOut .= Html::closeElement( 'table' ); |
674 | | - $htmlOut .= Html::hidden( 'authtoken', $wgUser->editToken() ); |
| 674 | + $htmlOut .= Html::hidden( 'authtoken', $wgUser->getEditToken() ); |
675 | 675 | $htmlOut .= Html::closeElement( 'fieldset' ); |
676 | 676 | $htmlOut .= Html::closeElement( 'form' ); |
677 | 677 | } |
— | — | @@ -692,7 +692,7 @@ |
693 | 693 | // Testing to see if bumping up the memory limit lets meta preview |
694 | 694 | ini_set( 'memory_limit', '120M' ); |
695 | 695 | |
696 | | - $sk = $wgUser->getSkin(); |
| 696 | + $sk = $this->getSkin(); |
697 | 697 | |
698 | 698 | // Pull all available text for a banner |
699 | 699 | $langs = array_keys( $this->getTranslations( $template ) ); |
Index: trunk/extensions/CentralNotice/TemplatePager.php |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | $htmlOut = ''; |
108 | 108 | $htmlOut .= Xml::closeElement( 'table' ); |
109 | 109 | if ( $this->editable ) { |
110 | | - $htmlOut .= Html::hidden( 'authtoken', $wgUser->editToken() ); |
| 110 | + $htmlOut .= Html::hidden( 'authtoken', $wgUser->getEditToken() ); |
111 | 111 | $htmlOut .= Xml::tags( 'div', |
112 | 112 | array( 'class' => 'cn-buttons' ), |
113 | 113 | Xml::submitButton( wfMsg( 'centralnotice-modify' ) ) |
Index: trunk/extensions/CentralNotice/CentralNoticeBannerLogPager.php |
— | — | @@ -132,7 +132,6 @@ |
133 | 133 | } |
134 | 134 | |
135 | 135 | function showInitialSettings( $row ) { |
136 | | - global $wgLang; |
137 | 136 | $details = ''; |
138 | 137 | $details .= wfMsg ( |
139 | 138 | 'centralnotice-log-label', |
— | — | @@ -165,9 +164,7 @@ |
166 | 165 | } |
167 | 166 | |
168 | 167 | function showChanges( $row ) { |
169 | | - global $wgLang; |
170 | | - $details = ''; |
171 | | - $details .= $this->testBooleanChange( 'anon', $row ); |
| 168 | + $details = $this->testBooleanChange( 'anon', $row ); |
172 | 169 | $details .= $this->testBooleanChange( 'account', $row ); |
173 | 170 | $details .= $this->testBooleanChange( 'fundraising', $row ); |
174 | 171 | $details .= $this->testBooleanChange( 'autolink', $row ); |
Index: trunk/extensions/CentralNotice/CentralNoticePageLogPager.php |
— | — | @@ -59,8 +59,6 @@ |
60 | 60 | * Generate the content of each table row (1 row = 1 log entry) |
61 | 61 | */ |
62 | 62 | function formatRow( $row ) { |
63 | | - global $wgLang, $wgExtensionAssetsPath; |
64 | | - |
65 | 63 | // Create a user object so we can pull the name, user page, etc. |
66 | 64 | $loggedUser = User::newFromId( $row->rc_user ); |
67 | 65 | // Create the user page link |
Index: trunk/extensions/CentralNotice/CentralNoticeCampaignLogPager.php |
— | — | @@ -4,7 +4,6 @@ |
5 | 5 | var $viewPage, $special; |
6 | 6 | |
7 | 7 | function __construct( $special ) { |
8 | | - global $wgRequest; |
9 | 8 | $this->special = $special; |
10 | 9 | parent::__construct(); |
11 | 10 | |