mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 22:15:26 +00:00
f9c9c07ccf
* Add searching and filtering functionality to the existing 'test' interface. * Add an 'examine' interface designed for testing filters against a previous change, selectable through the search interface in either the 'test' or the 'examine' view. * Minor enabling change in ChangesList core, to allow subclassing.
40 lines
890 B
PHP
40 lines
890 B
PHP
<?php
|
|
|
|
if (!defined( 'MEDIAWIKI' ))
|
|
die();
|
|
|
|
abstract class AbuseFilterView {
|
|
function __construct( $page, $params ) {
|
|
$this->mPage = $page;
|
|
$this->mParams = $params;
|
|
}
|
|
|
|
function getTitle( $subpage='' ) {
|
|
return $this->mPage->getTitle( $subpage );
|
|
}
|
|
|
|
abstract function show();
|
|
|
|
function canEdit() {
|
|
global $wgUser;
|
|
static $canEdit = 'unset';
|
|
|
|
if ($canEdit == 'unset') {
|
|
$canEdit = $wgUser->isAllowed( 'abusefilter-modify' );
|
|
}
|
|
|
|
return $canEdit;
|
|
}
|
|
}
|
|
|
|
class AbuseFilterChangesList extends OldChangesList {
|
|
protected function insertExtra( &$s, &$rc, &$classes ) {
|
|
## Empty, used for subclassers to add anything special.
|
|
$sk = $this->skin;
|
|
|
|
$title = SpecialPage::getTitleFor( 'AbuseFilter', "examine/".$rc->mAttribs['rc_id'] );
|
|
$examineLink = $sk->link( $title, wfMsgExt( 'abusefilter-changeslist-examine', 'parseinline' ) );
|
|
|
|
$s .= " ($examineLink)";
|
|
}
|
|
} |