r103142 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103141‎ | r103142 | r103143 >
Date:10:46, 15 November 2011
Author:aaron
Status:resolved (Comments)
Tags:
Comment:
* Removed skin member from special pages and use Linker class
* Killed some globals and cleaned up permission errors in special pages
* A bit of w/s cleanup
Modified paths:
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/actions/RevisionReview_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/actions/Stabilization_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ConfiguredPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/PendingChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ProblemChanges_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/QualityOversight_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ReviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ReviewedVersions_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/StablePages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/UnreviewedPages_body.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ValidationStatistics_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/frontend/specialpages/actions/Stabilization_body.php
@@ -3,76 +3,74 @@
44 // Assumes $wgFlaggedRevsProtection is off
55 class Stabilization extends UnlistedSpecialPage {
66 protected $form = null;
7 - protected $skin;
87
98 public function __construct() {
10 - global $wgUser;
119 parent::__construct( 'Stabilization', 'stablesettings' );
12 - $this->skin = $wgUser->getSkin();
1310 }
1411
1512 public function execute( $par ) {
16 - global $wgRequest, $wgUser, $wgOut;
17 - # Check user token
18 - $confirmed = false;
 13+ $out = $this->getOutput();
 14+ $user = $this->getUser();
 15+ $request = $this->getRequest();
 16+
 17+ $confirmed = $user->matchEditToken( $request->getVal( 'wpEditToken' ) );
 18+
1919 # Let anyone view, but not submit...
20 - if ( $wgRequest->wasPosted() ) {
21 - # Check user token
22 - $confirmed = $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
23 - if ( $wgUser->isBlocked( !$confirmed ) ) {
24 - $wgOut->blockedPage();
25 - return;
26 - } elseif ( !$wgUser->isAllowed( 'stablesettings' ) ) {
27 - $wgOut->permissionRequired( 'stablesettings' );
28 - return;
 20+ if ( $request->wasPosted() ) {
 21+ if ( !$user->isAllowed( 'stablesettings' ) ) {
 22+ throw new PermissionsError( 'stablesettings' );
 23+ }
 24+ $block = $user->getBlock( !$confirmed );
 25+ if ( $block ) {
 26+ throw new UserBlockedError( $block );
2927 } elseif ( wfReadOnly() ) {
30 - $wgOut->readOnlyPage();
31 - return;
 28+ throw new ReadOnlyError();
3229 }
3330 }
3431 # Set page title
3532 $this->setHeaders();
3633
3734 # Target page
38 - $title = Title::newFromURL( $wgRequest->getVal( 'page', $par ) );
 35+ $title = Title::newFromURL( $request->getVal( 'page', $par ) );
3936 if ( !$title ) {
40 - $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
 37+ $out->showErrorPage( 'notargettitle', 'notargettext' );
4138 return;
4239 }
4340
44 - $this->form = new PageStabilityGeneralForm( $wgUser );
 41+ $this->form = new PageStabilityGeneralForm( $user );
4542 $form = $this->form; // convenience
4643
4744 $form->setPage( $title );
4845 # Watch checkbox
49 - $form->setWatchThis( (bool)$wgRequest->getCheck( 'wpWatchthis' ) );
 46+ $form->setWatchThis( (bool)$request->getCheck( 'wpWatchthis' ) );
5047 # Get auto-review option...
51 - $form->setReviewThis( $wgRequest->getBool( 'wpReviewthis', true ) );
 48+ $form->setReviewThis( $request->getBool( 'wpReviewthis', true ) );
5249 # Reason
53 - $form->setReasonExtra( $wgRequest->getText( 'wpReason' ) );
54 - $form->setReasonSelection( $wgRequest->getVal( 'wpReasonSelection' ) );
 50+ $form->setReasonExtra( $request->getText( 'wpReason' ) );
 51+ $form->setReasonSelection( $request->getVal( 'wpReasonSelection' ) );
5552 # Expiry
56 - $form->setExpiryCustom( $wgRequest->getText( 'mwStabilize-expiry' ) );
57 - $form->setExpirySelection( $wgRequest->getVal( 'wpExpirySelection' ) );
 53+ $form->setExpiryCustom( $request->getText( 'mwStabilize-expiry' ) );
 54+ $form->setExpirySelection( $request->getVal( 'wpExpirySelection' ) );
5855 # Default version
59 - $form->setOverride( (int)$wgRequest->getBool( 'wpStableconfig-override' ) );
 56+ $form->setOverride( (int)$request->getBool( 'wpStableconfig-override' ) );
6057 # Get autoreview restrictions...
61 - $form->setAutoreview( $wgRequest->getVal( 'mwProtect-level-autoreview' ) );
 58+ $form->setAutoreview( $request->getVal( 'mwProtect-level-autoreview' ) );
6259 $form->ready(); // params all set
6360
6461 $status = $form->checkTarget();
6562 if ( $status === 'stabilize_page_notexists' ) {
66 - $wgOut->addWikiMsg( 'stabilization-notexists', $title->getPrefixedText() );
 63+ $out->addWikiMsg( 'stabilization-notexists', $title->getPrefixedText() );
6764 return;
6865 } elseif ( $status === 'stabilize_page_unreviewable' ) {
69 - $wgOut->addWikiMsg( 'stabilization-notcontent', $title->getPrefixedText() );
 66+ $out->addWikiMsg( 'stabilization-notcontent', $title->getPrefixedText() );
7067 return;
7168 }
 69+
7270 # Form POST request...
73 - if ( $confirmed && $form->isAllowed() ) {
 71+ if ( $request->wasPosted() && $confirmed && $form->isAllowed() ) {
7472 $status = $form->submit();
7573 if ( $status === true ) {
76 - $wgOut->redirect( $title->getFullUrl() );
 74+ $out->redirect( $title->getFullUrl() );
7775 } else {
7876 $this->showForm( wfMsg( $status ) );
7977 }
@@ -84,7 +82,8 @@
8583 }
8684
8785 public function showForm( $err = null ) {
88 - global $wgOut, $wgLang, $wgUser;
 86+ $out = $this->getOutput();
 87+
8988 $form = $this->form; // convenience
9089 $title = $this->form->getPage();
9190 $oldConfig = $form->getOldConfig();
@@ -92,8 +91,8 @@
9392 $s = ''; // form HTML string
9493 # Add any error messages
9594 if ( "" != $err ) {
96 - $wgOut->setSubtitle( wfMsgHtml( 'formerror' ) );
97 - $wgOut->addHTML( "<p class='error'>{$err}</p>\n" );
 95+ $out->setSubtitle( wfMsgHtml( 'formerror' ) );
 96+ $out->addHTML( "<p class='error'>{$err}</p>\n" );
9897 }
9998 # Add header text
10099 if ( !$form->isAllowed() ) {
@@ -115,9 +114,9 @@
116115 $dropdownOptions = array(); // array of <label,value>
117116 # Add the current expiry as a dropdown option
118117 if ( $oldConfig['expiry'] && $oldConfig['expiry'] != Block::infinity() ) {
119 - $timestamp = $wgLang->timeanddate( $oldConfig['expiry'] );
120 - $d = $wgLang->date( $oldConfig['expiry'] );
121 - $t = $wgLang->time( $oldConfig['expiry'] );
 118+ $timestamp = $this->getLang()->timeanddate( $oldConfig['expiry'] );
 119+ $d = $this->getLang()->date( $oldConfig['expiry'] );
 120+ $t = $this->getLang()->time( $oldConfig['expiry'] );
122121 $dropdownOptions[] = array(
123122 wfMsg( 'protect-existing-expiry', $timestamp, $d, $t ), 'existing' );
124123 }
@@ -172,8 +171,8 @@
173172 <td class='mw-input'>" .
174173 Xml::tags( 'select',
175174 array(
176 - 'id' => 'mwStabilizeExpirySelection',
177 - 'name' => 'wpExpirySelection',
 175+ 'id' => 'mwStabilizeExpirySelection',
 176+ 'name' => 'wpExpirySelection',
178177 'onchange' => 'onFRChangeExpiryDropdown()',
179178 ) + $this->disabledAttr(),
180179 $expiryFormOptions ) .
@@ -197,7 +196,7 @@
198197 $watchLabel = wfMsgExt( 'watchthis', 'parseinline' );
199198 $watchAttribs = array( 'accesskey' => wfMsg( 'accesskey-watch' ),
200199 'id' => 'wpWatchthis' );
201 - $watchChecked = ( $wgUser->getOption( 'watchdefault' )
 200+ $watchChecked = ( $this->getUser()->getOption( 'watchdefault' )
202201 || $title->userIsWatching() );
203202 $reviewLabel = wfMsgExt( 'stabilization-review', 'parseinline' );
204203
@@ -228,7 +227,7 @@
229228 Xml::check( 'wpWatchthis', $watchChecked, $watchAttribs ) .
230229 "&#160;<label for='wpWatchthis' " .
231230 Xml::expandAttributes(
232 - array( 'title' => $this->skin->titleAttrib( 'watch', 'withaccess' ) ) ) .
 231+ array( 'title' => Linker::titleAttrib( 'watch', 'withaccess' ) ) ) .
233232 ">{$watchLabel}</label>" .
234233 '</td>
235234 </tr>
@@ -240,21 +239,21 @@
241240 </tr>' . Xml::closeElement( 'table' ) .
242241 Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) .
243242 Html::hidden( 'page', $title->getPrefixedText() ) .
244 - Html::hidden( 'wpEditToken', $wgUser->editToken() );
 243+ Html::hidden( 'wpEditToken', $this->getUser()->editToken() );
245244 } else {
246245 $s .= Xml::closeElement( 'table' );
247246 }
248247 $s .= Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' );
249248
250 - $wgOut->addHTML( $s );
 249+ $out->addHTML( $s );
251250
252 - $wgOut->addHTML( Xml::element( 'h2', null,
 251+ $out->addHTML( Xml::element( 'h2', null,
253252 htmlspecialchars( LogPage::logName( 'stable' ) ) ) );
254 - LogEventsList::showLogExtract( $wgOut, 'stable',
 253+ LogEventsList::showLogExtract( $out, 'stable',
255254 $title->getPrefixedText(), '', array( 'lim' => 25 ) );
256255
257256 # Add some javascript for expiry dropdowns
258 - $wgOut->addScript(
 257+ $out->addScript(
259258 "<script type=\"text/javascript\">
260259 function onFRChangeExpiryDropdown() {
261260 document.getElementById('mwStabilizeExpiryOther').value = '';
@@ -267,7 +266,6 @@
268267 }
269268
270269 protected function buildSelector( $selected ) {
271 - global $wgUser;
272270 $allowedLevels = array();
273271 $levels = FlaggedRevs::getRestrictionLevels();
274272 array_unshift( $levels, '' ); // Add a "none" level
@@ -275,7 +273,7 @@
276274 # Don't let them choose levels they can't set,
277275 # but *show* them all when the form is disabled.
278276 if ( $this->form->isAllowed()
279 - && !FlaggedRevs::userCanSetAutoreviewLevel( $wgUser, $key ) )
 277+ && !FlaggedRevs::userCanSetAutoreviewLevel( $this->getUser(), $key ) )
280278 {
281279 continue;
282280 }
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/actions/RevisionReview_body.php
@@ -3,152 +3,149 @@
44 class RevisionReview extends UnlistedSpecialPage {
55 protected $form;
66 protected $page;
7 - protected $skin;
87
98 public function __construct() {
10 - global $wgUser;
119 parent::__construct( 'RevisionReview', 'review' );
12 - $this->skin = $wgUser->getSkin();
1310 }
1411
1512 public function execute( $par ) {
16 - global $wgRequest, $wgUser, $wgOut;
17 - $confirmed = $wgUser->matchEditToken( $wgRequest->getVal( 'wpEditToken' ) );
18 - if ( $wgUser->isAllowed( 'review' ) ) {
19 - if ( $wgUser->isBlocked( !$confirmed ) ) {
20 - $wgOut->blockedPage();
21 - return;
22 - }
23 - } else {
24 - $wgOut->permissionRequired( 'review' );
25 - return;
 13+ $out = $this->getOutput();
 14+ $user = $this->getUser();
 15+ $request = $this->getRequest();
 16+
 17+ $confirmed = $user->matchEditToken( $request->getVal( 'wpEditToken' ) );
 18+
 19+ if ( !$user->isAllowed( 'review' ) ) {
 20+ throw new PermissionsError( 'review' );
2621 }
27 - if ( wfReadOnly() ) {
28 - $wgOut->readOnlyPage();
29 - return;
 22+ $block = $user->getBlock( !$confirmed );
 23+ if ( $block ) {
 24+ throw new UserBlockedError( $block );
 25+ } elseif ( wfReadOnly() ) {
 26+ throw new ReadOnlyError();
3027 }
 28+
3129 $this->setHeaders();
3230
3331 # Our target page
34 - $this->page = Title::newFromURL( $wgRequest->getVal( 'target' ) );
 32+ $this->page = Title::newFromURL( $request->getVal( 'target' ) );
3533 if ( !$this->page ) {
36 - $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
 34+ $out->showErrorPage( 'notargettitle', 'notargettext' );
3735 return;
3836 }
3937 # Basic page permission checks...
40 - $permErrors = $this->page->getUserPermissionsErrors( 'review', $wgUser, false );
 38+ $permErrors = $this->page->getUserPermissionsErrors( 'review', $user, false );
4139 if ( !$permErrors ) {
42 - $permErrors = $this->page->getUserPermissionsErrors( 'edit', $wgUser, false );
 40+ $permErrors = $this->page->getUserPermissionsErrors( 'edit', $user, false );
4341 }
4442 if ( $permErrors ) {
45 - $wgOut->showPermissionsErrorPage( $permErrors, 'review' );
 43+ $out->showPermissionsErrorPage( $permErrors, 'review' );
4644 return;
4745 }
4846
49 - $this->form = new RevisionReviewForm( $wgUser );
 47+ $this->form = new RevisionReviewForm( $user );
5048 $form = $this->form; // convenience
5149
5250 $form->setPage( $this->page );
5351 # Param for sites with binary flagging
54 - $form->setApprove( $wgRequest->getCheck( 'wpApprove' ) );
55 - $form->setUnapprove( $wgRequest->getCheck( 'wpUnapprove' ) );
56 - $form->setReject( $wgRequest->getCheck( 'wpReject' ) );
 52+ $form->setApprove( $request->getCheck( 'wpApprove' ) );
 53+ $form->setUnapprove( $request->getCheck( 'wpUnapprove' ) );
 54+ $form->setReject( $request->getCheck( 'wpReject' ) );
5755 # Rev ID
58 - $form->setOldId( $wgRequest->getInt( 'oldid' ) );
59 - $form->setRefId( $wgRequest->getInt( 'refid' ) );
 56+ $form->setOldId( $request->getInt( 'oldid' ) );
 57+ $form->setRefId( $request->getInt( 'refid' ) );
6058 # Special parameter mapping
61 - $form->setTemplateParams( $wgRequest->getVal( 'templateParams' ) );
62 - $form->setFileParams( $wgRequest->getVal( 'imageParams' ) );
63 - $form->setFileVersion( $wgRequest->getVal( 'fileVersion' ) );
 59+ $form->setTemplateParams( $request->getVal( 'templateParams' ) );
 60+ $form->setFileParams( $request->getVal( 'imageParams' ) );
 61+ $form->setFileVersion( $request->getVal( 'fileVersion' ) );
6462 # Special token to discourage fiddling...
65 - $form->setValidatedParams( $wgRequest->getVal( 'validatedParams' ) );
 63+ $form->setValidatedParams( $request->getVal( 'validatedParams' ) );
6664 # Conflict handling
67 - $form->setLastChangeTime( $wgRequest->getVal( 'changetime' ) );
 65+ $form->setLastChangeTime( $request->getVal( 'changetime' ) );
6866 # Tag values
6967 foreach ( FlaggedRevs::getTags() as $tag ) {
7068 # This can be NULL if we uncheck a checkbox
71 - $val = $wgRequest->getInt( "wp$tag" );
 69+ $val = $request->getInt( "wp$tag" );
7270 $form->setDim( $tag, $val );
7371 }
7472 # Log comment
75 - $form->setComment( $wgRequest->getText( 'wpReason' ) );
 73+ $form->setComment( $request->getText( 'wpReason' ) );
7674 $form->ready();
7775
7876 # Review the edit if requested (POST)...
79 - if ( $wgRequest->wasPosted() ) {
 77+ if ( $request->wasPosted() ) {
8078 // Check the edit token...
8179 if ( !$confirmed ) {
82 - $wgOut->addWikiText( wfMsg( 'sessionfailure' ) );
83 - $wgOut->returnToMain( false, $this->page );
 80+ $out->addWikiText( wfMsg( 'sessionfailure' ) );
 81+ $out->returnToMain( false, $this->page );
8482 return;
8583 }
8684 // Use confirmation screen for reject...
87 - if ( $form->getAction() == 'reject' && !$wgRequest->getBool( 'wpRejectConfirm' ) ) {
 85+ if ( $form->getAction() == 'reject' && !$request->getBool( 'wpRejectConfirm' ) ) {
8886 $rejectForm = new RejectConfirmationFormUI( $form );
8987 list( $html, $status ) = $rejectForm->getHtml();
9088 // Success...
9189 if ( $status === true ) {
92 - $wgOut->addHtml( $html );
 90+ $out->addHtml( $html );
9391 // Failure...
9492 } else {
9593 if ( $status === 'review_page_unreviewable' ) {
96 - $wgOut->addWikiText( wfMsg( 'revreview-main' ) );
 94+ $out->addWikiText( wfMsg( 'revreview-main' ) );
9795 return;
9896 } elseif ( $status === 'review_page_notexists' ) {
99 - $wgOut->showErrorPage( 'internalerror', 'nopagetext' );
 97+ $out->showErrorPage( 'internalerror', 'nopagetext' );
10098 return;
10199 } elseif ( $status === 'review_bad_oldid' ) {
102 - $wgOut->showErrorPage( 'internalerror', 'revreview-revnotfound' );
 100+ $out->showErrorPage( 'internalerror', 'revreview-revnotfound' );
103101 } else {
104 - $wgOut->showErrorPage( 'internalerror', $status );
 102+ $out->showErrorPage( 'internalerror', $status );
105103 }
106 - $wgOut->returnToMain( false, $this->page );
 104+ $out->returnToMain( false, $this->page );
107105 }
108106 // Otherwise submit...
109107 } else {
110108 $status = $form->submit();
111109 // Success...
112110 if ( $status === true ) {
113 - $wgOut->setPageTitle( wfMsgHtml( 'actioncomplete' ) );
 111+ $out->setPageTitle( wfMsgHtml( 'actioncomplete' ) );
114112 if ( $form->getAction() === 'approve' ) {
115 - $wgOut->addHTML( $this->approvalSuccessHTML( true ) );
 113+ $out->addHTML( $this->approvalSuccessHTML( true ) );
116114 } elseif ( $form->getAction() === 'unapprove' ) {
117 - $wgOut->addHTML( $this->deapprovalSuccessHTML( true ) );
 115+ $out->addHTML( $this->deapprovalSuccessHTML( true ) );
118116 } elseif ( $form->getAction() === 'reject' ) {
119 - $wgOut->redirect( $this->page->getFullUrl() );
 117+ $out->redirect( $this->page->getFullUrl() );
120118 }
121119 // Failure...
122120 } else {
123121 if ( $status === 'review_page_unreviewable' ) {
124 - $wgOut->addWikiText( wfMsg( 'revreview-main' ) );
 122+ $out->addWikiText( wfMsg( 'revreview-main' ) );
125123 return;
126124 } elseif ( $status === 'review_page_notexists' ) {
127 - $wgOut->showErrorPage( 'internalerror', 'nopagetext' );
 125+ $out->showErrorPage( 'internalerror', 'nopagetext' );
128126 return;
129127 } elseif ( $status === 'review_denied' ) {
130 - $wgOut->permissionRequired( 'badaccess-group0' ); // protected?
 128+ $out->permissionRequired( 'badaccess-group0' ); // protected?
131129 } elseif ( $status === 'review_bad_key' ) {
132 - $wgOut->permissionRequired( 'badaccess-group0' ); // fiddling
 130+ $out->permissionRequired( 'badaccess-group0' ); // fiddling
133131 } elseif ( $status === 'review_bad_oldid' ) {
134 - $wgOut->showErrorPage( 'internalerror', 'revreview-revnotfound' );
 132+ $out->showErrorPage( 'internalerror', 'revreview-revnotfound' );
135133 } elseif ( $status === 'review_not_flagged' ) {
136 - $wgOut->redirect( $this->page->getFullUrl() ); // already unflagged
 134+ $out->redirect( $this->page->getFullUrl() ); // already unflagged
137135 } elseif ( $status === 'review_too_low' ) {
138 - $wgOut->addWikiText( wfMsg( 'revreview-toolow' ) );
 136+ $out->addWikiText( wfMsg( 'revreview-toolow' ) );
139137 } else {
140 - $wgOut->showErrorPage( 'internalerror', $status );
 138+ $out->showErrorPage( 'internalerror', $status );
141139 }
142 - $wgOut->returnToMain( false, $this->page );
 140+ $out->returnToMain( false, $this->page );
143141 }
144142 }
145143 // No form to view (GET)
146144 } else {
147 - $wgOut->returnToMain( false, $this->page );
 145+ $out->returnToMain( false, $this->page );
148146 }
149147 }
150148
151149 protected function approvalSuccessHTML( $showlinks = false ) {
152 - global $wgUser;
153150 $title = $this->form->getPage();
154151 # Show success message
155152 $s = "<div class='plainlinks'>";
@@ -158,14 +155,13 @@
159156 $title->getPrefixedUrl(), $this->form->getOldId() );
160157 $s .= "</div>";
161158 # Handy links to special pages
162 - if ( $showlinks && $wgUser->isAllowed( 'unreviewedpages' ) ) {
 159+ if ( $showlinks && $this->getUser()->isAllowed( 'unreviewedpages' ) ) {
163160 $s .= $this->getSpecialLinks();
164161 }
165162 return $s;
166163 }
167164
168165 protected function deapprovalSuccessHTML( $showlinks = false ) {
169 - global $wgUser;
170166 $title = $this->form->getPage();
171167 # Show success message
172168 $s = "<div class='plainlinks'>";
@@ -175,7 +171,7 @@
176172 $title->getPrefixedUrl(), $this->form->getOldId() );
177173 $s .= "</div>";
178174 # Handy links to special pages
179 - if ( $showlinks && $wgUser->isAllowed( 'unreviewedpages' ) ) {
 175+ if ( $showlinks && $this->getUser()->isAllowed( 'unreviewedpages' ) ) {
180176 $s .= $this->getSpecialLinks();
181177 }
182178 return $s;
@@ -183,16 +179,17 @@
184180
185181 protected function getSpecialLinks() {
186182 $s = '<p>' . wfMsgHtml( 'returnto',
187 - $this->skin->linkKnown( SpecialPage::getTitleFor( 'UnreviewedPages' ) )
 183+ Linker::linkKnown( SpecialPage::getTitleFor( 'UnreviewedPages' ) )
188184 ) . '</p>';
189185 $s .= '<p>' . wfMsgHtml( 'returnto',
190 - $this->skin->linkKnown( SpecialPage::getTitleFor( 'PendingChanges' ) )
 186+ Linker::linkKnown( SpecialPage::getTitleFor( 'PendingChanges' ) )
191187 ) . '</p>';
192188 return $s;
193189 }
194190
195191 public static function AjaxReview( /*$args...*/ ) {
196192 global $wgUser, $wgOut;
 193+
197194 $args = func_get_args();
198195 if ( wfReadOnly() ) {
199196 return '<err#>' . wfMsgExt( 'revreview-failed', 'parseinline' ) .
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/PendingChanges_body.php
@@ -9,21 +9,20 @@
1010 }
1111
1212 public function execute( $par ) {
13 - global $wgRequest, $wgUser;
 13+ $request = $this->getRequest();
1414
1515 $this->setHeaders();
16 - $this->skin = $wgUser->getSkin();
1716 $this->currentUnixTS = wfTimestamp( TS_UNIX ); // now
1817
19 - $this->namespace = $wgRequest->getIntOrNull( 'namespace' );
20 - $this->level = $wgRequest->getInt( 'level', - 1 );
21 - $category = trim( $wgRequest->getVal( 'category' ) );
 18+ $this->namespace = $request->getIntOrNull( 'namespace' );
 19+ $this->level = $request->getInt( 'level', - 1 );
 20+ $category = trim( $request->getVal( 'category' ) );
2221 $catTitle = Title::makeTitleSafe( NS_CATEGORY, $category );
2322 $this->category = is_null( $catTitle ) ? '' : $catTitle->getText();
24 - $this->size = $wgRequest->getIntOrNull( 'size' );
25 - $this->watched = $wgRequest->getCheck( 'watched' );
26 - $this->stable = $wgRequest->getCheck( 'stable' );
27 - $feedType = $wgRequest->getVal( 'feed' );
 23+ $this->size = $request->getIntOrNull( 'size' );
 24+ $this->watched = $request->getCheck( 'watched' );
 25+ $this->stable = $request->getCheck( 'stable' );
 26+ $feedType = $request->getVal( 'feed' );
2827
2928 $incLimit = 0;
3029 if ( $this->including() ) {
@@ -50,21 +49,22 @@
5150 }
5251
5352 protected function setSyndicated() {
54 - global $wgOut, $wgRequest;
 53+ $request = $this->getRequest();
5554 $queryParams = array(
56 - 'namespace' => $wgRequest->getIntOrNull( 'namespace' ),
57 - 'level' => $wgRequest->getIntOrNull( 'level' ),
58 - 'category' => $wgRequest->getVal( 'category' ),
 55+ 'namespace' => $request->getIntOrNull( 'namespace' ),
 56+ 'level' => $request->getIntOrNull( 'level' ),
 57+ 'category' => $request->getVal( 'category' ),
5958 );
60 - $wgOut->setSyndicated( true );
61 - $wgOut->setFeedAppendQuery( wfArrayToCGI( $queryParams ) );
 59+ $this->getOutput()->setSyndicated( true );
 60+ $this->getOutput()->setFeedAppendQuery( wfArrayToCGI( $queryParams ) );
6261 }
6362
6463 public function showForm() {
65 - global $wgUser, $wgOut, $wgScript, $wgLang;
 64+ global $wgScript;
 65+
6666 # Explanatory text
67 - $wgOut->addWikiMsg( 'pendingchanges-list',
68 - $wgLang->formatNum( $this->pager->getNumRows() ) );
 67+ $this->getOutput()->addWikiMsg( 'pendingchanges-list',
 68+ $this->getLang()->formatNum( $this->pager->getNumRows() ) );
6969
7070 $form = Html::openElement( 'form', array( 'name' => 'pendingchanges',
7171 'action' => $wgScript, 'method' => 'get' ) ) . "\n";
@@ -94,7 +94,7 @@
9595 $items[] =
9696 Xml::label( wfMsg( "pendingchanges-category" ), 'wpCategory' ) . '&#160;' .
9797 Xml::input( 'category', 30, $this->category, array( 'id' => 'wpCategory' ) );
98 - if ( $wgUser->getId() ) {
 98+ if ( $this->getUser()->getId() ) {
9999 $items[] = Xml::check( 'watched', $this->watched, array( 'id' => 'wpWatched' ) ) .
100100 Xml::label( wfMsg( 'pendingchanges-onwatchlist' ), 'wpWatched' );
101101 }
@@ -106,33 +106,32 @@
107107 $form .= "</fieldset>";
108108 $form .= Html::closeElement( 'form' ) . "\n";
109109
110 - $wgOut->addHTML( $form );
 110+ $this->getOutput()->addHTML( $form );
111111 }
112112
113113 public function showPageList() {
114 - global $wgOut;
 114+ $out = $this->getOutput();
115115 // Viewing the list normally...
116116 if ( !$this->including() ) {
117117 if ( $this->pager->getNumRows() ) {
118 - $wgOut->addHTML( $this->pager->getNavigationBar() );
119 - $wgOut->addHTML( $this->pager->getBody() );
120 - $wgOut->addHTML( $this->pager->getNavigationBar() );
 118+ $out->addHTML( $this->pager->getNavigationBar() );
 119+ $out->addHTML( $this->pager->getBody() );
 120+ $out->addHTML( $this->pager->getNavigationBar() );
121121 } else {
122 - $wgOut->addWikiMsg( 'pendingchanges-none' );
 122+ $out->addWikiMsg( 'pendingchanges-none' );
123123 }
124124 // If this list is transcluded...
125125 } else {
126126 if ( $this->pager->getNumRows() ) {
127 - $wgOut->addHTML( $this->pager->getBody() );
 127+ $out->addHTML( $this->pager->getBody() );
128128 } else {
129 - $wgOut->addWikiMsg( 'pendingchanges-none' );
 129+ $out->addWikiMsg( 'pendingchanges-none' );
130130 }
131131 }
132132 }
133133
134134 // set pager parameters from $par, return pager limit
135135 protected function parseParams( $par ) {
136 - global $wgLang;
137136 $bits = preg_split( '/\s*,\s*/', trim( $par ) );
138137 $limit = false;
139138 foreach ( $bits as $bit ) {
@@ -144,7 +143,7 @@
145144 $limit = intval( $m[1] );
146145 }
147146 if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) {
148 - $ns = $wgLang->getNsIndex( $m[1] );
 147+ $ns = $this->getLang()->getNsIndex( $m[1] );
149148 if ( $ns !== false ) {
150149 $this->namespace = $ns;
151150 }
@@ -161,13 +160,14 @@
162161 * @param string $type
163162 */
164163 protected function feed( $type ) {
165 - global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut;
 164+ global $wgFeed, $wgFeedClasses, $wgFeedLimit;
 165+
166166 if ( !$wgFeed ) {
167 - $wgOut->addWikiMsg( 'feed-unavailable' );
 167+ $this->getOutput()->addWikiMsg( 'feed-unavailable' );
168168 return;
169169 }
170170 if ( !isset( $wgFeedClasses[$type] ) ) {
171 - $wgOut->addWikiMsg( 'feed-invalid' );
 171+ $this->getOutput()->addWikiMsg( 'feed-invalid' );
172172 return;
173173 }
174174 $feed = new $wgFeedClasses[$type](
@@ -188,6 +188,7 @@
189189
190190 protected function feedTitle() {
191191 global $wgContLanguageCode, $wgSitename;
 192+
192193 $page = SpecialPage::getPage( 'PendingChanges' );
193194 $desc = $page->getDescription();
194195 return "$wgSitename - $desc [$wgContLanguageCode]";
@@ -213,15 +214,14 @@
214215 }
215216
216217 public function formatRow( $row ) {
217 - global $wgLang, $wgUser;
218218 $css = $quality = $underReview = '';
219219 $title = Title::newFromRow( $row );
220220 $stxt = ChangesList::showCharacterDifference( $row->rev_len, $row->page_len );
221221 # Page links...
222 - $link = $this->skin->link( $title );
223 - $hist = $this->skin->linkKnown( $title,
 222+ $link = Linker::link( $title );
 223+ $hist = Linker::linkKnown( $title,
224224 wfMsgHtml( 'hist' ), array(), 'action=history' );
225 - $review = $this->skin->linkKnown( $title,
 225+ $review = Linker::linkKnown( $title,
226226 wfMsg( 'pendingchanges-diff' ),
227227 array(),
228228 array( 'diff' => 'cur', 'oldid' => $row->stable ) + FlaggedRevs::diffOnlyCGI()
@@ -234,10 +234,10 @@
235235 $quality = " <b>[{$quality}]</b>";
236236 }
237237 # Is anybody watching?
238 - if ( !$this->including() && $wgUser->isAllowed( 'unreviewedpages' ) ) {
 238+ if ( !$this->including() && $this->getUser()->isAllowed( 'unreviewedpages' ) ) {
239239 $uw = FRUserActivity::numUsersWatchingPage( $title );
240240 $watching = $uw
241 - ? wfMsgExt( 'pendingchanges-watched', 'parsemag', $wgLang->formatNum( $uw ) )
 241+ ? wfMsgExt( 'pendingchanges-watched', 'parsemag', $this->getLang()->formatNum( $uw ) )
242242 : wfMsgHtml( 'pendingchanges-unwatched' );
243243 $watching = " {$watching}";
244244 } else {
@@ -252,12 +252,12 @@
253253 if ( $hours > ( 3 * 24 ) ) {
254254 $days = round( $hours / 24, 0 );
255255 $age = wfMsgExt( 'pendingchanges-days',
256 - 'parsemag', $wgLang->formatNum( $days ) );
 256+ 'parsemag', $this->getLang()->formatNum( $days ) );
257257 // If one or more hours, use hours
258258 } elseif ( $hours >= 1 ) {
259259 $hours = round( $hours, 0 );
260260 $age = wfMsgExt( 'pendingchanges-hours',
261 - 'parsemag', $wgLang->formatNum( $hours ) );
 261+ 'parsemag', $this->getLang()->formatNum( $hours ) );
262262 } else {
263263 $age = wfMsg( 'pendingchanges-recent' ); // hot off the press :)
264264 }
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/UnreviewedPages_body.php
@@ -8,26 +8,25 @@
99 }
1010
1111 public function execute( $par ) {
12 - global $wgRequest, $wgUser, $wgOut;
 12+ $request = $this->getRequest();
1313
1414 $this->setHeaders();
15 - if ( !$wgUser->isAllowed( 'unreviewedpages' ) ) {
16 - $wgOut->permissionRequired( 'unreviewedpages' );
 15+ if ( !$this->getUser()->isAllowed( 'unreviewedpages' ) ) {
 16+ $this->getOutput()->permissionRequired( 'unreviewedpages' );
1717 return;
1818 }
19 - $this->skin = $wgUser->getSkin();
2019 $this->currentUnixTS = wfTimestamp( TS_UNIX ); // now
2120
2221 # Get default namespace
2322 $namespaces = FlaggedRevs::getReviewNamespaces();
2423 $defaultNS = !$namespaces ? NS_MAIN : $namespaces[0];
2524
26 - $this->namespace = $wgRequest->getIntOrNull( 'namespace', $defaultNS );
27 - $category = trim( $wgRequest->getVal( 'category' ) );
 25+ $this->namespace = $request->getIntOrNull( 'namespace', $defaultNS );
 26+ $category = trim( $request->getVal( 'category' ) );
2827 $catTitle = Title::makeTitleSafe( NS_CATEGORY, $category );
2928 $this->category = is_null( $catTitle ) ? '' : $catTitle->getText();
30 - $this->level = $wgRequest->getInt( 'level' );
31 - $this->hideRedirs = $wgRequest->getBool( 'hideredirs', true );
 29+ $this->level = $request->getInt( 'level' );
 30+ $this->hideRedirs = $request->getBool( 'hideredirs', true );
3231 $this->live = self::generalQueryOK();
3332
3433 $this->pager = new UnreviewedPagesPager( $this, $this->live,
@@ -38,15 +37,16 @@
3938 }
4039
4140 protected function showForm() {
42 - global $wgOut, $wgLang, $wgScript;
 41+ global $wgScript;
 42+
4343 # Add explanatory text
44 - $wgOut->addWikiMsg( 'unreviewedpages-list',
45 - $wgLang->formatNum( $this->pager->getNumRows() ) );
 44+ $this->getOutput()->addWikiMsg( 'unreviewedpages-list',
 45+ $this->getLang()->formatNum( $this->pager->getNumRows() ) );
4646
4747 # show/hide links
4848 $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
4949 $onoff = 1 - $this->hideRedirs;
50 - $link = $this->skin->link( $this->getTitle(), $showhide[$onoff], array(),
 50+ $link = Linker::link( $this->getTitle(), $showhide[$onoff], array(),
5151 array( 'hideredirs' => $onoff, 'category' => $this->category,
5252 'namespace' => $this->namespace )
5353 );
@@ -81,41 +81,40 @@
8282 array( 'qci_type' => 'fr_unreviewedpages' ), __METHOD__ );
8383 if ( $ts ) {
8484 $ts = wfTimestamp( TS_MW, $ts );
85 - $td = $wgLang->timeanddate( $ts );
86 - $d = $wgLang->date( $ts );
87 - $t = $wgLang->time( $ts );
 85+ $td = $this->getLang()->timeanddate( $ts );
 86+ $d = $this->getLang()->date( $ts );
 87+ $t = $this->getLang()->time( $ts );
8888 $form .= wfMsgExt( 'perfcachedts', 'parse', $td, $d, $t );
8989 } else {
9090 $form .= wfMsgExt( 'perfcached', 'parse' );
9191 }
9292 }
9393
94 - $wgOut->addHTML( $form );
 94+ $this->getOutput()->addHTML( $form );
9595 }
9696
9797 protected function showPageList() {
98 - global $wgOut;
 98+ $out = $this->getOutput();
9999 if ( $this->pager->getNumRows() ) {
100 - $wgOut->addHTML( $this->pager->getNavigationBar() );
101 - $wgOut->addHTML( $this->pager->getBody() );
102 - $wgOut->addHTML( $this->pager->getNavigationBar() );
 100+ $out->addHTML( $this->pager->getNavigationBar() );
 101+ $out->addHTML( $this->pager->getBody() );
 102+ $out->addHTML( $this->pager->getNavigationBar() );
103103 } else {
104 - $wgOut->addWikiMsg( 'unreviewedpages-none' );
 104+ $out->addWikiMsg( 'unreviewedpages-none' );
105105 }
106106 }
107107
108108 public function formatRow( $row ) {
109 - global $wgLang, $wgUser;
110109 $title = Title::newFromRow( $row );
111110
112111 $stxt = $underReview = $watching = '';
113 - $link = $this->skin->link( $title, null, array(), 'redirect=no' );
 112+ $link = Linker::link( $title, null, array(), 'redirect=no' );
114113 $dirmark = wfUILang()->getDirMark();
115 - $hist = $this->skin->linkKnown( $title, wfMsgHtml( 'hist' ), array(), 'action=history' );
 114+ $hist = Linker::linkKnown( $title, wfMsgHtml( 'hist' ), array(), 'action=history' );
116115 if ( !is_null( $size = $row->page_len ) ) {
117116 $stxt = ( $size == 0 )
118117 ? wfMsgHtml( 'historyempty' )
119 - : wfMsgExt( 'historysize', 'parsemag', $wgLang->formatNum( $size ) );
 118+ : wfMsgExt( 'historysize', 'parsemag', $this->getLang()->formatNum( $size ) );
120119 $stxt = " <small>$stxt</small>";
121120 }
122121 # Get how long the first unreviewed edit has been waiting...
@@ -125,19 +124,19 @@
126125 if ( $hours > ( 3 * 24 ) ) {
127126 $days = round( $hours / 24, 0 );
128127 $age = ' ' . wfMsgExt( 'unreviewedpages-days',
129 - 'parsemag', $wgLang->formatNum( $days ) );
 128+ 'parsemag', $this->getLang()->formatNum( $days ) );
130129 // If one or more hours, use hours
131130 } elseif ( $hours >= 1 ) {
132131 $hours = round( $hours, 0 );
133132 $age = ' ' . wfMsgExt( 'unreviewedpages-hours',
134 - 'parsemag', $wgLang->formatNum( $hours ) );
 133+ 'parsemag', $this->getLang()->formatNum( $hours ) );
135134 } else {
136135 $age = ' ' . wfMsg( 'unreviewedpages-recent' ); // hot off the press :)
137136 }
138 - if ( $wgUser->isAllowed( 'unwatchedpages' ) ) {
 137+ if ( $this->getUser()->isAllowed( 'unwatchedpages' ) ) {
139138 $uw = FRUserActivity::numUsersWatchingPage( $title );
140139 $watching = $uw
141 - ? wfMsgExt( 'unreviewedpages-watched', 'parsemag', $wgLang->formatNum( $uw ) )
 140+ ? wfMsgExt( 'unreviewedpages-watched', 'parsemag', $this->getLang()->formatNum( $uw ) )
142141 : wfMsgHtml( 'unreviewedpages-unwatched' );
143142 $watching = " $watching"; // Oh-noes!
144143 } else {
@@ -213,10 +212,10 @@
214213 );
215214 foreach ( $res as $row ) {
216215 $insertRows[] = array(
217 - 'qc_type' => 'fr_unreviewedpages',
218 - 'qc_namespace' => $row->page_namespace,
219 - 'qc_title' => $row->page_title,
220 - 'qc_value' => $row->page_id
 216+ 'qc_type' => 'fr_unreviewedpages',
 217+ 'qc_namespace' => $row->page_namespace,
 218+ 'qc_title' => $row->page_title,
 219+ 'qc_value' => $row->page_id
221220 );
222221 }
223222 $dbr->freeResult( $res );
@@ -253,10 +252,10 @@
254253 );
255254 foreach ( $res as $row ) {
256255 $insertRows[] = array(
257 - 'qc_type' => 'fr_unreviewedpages_q',
258 - 'qc_namespace' => $row->page_namespace,
259 - 'qc_title' => $row->page_title,
260 - 'qc_value' => $row->page_id
 256+ 'qc_type' => 'fr_unreviewedpages_q',
 257+ 'qc_namespace' => $row->page_namespace,
 258+ 'qc_title' => $row->page_title,
 259+ 'qc_value' => $row->page_id
261260 );
262261 }
263262 $dbr->freeResult( $res );
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/QualityOversight_body.php
@@ -6,15 +6,18 @@
77 }
88
99 public function execute( $par ) {
10 - global $wgOut, $wgUser, $wgRequest, $wgLang, $wgFlaggedRevsOversightAge;
11 -
 10+ global $wgFlaggedRevsOversightAge;
 11+
 12+ $out = $this->getOutput();
 13+ $request = $this->getRequest();
 14+
1215 $this->setHeaders();
13 -
14 - $this->namespace = $wgRequest->getInt( 'namespace' );
15 - $this->level = $wgRequest->getIntOrNull( 'level' );
16 - $this->status = $wgRequest->getIntOrNull( 'status' );
17 - $this->automatic = $wgRequest->getIntOrNull( 'automatic' );
18 - $this->user = $wgRequest->getVal( 'user' );
 16+
 17+ $this->namespace = $request->getInt( 'namespace' );
 18+ $this->level = $request->getIntOrNull( 'level' );
 19+ $this->status = $request->getIntOrNull( 'status' );
 20+ $this->automatic = $request->getIntOrNull( 'automatic' );
 21+ $this->user = $request->getVal( 'user' );
1922 # Check if the user exists
2023 $usertitle = Title::makeTitleSafe( NS_USER, $this->user );
2124 $u = $usertitle ? User::idFromName( $this->user ) : false;
@@ -22,8 +25,8 @@
2326 # Are the dropdown params given even valid?
2427 $actions = $this->getActions();
2528 if ( empty( $actions ) ) {
26 - $wgOut->addWikiMsg( 'qualityoversight-list', 0 );
27 - $wgOut->addWikiMsg( 'logempty' );
 29+ $out->addWikiMsg( 'qualityoversight-list', 0 );
 30+ $out->addWikiMsg( 'logempty' );
2831 return;
2932 }
3033
@@ -38,19 +41,19 @@
3942 }
4043
4144 # Create a LogPager item to get the results and a LogEventsList item to format them...
42 - $loglist = new LogEventsList( $wgUser->getSkin(), $wgOut, 0 );
 45+ $loglist = new LogEventsList( $this->getUser()->getSkin(), $out, 0 );
4346 $pager = new LogPager( $loglist, 'review', $this->user, '', '', $conds );
4447
4548 # Explanatory text
46 - $wgOut->addWikiMsg( 'qualityoversight-list',
47 - $wgLang->formatNum( $pager->getNumRows() ) );
 49+ $out->addWikiMsg( 'qualityoversight-list',
 50+ $this->getLang()->formatNum( $pager->getNumRows() ) );
4851 # Show form options
4952 $this->showForm();
5053
5154 # Insert list
5255 $logBody = $pager->getBody();
5356 if ( $logBody ) {
54 - $wgOut->addHTML(
 57+ $out->addHTML(
5558 $pager->getNavigationBar() .
5659 $loglist->beginLogEventsList() .
5760 $logBody .
@@ -58,13 +61,14 @@
5962 $pager->getNavigationBar()
6063 );
6164 } else {
62 - $wgOut->addWikiMsg( 'logempty' );
 65+ $out->addWikiMsg( 'logempty' );
6366 }
6467 }
6568
6669 private function showForm() {
67 - global $wgOut, $wgScript;
68 - $wgOut->addHTML(
 70+ global $wgScript;
 71+
 72+ $this->getOutput()->addHTML(
6973 Xml::openElement( 'form', array( 'name' => 'qualityoversight',
7074 'action' => $wgScript, 'method' => 'get' ) ) .
7175 '<fieldset><legend>' . wfMsgHtml( 'qualityoversight-legend' ) . '</legend><p>' .
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ReviewedVersions_body.php
@@ -6,19 +6,18 @@
77 }
88
99 public function execute( $par ) {
10 - global $wgRequest, $wgUser, $wgOut;
 10+ $request = $this->getRequest();
1111
1212 $this->setHeaders();
13 - $this->skin = $wgUser->getSkin();
1413 # Our target page
15 - $this->target = $wgRequest->getText( 'page' );
 14+ $this->target = $request->getText( 'page' );
1615 $this->page = Title::newFromURL( $this->target );
1716 # Revision ID
18 - $this->oldid = $wgRequest->getVal( 'oldid' );
 17+ $this->oldid = $request->getVal( 'oldid' );
1918 $this->oldid = ( $this->oldid == 'best' ) ? 'best' : intval( $this->oldid );
2019 # We need a page...
2120 if ( is_null( $this->page ) ) {
22 - $wgOut->showErrorPage( 'notargettitle', 'notargettext' );
 21+ $this->getOutput()->showErrorPage( 'notargettitle', 'notargettext' );
2322 return;
2423 }
2524
@@ -26,42 +25,41 @@
2726 }
2827
2928 protected function showStableList() {
30 - global $wgOut, $wgLang;
 29+ $out = $this->getOutput();
3130 # Must be a content page
3231 if ( !FlaggedRevs::inReviewNamespace( $this->page ) ) {
33 - $wgOut->addWikiMsg( 'reviewedversions-none', $this->page->getPrefixedText() );
 32+ $out->addWikiMsg( 'reviewedversions-none', $this->page->getPrefixedText() );
3433 return;
3534 }
3635 $pager = new ReviewedVersionsPager( $this, array(), $this->page );
3736 $num = $pager->getNumRows();
3837 if ( $num ) {
39 - $wgOut->addWikiMsg( 'reviewedversions-list',
40 - $this->page->getPrefixedText(), $wgLang->formatNum( $num ) );
41 - $wgOut->addHTML( $pager->getNavigationBar() );
42 - $wgOut->addHTML( "<ul>" . $pager->getBody() . "</ul>" );
43 - $wgOut->addHTML( $pager->getNavigationBar() );
 38+ $out->addWikiMsg( 'reviewedversions-list',
 39+ $this->page->getPrefixedText(), $this->getLang()->formatNum( $num ) );
 40+ $out->addHTML( $pager->getNavigationBar() );
 41+ $out->addHTML( "<ul>" . $pager->getBody() . "</ul>" );
 42+ $out->addHTML( $pager->getNavigationBar() );
4443 } else {
45 - $wgOut->addHTML( wfMsgExt( 'reviewedversions-none', array( 'parse' ),
 44+ $out->addHTML( wfMsgExt( 'reviewedversions-none', array( 'parse' ),
4645 $this->page->getPrefixedText() ) );
4746 }
4847 }
4948
5049 public function formatRow( $row ) {
51 - global $wgLang;
52 - $rdatim = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
53 - $fdatim = $wgLang->timeanddate( wfTimestamp( TS_MW, $row->fr_timestamp ), true );
54 - $fdate = $wgLang->date( wfTimestamp( TS_MW, $row->fr_timestamp ), true );
55 - $ftime = $wgLang->time( wfTimestamp( TS_MW, $row->fr_timestamp ), true );
 50+ $rdatim = $this->getLang()->timeanddate( wfTimestamp( TS_MW, $row->rev_timestamp ), true );
 51+ $fdatim = $this->getLang()->timeanddate( wfTimestamp( TS_MW, $row->fr_timestamp ), true );
 52+ $fdate = $this->getLang()->date( wfTimestamp( TS_MW, $row->fr_timestamp ), true );
 53+ $ftime = $this->getLang()->time( wfTimestamp( TS_MW, $row->fr_timestamp ), true );
5654 $review = wfMsgExt( 'reviewedversions-review', array( 'parseinline', 'replaceafter' ),
5755 $fdatim,
58 - $this->skin->userLink( $row->fr_user, $row->user_name ) .
59 - ' ' . $this->skin->userToolLinks( $row->fr_user, $row->user_name ),
 56+ Linker::userLink( $row->fr_user, $row->user_name ) .
 57+ ' ' . Linker::userToolLinks( $row->fr_user, $row->user_name ),
6058 $fdate, $ftime, $row->user_name
6159 );
6260 $lev = ( $row->fr_quality >= 1 )
6361 ? wfMsgHtml( 'revreview-hist-quality' )
6462 : wfMsgHtml( 'revreview-hist-basic' );
65 - $link = $this->skin->makeKnownLinkObj( $this->page, $rdatim,
 63+ $link = Linker::makeKnownLinkObj( $this->page, $rdatim,
6664 'stableid=' . $row->fr_rev_id );
6765 return '<li>' . $link . ' (' . $review . ') <strong>[' . $lev . ']</strong></li>';
6866 }
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ConfiguredPages_body.php
@@ -9,14 +9,13 @@
1010 }
1111
1212 public function execute( $par ) {
13 - global $wgRequest, $wgUser;
 13+ $request = $this->getRequest();
1414
1515 $this->setHeaders();
16 - $this->skin = $wgUser->getSkin();
1716
18 - $this->namespace = $wgRequest->getIntOrNull( 'namespace' );
19 - $this->override = $wgRequest->getIntOrNull( 'stable' );
20 - $this->autoreview = $wgRequest->getVal( 'restriction', '' );
 17+ $this->namespace = $request->getIntOrNull( 'namespace' );
 18+ $this->override = $request->getIntOrNull( 'stable' );
 19+ $this->autoreview = $request->getVal( 'restriction', '' );
2120
2221 $this->pager = new ConfiguredPagesPager(
2322 $this, array(), $this->namespace, $this->override, $this->autoreview );
@@ -26,10 +25,11 @@
2726 }
2827
2928 protected function showForm() {
30 - global $wgOut, $wgScript, $wgLang;
 29+ global $wgScript;
 30+
3131 # Explanatory text
32 - $wgOut->addWikiMsg( 'configuredpages-list',
33 - $wgLang->formatNum( $this->pager->getNumRows() ) );
 32+ $this->getOutput()->addWikiMsg( 'configuredpages-list',
 33+ $this->getLang()->formatNum( $this->pager->getNumRows() ) );
3434
3535 $fields = array();
3636 # Namespace selector
@@ -52,17 +52,16 @@
5353 $form .= "</fieldset>\n";
5454 $form .= Html::closeElement( 'form' ) . "\n";
5555
56 - $wgOut->addHTML( $form );
 56+ $this->getOutput()->addHTML( $form );
5757 }
5858
5959 protected function showPageList() {
60 - global $wgOut;
6160 if ( $this->pager->getNumRows() ) {
62 - $wgOut->addHTML( $this->pager->getNavigationBar() );
63 - $wgOut->addHTML( $this->pager->getBody() );
64 - $wgOut->addHTML( $this->pager->getNavigationBar() );
 61+ $this->getOutput()->addHTML( $this->pager->getNavigationBar() );
 62+ $this->getOutput()->addHTML( $this->pager->getBody() );
 63+ $this->getOutput()->addHTML( $this->pager->getNavigationBar() );
6564 } else {
66 - $wgOut->addWikiMsg( 'configuredpages-none' );
 65+ $this->getOutput()->addWikiMsg( 'configuredpages-none' );
6766 }
6867 # Purge expired entries on one in every 10 queries
6968 if ( !mt_rand( 0, 10 ) ) {
@@ -71,12 +70,11 @@
7271 }
7372
7473 public function formatRow( $row ) {
75 - global $wgLang;
7674 $title = Title::newFromRow( $row );
7775 # Link to page
78 - $link = $this->skin->link( $title );
 76+ $link = Linker::link( $title );
7977 # Link to page configuration
80 - $config = $this->skin->linkKnown(
 78+ $config = Linker::linkKnown(
8179 SpecialPage::getTitleFor( 'Stabilization' ),
8280 wfMsgHtml( 'configuredpages-config' ),
8381 array(),
@@ -98,9 +96,9 @@
9997 if ( $row->fpc_expiry != 'infinity' && strlen( $row->fpc_expiry ) ) {
10098 $expiry_description = " (" . wfMsgForContent(
10199 'protect-expiring',
102 - $wgLang->timeanddate( $row->fpc_expiry ),
103 - $wgLang->date( $row->fpc_expiry ),
104 - $wgLang->time( $row->fpc_expiry )
 100+ $this->getLang()->timeanddate( $row->fpc_expiry ),
 101+ $this->getLang()->date( $row->fpc_expiry ),
 102+ $this->getLang()->time( $row->fpc_expiry )
105103 ) . ")";
106104 } else {
107105 $expiry_description = "";
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ValidationStatistics_body.php
@@ -8,9 +8,12 @@
99 }
1010
1111 public function execute( $par ) {
12 - global $wgUser, $wgOut, $wgLang, $wgContLang, $wgFlaggedRevsStats;
 12+ global $wgContLang, $wgFlaggedRevsStats;
 13+
 14+ $out = $this->getOutput();
 15+ $lang = $this->getLang();
 16+
1317 $this->setHeaders();
14 - $this->skin = $wgUser->getSkin();
1518 $this->db = wfGetDB( DB_SLAVE );
1619
1720 $this->maybeUpdate();
@@ -23,8 +26,8 @@
2427 $pData = $this->getPercentiles();
2528 $timestamp = $this->getLastUpdate();
2629
27 - $wgOut->addWikiMsg( 'validationstatistics-users',
28 - $wgLang->formatnum( $ec ), $wgLang->formatnum( $rc )
 30+ $out->addWikiMsg( 'validationstatistics-users',
 31+ $lang->formatnum( $ec ), $lang->formatnum( $rc )
2932 );
3033 # Most of the output depends on background queries
3134 if ( !$this->readyForQuery() ) {
@@ -37,7 +40,7 @@
3841 foreach ( $pData as $percentile => $perValue ) {
3942 $headerRows .= "<th>P<sub>" . intval( $percentile ) . "</sub></th>";
4043 $dataRows .= '<td>' .
41 - $wgLang->formatTimePeriod( $perValue, 'avoidminutes' ) . '</td>';
 44+ $lang->formatTimePeriod( $perValue, 'avoidminutes' ) . '</td>';
4245 }
4346 $css = 'wikitable flaggedrevs_stats_table';
4447 $reviewChart = "<table class='$css' style='white-space: nowrap;'>\n";
@@ -50,38 +53,38 @@
5154
5255 if ( $timestamp != '-' ) {
5356 # Show "last updated"...
54 - $wgOut->addWikiMsg( 'validationstatistics-lastupdate',
55 - $wgLang->date( $timestamp, true ),
56 - $wgLang->time( $timestamp, true )
 57+ $out->addWikiMsg( 'validationstatistics-lastupdate',
 58+ $lang->date( $timestamp, true ),
 59+ $lang->time( $timestamp, true )
5760 );
5861 }
59 - $wgOut->addHtml( '<hr/>' );
 62+ $out->addHtml( '<hr/>' );
6063 # Show pending time stats...
61 - $wgOut->addWikiMsg( 'validationstatistics-pndtime',
62 - $wgLang->formatTimePeriod( $pt, 'avoidminutes' ) );
 64+ $out->addWikiMsg( 'validationstatistics-pndtime',
 65+ $lang->formatTimePeriod( $pt, 'avoidminutes' ) );
6366 # Show review time stats...
6467 if ( !FlaggedRevs::useOnlyIfProtected() ) {
65 - $wgOut->addWikiMsg( 'validationstatistics-revtime',
66 - $wgLang->formatTimePeriod( $mt, 'avoidminutes' ),
67 - $wgLang->formatTimePeriod( $mdt, 'avoidminutes' ),
 68+ $out->addWikiMsg( 'validationstatistics-revtime',
 69+ $lang->formatTimePeriod( $mt, 'avoidminutes' ),
 70+ $lang->formatTimePeriod( $mdt, 'avoidminutes' ),
6871 $reviewChart
6972 );
7073 }
7174 # Show per-namespace stats table...
72 - $wgOut->addWikiMsg( 'validationstatistics-table' );
73 - $wgOut->addHTML(
 75+ $out->addWikiMsg( 'validationstatistics-table' );
 76+ $out->addHTML(
7477 Xml::openElement( 'table', array( 'class' => 'wikitable flaggedrevs_stats_table' ) )
7578 );
76 - $wgOut->addHTML( "<tr>\n" );
 79+ $out->addHTML( "<tr>\n" );
7780 // Headings (for a positive grep result):
7881 // validationstatistics-ns, validationstatistics-total, validationstatistics-stable,
7982 // validationstatistics-latest, validationstatistics-synced, validationstatistics-old
8083 $msgs = array( 'ns', 'total', 'stable', 'latest', 'synced', 'old' ); // our headings
8184 foreach ( $msgs as $msg ) {
82 - $wgOut->addHTML( '<th>' .
 85+ $out->addHTML( '<th>' .
8386 wfMsgExt( "validationstatistics-$msg", 'parseinline' ) . '</th>' );
8487 }
85 - $wgOut->addHTML( "</tr>\n" );
 88+ $out->addHTML( "</tr>\n" );
8689 $namespaces = FlaggedRevs::getReviewNamespaces();
8790 foreach ( $namespaces as $namespace ) {
8891 $total = $this->getTotalPages( $namespace );
@@ -98,7 +101,7 @@
99102 ? '-' // devision by zero
100103 : wfMsg( 'parentheses',
101104 wfMsgExt( 'percent', array( 'escapenoentities' ),
102 - $wgLang->formatnum( sprintf( '%4.2f',
 105+ $lang->formatnum( sprintf( '%4.2f',
103106 100 * intval( $reviewed ) / intval( $total ) ) )
104107 )
105108 );
@@ -106,40 +109,40 @@
107110 ? '-' // devision by zero
108111 : wfMsg( 'parentheses',
109112 wfMsgExt( 'percent', array( 'escapenoentities' ),
110 - $wgLang->formatnum( sprintf( '%4.2f',
 113+ $lang->formatnum( sprintf( '%4.2f',
111114 100 * intval( $synced ) / intval( $total ) ) )
112115 )
113116 );
114117 $percSynced = intval( $reviewed ) == 0
115118 ? '-' // devision by zero
116119 : wfMsgExt( 'percent', array( 'escapenoentities' ),
117 - $wgLang->formatnum( sprintf( '%4.2f',
 120+ $lang->formatnum( sprintf( '%4.2f',
118121 100 * intval( $synced ) / intval( $reviewed ) ) )
119122 );
120123 $outdated = intval( $reviewed ) - intval( $synced );
121 - $outdated = $wgLang->formatnum( max( 0, $outdated ) ); // lag between queries
 124+ $outdated = $lang->formatnum( max( 0, $outdated ) ); // lag between queries
122125
123 - $wgOut->addHTML(
 126+ $out->addHTML(
124127 "<tr align='center'>
125128 <td>" .
126129 htmlspecialchars( $NsText ) .
127130 "</td>
128131 <td>" .
129 - htmlspecialchars( $wgLang->formatnum( $total ) ) .
 132+ htmlspecialchars( $lang->formatnum( $total ) ) .
130133 "</td>
131134 <td>" .
132 - htmlspecialchars( $wgLang->formatnum( $reviewed ) .
 135+ htmlspecialchars( $lang->formatnum( $reviewed ) .
133136 $wgContLang->getDirMark() ) . " <i>$percRev</i>
134137 </td>
135138 <td>" .
136 - htmlspecialchars( $wgLang->formatnum( $synced ) .
 139+ htmlspecialchars( $lang->formatnum( $synced ) .
137140 $wgContLang->getDirMark() ) . " <i>$percLatest</i>
138141 </td>
139142 <td>" .
140143 $percSynced .
141144 "</td>
142145 <td>" .
143 - $this->skin->linkKnown( SpecialPage::getTitleFor( 'PendingChanges' ),
 146+ Linker::linkKnown( SpecialPage::getTitleFor( 'PendingChanges' ),
144147 htmlspecialchars( $outdated ),
145148 array(),
146149 array( 'namespace' => $namespace )
@@ -148,13 +151,13 @@
149152 </tr>"
150153 );
151154 }
152 - $wgOut->addHTML( Xml::closeElement( 'table' ) );
 155+ $out->addHTML( Xml::closeElement( 'table' ) );
153156 # Is there a top X user list? If so, then show it...
154157 $data = $this->getTopReviewers();
155158 if ( is_array( $data ) && count( $data ) ) {
156 - $wgOut->addWikiMsg( 'validationstatistics-utable',
157 - $wgLang->formatNum( $wgFlaggedRevsStats['topReviewersCount'] ),
158 - $wgLang->formatNum( $wgFlaggedRevsStats['topReviewersHours'] )
 159+ $out->addWikiMsg( 'validationstatistics-utable',
 160+ $lang->formatNum( $wgFlaggedRevsStats['topReviewersCount'] ),
 161+ $lang->formatNum( $wgFlaggedRevsStats['topReviewersHours'] )
159162 );
160163 $css = 'wikitable flaggedrevs_stats_table';
161164 $reviewChart = "<table class='$css' style='white-space: nowrap;'>\n";
@@ -162,18 +165,20 @@
163166 '</th><th>' . wfMsgHtml( 'validationstatistics-reviews' ) . '</th></tr>';
164167 foreach ( $data as $userId => $reviews ) {
165168 $reviewChart .= '<tr><td>' . htmlspecialchars( User::whois( $userId ) ) .
166 - '</td><td>' . $wgLang->formatNum( $reviews ) . '</td></tr>';
 169+ '</td><td>' . $lang->formatNum( $reviews ) . '</td></tr>';
167170 }
168171 $reviewChart .= "</table>\n";
169 - $wgOut->addHTML( $reviewChart );
 172+ $out->addHTML( $reviewChart );
170173 }
171174 }
172175
173176 protected function maybeUpdate() {
174177 global $wgFlaggedRevsStatsAge;
 178+
175179 if ( !$wgFlaggedRevsStatsAge ) {
176180 return false;
177181 }
 182+
178183 $dbCache = wfGetCache( CACHE_DB );
179184 $key = wfMemcKey( 'flaggedrevs', 'statsUpdated' );
180185 $keySQL = wfMemcKey( 'flaggedrevs', 'statsUpdating' );
@@ -302,6 +307,7 @@
303308 }
304309 // Save/cache users
305310 $dbCache->set( $key, $data, 3600 );
 311+
306312 return $data;
307313 }
308314 }
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ProblemChanges_body.php
@@ -9,18 +9,17 @@
1010 }
1111
1212 public function execute( $par ) {
13 - global $wgRequest, $wgUser;
 13+ $request = $this->getRequest();
1414
1515 $this->setHeaders();
16 - $this->skin = $wgUser->getSkin();
1716 $this->currentUnixTS = wfTimestamp( TS_UNIX ); // now
1817
19 - $this->level = $wgRequest->getInt( 'level', - 1 );
20 - $this->tag = trim( $wgRequest->getVal( 'tagfilter' ) );
21 - $category = trim( $wgRequest->getVal( 'category' ) );
 18+ $this->level = $request->getInt( 'level', - 1 );
 19+ $this->tag = trim( $request->getVal( 'tagfilter' ) );
 20+ $category = trim( $request->getVal( 'category' ) );
2221 $catTitle = Title::newFromText( $category );
2322 $this->category = is_null( $catTitle ) ? '' : $catTitle->getText();
24 - $feedType = $wgRequest->getVal( 'feed' );
 23+ $feedType = $request->getVal( 'feed' );
2524
2625 $incLimit = 0;
2726 if ( $this->including() ) {
@@ -45,21 +44,22 @@
4645 }
4746
4847 protected function setSyndicated() {
49 - global $wgOut, $wgRequest;
 48+ $request = $this->getRequest();
5049 $queryParams = array(
51 - 'level' => $wgRequest->getIntOrNull( 'level' ),
52 - 'tag' => $wgRequest->getVal( 'tag' ),
53 - 'category' => $wgRequest->getVal( 'category' ),
 50+ 'level' => $request->getIntOrNull( 'level' ),
 51+ 'tag' => $request->getVal( 'tag' ),
 52+ 'category' => $request->getVal( 'category' ),
5453 );
55 - $wgOut->setSyndicated( true );
56 - $wgOut->setFeedAppendQuery( wfArrayToCGI( $queryParams ) );
 54+ $this->getOutput()->setSyndicated( true );
 55+ $this->getOutput()->setFeedAppendQuery( wfArrayToCGI( $queryParams ) );
5756 }
5857
5958 public function showForm() {
60 - global $wgOut, $wgScript, $wgLang;
 59+ global $wgScript;
 60+
6161 // Add explanatory text
62 - $wgOut->addWikiMsg( 'problemchanges-list',
63 - $wgLang->formatNum( $this->pager->getNumRows() ) );
 62+ $this->getOutput()->addWikiMsg( 'problemchanges-list',
 63+ $this->getLang()->formatNum( $this->pager->getNumRows() ) );
6464
6565 $form = Html::openElement( 'form', array( 'name' => 'problemchanges',
6666 'action' => $wgScript, 'method' => 'get' ) ) . "\n";
@@ -84,26 +84,26 @@
8585 $form .= '</fieldset>';
8686 $form .= Html::closeElement( 'form' ) . "\n";
8787
88 - $wgOut->addHTML( $form );
 88+ $this->getOutput()->addHTML( $form );
8989 }
9090
9191 public function showPageList() {
92 - global $wgOut;
 92+ $out = $this->getOutput();
9393 // Viewing the page normally...
9494 if ( !$this->including() ) {
9595 if ( $this->pager->getNumRows() ) {
96 - $wgOut->addHTML( $this->pager->getNavigationBar() );
97 - $wgOut->addHTML( $this->pager->getBody() );
98 - $wgOut->addHTML( $this->pager->getNavigationBar() );
 96+ $out->addHTML( $this->pager->getNavigationBar() );
 97+ $out->addHTML( $this->pager->getBody() );
 98+ $out->addHTML( $this->pager->getNavigationBar() );
9999 } else {
100 - $wgOut->addWikiMsg( 'problemchanges-none' );
 100+ $out->addWikiMsg( 'problemchanges-none' );
101101 }
102102 // If this page is transcluded...
103103 } else {
104104 if ( $this->pager->getNumRows() ) {
105 - $wgOut->addHTML( $this->pager->getBody() );
 105+ $out->addHTML( $this->pager->getBody() );
106106 } else {
107 - $wgOut->addWikiMsg( 'problemchanges-none' );
 107+ $out->addWikiMsg( 'problemchanges-none' );
108108 }
109109 }
110110 }
@@ -131,13 +131,14 @@
132132 * @param string $type
133133 */
134134 protected function feed( $type ) {
135 - global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut;
 135+ global $wgFeed, $wgFeedClasses, $wgFeedLimit;
 136+
136137 if ( !$wgFeed ) {
137 - $wgOut->addWikiMsg( 'feed-unavailable' );
 138+ $this->getOutput()->addWikiMsg( 'feed-unavailable' );
138139 return;
139140 }
140141 if ( !isset( $wgFeedClasses[$type] ) ) {
141 - $wgOut->addWikiMsg( 'feed-invalid' );
 142+ $this->getOutput()->addWikiMsg( 'feed-invalid' );
142143 return;
143144 }
144145 $feed = new $wgFeedClasses[$type](
@@ -158,6 +159,7 @@
159160
160161 protected function feedTitle() {
161162 global $wgContLanguageCode, $wgSitename;
 163+
162164 $page = SpecialPage::getPage( 'ProblemChanges' );
163165 $desc = $page->getDescription();
164166 return "$wgSitename - $desc [$wgContLanguageCode]";
@@ -184,12 +186,11 @@
185187 }
186188
187189 public function formatRow( $row ) {
188 - global $wgLang, $wgUser;
189190 $css = $quality = $tags = $underReview = '';
190191
191192 $title = Title::newFromRow( $row );
192 - $link = $this->skin->link( $title );
193 - $review = $this->skin->linkKnown( $title,
 193+ $link = Linker::link( $title );
 194+ $review = Linker::linkKnown( $title,
194195 wfMsg( 'pendingchanges-diff' ),
195196 array(),
196197 array( 'diff' => 'cur', 'oldid' => $row->stable ) + FlaggedRevs::diffOnlyCGI()
@@ -208,10 +209,10 @@
209210 $tags = ' <b>' . wfMsgHtml( 'parentheses', $tags ) . '</b>';
210211 }
211212 # Is anybody watching?
212 - if ( !$this->including() && $wgUser->isAllowed( 'unreviewedpages' ) ) {
 213+ if ( !$this->including() && $this->getUser()->isAllowed( 'unreviewedpages' ) ) {
213214 $uw = FRUserActivity::numUsersWatchingPage( $title );
214215 $watching = $uw
215 - ? wfMsgExt( 'pendingchanges-watched', 'parsemag', $wgLang->formatNum( $uw ) )
 216+ ? wfMsgExt( 'pendingchanges-watched', 'parsemag', $this->getLang()->formatNum( $uw ) )
216217 : wfMsgHtml( 'pendingchanges-unwatched' );
217218 $watching = " {$watching}";
218219 } else {
@@ -226,12 +227,12 @@
227228 if ( $hours > ( 3 * 24 ) ) {
228229 $days = round( $hours / 24, 0 );
229230 $age = wfMsgExt( 'pendingchanges-days',
230 - 'parsemag', $wgLang->formatNum( $days ) );
 231+ 'parsemag', $this->getLang()->formatNum( $days ) );
231232 // If one or more hours, use hours
232233 } elseif ( $hours >= 1 ) {
233234 $hours = round( $hours, 0 );
234235 $age = wfMsgExt( 'pendingchanges-hours',
235 - 'parsemag', $wgLang->formatNum( $hours ) );
 236+ 'parsemag', $this->getLang()->formatNum( $hours ) );
236237 } else {
237238 $age = wfMsg( 'pendingchanges-recent' ); // hot off the press :)
238239 }
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ReviewedPages_body.php
@@ -8,18 +8,17 @@
99 }
1010
1111 public function execute( $par ) {
12 - global $wgRequest, $wgUser;
 12+ $request = $this->getRequest();
1313
1414 $this->setHeaders();
15 - $this->skin = $wgUser->getSkin();
1615
1716 # Check if there is a featured level
1817 $maxType = FlaggedRevs::pristineVersions() ? 2 : 1;
1918
20 - $this->namespace = $wgRequest->getInt( 'namespace' );
21 - $this->type = $wgRequest->getInt( 'level', - 1 );
 19+ $this->namespace = $request->getInt( 'namespace' );
 20+ $this->type = $request->getInt( 'level', - 1 );
2221 $this->type = min( $this->type, $maxType );
23 - $this->hideRedirs = $wgRequest->getBool( 'hideredirs', true );
 22+ $this->hideRedirs = $request->getBool( 'hideredirs', true );
2423
2524 $this->pager = new ReviewedPagesPager(
2625 $this, array(), $this->type, $this->namespace, $this->hideRedirs );
@@ -29,12 +28,12 @@
3029 }
3130
3231 public function showForm() {
33 - global $wgOut, $wgScript, $wgLang;
 32+ global $wgScript;
3433
3534 // Text to explain level select (if there are several levels)
3635 if ( FlaggedRevs::qualityVersions() ) {
37 - $wgOut->addWikiMsg( 'reviewedpages-list',
38 - $wgLang->formatNum( $this->pager->getNumRows() ) );
 36+ $this->getOutput()->addWikiMsg( 'reviewedpages-list',
 37+ $this->getLang()->formatNum( $this->pager->getNumRows() ) );
3938 }
4039 $form = Html::openElement( 'form',
4140 array( 'name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get' ) );
@@ -43,7 +42,7 @@
4443 // show/hide links
4544 $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) );
4645 $onoff = 1 - $this->hideRedirs;
47 - $link = $this->skin->link( $this->getTitle(), $showhide[$onoff], array(),
 46+ $link = Linker::link( $this->getTitle(), $showhide[$onoff], array(),
4847 array( 'hideredirs' => $onoff, 'namespace' => $this->namespace )
4948 );
5049 $showhideredirs = wfMsgHtml( 'whatlinkshere-hideredirs', $link );
@@ -66,26 +65,25 @@
6766 $form .= "</fieldset>";
6867 $form .= Html::closeElement( 'form ' ) . "\n";
6968
70 - $wgOut->addHTML( $form );
 69+ $this->getOutput()->addHTML( $form );
7170 }
7271
7372 protected function showPageList() {
74 - global $wgOut;
 73+ $out = $this->getOutput();
7574 $num = $this->pager->getNumRows();
7675 if ( $num ) {
77 - $wgOut->addHTML( $this->pager->getNavigationBar() );
78 - $wgOut->addHTML( $this->pager->getBody() );
79 - $wgOut->addHTML( $this->pager->getNavigationBar() );
 76+ $out->addHTML( $this->pager->getNavigationBar() );
 77+ $out->addHTML( $this->pager->getBody() );
 78+ $out->addHTML( $this->pager->getNavigationBar() );
8079 } else {
81 - $wgOut->addHTML( wfMsgExt( 'reviewedpages-none', array( 'parse' ) ) );
 80+ $out->addHTML( wfMsgExt( 'reviewedpages-none', array( 'parse' ) ) );
8281 }
8382 }
8483
8584 public function formatRow( $row ) {
86 - global $wgLang;
8785 $title = Title::newFromRow( $row );
8886 # Link to page
89 - $link = $this->skin->link( $title );
 87+ $link = Linker::link( $title );
9088 # Direction mark
9189 $dirmark = wfUILang()->getDirMark();
9290 # Size (bytes)
@@ -95,12 +93,12 @@
9694 $stxt = ' <small>' . wfMsgHtml( 'historyempty' ) . '</small>';
9795 } else {
9896 $stxt = ' <small>' .
99 - wfMsgExt( 'historysize', 'parsemag', $wgLang->formatNum( $size ) ) .
 97+ wfMsgExt( 'historysize', 'parsemag', $this->getLang()->formatNum( $size ) ) .
10098 '</small>';
10199 }
102100 }
103101 # Link to list of reviewed versions for page
104 - $list = $this->skin->linkKnown(
 102+ $list = Linker::linkKnown(
105103 SpecialPage::getTitleFor( 'ReviewedVersions' ),
106104 wfMsgHtml( 'reviewedpages-all' ),
107105 array(),
@@ -109,7 +107,7 @@
110108 # Link to highest tier rev
111109 $best = '';
112110 if ( FlaggedRevs::qualityVersions() ) {
113 - $best = $this->skin->linkKnown(
 111+ $best = Linker::linkKnown(
114112 $title,
115113 wfMsgHtml( 'reviewedpages-best' ),
116114 array(),
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/StablePages_body.php
@@ -1,6 +1,6 @@
22 <?php
33
4 -// Assumes $wgFlaggedRevsProtection is on
 4+ Assumes $wgFlaggedRevsProtection is on
55 class StablePages extends SpecialPage {
66 protected $pager = null;
77
@@ -9,14 +9,13 @@
1010 }
1111
1212 public function execute( $par ) {
13 - global $wgRequest, $wgUser;
 13+ $request = $this->getRequest();
1414
1515 $this->setHeaders();
16 - $this->skin = $wgUser->getSkin();
1716
18 - $this->namespace = $wgRequest->getIntOrNull( 'namespace' );
19 - $this->autoreview = $wgRequest->getVal( 'restriction', '' );
20 - $this->indef = $wgRequest->getBool( 'indef', false );
 17+ $this->namespace = $request->getIntOrNull( 'namespace' );
 18+ $this->autoreview = $request->getVal( 'restriction', '' );
 19+ $this->indef = $request->getBool( 'indef', false );
2120
2221 $this->pager = new StablePagesPager( $this, array(),
2322 $this->namespace, $this->autoreview, $this->indef );
@@ -26,15 +25,17 @@
2726 }
2827
2928 protected function showForm() {
30 - global $wgOut, $wgScript, $wgLang;
31 - $wgOut->addWikiMsg( 'stablepages-list',
32 - $wgLang->formatNum( $this->pager->getNumRows() ) );
 29+ global $wgScript;
 30+
 31+ $this->getOutput()->addWikiMsg( 'stablepages-list',
 32+ $this->getLang()->formatNum( $this->pager->getNumRows() ) );
 33+
3334 $fields = array();
34 - # Namespace selector
 35+ Namespace selector
3536 if ( count( FlaggedRevs::getReviewNamespaces() ) > 1 ) {
3637 $fields[] = FlaggedRevsXML::getNamespaceMenu( $this->namespace, '' );
3738 }
38 - # Restriction level selector
 39+ Restriction level selector
3940 if ( FlaggedRevs::getRestrictionLevels() ) {
4041 $fields[] = FlaggedRevsXML::getRestrictionFilterMenu( $this->autoreview );
4142 }
@@ -50,58 +51,57 @@
5152 $form .= "</fieldset>\n";
5253 $form .= Html::closeElement( 'form' ) . "\n";
5354
54 - $wgOut->addHTML( $form );
 55+ $this->getOutput()->addHTML( $form );
5556 }
5657
5758 protected function showPageList() {
58 - global $wgOut;
 59+ $out = $this->getOutput();
5960 if ( $this->pager->getNumRows() ) {
60 - $wgOut->addHTML( $this->pager->getNavigationBar() );
61 - $wgOut->addHTML( $this->pager->getBody() );
62 - $wgOut->addHTML( $this->pager->getNavigationBar() );
 61+ $out->addHTML( $this->pager->getNavigationBar() );
 62+ $out->addHTML( $this->pager->getBody() );
 63+ $out->addHTML( $this->pager->getNavigationBar() );
6364 } else {
64 - $wgOut->addWikiMsg( 'stablepages-none' );
 65+ $out->addWikiMsg( 'stablepages-none' );
6566 }
66 - # Purge expired entries on one in every 10 queries
 67+ Purge expired entries on one in every 10 queries
6768 if ( !mt_rand( 0, 10 ) ) {
6869 FRPageConfig::purgeExpiredConfigurations();
6970 }
7071 }
7172
7273 public function formatRow( $row ) {
73 - global $wgLang;
7474 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
75 - # Link to page
76 - $link = $this->skin->link( $title );
77 - # Helpful utility links
 75+ Link to page
 76+ $link = Linker::link( $title );
 77+ Helpful utility links
7878 $utilLinks = array();
79 - $utilLinks[] = $this->skin->link( $title,
 79+ $utilLinks[] = Linker::link( $title,
8080 wfMsgHtml( 'stablepages-config' ),
8181 array(), array( 'action' => 'protect' ), 'known' );
82 - $utilLinks[] = $this->skin->link( $title,
 82+ $utilLinks[] = Linker::link( $title,
8383 wfMsgHtml( 'history' ),
8484 array(), array( 'action' => 'history' ), 'known' );
85 - $utilLinks[] = $this->skin->link( SpecialPage::getTitleFor( 'Log', 'stable' ),
 85+ $utilLinks[] = Linker::link( SpecialPage::getTitleFor( 'Log', 'stable' ),
8686 wfMsgHtml( 'stable-logpage' ),
8787 array(), array( 'page' => $title->getPrefixedText() ), 'known' );
88 - # Autoreview/review restriction level
 88+ Autoreview/review restriction level
8989 $restr = '';
9090 if ( $row->fpc_level != '' ) {
9191 $restr = 'autoreview=' . htmlspecialchars( $row->fpc_level );
9292 $restr = "[$restr]";
9393 }
94 - # When these configuration settings expire
 94+ When these configuration settings expire
9595 if ( $row->fpc_expiry != 'infinity' && strlen( $row->fpc_expiry ) ) {
9696 $expiry_description = " (" . wfMsgForContent(
9797 'protect-expiring',
98 - $wgLang->timeanddate( $row->fpc_expiry ),
99 - $wgLang->date( $row->fpc_expiry ),
100 - $wgLang->time( $row->fpc_expiry )
 98+ $this->getLang()->timeanddate( $row->fpc_expiry ),
 99+ $this->getLang()->date( $row->fpc_expiry ),
 100+ $this->getLang()->time( $row->fpc_expiry )
101101 ) . ")";
102102 } else {
103103 $expiry_description = "";
104104 }
105 - $utilLinks = $wgLang->pipeList( $utilLinks );
 105+ $utilLinks = $this->getLang()->pipeList( $utilLinks );
106106 return "<li>{$link} ({$utilLinks}) {$restr}<i>{$expiry_description}</i></li>";
107107 }
108108 }
@@ -112,13 +112,13 @@
113113 class StablePagesPager extends AlphabeticPager {
114114 public $mForm, $mConds, $namespace, $override;
115115
116 - // @param int $namespace (null for "all")
117 - // @param string $autoreview ('' for "all", 'none' for no restriction)
 116+ @param int $namespace (null for "all")
 117+ @param string $autoreview ('' for "all", 'none' for no restriction)
118118 function __construct( $form, $conds = array(), $namespace, $autoreview, $indef ) {
119119 $this->mForm = $form;
120120 $this->mConds = $conds;
121121 $this->indef = $indef;
122 - # Must be content pages...
 122+ Must be content pages...
123123 $validNS = FlaggedRevs::getReviewNamespaces();
124124 if ( is_integer( $namespace ) ) {
125125 if ( !in_array( $namespace, $validNS ) ) {
@@ -149,7 +149,7 @@
150150 $conds['fpc_level'] = $this->autoreview;
151151 }
152152 $conds['page_namespace'] = $this->namespace;
153 - # Be sure not to include expired items
 153+ Be sure not to include expired items
154154 if( $this->indef ) {
155155 $conds['fpc_expiry'] = Block::infinity();
156156 } else {

Follow-up revisions

RevisionCommit summaryAuthorDate
r103193Followup r103142...reedy16:55, 15 November 2011

Comments

#Comment by Reedy (talk | contribs)   16:57, 15 November 2011

Not sure wth happened, but in StablePages_body.php you seem to have stripped pretty much all the comments....

#Comment by Aaron Schulz (talk | contribs)   21:37, 15 November 2011

Must be a Komodo tabify bug or something.

Status & tagging log