Index: trunk/extensions/AbuseFilter/special/SpecialAbuseLog.php |
— | — | @@ -111,6 +111,10 @@ |
112 | 112 | $this->getOutput()->addHTML( $output ); |
113 | 113 | } |
114 | 114 | |
| 115 | + /** |
| 116 | + * @param $id |
| 117 | + * @return mixed |
| 118 | + */ |
115 | 119 | function showHideForm( $id ) { |
116 | 120 | if ( !$this->getUser()->isAllowed( 'abusefilter-hide-log' ) ) { |
117 | 121 | $this->getOutput()->addWikiMsg( 'abusefilter-log-hide-forbidden' ); |
— | — | @@ -157,6 +161,10 @@ |
158 | 162 | $form->show(); |
159 | 163 | } |
160 | 164 | |
| 165 | + /** |
| 166 | + * @param $fields |
| 167 | + * @return bool |
| 168 | + */ |
161 | 169 | function saveHideForm( $fields ) { |
162 | 170 | $logid = $this->getRequest()->getVal( 'hide' ); |
163 | 171 | |
— | — | @@ -223,6 +231,10 @@ |
224 | 232 | } |
225 | 233 | } |
226 | 234 | |
| 235 | + /** |
| 236 | + * @param $id |
| 237 | + * @return mixed |
| 238 | + */ |
227 | 239 | function showDetails( $id ) { |
228 | 240 | $out = $this->getOutput(); |
229 | 241 | |
— | — | @@ -252,7 +264,7 @@ |
253 | 265 | return; |
254 | 266 | } |
255 | 267 | |
256 | | - if ( $this->isHidden($row) && !self::canSeeHidden() ) { |
| 268 | + if ( $this->isHidden( $row ) && !self::canSeeHidden() ) { |
257 | 269 | $out->addWikiMsg( 'abusefilter-log-details-hidden' ); |
258 | 270 | return; |
259 | 271 | } |
— | — | @@ -333,6 +345,8 @@ |
334 | 346 | } |
335 | 347 | |
336 | 348 | /** |
| 349 | + * @param $filter_id null |
| 350 | + * @param $filter_hidden null |
337 | 351 | * @return bool |
338 | 352 | */ |
339 | 353 | static function canSeeDetails( $filter_id = null, $filter_hidden = null ) { |
— | — | @@ -366,9 +380,13 @@ |
367 | 381 | return $wgUser->isAllowed( 'abusefilter-hidden-log' ); |
368 | 382 | } |
369 | 383 | |
| 384 | + /** |
| 385 | + * @param $row |
| 386 | + * @param $li bool |
| 387 | + * @return String |
| 388 | + */ |
370 | 389 | function formatRow( $row, $li = true ) { |
371 | 390 | $user = $this->getUser(); |
372 | | - $sk = $this->getSkin(); |
373 | 391 | $lang = $this->getLanguage(); |
374 | 392 | |
375 | 393 | $actionLinks = array(); |
— | — | @@ -382,9 +400,9 @@ |
383 | 401 | } |
384 | 402 | |
385 | 403 | if ( !$row->afl_wiki ) { |
386 | | - $pageLink = $sk->link( $title ); |
| 404 | + $pageLink = Linker::link( $title ); |
387 | 405 | if ( $row->afl_rev_id ) { |
388 | | - $diffLink = $sk->link( $title, |
| 406 | + $diffLink = Linker::link( $title, |
389 | 407 | wfMessage('abusefilter-log-diff')->parse(), array(), |
390 | 408 | array( 'diff' => 'prev', 'oldid' => $row->afl_rev_id ) ); |
391 | 409 | } |
— | — | @@ -403,8 +421,8 @@ |
404 | 422 | |
405 | 423 | if ( !$row->afl_wiki ) { |
406 | 424 | // Local user |
407 | | - $userLink = $sk->userLink( $row->afl_user, $row->afl_user_text ) . |
408 | | - $sk->userToolLinks( $row->afl_user, $row->afl_user_text ); |
| 425 | + $userLink = Linker::userLink( $row->afl_user, $row->afl_user_text ) . |
| 426 | + Linker::userToolLinks( $row->afl_user, $row->afl_user_text ); |
409 | 427 | } else { |
410 | 428 | $userLink = WikiMap::foreignUserLink( $row->afl_wiki, $row->afl_user_text ); |
411 | 429 | $userLink .= ' (' . WikiMap::getWikiName( $row->afl_wiki ) . ')'; |
— | — | @@ -440,11 +458,11 @@ |
441 | 459 | |
442 | 460 | if ( self::canSeeDetails( $row->afl_filter, $filter_hidden ) ) { |
443 | 461 | $examineTitle = SpecialPage::getTitleFor( 'AbuseFilter', 'examine/log/' . $row->afl_id ); |
444 | | - $detailsLink = $sk->makeKnownLinkObj( |
| 462 | + $detailsLink = Linker::makeKnownLinkObj( |
445 | 463 | $this->getTitle($row->afl_id), |
446 | 464 | wfMsg( 'abusefilter-log-detailslink' ) |
447 | 465 | ); |
448 | | - $examineLink = $sk->link( |
| 466 | + $examineLink = Linker::link( |
449 | 467 | $examineTitle, |
450 | 468 | wfMsgExt( 'abusefilter-changeslist-examine', 'parseinline' ), |
451 | 469 | array() |
— | — | @@ -457,7 +475,7 @@ |
458 | 476 | $actionLinks[] = $diffLink; |
459 | 477 | |
460 | 478 | if ( $user->isAllowed( 'abusefilter-hide-log' ) ) { |
461 | | - $hideLink = $sk->link( |
| 479 | + $hideLink = Linker::link( |
462 | 480 | $this->getTitle(), |
463 | 481 | wfMsg( 'abusefilter-log-hidelink' ), |
464 | 482 | array(), |
— | — | @@ -474,11 +492,11 @@ |
475 | 493 | 'Special:AbuseFilter/' . $globalIndex ); |
476 | 494 | |
477 | 495 | $linkText = wfMessage( 'abusefilter-log-detailedentry-global' )->numParams( $globalIndex )->escaped(); |
478 | | - $filterLink = $sk->makeExternalLink( $globalURL, $linkText ); |
| 496 | + $filterLink = Linker::makeExternalLink( $globalURL, $linkText ); |
479 | 497 | } else { |
480 | 498 | $title = SpecialPage::getTitleFor( 'AbuseFilter', $row->afl_filter ); |
481 | 499 | $linkText = wfMessage( 'abusefilter-log-detailedentry-local' )->numParams( $row->afl_filter )->escaped(); |
482 | | - $filterLink = $sk->link( $title, $linkText ); |
| 500 | + $filterLink = Linker::link( $title, $linkText ); |
483 | 501 | } |
484 | 502 | $description = wfMsgExt( 'abusefilter-log-detailedentry-meta', |
485 | 503 | array( 'parseinline', 'replaceafter' ), |
— | — | @@ -501,7 +519,7 @@ |
502 | 520 | $timestamp, |
503 | 521 | $userLink, |
504 | 522 | $row->afl_action, |
505 | | - $sk->link( $title ), |
| 523 | + Linker::link( $title ), |
506 | 524 | $actions_taken, |
507 | 525 | $parsed_comments |
508 | 526 | ) |
— | — | @@ -537,7 +555,7 @@ |
538 | 556 | /** |
539 | 557 | * Given a log entry row, decides whether or not it can be viewed by the public. |
540 | 558 | * |
541 | | - * @param $row The abuse_filter_log row object. |
| 559 | + * @param $row object The abuse_filter_log row object. |
542 | 560 | * |
543 | 561 | * @return Mixed true if the item is explicitly hidden, false if it is not. |
544 | 562 | * The string 'implicit' if it is hidden because the corresponding revision is hidden. |
— | — | @@ -566,6 +584,11 @@ |
567 | 585 | */ |
568 | 586 | public $mConds; |
569 | 587 | |
| 588 | + /** |
| 589 | + * @param $form |
| 590 | + * @param array $conds |
| 591 | + * @param bool $details |
| 592 | + */ |
570 | 593 | function __construct( $form, $conds = array(), $details = false ) { |
571 | 594 | $this->mForm = $form; |
572 | 595 | $this->mConds = $conds; |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewDiff.php |
— | — | @@ -94,7 +94,7 @@ |
95 | 95 | 'history/' . $this->mFilter . '/item/' . $other['meta']['history_id'] ); |
96 | 96 | global $wgOut; |
97 | 97 | $wgOut->redirect( $t->getFullURL() ); |
98 | | - return; |
| 98 | + return null; |
99 | 99 | } |
100 | 100 | |
101 | 101 | } elseif ( $spec == 'next' && !in_array( $otherSpec, $dependentSpecs ) ) { |
— | — | @@ -117,7 +117,7 @@ |
118 | 118 | 'history/' . $this->mFilter . '/item/' . $other['meta']['history_id'] ); |
119 | 119 | global $wgOut; |
120 | 120 | $wgOut->redirect( $t->getFullURL() ); |
121 | | - return; |
| 121 | + return null; |
122 | 122 | } |
123 | 123 | } |
124 | 124 | |
— | — | @@ -148,6 +148,11 @@ |
149 | 149 | ); |
150 | 150 | } |
151 | 151 | |
| 152 | + /** |
| 153 | + * @param $timestamp |
| 154 | + * @param $history_id |
| 155 | + * @return string |
| 156 | + */ |
152 | 157 | function formatVersionLink( $timestamp, $history_id ) { |
153 | 158 | $filter = $this->mFilter; |
154 | 159 | $text = $this->getLanguage()->timeanddate( $timestamp, true ); |
— | — | @@ -158,6 +163,9 @@ |
159 | 164 | return $link; |
160 | 165 | } |
161 | 166 | |
| 167 | + /** |
| 168 | + * @return string |
| 169 | + */ |
162 | 170 | function formatDiff() { |
163 | 171 | $oldVersion = $this->mOldVersion; |
164 | 172 | $newVersion = $this->mNewVersion; |
— | — | @@ -249,6 +257,10 @@ |
250 | 258 | return $html; |
251 | 259 | } |
252 | 260 | |
| 261 | + /** |
| 262 | + * @param $actions |
| 263 | + * @return array |
| 264 | + */ |
253 | 265 | function stringifyActions( $actions ) { |
254 | 266 | $lines = array(); |
255 | 267 | |
— | — | @@ -264,6 +276,10 @@ |
265 | 277 | return $lines; |
266 | 278 | } |
267 | 279 | |
| 280 | + /** |
| 281 | + * @param $msg |
| 282 | + * @return String |
| 283 | + */ |
268 | 284 | function getHeaderRow( $msg ) { |
269 | 285 | $html = wfMsgExt( $msg, 'parseinline' ); |
270 | 286 | $html = Xml::tags( 'th', array( 'colspan' => 3 ), $html ); |
— | — | @@ -272,6 +288,13 @@ |
273 | 289 | return $html; |
274 | 290 | } |
275 | 291 | |
| 292 | + /** |
| 293 | + * @param $msg |
| 294 | + * @param $old |
| 295 | + * @param $new |
| 296 | + * @param string $format |
| 297 | + * @return string |
| 298 | + */ |
276 | 299 | function getSimpleRow( $msg, $old, $new, $format = 'wikitext' ) { |
277 | 300 | $row = ''; |
278 | 301 | |
— | — | @@ -300,6 +323,12 @@ |
301 | 324 | return Xml::tags( 'tr', null, $row ) . "\n"; |
302 | 325 | } |
303 | 326 | |
| 327 | + /** |
| 328 | + * @param $msg |
| 329 | + * @param $old |
| 330 | + * @param $new |
| 331 | + * @return string |
| 332 | + */ |
304 | 333 | function getMultiLineRow( $msg, $old, $new ) { |
305 | 334 | if ( !is_array( $old ) ) { |
306 | 335 | $old = explode( "\n", preg_replace( "/\\\r\\\n?/", "\n", $old ) ); |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterView.php |
— | — | @@ -53,6 +53,12 @@ |
54 | 54 | } |
55 | 55 | |
56 | 56 | class AbuseFilterChangesList extends OldChangesList { |
| 57 | + |
| 58 | + /** |
| 59 | + * @param $s |
| 60 | + * @param $rc |
| 61 | + * @param $classes array |
| 62 | + */ |
57 | 63 | public function insertExtra( &$s, &$rc, &$classes ) { |
58 | 64 | $examineParams = empty( $rc->examineParams ) ? array() : $rc->examineParams; |
59 | 65 | |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewHistory.php |
— | — | @@ -118,7 +118,6 @@ |
119 | 119 | } |
120 | 120 | |
121 | 121 | function formatValue( $name, $value ) { |
122 | | - $sk = $this->getSkin(); |
123 | 122 | $lang = $this->getLanguage(); |
124 | 123 | |
125 | 124 | $row = $this->mCurrentRow; |
— | — | @@ -130,12 +129,12 @@ |
131 | 130 | case 'afh_timestamp': |
132 | 131 | $title = SpecialPage::getTitleFor( 'AbuseFilter', |
133 | 132 | 'history/' . $row->afh_filter . '/item/' . $row->afh_id ); |
134 | | - $formatted = $sk->link( $title, $lang->timeanddate( $row->afh_timestamp, true ) ); |
| 133 | + $formatted = Linker::link( $title, $lang->timeanddate( $row->afh_timestamp, true ) ); |
135 | 134 | break; |
136 | 135 | case 'afh_user_text': |
137 | 136 | $formatted = |
138 | | - $sk->userLink( $row->afh_user, $row->afh_user_text ) . ' ' . |
139 | | - $sk->userToolLinks( $row->afh_user, $row->afh_user_text ); |
| 137 | + Linker::userLink( $row->afh_user, $row->afh_user_text ) . ' ' . |
| 138 | + Linker::userToolLinks( $row->afh_user, $row->afh_user_text ); |
140 | 139 | break; |
141 | 140 | case 'afh_public_comments': |
142 | 141 | $formatted = $this->getOutput()->parse( $value ); |
— | — | @@ -158,12 +157,12 @@ |
159 | 158 | break; |
160 | 159 | case 'afh_filter': |
161 | 160 | $title = $this->mPage->getTitle( strval( $value ) ); |
162 | | - $formatted = $sk->link( $title, $value ); |
| 161 | + $formatted = Linker::link( $title, $value ); |
163 | 162 | break; |
164 | 163 | case 'afh_id': |
165 | 164 | $title = $this->mPage->getTitle( |
166 | 165 | 'history/' . $row->afh_filter . "/diff/prev/$value" ); |
167 | | - $formatted = $sk->link( $title, wfMsgExt( 'abusefilter-history-diff', 'parseinline' ) ); |
| 166 | + $formatted = Linker::link( $title, wfMsgExt( 'abusefilter-history-diff', 'parseinline' ) ); |
168 | 167 | break; |
169 | 168 | default: |
170 | 169 | $formatted = "Unable to format $name"; |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewEdit.php |
— | — | @@ -240,6 +240,12 @@ |
241 | 241 | } |
242 | 242 | } |
243 | 243 | |
| 244 | + /** |
| 245 | + * @param $error |
| 246 | + * @param $filter |
| 247 | + * @param $history_id null |
| 248 | + * @return bool|String |
| 249 | + */ |
244 | 250 | function buildFilterEditor( $error, $filter, $history_id = null ) { |
245 | 251 | if ( $filter === null ) { |
246 | 252 | return false; |
— | — | @@ -249,14 +255,13 @@ |
250 | 256 | $out = $this->getOutput(); |
251 | 257 | $lang = $this->getLanguage(); |
252 | 258 | $user = $this->getUser(); |
253 | | - $sk = $this->getSkin(); |
254 | 259 | |
255 | 260 | // Load from request OR database. |
256 | 261 | list( $row, $actions ) = $this->loadRequest( $filter, $history_id ); |
257 | 262 | |
258 | 263 | if ( !$row ) { |
259 | 264 | $out->addWikiMsg( 'abusefilter-edit-badfilter' ); |
260 | | - $out->addHTML( $sk->link( $this->getTitle(), wfMsg( 'abusefilter-return' ) ) ); |
| 265 | + $out->addHTML( Linker::link( $this->getTitle(), wfMsg( 'abusefilter-return' ) ) ); |
261 | 266 | return; |
262 | 267 | } |
263 | 268 | |
— | — | @@ -301,7 +306,7 @@ |
302 | 307 | $count_display = wfMsgExt( 'abusefilter-hitcount', array( 'parseinline' ), |
303 | 308 | $lang->formatNum( $count ) |
304 | 309 | ); |
305 | | - $hitCount = $sk->makeKnownLinkObj( |
| 310 | + $hitCount = Linker::makeKnownLinkObj( |
306 | 311 | SpecialPage::getTitleFor( 'AbuseLog' ), |
307 | 312 | $count_display, |
308 | 313 | 'wpSearchFilter=' . $row->af_id |
— | — | @@ -387,7 +392,7 @@ |
388 | 393 | if ( $filter != 'new' && $user->isAllowed( 'abusefilter-revert' ) ) { |
389 | 394 | $tools .= Xml::tags( |
390 | 395 | 'p', null, |
391 | | - $sk->link( |
| 396 | + Linker::link( |
392 | 397 | $this->getTitle( 'revert/' . $filter ), |
393 | 398 | wfMsg( 'abusefilter-edit-revert' ) |
394 | 399 | ) |
— | — | @@ -398,15 +403,15 @@ |
399 | 404 | // Test link |
400 | 405 | $tools .= Xml::tags( |
401 | 406 | 'p', null, |
402 | | - $sk->link( |
| 407 | + Linker::link( |
403 | 408 | $this->getTitle( "test/$filter" ), |
404 | 409 | wfMsgExt( 'abusefilter-edit-test-link', 'parseinline' ) |
405 | 410 | ) |
406 | 411 | ); |
407 | 412 | // Last modification details |
408 | 413 | $userLink = |
409 | | - $sk->userLink( $row->af_user, $row->af_user_text ) . |
410 | | - $sk->userToolLinks( $row->af_user, $row->af_user_text ); |
| 414 | + Linker::userLink( $row->af_user, $row->af_user_text ) . |
| 415 | + Linker::userToolLinks( $row->af_user, $row->af_user_text ); |
411 | 416 | $userName = $row->af_user_text; |
412 | 417 | $fields['abusefilter-edit-lastmod'] = |
413 | 418 | wfMsgExt( |
— | — | @@ -421,7 +426,7 @@ |
422 | 427 | ); |
423 | 428 | $history_display = wfMsgExt( 'abusefilter-edit-viewhistory', array( 'parseinline' ) ); |
424 | 429 | $fields['abusefilter-edit-history'] = |
425 | | - $sk->makeKnownLinkObj( $this->getTitle( 'history/' . $filter ), $history_display ); |
| 430 | + Linker::makeKnownLinkObj( $this->getTitle( 'history/' . $filter ), $history_display ); |
426 | 431 | } |
427 | 432 | |
428 | 433 | // Add export |
— | — | @@ -463,6 +468,11 @@ |
464 | 469 | return $output; |
465 | 470 | } |
466 | 471 | |
| 472 | + /** |
| 473 | + * @param $row |
| 474 | + * @param $actions |
| 475 | + * @return string |
| 476 | + */ |
467 | 477 | function buildConsequenceEditor( $row, $actions ) { |
468 | 478 | global $wgAbuseFilterAvailableActions; |
469 | 479 | |
— | — | @@ -481,6 +491,12 @@ |
482 | 492 | return $output; |
483 | 493 | } |
484 | 494 | |
| 495 | + /** |
| 496 | + * @param $action |
| 497 | + * @param $set |
| 498 | + * @param $parameters |
| 499 | + * @return string |
| 500 | + */ |
485 | 501 | function buildConsequenceSelector( $action, $set, $parameters ) { |
486 | 502 | global $wgAbuseFilterAvailableActions; |
487 | 503 | |
— | — | @@ -641,6 +657,10 @@ |
642 | 658 | } |
643 | 659 | } |
644 | 660 | |
| 661 | + /** |
| 662 | + * @param $warnMsg |
| 663 | + * @return string |
| 664 | + */ |
645 | 665 | function getExistingSelector( $warnMsg ) { |
646 | 666 | $existingSelector = new XmlSelect( |
647 | 667 | 'wpFilterWarnMessage', |
— | — | @@ -678,6 +698,10 @@ |
679 | 699 | return $existingSelector->getHTML(); |
680 | 700 | } |
681 | 701 | |
| 702 | + /** |
| 703 | + * @param $id |
| 704 | + * @return array|null |
| 705 | + */ |
682 | 706 | function loadFilterData( $id ) { |
683 | 707 | if ( $id == 'new' ) { |
684 | 708 | $obj = new stdClass; |
— | — | @@ -737,6 +761,11 @@ |
738 | 762 | return array( $row, $actions ); |
739 | 763 | } |
740 | 764 | |
| 765 | + /** |
| 766 | + * @param $filter |
| 767 | + * @param null $history_id |
| 768 | + * @return array|null |
| 769 | + */ |
741 | 770 | function loadRequest( $filter, $history_id = null ) { |
742 | 771 | static $row = null; |
743 | 772 | static $actions = null; |
— | — | @@ -837,6 +866,10 @@ |
838 | 867 | return array( $row, $actions ); |
839 | 868 | } |
840 | 869 | |
| 870 | + /** |
| 871 | + * @param $id |
| 872 | + * @return array |
| 873 | + */ |
841 | 874 | function loadHistoryItem( $id ) { |
842 | 875 | $dbr = wfGetDB( DB_SLAVE ); |
843 | 876 | |
Index: trunk/extensions/AbuseFilter/Views/AbuseFilterViewRevert.php |
— | — | @@ -9,7 +9,6 @@ |
10 | 10 | |
11 | 11 | $user = $this->getUser(); |
12 | 12 | $out = $this->getOutput(); |
13 | | - $sk = $this->getSkin(); |
14 | 13 | |
15 | 14 | if ( !$user->isAllowed( 'abusefilter-revert' ) ) { |
16 | 15 | throw new PermissionsError( 'abusefilter-revert' ); |
— | — | @@ -67,11 +66,11 @@ |
68 | 67 | array( 'parseinline', 'replaceafter' ), |
69 | 68 | array( |
70 | 69 | $lang->timeanddate( $result['timestamp'], true ), |
71 | | - $sk->userLink( $result['userid'], $result['user'] ), |
| 70 | + Linker::userLink( $result['userid'], $result['user'] ), |
72 | 71 | $result['action'], |
73 | | - $sk->link( $result['title'] ), |
| 72 | + Linker::link( $result['title'] ), |
74 | 73 | $lang->commaList( $displayActions ), |
75 | | - $sk->link( |
| 74 | + Linker::link( |
76 | 75 | SpecialPage::getTitleFor( 'AbuseLog' ), |
77 | 76 | wfMsgNoTrans( 'abusefilter-log-detailslink' ), |
78 | 77 | array(), |
— | — | @@ -90,7 +89,7 @@ |
91 | 90 | Html::hidden( 'title', $this->getTitle( "revert/$filter" )->getPrefixedText() ) . |
92 | 91 | Html::hidden( 'wpPeriodStart', $this->origPeriodStart ) . |
93 | 92 | Html::hidden( 'wpPeriodEnd', $this->origPeriodEnd ) . |
94 | | - Html::inputLabel( |
| 93 | + Xml::inputLabel( |
95 | 94 | wfMsg( 'abusefilter-revert-reasonfield' ), |
96 | 95 | 'wpReason', 'wpReason', 45 |
97 | 96 | ) . |
Index: trunk/extensions/AbuseFilter/AbuseFilter.class.php |
— | — | @@ -990,7 +990,7 @@ |
991 | 991 | * |
992 | 992 | * @param $stored_dump |
993 | 993 | * |
994 | | - * @return object |
| 994 | + * @return object|AbuseFilterVariableHolder |
995 | 995 | */ |
996 | 996 | public static function loadVarDump( $stored_dump ) { |
997 | 997 | wfProfileIn( __METHOD__ ); |