Haritha28 has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/312265

Change subject: Convert SpecialPrefixIndex to OOUI
......................................................................

Convert SpecialPrefixIndex to OOUI

The xml part of the namespacePrefixForm() is
changed to use HTML forms.

Bug: T117726
Change-Id: I98cdfb69d11dee0dd1ac2d0d862235f2e53d85d9
---
M includes/specials/SpecialPrefixindex.php
1 file changed, 28 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/65/312265/1

diff --git a/includes/specials/SpecialPrefixindex.php 
b/includes/specials/SpecialPrefixindex.php
index 5e3e430..f7b4cf6 100644
--- a/includes/specials/SpecialPrefixindex.php
+++ b/includes/specials/SpecialPrefixindex.php
@@ -98,56 +98,37 @@
         * @return string
         */
        protected function namespacePrefixForm( $namespace = NS_MAIN, $from = 
'' ) {
-               $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 .= "<tr>
-                               <td class='mw-label'>" .
-                       Xml::label( $this->msg( 'allpagesprefix' )->text(), 
'nsfrom' ) .
-                       "</td>
-                               <td class='mw-input'>" .
-                       Xml::input( 'prefix', 30, str_replace( '_', ' ', $from 
), [ 'id' => 'nsfrom' ] ) .
-                       "</td>
-                       </tr>
-                       <tr>
-                       <td class='mw-label'>" .
-                       Xml::label( $this->msg( 'namespace' )->text(), 
'namespace' ) .
-                       "</td>
-                               <td class='mw-input'>" .
-                       Html::namespaceSelector( [
-                               'selected' => $namespace,
-                       ], [
+               $fields = [
+                       'prefix' => [
+                               'label-message' =>  'allpagesprefix'  ,
+                               'type' => 'text',
+                               'size' => '30' ,
+                       ],
+                       'namespace' => [
+                               'type' => 'namespaceselect',
                                'name' => 'namespace',
                                'id' => 'namespace',
-                               '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() ) .
-                       "</td>
-                       </tr>";
-               $out .= Xml::closeElement( 'table' );
-               $out .= Xml::closeElement( 'fieldset' );
-               $out .= Xml::closeElement( 'form' );
-               $out .= Xml::closeElement( 'div' );
+                               'label-message' => 'namespace',
+                               'all' => null,
+                               'value' => $namespace,
+                       ],
+                       'hidedirects' => [
+                               'class' => 'HTMLCheckField',
+                               'label-message' =>  'allpages-hide-redirects' ,
+                       ],
+                       'stripprefix' => [
+                               'class' => 'HTMLCheckField',
+                               'label-message' => 'prefixindex-strip',
+                       ],
 
-               return $out;
+
+               ];
+               $form = HTMLForm::factory( 'table', $fields, 
$this->getContext() );
+               $form->setMethod( 'get' )
+                       ->setWrapperLegendMsg( 'allpages' )
+                       ->setSubmitTextMsg( 'prefixindex-submit' )
+                       ->prepareForm()
+                       ->displayForm( false);
        }
 
        /**

-- 
To view, visit https://gerrit.wikimedia.org/r/312265
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I98cdfb69d11dee0dd1ac2d0d862235f2e53d85d9
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Haritha28 <haritha....@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to