From: Fomafix Date: Tue, 10 Apr 2018 07:24:38 +0000 (+0200) Subject: Revert "Convert SpecialPrefixIndex to class HTMLForm" X-Git-Tag: 1.31.0-rc.0~142^2 X-Git-Url: http://git.cyclocoop.org/%24href?a=commitdiff_plain;h=2291e9f3bbf22ec1781f7bb0fa4f2776489a2868;p=lhc%2Fweb%2Fwiklou.git Revert "Convert SpecialPrefixIndex to class HTMLForm" This reverts commit ebf4bb56b7b430ce9580332722176996c343e223. ebf4bb56b7b430ce9580332722176996c343e223 changed the URL parameters from prefix=Foo&namespace=0&stripprefix=1 to wpprefix=Foo&namespace=0&wpstripprefix=1 and breaks Special:PrefixIndex. Change-Id: I99f75b5cb12913236a43b17970ea1752261ace9b --- diff --git a/includes/specials/SpecialPrefixindex.php b/includes/specials/SpecialPrefixindex.php index afd626b0a4..34ffa07363 100644 --- a/includes/specials/SpecialPrefixindex.php +++ b/includes/specials/SpecialPrefixindex.php @@ -98,36 +98,56 @@ class SpecialPrefixindex extends SpecialAllPages { * @return string */ protected function namespacePrefixForm( $namespace = NS_MAIN, $from = '' ) { - $fields = [ - 'prefix' => [ - 'label-message' => 'allpagesprefix', - 'type' => 'text', - 'size' => '30', - ], - 'namespace' => [ - 'type' => 'namespaceselect', + $out = Xml::openElement( 'div', [ 'class' => 'namespaceoptions' ] ); + $out .= Xml::openElement( + 'form', + [ 'method' => 'get', 'action' => $this->getConfig()->get( 'Script' ) ] + ); + $out .= Html::hidden( 'title', $this->getPageTitle()->getPrefixedText() ); + $out .= Xml::openElement( 'fieldset' ); + $out .= Xml::element( 'legend', null, $this->msg( 'allpages' )->text() ); + $out .= Xml::openElement( 'table', [ 'id' => 'nsselect', 'class' => 'allpages' ] ); + $out .= " + " . + Xml::label( $this->msg( 'allpagesprefix' )->text(), 'nsfrom' ) . + " + " . + Xml::input( 'prefix', 30, str_replace( '_', ' ', $from ), [ 'id' => 'nsfrom' ] ) . + " + + + " . + Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) . + " + " . + Html::namespaceSelector( [ + 'selected' => $namespace, + ], [ 'name' => 'namespace', 'id' => 'namespace', - 'label-message' => 'namespace', - 'all' => null, - 'value' => $namespace, - ], - 'hidedirects' => [ - 'class' => 'HTMLCheckField', - 'label-message' => 'allpages-hide-redirects', - ], - 'stripprefix' => [ - 'class' => 'HTMLCheckField', - 'label-message' => 'prefixindex-strip', - ], - ]; - $form = new HTMLForm( $fields, $this->getContext() ); - $form - ->setMethod( 'get' ) - ->setWrapperLegendMsg( 'allpages' ) - ->setSubmitTextMsg( 'prefixindex-submit' ) - ->prepareForm() - ->displayForm( false ); + 'class' => 'namespaceselector', + ] ) . + Xml::checkLabel( + $this->msg( 'allpages-hide-redirects' )->text(), + 'hideredirects', + 'hideredirects', + $this->hideRedirects + ) . ' ' . + Xml::checkLabel( + $this->msg( 'prefixindex-strip' )->text(), + 'stripprefix', + 'stripprefix', + $this->stripPrefix + ) . ' ' . + Xml::submitButton( $this->msg( 'prefixindex-submit' )->text() ) . + " + "; + $out .= Xml::closeElement( 'table' ); + $out .= Xml::closeElement( 'fieldset' ); + $out .= Xml::closeElement( 'form' ); + $out .= Xml::closeElement( 'div' ); + + return $out; } /**