mediawiki-extensions-AbuseF.../Views/AbuseFilterViewImport.php
tonythomas01 53b377a6d3 Convert Special:AbuseFilter/import to HTMLForm
Bug: T132284
Change-Id: Ife1ed3af19a4b4b506948763e4d92efc3a14a5bf
2016-04-18 23:07:31 +05:30

25 lines
657 B
PHP

<?php
class AbuseFilterViewImport extends AbuseFilterView {
function show() {
$out = $this->getOutput();
if ( !$this->getUser()->isAllowed( 'abusefilter-modify' ) ) {
$out->addWikiMsg( 'abusefilter-edit-notallowed' );
return;
}
$url = SpecialPage::getTitleFor( 'AbuseFilter', 'new' )->getFullURL();
$formDescriptor = array(
'ImportText' => array(
'type' => 'textarea',
'cols' => 200,
)
);
$htmlForm = new HTMLForm( $formDescriptor, $this->getContext() );
$htmlForm->setHeaderText( $this->msg( 'abusefilter-import-intro' ) )
->setSubmitTextMsg( 'abusefilter-import-submit' )
->setAction( $url )
->show();
}
}