2009-01-23 19:23:19 +00:00
|
|
|
<?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;
|
|
|
|
}
|
2009-01-29 22:44:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
class AbuseFilterChangesList extends OldChangesList {
|
|
|
|
protected function insertExtra( &$s, &$rc, &$classes ) {
|
|
|
|
$sk = $this->skin;
|
2009-01-30 23:24:11 +00:00
|
|
|
$examineParams = empty($rc->examineParams) ? array() : $rc->examineParams;
|
2009-01-29 22:44:31 +00:00
|
|
|
|
|
|
|
$title = SpecialPage::getTitleFor( 'AbuseFilter', "examine/".$rc->mAttribs['rc_id'] );
|
2009-01-30 23:24:11 +00:00
|
|
|
$examineLink = $sk->link( $title, wfMsgExt( 'abusefilter-changeslist-examine', 'parseinline' ), array(), $examineParams );
|
2009-01-29 22:44:31 +00:00
|
|
|
|
|
|
|
$s .= " ($examineLink)";
|
2009-01-30 00:54:20 +00:00
|
|
|
|
|
|
|
## If we have a match..
|
|
|
|
if ( isset( $rc->filterResult ) ) {
|
|
|
|
$class = $rc->filterResult ? 'mw-abusefilter-changeslist-match' : 'mw-abusefilter-changeslist-nomatch';
|
|
|
|
|
|
|
|
$classes[] = $class;
|
|
|
|
}
|
2009-01-29 22:44:31 +00:00
|
|
|
}
|
2009-01-23 19:23:19 +00:00
|
|
|
}
|