Replace most Xml methods with Html

Xml::buildForm and Xml::fieldset are left.

Change-Id: Iff88869fd002165ec9ee80897d4deb585005b9d1
This commit is contained in:
Matěj Suchánek 2024-03-29 13:40:23 +01:00
parent bc6240fbda
commit f9dcf46d70
15 changed files with 111 additions and 114 deletions

View file

@ -6,13 +6,13 @@ use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Extension\AbuseFilter\Parser\AbuseFilterTokenizer;
use MediaWiki\Extension\AbuseFilter\Parser\FilterEvaluator;
use MediaWiki\Html\Html;
use MediaWiki\Output\OutputPage;
use MediaWiki\Permissions\Authority;
use MessageLocalizer;
use OOUI\ButtonWidget;
use OOUI\HorizontalLayout;
use OOUI\Widget;
use Xml;
/**
* Class responsible for building filter edit boxes with both the Ace and the plain version
@ -51,7 +51,7 @@ class AceEditBoxBuilder extends EditBoxBuilder {
'id' => 'wpAceFilterEditor',
'class' => 'mw-abusefilter-editor'
];
$rulesContainer = Xml::element( 'div', $attribs, $rules );
$rulesContainer = Html::element( 'div', $attribs, $rules );
$editorConfig = $this->getAceConfig( $isUserAllowed );
$this->output->addJsConfigVars( 'aceConfig', $editorConfig );
return $rulesContainer . $this->plainBuilder->getEditBox( $rules, $isUserAllowed, $externalForm );

View file

@ -2,9 +2,9 @@
namespace MediaWiki\Extension\AbuseFilter\EditBox;
use Html;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Html\Html;
use MediaWiki\Output\OutputPage;
use MediaWiki\Permissions\Authority;
use MessageLocalizer;
@ -13,7 +13,6 @@ use OOUI\DropdownInputWidget;
use OOUI\FieldLayout;
use OOUI\FieldsetLayout;
use OOUI\Widget;
use Xml;
/**
* Base class for classes responsible for building filter edit boxes
@ -98,7 +97,7 @@ abstract class EditBoxBuilder {
}
if ( $addResultDiv ) {
$output .= Xml::element(
$output .= Html::element(
'div',
[ 'id' => 'mw-abusefilter-syntaxresult', 'style' => 'display: none;' ],
' '

View file

@ -2,7 +2,7 @@
namespace MediaWiki\Extension\AbuseFilter\EditBox;
use Html;
use MediaWiki\Html\Html;
/**
* Class responsible for building a plain text filter edit box
@ -14,11 +14,12 @@ class PlainEditBoxBuilder extends EditBoxBuilder {
public function getEditBox( string $rules, bool $isUserAllowed, bool $externalForm ): string {
$rules = rtrim( $rules ) . "\n";
$editorAttribs = [
'name' => 'wpFilterRules',
'id' => 'wpFilterRules',
// Rules are in English
'dir' => 'ltr',
'cols' => 40,
'rows' => 15
'rows' => 15,
];
if ( !$isUserAllowed ) {
$editorAttribs['readonly'] = 'readonly';
@ -26,7 +27,7 @@ class PlainEditBoxBuilder extends EditBoxBuilder {
if ( $externalForm ) {
$editorAttribs['form'] = 'wpFilterForm';
}
return Html::textarea( 'wpFilterRules', $rules, $editorAttribs );
return Html::element( 'textarea', $editorAttribs, $rules );
}
}

View file

@ -10,6 +10,7 @@ use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\Extension\AbuseFilter\FilterLookup;
use MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseFilter;
use MediaWiki\Extension\AbuseFilter\SpecsFormatter;
use MediaWiki\Html\Html;
use MediaWiki\Linker\Linker;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\MediaWikiServices;
@ -18,7 +19,6 @@ use MediaWiki\Title\Title;
use MediaWiki\User\UserRigorOptions;
use UnexpectedValueException;
use Wikimedia\Rdbms\IResultWrapper;
use Xml;
class AbuseFilterHistoryPager extends TablePager {
@ -148,9 +148,9 @@ class AbuseFilterHistoryPager extends TablePager {
foreach ( $actions as $action => $parameters ) {
$displayAction = $this->specsFormatter->formatAction( $action, $parameters, $lang );
$display_actions .= Xml::tags( 'li', null, $displayAction );
$display_actions .= Html::rawElement( 'li', [], $displayAction );
}
$display_actions = Xml::tags( 'ul', null, $display_actions );
$display_actions = Html::rawElement( 'ul', [], $display_actions );
$formatted = $display_actions;
break;

View file

@ -2,7 +2,6 @@
namespace MediaWiki\Extension\AbuseFilter\Pager;
use Html;
use HtmlArmor;
use IContextSource;
use MediaWiki\Cache\LinkBatchFactory;
@ -10,6 +9,7 @@ use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\AbuseFilterServices;
use MediaWiki\Extension\AbuseFilter\CentralDBNotAvailableException;
use MediaWiki\Extension\AbuseFilter\Special\SpecialAbuseLog;
use MediaWiki\Html\Html;
use MediaWiki\Linker\Linker;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Linker\LinkTarget;
@ -22,7 +22,6 @@ use MediaWiki\Title\Title;
use MediaWiki\WikiMap\WikiMap;
use stdClass;
use Wikimedia\Rdbms\IResultWrapper;
use Xml;
class AbuseLogPager extends ReverseChronologicalPager {
/**
@ -274,13 +273,13 @@ class AbuseLogPager extends ReverseChronologicalPager {
)->params( $row->afl_user_text )->parse();
}
$attribs = null;
$attribs = [];
if (
$this->isHidingEntry( $row ) === true ||
// If isHidingEntry is false, we've just unhidden the row
( $this->isHidingEntry( $row ) === null && $row->afl_deleted )
) {
$attribs = [ 'class' => 'mw-abusefilter-log-hidden-entry' ];
$attribs['class'] = 'mw-abusefilter-log-hidden-entry';
}
if ( self::entryHasAssociatedDeletedRev( $row ) ) {
$description .= ' ' .
@ -293,9 +292,9 @@ class AbuseLogPager extends ReverseChronologicalPager {
}
if ( $isListItem ) {
return Xml::tags( 'li', $attribs, $description );
return Html::rawElement( 'li', $attribs, $description );
} else {
return Xml::tags( 'span', $attribs, $description );
return Html::rawElement( 'span', $attribs, $description );
}
}

View file

@ -4,9 +4,9 @@ namespace MediaWiki\Extension\AbuseFilter\Special;
use HtmlArmor;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Html\Html;
use MediaWiki\SpecialPage\SpecialPage;
use MediaWiki\Title\TitleValue;
use Xml;
/**
* Parent class for AbuseFilter special pages.
@ -113,7 +113,7 @@ abstract class AbuseFilterSpecialPage extends SpecialPage {
$msg = $this->msg( $msgName )->parse();
if ( $name === $pageType ) {
$links[] = Xml::tags( 'strong', null, $msg );
$links[] = Html::rawElement( 'strong', [], $msg );
} else {
$links[] = $this->getLinkRenderer()->makeLink(
new TitleValue( NS_SPECIAL, $page ),
@ -127,7 +127,7 @@ abstract class AbuseFilterSpecialPage extends SpecialPage {
->escaped();
$linkStr = $this->msg( 'abusefilter-topnav' )->parse() . " $linkStr";
$linkStr = Xml::tags( 'div', [ 'class' => 'mw-abusefilter-navigation' ], $linkStr );
$linkStr = Html::rawElement( 'div', [ 'class' => 'mw-abusefilter-navigation' ], $linkStr );
$this->getOutput()->setSubtitle( $linkStr );
}

View file

@ -37,7 +37,6 @@ use MediaWiki\WikiMap\WikiMap;
use OOUI\ButtonInputWidget;
use stdClass;
use Wikimedia\Rdbms\LBFactory;
use Xml;
class SpecialAbuseLog extends AbuseFilterSpecialPage {
public const PAGE_NAME = 'AbuseLog';
@ -632,14 +631,14 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
$pager->doQuery();
$result = $pager->getResult();
$form = Xml::tags(
$form = Html::rawElement(
'form',
[
'method' => 'GET',
'action' => $this->getPageTitle( 'hide' )->getLocalURL()
],
$this->getDeleteButton() . $this->getListToggle() .
Xml::tags( 'ul', [ 'class' => 'plainlinks' ], $pager->getBody() ) .
Html::rawElement( 'ul', [ 'class' => 'plainlinks' ], $pager->getBody() ) .
$this->getListToggle() . $this->getDeleteButton()
);
@ -748,14 +747,14 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
return;
}
$output = Xml::element(
$output = Html::element(
'legend',
null,
[],
$this->msg( 'abusefilter-log-details-legend' )
->numParams( $id )
->text()
);
$output .= Xml::tags( 'p', null, $pager->doFormatRow( $row, false ) );
$output .= Html::rawElement( 'p', [], $pager->doFormatRow( $row, false ) );
// Load data
$vars = $this->varBlobStore->loadVarDump( $row->afl_var_dump );
@ -787,16 +786,16 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
);
$output .=
Xml::tags(
Html::rawElement(
'h3',
null,
[],
$this->msg( 'abusefilter-log-details-diff' )->parse()
);
$output .= $formattedDiff;
}
$output .= Xml::element( 'h3', null, $this->msg( 'abusefilter-log-details-vars' )->text() );
$output .= Html::element( 'h3', [], $this->msg( 'abusefilter-log-details-vars' )->text() );
// Build a table.
$output .= $this->variablesFormatter->buildVarDumpTable( $vars );
@ -819,7 +818,7 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
$output .= $htmlForm->getHTML( false );
}
$out->addHTML( Xml::tags( 'fieldset', null, $output ) );
$out->addHTML( Html::rawElement( 'fieldset', [], $output ) );
}
/**
@ -876,92 +875,92 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
* @return string The HTML output
*/
private function buildPrivateDetailsTable( $row ) {
$output = Xml::element(
$output = Html::element(
'legend',
null,
[],
$this->msg( 'abusefilter-log-details-privatedetails' )->text()
);
$header =
Xml::element( 'th', null, $this->msg( 'abusefilter-log-details-var' )->text() ) .
Xml::element( 'th', null, $this->msg( 'abusefilter-log-details-val' )->text() );
Html::element( 'th', [], $this->msg( 'abusefilter-log-details-var' )->text() ) .
Html::element( 'th', [], $this->msg( 'abusefilter-log-details-val' )->text() );
$output .=
Xml::openElement( 'table',
Html::openElement( 'table',
[
'class' => 'wikitable mw-abuselog-private',
'style' => 'width: 80%;'
]
) .
Xml::openElement( 'tbody' );
Html::openElement( 'tbody' );
$output .= $header;
// Log ID
$linkRenderer = $this->getLinkRenderer();
$output .=
Xml::tags( 'tr', null,
Xml::element( 'td',
Html::rawElement( 'tr', [],
Html::element( 'td',
[ 'style' => 'width: 30%;' ],
$this->msg( 'abusefilter-log-details-id' )->text()
) .
Xml::openElement( 'td' ) .
Html::openElement( 'td' ) .
$linkRenderer->makeKnownLink(
$this->getPageTitle( $row->afl_id ),
$this->getLanguage()->formatNum( $row->afl_id )
) .
Xml::closeElement( 'td' )
Html::closeElement( 'td' )
);
// Timestamp
$output .=
Xml::tags( 'tr', null,
Xml::element( 'td',
Html::rawElement( 'tr', [],
Html::element( 'td',
[ 'style' => 'width: 30%;' ],
$this->msg( 'abusefilter-edit-builder-vars-timestamp-expanded' )->text()
) .
Xml::element( 'td',
null,
Html::element( 'td',
[],
$this->getLanguage()->userTimeAndDate( $row->afl_timestamp, $this->getUser() )
)
);
// User
$output .=
Xml::tags( 'tr', null,
Xml::element( 'td',
Html::rawElement( 'tr', [],
Html::element( 'td',
[ 'style' => 'width: 30%;' ],
$this->msg( 'abusefilter-edit-builder-vars-user-name' )->text()
) .
Xml::element( 'td',
null,
Html::element( 'td',
[],
$row->afl_user_text
)
);
// Filter ID
$output .=
Xml::tags( 'tr', null,
Xml::element( 'td',
Html::rawElement( 'tr', [],
Html::element( 'td',
[ 'style' => 'width: 30%;' ],
$this->msg( 'abusefilter-list-id' )->text()
) .
Xml::openElement( 'td' ) .
Html::openElement( 'td' ) .
$linkRenderer->makeKnownLink(
SpecialPage::getTitleFor( 'AbuseFilter', $row->af_id ),
$this->getLanguage()->formatNum( $row->af_id )
) .
Xml::closeElement( 'td' )
Html::closeElement( 'td' )
);
// Filter description
$output .=
Xml::tags( 'tr', null,
Xml::element( 'td',
Html::rawElement( 'tr', [],
Html::element( 'td',
[ 'style' => 'width: 30%;' ],
$this->msg( 'abusefilter-list-public' )->text()
) .
Xml::element( 'td',
null,
Html::element( 'td',
[],
$row->af_public_comments
)
);
@ -982,35 +981,35 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
$CULink = '';
}
$output .=
Xml::tags( 'tr', null,
Xml::element( 'td',
Html::rawElement( 'tr', [],
Html::element( 'td',
[ 'style' => 'width: 30%;' ],
$this->msg( 'abusefilter-log-details-ip' )->text()
) .
Xml::tags(
Html::rawElement(
'td',
null,
[],
self::getUserLinks( 0, $row->afl_ip ) . $CULink
)
);
} else {
$output .=
Xml::tags( 'tr', null,
Xml::element( 'td',
Html::rawElement( 'tr', [],
Html::element( 'td',
[ 'style' => 'width: 30%;' ],
$this->msg( 'abusefilter-log-details-ip' )->text()
) .
Xml::element(
Html::element(
'td',
null,
[],
$this->msg( 'abusefilter-log-ip-not-available' )->text()
)
);
}
$output .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
$output .= Html::closeElement( 'tbody' ) . Html::closeElement( 'table' );
return Xml::tags( 'fieldset', null, $output );
return Html::rawElement( 'fieldset', [], $output );
}
/**
@ -1032,9 +1031,9 @@ class SpecialAbuseLog extends AbuseFilterSpecialPage {
$token = $request->getVal( 'wpEditToken' );
if ( !$request->wasPosted() || !$user->matchEditToken( $token ) ) {
$out->addHTML(
Xml::tags(
Html::rawElement(
'p',
null,
[],
Html::errorBox( $this->msg( 'abusefilter-invalid-request' )->params( $id )->parse() )
)
);

View file

@ -5,7 +5,6 @@ namespace MediaWiki\Extension\AbuseFilter\Variables;
use MediaWiki\Extension\AbuseFilter\KeywordsManager;
use MediaWiki\Html\Html;
use MessageLocalizer;
use Xml;
/**
* Pretty-prints the content of a VariableHolder for use e.g. in AbuseLog hit details
@ -52,17 +51,17 @@ class VariablesFormatter {
$output = '';
$output .=
Xml::openElement( 'table', [ 'class' => 'mw-abuselog-details' ] ) .
Xml::openElement( 'tbody' ) .
Html::openElement( 'table', [ 'class' => 'mw-abuselog-details' ] ) .
Html::openElement( 'tbody' ) .
"\n";
$header =
Xml::element( 'th', null, $this->messageLocalizer->msg( 'abusefilter-log-details-var' )->text() ) .
Xml::element( 'th', null, $this->messageLocalizer->msg( 'abusefilter-log-details-val' )->text() );
$output .= Xml::tags( 'tr', null, $header ) . "\n";
Html::element( 'th', [], $this->messageLocalizer->msg( 'abusefilter-log-details-var' )->text() ) .
Html::element( 'th', [], $this->messageLocalizer->msg( 'abusefilter-log-details-val' )->text() );
$output .= Html::rawElement( 'tr', [], $header ) . "\n";
if ( !count( $vars ) ) {
$output .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
$output .= Html::closeElement( 'tbody' ) . Html::closeElement( 'table' );
return $output;
}
@ -90,15 +89,15 @@ class VariablesFormatter {
);
$trow =
Xml::tags( 'td', [ 'class' => 'mw-abuselog-var' ], $keyDisplay ) .
Xml::tags( 'td', [ 'class' => 'mw-abuselog-var-value' ], $value );
Html::rawElement( 'td', [ 'class' => 'mw-abuselog-var' ], $keyDisplay ) .
Html::rawElement( 'td', [ 'class' => 'mw-abuselog-var-value' ], $value );
$output .=
Xml::tags( 'tr',
Html::rawElement( 'tr',
[ 'class' => "mw-abuselog-details-$key mw-abuselog-value" ], $trow
) . "\n";
}
$output .= Xml::closeElement( 'tbody' ) . Xml::closeElement( 'table' );
$output .= Html::closeElement( 'tbody' ) . Html::closeElement( 'table' );
return $output;
}

View file

@ -6,6 +6,7 @@ use ContextSource;
use Flow\Data\Listener\RecentChangesListener;
use IContextSource;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Html\Html;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Permissions\Authority;
use MediaWiki\Revision\RevisionRecord;
@ -15,7 +16,6 @@ use OOUI;
use RecentChange;
use UnexpectedValueException;
use Wikimedia\Rdbms\Platform\ISQLPlatform;
use Xml;
abstract class AbuseFilterView extends ContextSource {
@ -101,7 +101,7 @@ abstract class AbuseFilterView extends ContextSource {
]
);
// CSS class for reducing default input field width
return Xml::tags(
return Html::rawElement(
'div',
[ 'class' => 'mw-abusefilter-load-filter-id' ],
$loadGroup

View file

@ -494,8 +494,8 @@ class AbuseFilterViewEdit extends AbuseFilterView {
if ( $filter !== null ) {
$tools = '';
if ( $this->afPermManager->canRevertFilterActions( $user ) ) {
$tools .= Xml::tags(
'p', null,
$tools .= Html::rawElement(
'p', [],
$this->linkRenderer->makeLink(
$this->getTitle( "revert/$filter" ),
new HtmlArmor( $this->msg( 'abusefilter-edit-revert' )->parse() )
@ -505,8 +505,8 @@ class AbuseFilterViewEdit extends AbuseFilterView {
if ( $this->afPermManager->canUseTestTools( $user ) ) {
// Test link
$tools .= Xml::tags(
'p', null,
$tools .= Html::rawElement(
'p', [],
$this->linkRenderer->makeLink(
$this->getTitle( "test/$filter" ),
new HtmlArmor( $this->msg( 'abusefilter-edit-test-link' )->parse() )
@ -541,7 +541,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
$this->linkRenderer->makeKnownLink( $this->getTitle( 'history/' . $filter ), $history_display );
$exportText = $this->filterImporter->encodeData( $filterObj, $actions );
$tools .= Xml::tags( 'a', [ 'href' => '#', 'id' => 'mw-abusefilter-export-link' ],
$tools .= Html::rawElement( 'a', [ 'href' => '#', 'id' => 'mw-abusefilter-export-link' ],
$this->msg( 'abusefilter-edit-export' )->parse() );
$tools .=
new OOUI\MultilineTextInputWidget( [
@ -554,8 +554,11 @@ class AbuseFilterViewEdit extends AbuseFilterView {
$fields['abusefilter-edit-tools'] = $tools;
}
$form = Xml::buildForm( $fields );
$form = Xml::fieldset( $this->msg( 'abusefilter-edit-main' )->text(), $form );
$form = Xml::fieldset(
$this->msg( 'abusefilter-edit-main' )->text(),
// TODO: deprecated, use OOUI or Codex widgets instead
Xml::buildForm( $fields )
);
$form .= Xml::fieldset(
$this->msg( 'abusefilter-edit-consequences' )->text(),
$this->buildConsequenceEditor( $filterObj, $actions )
@ -577,7 +580,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
);
}
$form = Xml::tags( 'form',
$form = Html::rawElement( 'form',
[
'action' => $this->getTitle( $urlFilter )->getFullURL(),
'method' => 'post',
@ -744,7 +747,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
$this->getOutput()->addJsConfigVars( 'throttleConfig', $throttleConfig );
$throttleSettings .=
Xml::tags(
Html::rawElement(
'div',
[ 'id' => 'mw-abusefilter-throttle-parameters' ],
new OOUI\FieldsetLayout( [ 'items' => $throttleFields ] )
@ -845,7 +848,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
] )
] );
}
$previewHolder = Xml::tags(
$previewHolder = Html::rawElement(
'div',
[
// mw-abusefilter-warn-preview, mw-abusefilter-disallow-preview
@ -856,7 +859,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
);
$fields[] = $buttonGroup;
$output .=
Xml::tags(
Html::rawElement(
'div',
// mw-abusefilter-warn-parameters, mw-abusefilter-disallow-parameters
[ 'id' => "mw-abusefilter-$action-parameters" ],
@ -914,7 +917,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
]
);
$output .=
Xml::tags( 'div',
Html::rawElement( 'div',
[ 'id' => 'mw-abusefilter-tag-parameters' ],
$hiddenTags
);
@ -1006,7 +1009,7 @@ class AbuseFilterViewEdit extends AbuseFilterView {
]
);
$output .= Xml::tags(
$output .= Html::rawElement(
'div',
[ 'id' => 'mw-abusefilter-block-parameters' ],
new OOUI\FieldsetLayout( [ 'items' => $blockOptions ] )

View file

@ -18,13 +18,13 @@ use MediaWiki\Extension\AbuseFilter\Variables\VariableHolder;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesBlobStore;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesFormatter;
use MediaWiki\Extension\AbuseFilter\Variables\VariablesManager;
use MediaWiki\Html\Html;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\Revision\RevisionRecord;
use MediaWiki\Title\Title;
use OOUI;
use RecentChange;
use Wikimedia\Rdbms\LBFactory;
use Xml;
class AbuseFilterViewExamine extends AbuseFilterView {
/**
@ -319,12 +319,12 @@ class AbuseFilterViewExamine extends AbuseFilterView {
$output
);
$tester = Xml::tags( 'h2', null, $this->msg( 'abusefilter-examine-test' )->parse() );
$tester = Html::rawElement( 'h2', [], $this->msg( 'abusefilter-examine-test' )->parse() );
$tester .= $boxBuilder->buildEditBox( $this->testFilter, false, false, false );
$tester .= $this->buildFilterLoader();
$html .= Xml::tags( 'div', [ 'id' => 'mw-abusefilter-examine-editor' ], $tester );
$html .= Xml::tags( 'p',
null,
$html .= Html::rawElement( 'div', [ 'id' => 'mw-abusefilter-examine-editor' ], $tester );
$html .= Html::rawElement( 'p',
[],
new OOUI\ButtonInputWidget(
[
'label' => $this->msg( 'abusefilter-examine-test-button' )->text(),
@ -332,7 +332,7 @@ class AbuseFilterViewExamine extends AbuseFilterView {
'flags' => [ 'primary', 'progressive' ]
]
) .
Xml::element( 'div',
Html::element( 'div',
[
'id' => 'mw-abusefilter-syntaxresult',
'style' => 'display: none;'
@ -342,9 +342,9 @@ class AbuseFilterViewExamine extends AbuseFilterView {
}
// Variable dump
$html .= Xml::tags(
$html .= Html::rawElement(
'h2',
null,
[],
$this->msg( 'abusefilter-examine-vars' )->parse()
);
$html .= $this->variablesFormatter->buildVarDumpTable( $vars );

View file

@ -15,7 +15,6 @@ use MediaWiki\Html\Html;
use MediaWiki\Linker\LinkRenderer;
use OOUI;
use StringUtils;
use Xml;
/**
* The default view used in Special:AbuseFilter
@ -167,9 +166,9 @@ class AbuseFilterViewList extends AbuseFilterView {
if ( $error !== null ) {
$out->addHTML(
Xml::tags(
Html::rawElement(
'p',
null,
[],
Html::errorBox( $this->msg( $error )->escaped() )
)
);
@ -202,7 +201,7 @@ class AbuseFilterViewList extends AbuseFilterView {
$centralDB = $config->get( 'AbuseFilterCentralDB' );
$dbIsCentral = $config->get( 'AbuseFilterIsCentral' );
$this->getOutput()->addHTML(
Xml::tags( 'h2', null, $this->msg( 'abusefilter-list' )->parse() )
Html::rawElement( 'h2', [], $this->msg( 'abusefilter-list' )->parse() )
);
$deleted = $optarray['deleted'];
@ -357,7 +356,7 @@ class AbuseFilterViewList extends AbuseFilterView {
$matchPercent
)->parse();
$status = Xml::tags( 'p', [ 'class' => 'mw-abusefilter-status' ], $status );
$status = Html::rawElement( 'p', [ 'class' => 'mw-abusefilter-status' ], $status );
$this->getOutput()->addHTML( $status );
}
}

View file

@ -25,7 +25,6 @@ use UnexpectedValueException;
use UserBlockedError;
use Wikimedia\Rdbms\LBFactory;
use Wikimedia\Rdbms\SelectQueryBuilder;
use Xml;
class AbuseFilterViewRevert extends AbuseFilterView {
/** @var int */
@ -223,10 +222,10 @@ class AbuseFilterViewRevert extends AbuseFilterView {
)->params(
$spec->getUser()->getName()
)->parse();
$list[] = Xml::tags( 'li', null, $msg );
$list[] = Html::rawElement( 'li', [], $msg );
}
$dateForm->addPostHtml( Xml::tags( 'ul', null, implode( "\n", $list ) ) );
$dateForm->addPostHtml( Html::rawElement( 'ul', [], implode( "\n", $list ) ) );
// Add a button down the bottom.
$confirmForm = [];

View file

@ -7,8 +7,8 @@ use IContextSource;
use MediaWiki\Extension\AbuseFilter\AbuseFilterPermissionManager;
use MediaWiki\Extension\AbuseFilter\EditBox\EditBoxBuilderFactory;
use MediaWiki\Extension\AbuseFilter\EditBox\EditBoxField;
use MediaWiki\Html\Html;
use MediaWiki\Linker\LinkRenderer;
use Xml;
class AbuseFilterViewTools extends AbuseFilterView {
@ -75,7 +75,7 @@ class AbuseFilterViewTools extends AbuseFilterView {
->setWrapperLegendMsg( 'abusefilter-tools-expr' )
->setSubmitTextMsg( 'abusefilter-tools-submitexpr' )
->setSubmitID( 'mw-abusefilter-submitexpr' )
->setFooterHtml( Xml::element( 'pre', [ 'id' => 'mw-abusefilter-expr-result' ], ' ' ) )
->setFooterHtml( Html::element( 'pre', [ 'id' => 'mw-abusefilter-expr-result' ], ' ' ) )
->prepareForm()
->displayForm( false );

View file

@ -14,7 +14,6 @@ use MediaWiki\Html\Html;
use MediaWiki\Linker\LinkRenderer;
use MediaWiki\MediaWikiServices;
use Wikimedia\Rdbms\LBFactory;
use Xml;
class HideAbuseLog extends AbuseFilterView {
@ -85,7 +84,7 @@ class HideAbuseLog extends AbuseFilterView {
$this->getLanguage()->formatNum( count( $this->hideIDs ) )
]
);
$output->addHTML( Xml::tags( 'ul', [ 'class' => 'plainlinks' ], $pager->getBody() ) );
$output->addHTML( Html::rawElement( 'ul', [ 'class' => 'plainlinks' ], $pager->getBody() ) );
$hideReasonsOther = $this->msg( 'revdelete-reasonotherlist' )->text();
$hideReasons = $this->msg( 'revdelete-reason-dropdown-suppress' )->inContentLanguage()->text();