mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-12 16:57:22 +00:00
7cbfa0597a
* Adopt pretty logos for "Match" and "No Match" for visual distinguishment. * Allow negatives to be reported as well in 'test' interface.
46 lines
1 KiB
PHP
46 lines
1 KiB
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 ) {
|
|
$sk = $this->skin;
|
|
|
|
$title = SpecialPage::getTitleFor( 'AbuseFilter', "examine/".$rc->mAttribs['rc_id'] );
|
|
$examineLink = $sk->link( $title, wfMsgExt( 'abusefilter-changeslist-examine', 'parseinline' ) );
|
|
|
|
$s .= " ($examineLink)";
|
|
|
|
## If we have a match..
|
|
if ( isset( $rc->filterResult ) ) {
|
|
$class = $rc->filterResult ? 'mw-abusefilter-changeslist-match' : 'mw-abusefilter-changeslist-nomatch';
|
|
|
|
$classes[] = $class;
|
|
}
|
|
}
|
|
} |