Index: trunk/extensions/FlaggedRevs/frontend/specialpages/actions/Stabilization_body.php |
— | — | @@ -3,76 +3,74 @@ |
4 | 4 | // Assumes $wgFlaggedRevsProtection is off |
5 | 5 | class Stabilization extends UnlistedSpecialPage { |
6 | 6 | protected $form = null; |
7 | | - protected $skin; |
8 | 7 | |
9 | 8 | public function __construct() { |
10 | | - global $wgUser; |
11 | 9 | parent::__construct( 'Stabilization', 'stablesettings' ); |
12 | | - $this->skin = $wgUser->getSkin(); |
13 | 10 | } |
14 | 11 | |
15 | 12 | 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 | + |
19 | 19 | # 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 ); |
29 | 27 | } elseif ( wfReadOnly() ) { |
30 | | - $wgOut->readOnlyPage(); |
31 | | - return; |
| 28 | + throw new ReadOnlyError(); |
32 | 29 | } |
33 | 30 | } |
34 | 31 | # Set page title |
35 | 32 | $this->setHeaders(); |
36 | 33 | |
37 | 34 | # Target page |
38 | | - $title = Title::newFromURL( $wgRequest->getVal( 'page', $par ) ); |
| 35 | + $title = Title::newFromURL( $request->getVal( 'page', $par ) ); |
39 | 36 | if ( !$title ) { |
40 | | - $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); |
| 37 | + $out->showErrorPage( 'notargettitle', 'notargettext' ); |
41 | 38 | return; |
42 | 39 | } |
43 | 40 | |
44 | | - $this->form = new PageStabilityGeneralForm( $wgUser ); |
| 41 | + $this->form = new PageStabilityGeneralForm( $user ); |
45 | 42 | $form = $this->form; // convenience |
46 | 43 | |
47 | 44 | $form->setPage( $title ); |
48 | 45 | # Watch checkbox |
49 | | - $form->setWatchThis( (bool)$wgRequest->getCheck( 'wpWatchthis' ) ); |
| 46 | + $form->setWatchThis( (bool)$request->getCheck( 'wpWatchthis' ) ); |
50 | 47 | # Get auto-review option... |
51 | | - $form->setReviewThis( $wgRequest->getBool( 'wpReviewthis', true ) ); |
| 48 | + $form->setReviewThis( $request->getBool( 'wpReviewthis', true ) ); |
52 | 49 | # 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' ) ); |
55 | 52 | # 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' ) ); |
58 | 55 | # Default version |
59 | | - $form->setOverride( (int)$wgRequest->getBool( 'wpStableconfig-override' ) ); |
| 56 | + $form->setOverride( (int)$request->getBool( 'wpStableconfig-override' ) ); |
60 | 57 | # Get autoreview restrictions... |
61 | | - $form->setAutoreview( $wgRequest->getVal( 'mwProtect-level-autoreview' ) ); |
| 58 | + $form->setAutoreview( $request->getVal( 'mwProtect-level-autoreview' ) ); |
62 | 59 | $form->ready(); // params all set |
63 | 60 | |
64 | 61 | $status = $form->checkTarget(); |
65 | 62 | if ( $status === 'stabilize_page_notexists' ) { |
66 | | - $wgOut->addWikiMsg( 'stabilization-notexists', $title->getPrefixedText() ); |
| 63 | + $out->addWikiMsg( 'stabilization-notexists', $title->getPrefixedText() ); |
67 | 64 | return; |
68 | 65 | } elseif ( $status === 'stabilize_page_unreviewable' ) { |
69 | | - $wgOut->addWikiMsg( 'stabilization-notcontent', $title->getPrefixedText() ); |
| 66 | + $out->addWikiMsg( 'stabilization-notcontent', $title->getPrefixedText() ); |
70 | 67 | return; |
71 | 68 | } |
| 69 | + |
72 | 70 | # Form POST request... |
73 | | - if ( $confirmed && $form->isAllowed() ) { |
| 71 | + if ( $request->wasPosted() && $confirmed && $form->isAllowed() ) { |
74 | 72 | $status = $form->submit(); |
75 | 73 | if ( $status === true ) { |
76 | | - $wgOut->redirect( $title->getFullUrl() ); |
| 74 | + $out->redirect( $title->getFullUrl() ); |
77 | 75 | } else { |
78 | 76 | $this->showForm( wfMsg( $status ) ); |
79 | 77 | } |
— | — | @@ -84,7 +82,8 @@ |
85 | 83 | } |
86 | 84 | |
87 | 85 | public function showForm( $err = null ) { |
88 | | - global $wgOut, $wgLang, $wgUser; |
| 86 | + $out = $this->getOutput(); |
| 87 | + |
89 | 88 | $form = $this->form; // convenience |
90 | 89 | $title = $this->form->getPage(); |
91 | 90 | $oldConfig = $form->getOldConfig(); |
— | — | @@ -92,8 +91,8 @@ |
93 | 92 | $s = ''; // form HTML string |
94 | 93 | # Add any error messages |
95 | 94 | 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" ); |
98 | 97 | } |
99 | 98 | # Add header text |
100 | 99 | if ( !$form->isAllowed() ) { |
— | — | @@ -115,9 +114,9 @@ |
116 | 115 | $dropdownOptions = array(); // array of <label,value> |
117 | 116 | # Add the current expiry as a dropdown option |
118 | 117 | 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'] ); |
122 | 121 | $dropdownOptions[] = array( |
123 | 122 | wfMsg( 'protect-existing-expiry', $timestamp, $d, $t ), 'existing' ); |
124 | 123 | } |
— | — | @@ -172,8 +171,8 @@ |
173 | 172 | <td class='mw-input'>" . |
174 | 173 | Xml::tags( 'select', |
175 | 174 | array( |
176 | | - 'id' => 'mwStabilizeExpirySelection', |
177 | | - 'name' => 'wpExpirySelection', |
| 175 | + 'id' => 'mwStabilizeExpirySelection', |
| 176 | + 'name' => 'wpExpirySelection', |
178 | 177 | 'onchange' => 'onFRChangeExpiryDropdown()', |
179 | 178 | ) + $this->disabledAttr(), |
180 | 179 | $expiryFormOptions ) . |
— | — | @@ -197,7 +196,7 @@ |
198 | 197 | $watchLabel = wfMsgExt( 'watchthis', 'parseinline' ); |
199 | 198 | $watchAttribs = array( 'accesskey' => wfMsg( 'accesskey-watch' ), |
200 | 199 | 'id' => 'wpWatchthis' ); |
201 | | - $watchChecked = ( $wgUser->getOption( 'watchdefault' ) |
| 200 | + $watchChecked = ( $this->getUser()->getOption( 'watchdefault' ) |
202 | 201 | || $title->userIsWatching() ); |
203 | 202 | $reviewLabel = wfMsgExt( 'stabilization-review', 'parseinline' ); |
204 | 203 | |
— | — | @@ -228,7 +227,7 @@ |
229 | 228 | Xml::check( 'wpWatchthis', $watchChecked, $watchAttribs ) . |
230 | 229 | " <label for='wpWatchthis' " . |
231 | 230 | Xml::expandAttributes( |
232 | | - array( 'title' => $this->skin->titleAttrib( 'watch', 'withaccess' ) ) ) . |
| 231 | + array( 'title' => Linker::titleAttrib( 'watch', 'withaccess' ) ) ) . |
233 | 232 | ">{$watchLabel}</label>" . |
234 | 233 | '</td> |
235 | 234 | </tr> |
— | — | @@ -240,21 +239,21 @@ |
241 | 240 | </tr>' . Xml::closeElement( 'table' ) . |
242 | 241 | Html::hidden( 'title', $this->getTitle()->getPrefixedDBKey() ) . |
243 | 242 | Html::hidden( 'page', $title->getPrefixedText() ) . |
244 | | - Html::hidden( 'wpEditToken', $wgUser->editToken() ); |
| 243 | + Html::hidden( 'wpEditToken', $this->getUser()->editToken() ); |
245 | 244 | } else { |
246 | 245 | $s .= Xml::closeElement( 'table' ); |
247 | 246 | } |
248 | 247 | $s .= Xml::closeElement( 'fieldset' ) . Xml::closeElement( 'form' ); |
249 | 248 | |
250 | | - $wgOut->addHTML( $s ); |
| 249 | + $out->addHTML( $s ); |
251 | 250 | |
252 | | - $wgOut->addHTML( Xml::element( 'h2', null, |
| 251 | + $out->addHTML( Xml::element( 'h2', null, |
253 | 252 | htmlspecialchars( LogPage::logName( 'stable' ) ) ) ); |
254 | | - LogEventsList::showLogExtract( $wgOut, 'stable', |
| 253 | + LogEventsList::showLogExtract( $out, 'stable', |
255 | 254 | $title->getPrefixedText(), '', array( 'lim' => 25 ) ); |
256 | 255 | |
257 | 256 | # Add some javascript for expiry dropdowns |
258 | | - $wgOut->addScript( |
| 257 | + $out->addScript( |
259 | 258 | "<script type=\"text/javascript\"> |
260 | 259 | function onFRChangeExpiryDropdown() { |
261 | 260 | document.getElementById('mwStabilizeExpiryOther').value = ''; |
— | — | @@ -267,7 +266,6 @@ |
268 | 267 | } |
269 | 268 | |
270 | 269 | protected function buildSelector( $selected ) { |
271 | | - global $wgUser; |
272 | 270 | $allowedLevels = array(); |
273 | 271 | $levels = FlaggedRevs::getRestrictionLevels(); |
274 | 272 | array_unshift( $levels, '' ); // Add a "none" level |
— | — | @@ -275,7 +273,7 @@ |
276 | 274 | # Don't let them choose levels they can't set, |
277 | 275 | # but *show* them all when the form is disabled. |
278 | 276 | if ( $this->form->isAllowed() |
279 | | - && !FlaggedRevs::userCanSetAutoreviewLevel( $wgUser, $key ) ) |
| 277 | + && !FlaggedRevs::userCanSetAutoreviewLevel( $this->getUser(), $key ) ) |
280 | 278 | { |
281 | 279 | continue; |
282 | 280 | } |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/actions/RevisionReview_body.php |
— | — | @@ -3,152 +3,149 @@ |
4 | 4 | class RevisionReview extends UnlistedSpecialPage { |
5 | 5 | protected $form; |
6 | 6 | protected $page; |
7 | | - protected $skin; |
8 | 7 | |
9 | 8 | public function __construct() { |
10 | | - global $wgUser; |
11 | 9 | parent::__construct( 'RevisionReview', 'review' ); |
12 | | - $this->skin = $wgUser->getSkin(); |
13 | 10 | } |
14 | 11 | |
15 | 12 | 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' ); |
26 | 21 | } |
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(); |
30 | 27 | } |
| 28 | + |
31 | 29 | $this->setHeaders(); |
32 | 30 | |
33 | 31 | # Our target page |
34 | | - $this->page = Title::newFromURL( $wgRequest->getVal( 'target' ) ); |
| 32 | + $this->page = Title::newFromURL( $request->getVal( 'target' ) ); |
35 | 33 | if ( !$this->page ) { |
36 | | - $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); |
| 34 | + $out->showErrorPage( 'notargettitle', 'notargettext' ); |
37 | 35 | return; |
38 | 36 | } |
39 | 37 | # Basic page permission checks... |
40 | | - $permErrors = $this->page->getUserPermissionsErrors( 'review', $wgUser, false ); |
| 38 | + $permErrors = $this->page->getUserPermissionsErrors( 'review', $user, false ); |
41 | 39 | if ( !$permErrors ) { |
42 | | - $permErrors = $this->page->getUserPermissionsErrors( 'edit', $wgUser, false ); |
| 40 | + $permErrors = $this->page->getUserPermissionsErrors( 'edit', $user, false ); |
43 | 41 | } |
44 | 42 | if ( $permErrors ) { |
45 | | - $wgOut->showPermissionsErrorPage( $permErrors, 'review' ); |
| 43 | + $out->showPermissionsErrorPage( $permErrors, 'review' ); |
46 | 44 | return; |
47 | 45 | } |
48 | 46 | |
49 | | - $this->form = new RevisionReviewForm( $wgUser ); |
| 47 | + $this->form = new RevisionReviewForm( $user ); |
50 | 48 | $form = $this->form; // convenience |
51 | 49 | |
52 | 50 | $form->setPage( $this->page ); |
53 | 51 | # 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' ) ); |
57 | 55 | # 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' ) ); |
60 | 58 | # 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' ) ); |
64 | 62 | # Special token to discourage fiddling... |
65 | | - $form->setValidatedParams( $wgRequest->getVal( 'validatedParams' ) ); |
| 63 | + $form->setValidatedParams( $request->getVal( 'validatedParams' ) ); |
66 | 64 | # Conflict handling |
67 | | - $form->setLastChangeTime( $wgRequest->getVal( 'changetime' ) ); |
| 65 | + $form->setLastChangeTime( $request->getVal( 'changetime' ) ); |
68 | 66 | # Tag values |
69 | 67 | foreach ( FlaggedRevs::getTags() as $tag ) { |
70 | 68 | # This can be NULL if we uncheck a checkbox |
71 | | - $val = $wgRequest->getInt( "wp$tag" ); |
| 69 | + $val = $request->getInt( "wp$tag" ); |
72 | 70 | $form->setDim( $tag, $val ); |
73 | 71 | } |
74 | 72 | # Log comment |
75 | | - $form->setComment( $wgRequest->getText( 'wpReason' ) ); |
| 73 | + $form->setComment( $request->getText( 'wpReason' ) ); |
76 | 74 | $form->ready(); |
77 | 75 | |
78 | 76 | # Review the edit if requested (POST)... |
79 | | - if ( $wgRequest->wasPosted() ) { |
| 77 | + if ( $request->wasPosted() ) { |
80 | 78 | // Check the edit token... |
81 | 79 | if ( !$confirmed ) { |
82 | | - $wgOut->addWikiText( wfMsg( 'sessionfailure' ) ); |
83 | | - $wgOut->returnToMain( false, $this->page ); |
| 80 | + $out->addWikiText( wfMsg( 'sessionfailure' ) ); |
| 81 | + $out->returnToMain( false, $this->page ); |
84 | 82 | return; |
85 | 83 | } |
86 | 84 | // Use confirmation screen for reject... |
87 | | - if ( $form->getAction() == 'reject' && !$wgRequest->getBool( 'wpRejectConfirm' ) ) { |
| 85 | + if ( $form->getAction() == 'reject' && !$request->getBool( 'wpRejectConfirm' ) ) { |
88 | 86 | $rejectForm = new RejectConfirmationFormUI( $form ); |
89 | 87 | list( $html, $status ) = $rejectForm->getHtml(); |
90 | 88 | // Success... |
91 | 89 | if ( $status === true ) { |
92 | | - $wgOut->addHtml( $html ); |
| 90 | + $out->addHtml( $html ); |
93 | 91 | // Failure... |
94 | 92 | } else { |
95 | 93 | if ( $status === 'review_page_unreviewable' ) { |
96 | | - $wgOut->addWikiText( wfMsg( 'revreview-main' ) ); |
| 94 | + $out->addWikiText( wfMsg( 'revreview-main' ) ); |
97 | 95 | return; |
98 | 96 | } elseif ( $status === 'review_page_notexists' ) { |
99 | | - $wgOut->showErrorPage( 'internalerror', 'nopagetext' ); |
| 97 | + $out->showErrorPage( 'internalerror', 'nopagetext' ); |
100 | 98 | return; |
101 | 99 | } elseif ( $status === 'review_bad_oldid' ) { |
102 | | - $wgOut->showErrorPage( 'internalerror', 'revreview-revnotfound' ); |
| 100 | + $out->showErrorPage( 'internalerror', 'revreview-revnotfound' ); |
103 | 101 | } else { |
104 | | - $wgOut->showErrorPage( 'internalerror', $status ); |
| 102 | + $out->showErrorPage( 'internalerror', $status ); |
105 | 103 | } |
106 | | - $wgOut->returnToMain( false, $this->page ); |
| 104 | + $out->returnToMain( false, $this->page ); |
107 | 105 | } |
108 | 106 | // Otherwise submit... |
109 | 107 | } else { |
110 | 108 | $status = $form->submit(); |
111 | 109 | // Success... |
112 | 110 | if ( $status === true ) { |
113 | | - $wgOut->setPageTitle( wfMsgHtml( 'actioncomplete' ) ); |
| 111 | + $out->setPageTitle( wfMsgHtml( 'actioncomplete' ) ); |
114 | 112 | if ( $form->getAction() === 'approve' ) { |
115 | | - $wgOut->addHTML( $this->approvalSuccessHTML( true ) ); |
| 113 | + $out->addHTML( $this->approvalSuccessHTML( true ) ); |
116 | 114 | } elseif ( $form->getAction() === 'unapprove' ) { |
117 | | - $wgOut->addHTML( $this->deapprovalSuccessHTML( true ) ); |
| 115 | + $out->addHTML( $this->deapprovalSuccessHTML( true ) ); |
118 | 116 | } elseif ( $form->getAction() === 'reject' ) { |
119 | | - $wgOut->redirect( $this->page->getFullUrl() ); |
| 117 | + $out->redirect( $this->page->getFullUrl() ); |
120 | 118 | } |
121 | 119 | // Failure... |
122 | 120 | } else { |
123 | 121 | if ( $status === 'review_page_unreviewable' ) { |
124 | | - $wgOut->addWikiText( wfMsg( 'revreview-main' ) ); |
| 122 | + $out->addWikiText( wfMsg( 'revreview-main' ) ); |
125 | 123 | return; |
126 | 124 | } elseif ( $status === 'review_page_notexists' ) { |
127 | | - $wgOut->showErrorPage( 'internalerror', 'nopagetext' ); |
| 125 | + $out->showErrorPage( 'internalerror', 'nopagetext' ); |
128 | 126 | return; |
129 | 127 | } elseif ( $status === 'review_denied' ) { |
130 | | - $wgOut->permissionRequired( 'badaccess-group0' ); // protected? |
| 128 | + $out->permissionRequired( 'badaccess-group0' ); // protected? |
131 | 129 | } elseif ( $status === 'review_bad_key' ) { |
132 | | - $wgOut->permissionRequired( 'badaccess-group0' ); // fiddling |
| 130 | + $out->permissionRequired( 'badaccess-group0' ); // fiddling |
133 | 131 | } elseif ( $status === 'review_bad_oldid' ) { |
134 | | - $wgOut->showErrorPage( 'internalerror', 'revreview-revnotfound' ); |
| 132 | + $out->showErrorPage( 'internalerror', 'revreview-revnotfound' ); |
135 | 133 | } elseif ( $status === 'review_not_flagged' ) { |
136 | | - $wgOut->redirect( $this->page->getFullUrl() ); // already unflagged |
| 134 | + $out->redirect( $this->page->getFullUrl() ); // already unflagged |
137 | 135 | } elseif ( $status === 'review_too_low' ) { |
138 | | - $wgOut->addWikiText( wfMsg( 'revreview-toolow' ) ); |
| 136 | + $out->addWikiText( wfMsg( 'revreview-toolow' ) ); |
139 | 137 | } else { |
140 | | - $wgOut->showErrorPage( 'internalerror', $status ); |
| 138 | + $out->showErrorPage( 'internalerror', $status ); |
141 | 139 | } |
142 | | - $wgOut->returnToMain( false, $this->page ); |
| 140 | + $out->returnToMain( false, $this->page ); |
143 | 141 | } |
144 | 142 | } |
145 | 143 | // No form to view (GET) |
146 | 144 | } else { |
147 | | - $wgOut->returnToMain( false, $this->page ); |
| 145 | + $out->returnToMain( false, $this->page ); |
148 | 146 | } |
149 | 147 | } |
150 | 148 | |
151 | 149 | protected function approvalSuccessHTML( $showlinks = false ) { |
152 | | - global $wgUser; |
153 | 150 | $title = $this->form->getPage(); |
154 | 151 | # Show success message |
155 | 152 | $s = "<div class='plainlinks'>"; |
— | — | @@ -158,14 +155,13 @@ |
159 | 156 | $title->getPrefixedUrl(), $this->form->getOldId() ); |
160 | 157 | $s .= "</div>"; |
161 | 158 | # Handy links to special pages |
162 | | - if ( $showlinks && $wgUser->isAllowed( 'unreviewedpages' ) ) { |
| 159 | + if ( $showlinks && $this->getUser()->isAllowed( 'unreviewedpages' ) ) { |
163 | 160 | $s .= $this->getSpecialLinks(); |
164 | 161 | } |
165 | 162 | return $s; |
166 | 163 | } |
167 | 164 | |
168 | 165 | protected function deapprovalSuccessHTML( $showlinks = false ) { |
169 | | - global $wgUser; |
170 | 166 | $title = $this->form->getPage(); |
171 | 167 | # Show success message |
172 | 168 | $s = "<div class='plainlinks'>"; |
— | — | @@ -175,7 +171,7 @@ |
176 | 172 | $title->getPrefixedUrl(), $this->form->getOldId() ); |
177 | 173 | $s .= "</div>"; |
178 | 174 | # Handy links to special pages |
179 | | - if ( $showlinks && $wgUser->isAllowed( 'unreviewedpages' ) ) { |
| 175 | + if ( $showlinks && $this->getUser()->isAllowed( 'unreviewedpages' ) ) { |
180 | 176 | $s .= $this->getSpecialLinks(); |
181 | 177 | } |
182 | 178 | return $s; |
— | — | @@ -183,16 +179,17 @@ |
184 | 180 | |
185 | 181 | protected function getSpecialLinks() { |
186 | 182 | $s = '<p>' . wfMsgHtml( 'returnto', |
187 | | - $this->skin->linkKnown( SpecialPage::getTitleFor( 'UnreviewedPages' ) ) |
| 183 | + Linker::linkKnown( SpecialPage::getTitleFor( 'UnreviewedPages' ) ) |
188 | 184 | ) . '</p>'; |
189 | 185 | $s .= '<p>' . wfMsgHtml( 'returnto', |
190 | | - $this->skin->linkKnown( SpecialPage::getTitleFor( 'PendingChanges' ) ) |
| 186 | + Linker::linkKnown( SpecialPage::getTitleFor( 'PendingChanges' ) ) |
191 | 187 | ) . '</p>'; |
192 | 188 | return $s; |
193 | 189 | } |
194 | 190 | |
195 | 191 | public static function AjaxReview( /*$args...*/ ) { |
196 | 192 | global $wgUser, $wgOut; |
| 193 | + |
197 | 194 | $args = func_get_args(); |
198 | 195 | if ( wfReadOnly() ) { |
199 | 196 | return '<err#>' . wfMsgExt( 'revreview-failed', 'parseinline' ) . |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/PendingChanges_body.php |
— | — | @@ -9,21 +9,20 @@ |
10 | 10 | } |
11 | 11 | |
12 | 12 | public function execute( $par ) { |
13 | | - global $wgRequest, $wgUser; |
| 13 | + $request = $this->getRequest(); |
14 | 14 | |
15 | 15 | $this->setHeaders(); |
16 | | - $this->skin = $wgUser->getSkin(); |
17 | 16 | $this->currentUnixTS = wfTimestamp( TS_UNIX ); // now |
18 | 17 | |
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' ) ); |
22 | 21 | $catTitle = Title::makeTitleSafe( NS_CATEGORY, $category ); |
23 | 22 | $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' ); |
28 | 27 | |
29 | 28 | $incLimit = 0; |
30 | 29 | if ( $this->including() ) { |
— | — | @@ -50,21 +49,22 @@ |
51 | 50 | } |
52 | 51 | |
53 | 52 | protected function setSyndicated() { |
54 | | - global $wgOut, $wgRequest; |
| 53 | + $request = $this->getRequest(); |
55 | 54 | $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' ), |
59 | 58 | ); |
60 | | - $wgOut->setSyndicated( true ); |
61 | | - $wgOut->setFeedAppendQuery( wfArrayToCGI( $queryParams ) ); |
| 59 | + $this->getOutput()->setSyndicated( true ); |
| 60 | + $this->getOutput()->setFeedAppendQuery( wfArrayToCGI( $queryParams ) ); |
62 | 61 | } |
63 | 62 | |
64 | 63 | public function showForm() { |
65 | | - global $wgUser, $wgOut, $wgScript, $wgLang; |
| 64 | + global $wgScript; |
| 65 | + |
66 | 66 | # 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() ) ); |
69 | 69 | |
70 | 70 | $form = Html::openElement( 'form', array( 'name' => 'pendingchanges', |
71 | 71 | 'action' => $wgScript, 'method' => 'get' ) ) . "\n"; |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | $items[] = |
96 | 96 | Xml::label( wfMsg( "pendingchanges-category" ), 'wpCategory' ) . ' ' . |
97 | 97 | Xml::input( 'category', 30, $this->category, array( 'id' => 'wpCategory' ) ); |
98 | | - if ( $wgUser->getId() ) { |
| 98 | + if ( $this->getUser()->getId() ) { |
99 | 99 | $items[] = Xml::check( 'watched', $this->watched, array( 'id' => 'wpWatched' ) ) . |
100 | 100 | Xml::label( wfMsg( 'pendingchanges-onwatchlist' ), 'wpWatched' ); |
101 | 101 | } |
— | — | @@ -106,33 +106,32 @@ |
107 | 107 | $form .= "</fieldset>"; |
108 | 108 | $form .= Html::closeElement( 'form' ) . "\n"; |
109 | 109 | |
110 | | - $wgOut->addHTML( $form ); |
| 110 | + $this->getOutput()->addHTML( $form ); |
111 | 111 | } |
112 | 112 | |
113 | 113 | public function showPageList() { |
114 | | - global $wgOut; |
| 114 | + $out = $this->getOutput(); |
115 | 115 | // Viewing the list normally... |
116 | 116 | if ( !$this->including() ) { |
117 | 117 | 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() ); |
121 | 121 | } else { |
122 | | - $wgOut->addWikiMsg( 'pendingchanges-none' ); |
| 122 | + $out->addWikiMsg( 'pendingchanges-none' ); |
123 | 123 | } |
124 | 124 | // If this list is transcluded... |
125 | 125 | } else { |
126 | 126 | if ( $this->pager->getNumRows() ) { |
127 | | - $wgOut->addHTML( $this->pager->getBody() ); |
| 127 | + $out->addHTML( $this->pager->getBody() ); |
128 | 128 | } else { |
129 | | - $wgOut->addWikiMsg( 'pendingchanges-none' ); |
| 129 | + $out->addWikiMsg( 'pendingchanges-none' ); |
130 | 130 | } |
131 | 131 | } |
132 | 132 | } |
133 | 133 | |
134 | 134 | // set pager parameters from $par, return pager limit |
135 | 135 | protected function parseParams( $par ) { |
136 | | - global $wgLang; |
137 | 136 | $bits = preg_split( '/\s*,\s*/', trim( $par ) ); |
138 | 137 | $limit = false; |
139 | 138 | foreach ( $bits as $bit ) { |
— | — | @@ -144,7 +143,7 @@ |
145 | 144 | $limit = intval( $m[1] ); |
146 | 145 | } |
147 | 146 | if ( preg_match( '/^namespace=(.*)$/', $bit, $m ) ) { |
148 | | - $ns = $wgLang->getNsIndex( $m[1] ); |
| 147 | + $ns = $this->getLang()->getNsIndex( $m[1] ); |
149 | 148 | if ( $ns !== false ) { |
150 | 149 | $this->namespace = $ns; |
151 | 150 | } |
— | — | @@ -161,13 +160,14 @@ |
162 | 161 | * @param string $type |
163 | 162 | */ |
164 | 163 | protected function feed( $type ) { |
165 | | - global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut; |
| 164 | + global $wgFeed, $wgFeedClasses, $wgFeedLimit; |
| 165 | + |
166 | 166 | if ( !$wgFeed ) { |
167 | | - $wgOut->addWikiMsg( 'feed-unavailable' ); |
| 167 | + $this->getOutput()->addWikiMsg( 'feed-unavailable' ); |
168 | 168 | return; |
169 | 169 | } |
170 | 170 | if ( !isset( $wgFeedClasses[$type] ) ) { |
171 | | - $wgOut->addWikiMsg( 'feed-invalid' ); |
| 171 | + $this->getOutput()->addWikiMsg( 'feed-invalid' ); |
172 | 172 | return; |
173 | 173 | } |
174 | 174 | $feed = new $wgFeedClasses[$type]( |
— | — | @@ -188,6 +188,7 @@ |
189 | 189 | |
190 | 190 | protected function feedTitle() { |
191 | 191 | global $wgContLanguageCode, $wgSitename; |
| 192 | + |
192 | 193 | $page = SpecialPage::getPage( 'PendingChanges' ); |
193 | 194 | $desc = $page->getDescription(); |
194 | 195 | return "$wgSitename - $desc [$wgContLanguageCode]"; |
— | — | @@ -213,15 +214,14 @@ |
214 | 215 | } |
215 | 216 | |
216 | 217 | public function formatRow( $row ) { |
217 | | - global $wgLang, $wgUser; |
218 | 218 | $css = $quality = $underReview = ''; |
219 | 219 | $title = Title::newFromRow( $row ); |
220 | 220 | $stxt = ChangesList::showCharacterDifference( $row->rev_len, $row->page_len ); |
221 | 221 | # Page links... |
222 | | - $link = $this->skin->link( $title ); |
223 | | - $hist = $this->skin->linkKnown( $title, |
| 222 | + $link = Linker::link( $title ); |
| 223 | + $hist = Linker::linkKnown( $title, |
224 | 224 | wfMsgHtml( 'hist' ), array(), 'action=history' ); |
225 | | - $review = $this->skin->linkKnown( $title, |
| 225 | + $review = Linker::linkKnown( $title, |
226 | 226 | wfMsg( 'pendingchanges-diff' ), |
227 | 227 | array(), |
228 | 228 | array( 'diff' => 'cur', 'oldid' => $row->stable ) + FlaggedRevs::diffOnlyCGI() |
— | — | @@ -234,10 +234,10 @@ |
235 | 235 | $quality = " <b>[{$quality}]</b>"; |
236 | 236 | } |
237 | 237 | # Is anybody watching? |
238 | | - if ( !$this->including() && $wgUser->isAllowed( 'unreviewedpages' ) ) { |
| 238 | + if ( !$this->including() && $this->getUser()->isAllowed( 'unreviewedpages' ) ) { |
239 | 239 | $uw = FRUserActivity::numUsersWatchingPage( $title ); |
240 | 240 | $watching = $uw |
241 | | - ? wfMsgExt( 'pendingchanges-watched', 'parsemag', $wgLang->formatNum( $uw ) ) |
| 241 | + ? wfMsgExt( 'pendingchanges-watched', 'parsemag', $this->getLang()->formatNum( $uw ) ) |
242 | 242 | : wfMsgHtml( 'pendingchanges-unwatched' ); |
243 | 243 | $watching = " {$watching}"; |
244 | 244 | } else { |
— | — | @@ -252,12 +252,12 @@ |
253 | 253 | if ( $hours > ( 3 * 24 ) ) { |
254 | 254 | $days = round( $hours / 24, 0 ); |
255 | 255 | $age = wfMsgExt( 'pendingchanges-days', |
256 | | - 'parsemag', $wgLang->formatNum( $days ) ); |
| 256 | + 'parsemag', $this->getLang()->formatNum( $days ) ); |
257 | 257 | // If one or more hours, use hours |
258 | 258 | } elseif ( $hours >= 1 ) { |
259 | 259 | $hours = round( $hours, 0 ); |
260 | 260 | $age = wfMsgExt( 'pendingchanges-hours', |
261 | | - 'parsemag', $wgLang->formatNum( $hours ) ); |
| 261 | + 'parsemag', $this->getLang()->formatNum( $hours ) ); |
262 | 262 | } else { |
263 | 263 | $age = wfMsg( 'pendingchanges-recent' ); // hot off the press :) |
264 | 264 | } |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/UnreviewedPages_body.php |
— | — | @@ -8,26 +8,25 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | public function execute( $par ) { |
12 | | - global $wgRequest, $wgUser, $wgOut; |
| 12 | + $request = $this->getRequest(); |
13 | 13 | |
14 | 14 | $this->setHeaders(); |
15 | | - if ( !$wgUser->isAllowed( 'unreviewedpages' ) ) { |
16 | | - $wgOut->permissionRequired( 'unreviewedpages' ); |
| 15 | + if ( !$this->getUser()->isAllowed( 'unreviewedpages' ) ) { |
| 16 | + $this->getOutput()->permissionRequired( 'unreviewedpages' ); |
17 | 17 | return; |
18 | 18 | } |
19 | | - $this->skin = $wgUser->getSkin(); |
20 | 19 | $this->currentUnixTS = wfTimestamp( TS_UNIX ); // now |
21 | 20 | |
22 | 21 | # Get default namespace |
23 | 22 | $namespaces = FlaggedRevs::getReviewNamespaces(); |
24 | 23 | $defaultNS = !$namespaces ? NS_MAIN : $namespaces[0]; |
25 | 24 | |
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' ) ); |
28 | 27 | $catTitle = Title::makeTitleSafe( NS_CATEGORY, $category ); |
29 | 28 | $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 ); |
32 | 31 | $this->live = self::generalQueryOK(); |
33 | 32 | |
34 | 33 | $this->pager = new UnreviewedPagesPager( $this, $this->live, |
— | — | @@ -38,15 +37,16 @@ |
39 | 38 | } |
40 | 39 | |
41 | 40 | protected function showForm() { |
42 | | - global $wgOut, $wgLang, $wgScript; |
| 41 | + global $wgScript; |
| 42 | + |
43 | 43 | # 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() ) ); |
46 | 46 | |
47 | 47 | # show/hide links |
48 | 48 | $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) ); |
49 | 49 | $onoff = 1 - $this->hideRedirs; |
50 | | - $link = $this->skin->link( $this->getTitle(), $showhide[$onoff], array(), |
| 50 | + $link = Linker::link( $this->getTitle(), $showhide[$onoff], array(), |
51 | 51 | array( 'hideredirs' => $onoff, 'category' => $this->category, |
52 | 52 | 'namespace' => $this->namespace ) |
53 | 53 | ); |
— | — | @@ -81,41 +81,40 @@ |
82 | 82 | array( 'qci_type' => 'fr_unreviewedpages' ), __METHOD__ ); |
83 | 83 | if ( $ts ) { |
84 | 84 | $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 ); |
88 | 88 | $form .= wfMsgExt( 'perfcachedts', 'parse', $td, $d, $t ); |
89 | 89 | } else { |
90 | 90 | $form .= wfMsgExt( 'perfcached', 'parse' ); |
91 | 91 | } |
92 | 92 | } |
93 | 93 | |
94 | | - $wgOut->addHTML( $form ); |
| 94 | + $this->getOutput()->addHTML( $form ); |
95 | 95 | } |
96 | 96 | |
97 | 97 | protected function showPageList() { |
98 | | - global $wgOut; |
| 98 | + $out = $this->getOutput(); |
99 | 99 | 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() ); |
103 | 103 | } else { |
104 | | - $wgOut->addWikiMsg( 'unreviewedpages-none' ); |
| 104 | + $out->addWikiMsg( 'unreviewedpages-none' ); |
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | 108 | public function formatRow( $row ) { |
109 | | - global $wgLang, $wgUser; |
110 | 109 | $title = Title::newFromRow( $row ); |
111 | 110 | |
112 | 111 | $stxt = $underReview = $watching = ''; |
113 | | - $link = $this->skin->link( $title, null, array(), 'redirect=no' ); |
| 112 | + $link = Linker::link( $title, null, array(), 'redirect=no' ); |
114 | 113 | $dirmark = wfUILang()->getDirMark(); |
115 | | - $hist = $this->skin->linkKnown( $title, wfMsgHtml( 'hist' ), array(), 'action=history' ); |
| 114 | + $hist = Linker::linkKnown( $title, wfMsgHtml( 'hist' ), array(), 'action=history' ); |
116 | 115 | if ( !is_null( $size = $row->page_len ) ) { |
117 | 116 | $stxt = ( $size == 0 ) |
118 | 117 | ? wfMsgHtml( 'historyempty' ) |
119 | | - : wfMsgExt( 'historysize', 'parsemag', $wgLang->formatNum( $size ) ); |
| 118 | + : wfMsgExt( 'historysize', 'parsemag', $this->getLang()->formatNum( $size ) ); |
120 | 119 | $stxt = " <small>$stxt</small>"; |
121 | 120 | } |
122 | 121 | # Get how long the first unreviewed edit has been waiting... |
— | — | @@ -125,19 +124,19 @@ |
126 | 125 | if ( $hours > ( 3 * 24 ) ) { |
127 | 126 | $days = round( $hours / 24, 0 ); |
128 | 127 | $age = ' ' . wfMsgExt( 'unreviewedpages-days', |
129 | | - 'parsemag', $wgLang->formatNum( $days ) ); |
| 128 | + 'parsemag', $this->getLang()->formatNum( $days ) ); |
130 | 129 | // If one or more hours, use hours |
131 | 130 | } elseif ( $hours >= 1 ) { |
132 | 131 | $hours = round( $hours, 0 ); |
133 | 132 | $age = ' ' . wfMsgExt( 'unreviewedpages-hours', |
134 | | - 'parsemag', $wgLang->formatNum( $hours ) ); |
| 133 | + 'parsemag', $this->getLang()->formatNum( $hours ) ); |
135 | 134 | } else { |
136 | 135 | $age = ' ' . wfMsg( 'unreviewedpages-recent' ); // hot off the press :) |
137 | 136 | } |
138 | | - if ( $wgUser->isAllowed( 'unwatchedpages' ) ) { |
| 137 | + if ( $this->getUser()->isAllowed( 'unwatchedpages' ) ) { |
139 | 138 | $uw = FRUserActivity::numUsersWatchingPage( $title ); |
140 | 139 | $watching = $uw |
141 | | - ? wfMsgExt( 'unreviewedpages-watched', 'parsemag', $wgLang->formatNum( $uw ) ) |
| 140 | + ? wfMsgExt( 'unreviewedpages-watched', 'parsemag', $this->getLang()->formatNum( $uw ) ) |
142 | 141 | : wfMsgHtml( 'unreviewedpages-unwatched' ); |
143 | 142 | $watching = " $watching"; // Oh-noes! |
144 | 143 | } else { |
— | — | @@ -213,10 +212,10 @@ |
214 | 213 | ); |
215 | 214 | foreach ( $res as $row ) { |
216 | 215 | $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 |
221 | 220 | ); |
222 | 221 | } |
223 | 222 | $dbr->freeResult( $res ); |
— | — | @@ -253,10 +252,10 @@ |
254 | 253 | ); |
255 | 254 | foreach ( $res as $row ) { |
256 | 255 | $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 |
261 | 260 | ); |
262 | 261 | } |
263 | 262 | $dbr->freeResult( $res ); |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/QualityOversight_body.php |
— | — | @@ -6,15 +6,18 @@ |
7 | 7 | } |
8 | 8 | |
9 | 9 | 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 | + |
12 | 15 | $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' ); |
19 | 22 | # Check if the user exists |
20 | 23 | $usertitle = Title::makeTitleSafe( NS_USER, $this->user ); |
21 | 24 | $u = $usertitle ? User::idFromName( $this->user ) : false; |
— | — | @@ -22,8 +25,8 @@ |
23 | 26 | # Are the dropdown params given even valid? |
24 | 27 | $actions = $this->getActions(); |
25 | 28 | if ( empty( $actions ) ) { |
26 | | - $wgOut->addWikiMsg( 'qualityoversight-list', 0 ); |
27 | | - $wgOut->addWikiMsg( 'logempty' ); |
| 29 | + $out->addWikiMsg( 'qualityoversight-list', 0 ); |
| 30 | + $out->addWikiMsg( 'logempty' ); |
28 | 31 | return; |
29 | 32 | } |
30 | 33 | |
— | — | @@ -38,19 +41,19 @@ |
39 | 42 | } |
40 | 43 | |
41 | 44 | # 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 ); |
43 | 46 | $pager = new LogPager( $loglist, 'review', $this->user, '', '', $conds ); |
44 | 47 | |
45 | 48 | # Explanatory text |
46 | | - $wgOut->addWikiMsg( 'qualityoversight-list', |
47 | | - $wgLang->formatNum( $pager->getNumRows() ) ); |
| 49 | + $out->addWikiMsg( 'qualityoversight-list', |
| 50 | + $this->getLang()->formatNum( $pager->getNumRows() ) ); |
48 | 51 | # Show form options |
49 | 52 | $this->showForm(); |
50 | 53 | |
51 | 54 | # Insert list |
52 | 55 | $logBody = $pager->getBody(); |
53 | 56 | if ( $logBody ) { |
54 | | - $wgOut->addHTML( |
| 57 | + $out->addHTML( |
55 | 58 | $pager->getNavigationBar() . |
56 | 59 | $loglist->beginLogEventsList() . |
57 | 60 | $logBody . |
— | — | @@ -58,13 +61,14 @@ |
59 | 62 | $pager->getNavigationBar() |
60 | 63 | ); |
61 | 64 | } else { |
62 | | - $wgOut->addWikiMsg( 'logempty' ); |
| 65 | + $out->addWikiMsg( 'logempty' ); |
63 | 66 | } |
64 | 67 | } |
65 | 68 | |
66 | 69 | private function showForm() { |
67 | | - global $wgOut, $wgScript; |
68 | | - $wgOut->addHTML( |
| 70 | + global $wgScript; |
| 71 | + |
| 72 | + $this->getOutput()->addHTML( |
69 | 73 | Xml::openElement( 'form', array( 'name' => 'qualityoversight', |
70 | 74 | 'action' => $wgScript, 'method' => 'get' ) ) . |
71 | 75 | '<fieldset><legend>' . wfMsgHtml( 'qualityoversight-legend' ) . '</legend><p>' . |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ReviewedVersions_body.php |
— | — | @@ -6,19 +6,18 @@ |
7 | 7 | } |
8 | 8 | |
9 | 9 | public function execute( $par ) { |
10 | | - global $wgRequest, $wgUser, $wgOut; |
| 10 | + $request = $this->getRequest(); |
11 | 11 | |
12 | 12 | $this->setHeaders(); |
13 | | - $this->skin = $wgUser->getSkin(); |
14 | 13 | # Our target page |
15 | | - $this->target = $wgRequest->getText( 'page' ); |
| 14 | + $this->target = $request->getText( 'page' ); |
16 | 15 | $this->page = Title::newFromURL( $this->target ); |
17 | 16 | # Revision ID |
18 | | - $this->oldid = $wgRequest->getVal( 'oldid' ); |
| 17 | + $this->oldid = $request->getVal( 'oldid' ); |
19 | 18 | $this->oldid = ( $this->oldid == 'best' ) ? 'best' : intval( $this->oldid ); |
20 | 19 | # We need a page... |
21 | 20 | if ( is_null( $this->page ) ) { |
22 | | - $wgOut->showErrorPage( 'notargettitle', 'notargettext' ); |
| 21 | + $this->getOutput()->showErrorPage( 'notargettitle', 'notargettext' ); |
23 | 22 | return; |
24 | 23 | } |
25 | 24 | |
— | — | @@ -26,42 +25,41 @@ |
27 | 26 | } |
28 | 27 | |
29 | 28 | protected function showStableList() { |
30 | | - global $wgOut, $wgLang; |
| 29 | + $out = $this->getOutput(); |
31 | 30 | # Must be a content page |
32 | 31 | if ( !FlaggedRevs::inReviewNamespace( $this->page ) ) { |
33 | | - $wgOut->addWikiMsg( 'reviewedversions-none', $this->page->getPrefixedText() ); |
| 32 | + $out->addWikiMsg( 'reviewedversions-none', $this->page->getPrefixedText() ); |
34 | 33 | return; |
35 | 34 | } |
36 | 35 | $pager = new ReviewedVersionsPager( $this, array(), $this->page ); |
37 | 36 | $num = $pager->getNumRows(); |
38 | 37 | 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() ); |
44 | 43 | } else { |
45 | | - $wgOut->addHTML( wfMsgExt( 'reviewedversions-none', array( 'parse' ), |
| 44 | + $out->addHTML( wfMsgExt( 'reviewedversions-none', array( 'parse' ), |
46 | 45 | $this->page->getPrefixedText() ) ); |
47 | 46 | } |
48 | 47 | } |
49 | 48 | |
50 | 49 | 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 ); |
56 | 54 | $review = wfMsgExt( 'reviewedversions-review', array( 'parseinline', 'replaceafter' ), |
57 | 55 | $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 ), |
60 | 58 | $fdate, $ftime, $row->user_name |
61 | 59 | ); |
62 | 60 | $lev = ( $row->fr_quality >= 1 ) |
63 | 61 | ? wfMsgHtml( 'revreview-hist-quality' ) |
64 | 62 | : wfMsgHtml( 'revreview-hist-basic' ); |
65 | | - $link = $this->skin->makeKnownLinkObj( $this->page, $rdatim, |
| 63 | + $link = Linker::makeKnownLinkObj( $this->page, $rdatim, |
66 | 64 | 'stableid=' . $row->fr_rev_id ); |
67 | 65 | return '<li>' . $link . ' (' . $review . ') <strong>[' . $lev . ']</strong></li>'; |
68 | 66 | } |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ConfiguredPages_body.php |
— | — | @@ -9,14 +9,13 @@ |
10 | 10 | } |
11 | 11 | |
12 | 12 | public function execute( $par ) { |
13 | | - global $wgRequest, $wgUser; |
| 13 | + $request = $this->getRequest(); |
14 | 14 | |
15 | 15 | $this->setHeaders(); |
16 | | - $this->skin = $wgUser->getSkin(); |
17 | 16 | |
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', '' ); |
21 | 20 | |
22 | 21 | $this->pager = new ConfiguredPagesPager( |
23 | 22 | $this, array(), $this->namespace, $this->override, $this->autoreview ); |
— | — | @@ -26,10 +25,11 @@ |
27 | 26 | } |
28 | 27 | |
29 | 28 | protected function showForm() { |
30 | | - global $wgOut, $wgScript, $wgLang; |
| 29 | + global $wgScript; |
| 30 | + |
31 | 31 | # 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() ) ); |
34 | 34 | |
35 | 35 | $fields = array(); |
36 | 36 | # Namespace selector |
— | — | @@ -52,17 +52,16 @@ |
53 | 53 | $form .= "</fieldset>\n"; |
54 | 54 | $form .= Html::closeElement( 'form' ) . "\n"; |
55 | 55 | |
56 | | - $wgOut->addHTML( $form ); |
| 56 | + $this->getOutput()->addHTML( $form ); |
57 | 57 | } |
58 | 58 | |
59 | 59 | protected function showPageList() { |
60 | | - global $wgOut; |
61 | 60 | 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() ); |
65 | 64 | } else { |
66 | | - $wgOut->addWikiMsg( 'configuredpages-none' ); |
| 65 | + $this->getOutput()->addWikiMsg( 'configuredpages-none' ); |
67 | 66 | } |
68 | 67 | # Purge expired entries on one in every 10 queries |
69 | 68 | if ( !mt_rand( 0, 10 ) ) { |
— | — | @@ -71,12 +70,11 @@ |
72 | 71 | } |
73 | 72 | |
74 | 73 | public function formatRow( $row ) { |
75 | | - global $wgLang; |
76 | 74 | $title = Title::newFromRow( $row ); |
77 | 75 | # Link to page |
78 | | - $link = $this->skin->link( $title ); |
| 76 | + $link = Linker::link( $title ); |
79 | 77 | # Link to page configuration |
80 | | - $config = $this->skin->linkKnown( |
| 78 | + $config = Linker::linkKnown( |
81 | 79 | SpecialPage::getTitleFor( 'Stabilization' ), |
82 | 80 | wfMsgHtml( 'configuredpages-config' ), |
83 | 81 | array(), |
— | — | @@ -98,9 +96,9 @@ |
99 | 97 | if ( $row->fpc_expiry != 'infinity' && strlen( $row->fpc_expiry ) ) { |
100 | 98 | $expiry_description = " (" . wfMsgForContent( |
101 | 99 | '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 ) |
105 | 103 | ) . ")"; |
106 | 104 | } else { |
107 | 105 | $expiry_description = ""; |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ValidationStatistics_body.php |
— | — | @@ -8,9 +8,12 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | 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 | + |
13 | 17 | $this->setHeaders(); |
14 | | - $this->skin = $wgUser->getSkin(); |
15 | 18 | $this->db = wfGetDB( DB_SLAVE ); |
16 | 19 | |
17 | 20 | $this->maybeUpdate(); |
— | — | @@ -23,8 +26,8 @@ |
24 | 27 | $pData = $this->getPercentiles(); |
25 | 28 | $timestamp = $this->getLastUpdate(); |
26 | 29 | |
27 | | - $wgOut->addWikiMsg( 'validationstatistics-users', |
28 | | - $wgLang->formatnum( $ec ), $wgLang->formatnum( $rc ) |
| 30 | + $out->addWikiMsg( 'validationstatistics-users', |
| 31 | + $lang->formatnum( $ec ), $lang->formatnum( $rc ) |
29 | 32 | ); |
30 | 33 | # Most of the output depends on background queries |
31 | 34 | if ( !$this->readyForQuery() ) { |
— | — | @@ -37,7 +40,7 @@ |
38 | 41 | foreach ( $pData as $percentile => $perValue ) { |
39 | 42 | $headerRows .= "<th>P<sub>" . intval( $percentile ) . "</sub></th>"; |
40 | 43 | $dataRows .= '<td>' . |
41 | | - $wgLang->formatTimePeriod( $perValue, 'avoidminutes' ) . '</td>'; |
| 44 | + $lang->formatTimePeriod( $perValue, 'avoidminutes' ) . '</td>'; |
42 | 45 | } |
43 | 46 | $css = 'wikitable flaggedrevs_stats_table'; |
44 | 47 | $reviewChart = "<table class='$css' style='white-space: nowrap;'>\n"; |
— | — | @@ -50,38 +53,38 @@ |
51 | 54 | |
52 | 55 | if ( $timestamp != '-' ) { |
53 | 56 | # 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 ) |
57 | 60 | ); |
58 | 61 | } |
59 | | - $wgOut->addHtml( '<hr/>' ); |
| 62 | + $out->addHtml( '<hr/>' ); |
60 | 63 | # Show pending time stats... |
61 | | - $wgOut->addWikiMsg( 'validationstatistics-pndtime', |
62 | | - $wgLang->formatTimePeriod( $pt, 'avoidminutes' ) ); |
| 64 | + $out->addWikiMsg( 'validationstatistics-pndtime', |
| 65 | + $lang->formatTimePeriod( $pt, 'avoidminutes' ) ); |
63 | 66 | # Show review time stats... |
64 | 67 | 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' ), |
68 | 71 | $reviewChart |
69 | 72 | ); |
70 | 73 | } |
71 | 74 | # Show per-namespace stats table... |
72 | | - $wgOut->addWikiMsg( 'validationstatistics-table' ); |
73 | | - $wgOut->addHTML( |
| 75 | + $out->addWikiMsg( 'validationstatistics-table' ); |
| 76 | + $out->addHTML( |
74 | 77 | Xml::openElement( 'table', array( 'class' => 'wikitable flaggedrevs_stats_table' ) ) |
75 | 78 | ); |
76 | | - $wgOut->addHTML( "<tr>\n" ); |
| 79 | + $out->addHTML( "<tr>\n" ); |
77 | 80 | // Headings (for a positive grep result): |
78 | 81 | // validationstatistics-ns, validationstatistics-total, validationstatistics-stable, |
79 | 82 | // validationstatistics-latest, validationstatistics-synced, validationstatistics-old |
80 | 83 | $msgs = array( 'ns', 'total', 'stable', 'latest', 'synced', 'old' ); // our headings |
81 | 84 | foreach ( $msgs as $msg ) { |
82 | | - $wgOut->addHTML( '<th>' . |
| 85 | + $out->addHTML( '<th>' . |
83 | 86 | wfMsgExt( "validationstatistics-$msg", 'parseinline' ) . '</th>' ); |
84 | 87 | } |
85 | | - $wgOut->addHTML( "</tr>\n" ); |
| 88 | + $out->addHTML( "</tr>\n" ); |
86 | 89 | $namespaces = FlaggedRevs::getReviewNamespaces(); |
87 | 90 | foreach ( $namespaces as $namespace ) { |
88 | 91 | $total = $this->getTotalPages( $namespace ); |
— | — | @@ -98,7 +101,7 @@ |
99 | 102 | ? '-' // devision by zero |
100 | 103 | : wfMsg( 'parentheses', |
101 | 104 | wfMsgExt( 'percent', array( 'escapenoentities' ), |
102 | | - $wgLang->formatnum( sprintf( '%4.2f', |
| 105 | + $lang->formatnum( sprintf( '%4.2f', |
103 | 106 | 100 * intval( $reviewed ) / intval( $total ) ) ) |
104 | 107 | ) |
105 | 108 | ); |
— | — | @@ -106,40 +109,40 @@ |
107 | 110 | ? '-' // devision by zero |
108 | 111 | : wfMsg( 'parentheses', |
109 | 112 | wfMsgExt( 'percent', array( 'escapenoentities' ), |
110 | | - $wgLang->formatnum( sprintf( '%4.2f', |
| 113 | + $lang->formatnum( sprintf( '%4.2f', |
111 | 114 | 100 * intval( $synced ) / intval( $total ) ) ) |
112 | 115 | ) |
113 | 116 | ); |
114 | 117 | $percSynced = intval( $reviewed ) == 0 |
115 | 118 | ? '-' // devision by zero |
116 | 119 | : wfMsgExt( 'percent', array( 'escapenoentities' ), |
117 | | - $wgLang->formatnum( sprintf( '%4.2f', |
| 120 | + $lang->formatnum( sprintf( '%4.2f', |
118 | 121 | 100 * intval( $synced ) / intval( $reviewed ) ) ) |
119 | 122 | ); |
120 | 123 | $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 |
122 | 125 | |
123 | | - $wgOut->addHTML( |
| 126 | + $out->addHTML( |
124 | 127 | "<tr align='center'> |
125 | 128 | <td>" . |
126 | 129 | htmlspecialchars( $NsText ) . |
127 | 130 | "</td> |
128 | 131 | <td>" . |
129 | | - htmlspecialchars( $wgLang->formatnum( $total ) ) . |
| 132 | + htmlspecialchars( $lang->formatnum( $total ) ) . |
130 | 133 | "</td> |
131 | 134 | <td>" . |
132 | | - htmlspecialchars( $wgLang->formatnum( $reviewed ) . |
| 135 | + htmlspecialchars( $lang->formatnum( $reviewed ) . |
133 | 136 | $wgContLang->getDirMark() ) . " <i>$percRev</i> |
134 | 137 | </td> |
135 | 138 | <td>" . |
136 | | - htmlspecialchars( $wgLang->formatnum( $synced ) . |
| 139 | + htmlspecialchars( $lang->formatnum( $synced ) . |
137 | 140 | $wgContLang->getDirMark() ) . " <i>$percLatest</i> |
138 | 141 | </td> |
139 | 142 | <td>" . |
140 | 143 | $percSynced . |
141 | 144 | "</td> |
142 | 145 | <td>" . |
143 | | - $this->skin->linkKnown( SpecialPage::getTitleFor( 'PendingChanges' ), |
| 146 | + Linker::linkKnown( SpecialPage::getTitleFor( 'PendingChanges' ), |
144 | 147 | htmlspecialchars( $outdated ), |
145 | 148 | array(), |
146 | 149 | array( 'namespace' => $namespace ) |
— | — | @@ -148,13 +151,13 @@ |
149 | 152 | </tr>" |
150 | 153 | ); |
151 | 154 | } |
152 | | - $wgOut->addHTML( Xml::closeElement( 'table' ) ); |
| 155 | + $out->addHTML( Xml::closeElement( 'table' ) ); |
153 | 156 | # Is there a top X user list? If so, then show it... |
154 | 157 | $data = $this->getTopReviewers(); |
155 | 158 | 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'] ) |
159 | 162 | ); |
160 | 163 | $css = 'wikitable flaggedrevs_stats_table'; |
161 | 164 | $reviewChart = "<table class='$css' style='white-space: nowrap;'>\n"; |
— | — | @@ -162,18 +165,20 @@ |
163 | 166 | '</th><th>' . wfMsgHtml( 'validationstatistics-reviews' ) . '</th></tr>'; |
164 | 167 | foreach ( $data as $userId => $reviews ) { |
165 | 168 | $reviewChart .= '<tr><td>' . htmlspecialchars( User::whois( $userId ) ) . |
166 | | - '</td><td>' . $wgLang->formatNum( $reviews ) . '</td></tr>'; |
| 169 | + '</td><td>' . $lang->formatNum( $reviews ) . '</td></tr>'; |
167 | 170 | } |
168 | 171 | $reviewChart .= "</table>\n"; |
169 | | - $wgOut->addHTML( $reviewChart ); |
| 172 | + $out->addHTML( $reviewChart ); |
170 | 173 | } |
171 | 174 | } |
172 | 175 | |
173 | 176 | protected function maybeUpdate() { |
174 | 177 | global $wgFlaggedRevsStatsAge; |
| 178 | + |
175 | 179 | if ( !$wgFlaggedRevsStatsAge ) { |
176 | 180 | return false; |
177 | 181 | } |
| 182 | + |
178 | 183 | $dbCache = wfGetCache( CACHE_DB ); |
179 | 184 | $key = wfMemcKey( 'flaggedrevs', 'statsUpdated' ); |
180 | 185 | $keySQL = wfMemcKey( 'flaggedrevs', 'statsUpdating' ); |
— | — | @@ -302,6 +307,7 @@ |
303 | 308 | } |
304 | 309 | // Save/cache users |
305 | 310 | $dbCache->set( $key, $data, 3600 ); |
| 311 | + |
306 | 312 | return $data; |
307 | 313 | } |
308 | 314 | } |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ProblemChanges_body.php |
— | — | @@ -9,18 +9,17 @@ |
10 | 10 | } |
11 | 11 | |
12 | 12 | public function execute( $par ) { |
13 | | - global $wgRequest, $wgUser; |
| 13 | + $request = $this->getRequest(); |
14 | 14 | |
15 | 15 | $this->setHeaders(); |
16 | | - $this->skin = $wgUser->getSkin(); |
17 | 16 | $this->currentUnixTS = wfTimestamp( TS_UNIX ); // now |
18 | 17 | |
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' ) ); |
22 | 21 | $catTitle = Title::newFromText( $category ); |
23 | 22 | $this->category = is_null( $catTitle ) ? '' : $catTitle->getText(); |
24 | | - $feedType = $wgRequest->getVal( 'feed' ); |
| 23 | + $feedType = $request->getVal( 'feed' ); |
25 | 24 | |
26 | 25 | $incLimit = 0; |
27 | 26 | if ( $this->including() ) { |
— | — | @@ -45,21 +44,22 @@ |
46 | 45 | } |
47 | 46 | |
48 | 47 | protected function setSyndicated() { |
49 | | - global $wgOut, $wgRequest; |
| 48 | + $request = $this->getRequest(); |
50 | 49 | $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' ), |
54 | 53 | ); |
55 | | - $wgOut->setSyndicated( true ); |
56 | | - $wgOut->setFeedAppendQuery( wfArrayToCGI( $queryParams ) ); |
| 54 | + $this->getOutput()->setSyndicated( true ); |
| 55 | + $this->getOutput()->setFeedAppendQuery( wfArrayToCGI( $queryParams ) ); |
57 | 56 | } |
58 | 57 | |
59 | 58 | public function showForm() { |
60 | | - global $wgOut, $wgScript, $wgLang; |
| 59 | + global $wgScript; |
| 60 | + |
61 | 61 | // 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() ) ); |
64 | 64 | |
65 | 65 | $form = Html::openElement( 'form', array( 'name' => 'problemchanges', |
66 | 66 | 'action' => $wgScript, 'method' => 'get' ) ) . "\n"; |
— | — | @@ -84,26 +84,26 @@ |
85 | 85 | $form .= '</fieldset>'; |
86 | 86 | $form .= Html::closeElement( 'form' ) . "\n"; |
87 | 87 | |
88 | | - $wgOut->addHTML( $form ); |
| 88 | + $this->getOutput()->addHTML( $form ); |
89 | 89 | } |
90 | 90 | |
91 | 91 | public function showPageList() { |
92 | | - global $wgOut; |
| 92 | + $out = $this->getOutput(); |
93 | 93 | // Viewing the page normally... |
94 | 94 | if ( !$this->including() ) { |
95 | 95 | 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() ); |
99 | 99 | } else { |
100 | | - $wgOut->addWikiMsg( 'problemchanges-none' ); |
| 100 | + $out->addWikiMsg( 'problemchanges-none' ); |
101 | 101 | } |
102 | 102 | // If this page is transcluded... |
103 | 103 | } else { |
104 | 104 | if ( $this->pager->getNumRows() ) { |
105 | | - $wgOut->addHTML( $this->pager->getBody() ); |
| 105 | + $out->addHTML( $this->pager->getBody() ); |
106 | 106 | } else { |
107 | | - $wgOut->addWikiMsg( 'problemchanges-none' ); |
| 107 | + $out->addWikiMsg( 'problemchanges-none' ); |
108 | 108 | } |
109 | 109 | } |
110 | 110 | } |
— | — | @@ -131,13 +131,14 @@ |
132 | 132 | * @param string $type |
133 | 133 | */ |
134 | 134 | protected function feed( $type ) { |
135 | | - global $wgFeed, $wgFeedClasses, $wgFeedLimit, $wgOut; |
| 135 | + global $wgFeed, $wgFeedClasses, $wgFeedLimit; |
| 136 | + |
136 | 137 | if ( !$wgFeed ) { |
137 | | - $wgOut->addWikiMsg( 'feed-unavailable' ); |
| 138 | + $this->getOutput()->addWikiMsg( 'feed-unavailable' ); |
138 | 139 | return; |
139 | 140 | } |
140 | 141 | if ( !isset( $wgFeedClasses[$type] ) ) { |
141 | | - $wgOut->addWikiMsg( 'feed-invalid' ); |
| 142 | + $this->getOutput()->addWikiMsg( 'feed-invalid' ); |
142 | 143 | return; |
143 | 144 | } |
144 | 145 | $feed = new $wgFeedClasses[$type]( |
— | — | @@ -158,6 +159,7 @@ |
159 | 160 | |
160 | 161 | protected function feedTitle() { |
161 | 162 | global $wgContLanguageCode, $wgSitename; |
| 163 | + |
162 | 164 | $page = SpecialPage::getPage( 'ProblemChanges' ); |
163 | 165 | $desc = $page->getDescription(); |
164 | 166 | return "$wgSitename - $desc [$wgContLanguageCode]"; |
— | — | @@ -184,12 +186,11 @@ |
185 | 187 | } |
186 | 188 | |
187 | 189 | public function formatRow( $row ) { |
188 | | - global $wgLang, $wgUser; |
189 | 190 | $css = $quality = $tags = $underReview = ''; |
190 | 191 | |
191 | 192 | $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, |
194 | 195 | wfMsg( 'pendingchanges-diff' ), |
195 | 196 | array(), |
196 | 197 | array( 'diff' => 'cur', 'oldid' => $row->stable ) + FlaggedRevs::diffOnlyCGI() |
— | — | @@ -208,10 +209,10 @@ |
209 | 210 | $tags = ' <b>' . wfMsgHtml( 'parentheses', $tags ) . '</b>'; |
210 | 211 | } |
211 | 212 | # Is anybody watching? |
212 | | - if ( !$this->including() && $wgUser->isAllowed( 'unreviewedpages' ) ) { |
| 213 | + if ( !$this->including() && $this->getUser()->isAllowed( 'unreviewedpages' ) ) { |
213 | 214 | $uw = FRUserActivity::numUsersWatchingPage( $title ); |
214 | 215 | $watching = $uw |
215 | | - ? wfMsgExt( 'pendingchanges-watched', 'parsemag', $wgLang->formatNum( $uw ) ) |
| 216 | + ? wfMsgExt( 'pendingchanges-watched', 'parsemag', $this->getLang()->formatNum( $uw ) ) |
216 | 217 | : wfMsgHtml( 'pendingchanges-unwatched' ); |
217 | 218 | $watching = " {$watching}"; |
218 | 219 | } else { |
— | — | @@ -226,12 +227,12 @@ |
227 | 228 | if ( $hours > ( 3 * 24 ) ) { |
228 | 229 | $days = round( $hours / 24, 0 ); |
229 | 230 | $age = wfMsgExt( 'pendingchanges-days', |
230 | | - 'parsemag', $wgLang->formatNum( $days ) ); |
| 231 | + 'parsemag', $this->getLang()->formatNum( $days ) ); |
231 | 232 | // If one or more hours, use hours |
232 | 233 | } elseif ( $hours >= 1 ) { |
233 | 234 | $hours = round( $hours, 0 ); |
234 | 235 | $age = wfMsgExt( 'pendingchanges-hours', |
235 | | - 'parsemag', $wgLang->formatNum( $hours ) ); |
| 236 | + 'parsemag', $this->getLang()->formatNum( $hours ) ); |
236 | 237 | } else { |
237 | 238 | $age = wfMsg( 'pendingchanges-recent' ); // hot off the press :) |
238 | 239 | } |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/ReviewedPages_body.php |
— | — | @@ -8,18 +8,17 @@ |
9 | 9 | } |
10 | 10 | |
11 | 11 | public function execute( $par ) { |
12 | | - global $wgRequest, $wgUser; |
| 12 | + $request = $this->getRequest(); |
13 | 13 | |
14 | 14 | $this->setHeaders(); |
15 | | - $this->skin = $wgUser->getSkin(); |
16 | 15 | |
17 | 16 | # Check if there is a featured level |
18 | 17 | $maxType = FlaggedRevs::pristineVersions() ? 2 : 1; |
19 | 18 | |
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 ); |
22 | 21 | $this->type = min( $this->type, $maxType ); |
23 | | - $this->hideRedirs = $wgRequest->getBool( 'hideredirs', true ); |
| 22 | + $this->hideRedirs = $request->getBool( 'hideredirs', true ); |
24 | 23 | |
25 | 24 | $this->pager = new ReviewedPagesPager( |
26 | 25 | $this, array(), $this->type, $this->namespace, $this->hideRedirs ); |
— | — | @@ -29,12 +28,12 @@ |
30 | 29 | } |
31 | 30 | |
32 | 31 | public function showForm() { |
33 | | - global $wgOut, $wgScript, $wgLang; |
| 32 | + global $wgScript; |
34 | 33 | |
35 | 34 | // Text to explain level select (if there are several levels) |
36 | 35 | 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() ) ); |
39 | 38 | } |
40 | 39 | $form = Html::openElement( 'form', |
41 | 40 | array( 'name' => 'reviewedpages', 'action' => $wgScript, 'method' => 'get' ) ); |
— | — | @@ -43,7 +42,7 @@ |
44 | 43 | // show/hide links |
45 | 44 | $showhide = array( wfMsgHtml( 'show' ), wfMsgHtml( 'hide' ) ); |
46 | 45 | $onoff = 1 - $this->hideRedirs; |
47 | | - $link = $this->skin->link( $this->getTitle(), $showhide[$onoff], array(), |
| 46 | + $link = Linker::link( $this->getTitle(), $showhide[$onoff], array(), |
48 | 47 | array( 'hideredirs' => $onoff, 'namespace' => $this->namespace ) |
49 | 48 | ); |
50 | 49 | $showhideredirs = wfMsgHtml( 'whatlinkshere-hideredirs', $link ); |
— | — | @@ -66,26 +65,25 @@ |
67 | 66 | $form .= "</fieldset>"; |
68 | 67 | $form .= Html::closeElement( 'form ' ) . "\n"; |
69 | 68 | |
70 | | - $wgOut->addHTML( $form ); |
| 69 | + $this->getOutput()->addHTML( $form ); |
71 | 70 | } |
72 | 71 | |
73 | 72 | protected function showPageList() { |
74 | | - global $wgOut; |
| 73 | + $out = $this->getOutput(); |
75 | 74 | $num = $this->pager->getNumRows(); |
76 | 75 | 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() ); |
80 | 79 | } else { |
81 | | - $wgOut->addHTML( wfMsgExt( 'reviewedpages-none', array( 'parse' ) ) ); |
| 80 | + $out->addHTML( wfMsgExt( 'reviewedpages-none', array( 'parse' ) ) ); |
82 | 81 | } |
83 | 82 | } |
84 | 83 | |
85 | 84 | public function formatRow( $row ) { |
86 | | - global $wgLang; |
87 | 85 | $title = Title::newFromRow( $row ); |
88 | 86 | # Link to page |
89 | | - $link = $this->skin->link( $title ); |
| 87 | + $link = Linker::link( $title ); |
90 | 88 | # Direction mark |
91 | 89 | $dirmark = wfUILang()->getDirMark(); |
92 | 90 | # Size (bytes) |
— | — | @@ -95,12 +93,12 @@ |
96 | 94 | $stxt = ' <small>' . wfMsgHtml( 'historyempty' ) . '</small>'; |
97 | 95 | } else { |
98 | 96 | $stxt = ' <small>' . |
99 | | - wfMsgExt( 'historysize', 'parsemag', $wgLang->formatNum( $size ) ) . |
| 97 | + wfMsgExt( 'historysize', 'parsemag', $this->getLang()->formatNum( $size ) ) . |
100 | 98 | '</small>'; |
101 | 99 | } |
102 | 100 | } |
103 | 101 | # Link to list of reviewed versions for page |
104 | | - $list = $this->skin->linkKnown( |
| 102 | + $list = Linker::linkKnown( |
105 | 103 | SpecialPage::getTitleFor( 'ReviewedVersions' ), |
106 | 104 | wfMsgHtml( 'reviewedpages-all' ), |
107 | 105 | array(), |
— | — | @@ -109,7 +107,7 @@ |
110 | 108 | # Link to highest tier rev |
111 | 109 | $best = ''; |
112 | 110 | if ( FlaggedRevs::qualityVersions() ) { |
113 | | - $best = $this->skin->linkKnown( |
| 111 | + $best = Linker::linkKnown( |
114 | 112 | $title, |
115 | 113 | wfMsgHtml( 'reviewedpages-best' ), |
116 | 114 | array(), |
Index: trunk/extensions/FlaggedRevs/frontend/specialpages/reports/StablePages_body.php |
— | — | @@ -1,6 +1,6 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | | -// Assumes $wgFlaggedRevsProtection is on |
| 4 | + Assumes $wgFlaggedRevsProtection is on |
5 | 5 | class StablePages extends SpecialPage { |
6 | 6 | protected $pager = null; |
7 | 7 | |
— | — | @@ -9,14 +9,13 @@ |
10 | 10 | } |
11 | 11 | |
12 | 12 | public function execute( $par ) { |
13 | | - global $wgRequest, $wgUser; |
| 13 | + $request = $this->getRequest(); |
14 | 14 | |
15 | 15 | $this->setHeaders(); |
16 | | - $this->skin = $wgUser->getSkin(); |
17 | 16 | |
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 ); |
21 | 20 | |
22 | 21 | $this->pager = new StablePagesPager( $this, array(), |
23 | 22 | $this->namespace, $this->autoreview, $this->indef ); |
— | — | @@ -26,15 +25,17 @@ |
27 | 26 | } |
28 | 27 | |
29 | 28 | 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 | + |
33 | 34 | $fields = array(); |
34 | | - # Namespace selector |
| 35 | + Namespace selector |
35 | 36 | if ( count( FlaggedRevs::getReviewNamespaces() ) > 1 ) { |
36 | 37 | $fields[] = FlaggedRevsXML::getNamespaceMenu( $this->namespace, '' ); |
37 | 38 | } |
38 | | - # Restriction level selector |
| 39 | + Restriction level selector |
39 | 40 | if ( FlaggedRevs::getRestrictionLevels() ) { |
40 | 41 | $fields[] = FlaggedRevsXML::getRestrictionFilterMenu( $this->autoreview ); |
41 | 42 | } |
— | — | @@ -50,58 +51,57 @@ |
51 | 52 | $form .= "</fieldset>\n"; |
52 | 53 | $form .= Html::closeElement( 'form' ) . "\n"; |
53 | 54 | |
54 | | - $wgOut->addHTML( $form ); |
| 55 | + $this->getOutput()->addHTML( $form ); |
55 | 56 | } |
56 | 57 | |
57 | 58 | protected function showPageList() { |
58 | | - global $wgOut; |
| 59 | + $out = $this->getOutput(); |
59 | 60 | 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() ); |
63 | 64 | } else { |
64 | | - $wgOut->addWikiMsg( 'stablepages-none' ); |
| 65 | + $out->addWikiMsg( 'stablepages-none' ); |
65 | 66 | } |
66 | | - # Purge expired entries on one in every 10 queries |
| 67 | + Purge expired entries on one in every 10 queries |
67 | 68 | if ( !mt_rand( 0, 10 ) ) { |
68 | 69 | FRPageConfig::purgeExpiredConfigurations(); |
69 | 70 | } |
70 | 71 | } |
71 | 72 | |
72 | 73 | public function formatRow( $row ) { |
73 | | - global $wgLang; |
74 | 74 | $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 |
78 | 78 | $utilLinks = array(); |
79 | | - $utilLinks[] = $this->skin->link( $title, |
| 79 | + $utilLinks[] = Linker::link( $title, |
80 | 80 | wfMsgHtml( 'stablepages-config' ), |
81 | 81 | array(), array( 'action' => 'protect' ), 'known' ); |
82 | | - $utilLinks[] = $this->skin->link( $title, |
| 82 | + $utilLinks[] = Linker::link( $title, |
83 | 83 | wfMsgHtml( 'history' ), |
84 | 84 | array(), array( 'action' => 'history' ), 'known' ); |
85 | | - $utilLinks[] = $this->skin->link( SpecialPage::getTitleFor( 'Log', 'stable' ), |
| 85 | + $utilLinks[] = Linker::link( SpecialPage::getTitleFor( 'Log', 'stable' ), |
86 | 86 | wfMsgHtml( 'stable-logpage' ), |
87 | 87 | array(), array( 'page' => $title->getPrefixedText() ), 'known' ); |
88 | | - # Autoreview/review restriction level |
| 88 | + Autoreview/review restriction level |
89 | 89 | $restr = ''; |
90 | 90 | if ( $row->fpc_level != '' ) { |
91 | 91 | $restr = 'autoreview=' . htmlspecialchars( $row->fpc_level ); |
92 | 92 | $restr = "[$restr]"; |
93 | 93 | } |
94 | | - # When these configuration settings expire |
| 94 | + When these configuration settings expire |
95 | 95 | if ( $row->fpc_expiry != 'infinity' && strlen( $row->fpc_expiry ) ) { |
96 | 96 | $expiry_description = " (" . wfMsgForContent( |
97 | 97 | '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 ) |
101 | 101 | ) . ")"; |
102 | 102 | } else { |
103 | 103 | $expiry_description = ""; |
104 | 104 | } |
105 | | - $utilLinks = $wgLang->pipeList( $utilLinks ); |
| 105 | + $utilLinks = $this->getLang()->pipeList( $utilLinks ); |
106 | 106 | return "<li>{$link} ({$utilLinks}) {$restr}<i>{$expiry_description}</i></li>"; |
107 | 107 | } |
108 | 108 | } |
— | — | @@ -112,13 +112,13 @@ |
113 | 113 | class StablePagesPager extends AlphabeticPager { |
114 | 114 | public $mForm, $mConds, $namespace, $override; |
115 | 115 | |
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) |
118 | 118 | function __construct( $form, $conds = array(), $namespace, $autoreview, $indef ) { |
119 | 119 | $this->mForm = $form; |
120 | 120 | $this->mConds = $conds; |
121 | 121 | $this->indef = $indef; |
122 | | - # Must be content pages... |
| 122 | + Must be content pages... |
123 | 123 | $validNS = FlaggedRevs::getReviewNamespaces(); |
124 | 124 | if ( is_integer( $namespace ) ) { |
125 | 125 | if ( !in_array( $namespace, $validNS ) ) { |
— | — | @@ -149,7 +149,7 @@ |
150 | 150 | $conds['fpc_level'] = $this->autoreview; |
151 | 151 | } |
152 | 152 | $conds['page_namespace'] = $this->namespace; |
153 | | - # Be sure not to include expired items |
| 153 | + Be sure not to include expired items |
154 | 154 | if( $this->indef ) { |
155 | 155 | $conds['fpc_expiry'] = Block::infinity(); |
156 | 156 | } else { |