Converted Special:Tags to OOUI
authorawu42 <9922yalp@gmail.com>
Sun, 1 Jan 2017 23:16:30 +0000 (18:16 -0500)
committerawu42 <9922yalp@gmail.com>
Mon, 2 Jan 2017 02:02:30 +0000 (21:02 -0500)
Updated forms to use OOUI with HTMLForm::factory()

Bug: T117742
Change-Id: I6ec8dd59af482ed22ac3bee29c35d4a056540ac2

includes/specials/SpecialTags.php

index ea40cb8..e67356f 100644 (file)
@@ -98,7 +98,7 @@ class SpecialTags extends SpecialPage {
                                ],
                        ];
 
-                       $form = new HTMLForm( $fields, $this->getContext() );
+                       $form = HTMLForm::factory( 'ooui', $fields, $this->getContext() );
                        $form->setAction( $this->getPageTitle( 'create' )->getLocalURL() );
                        $form->setWrapperLegendMsg( 'tags-create-heading' );
                        $form->setHeaderText( $this->msg( 'tags-create-explanation' )->parseAsBlock() );
@@ -312,7 +312,7 @@ class SpecialTags extends SpecialPage {
                                $out->parse( $status->getWikiText() ) .
                                $this->msg( 'tags-create-warnings-below' )->parseAsBlock();
 
-                       $subform = new HTMLForm( $fields, $this->getContext() );
+                       $subform = HTMLForm::factory( 'ooui', $fields, $this->getContext() );
                        $subform->setAction( $this->getPageTitle( 'create' )->getLocalURL() );
                        $subform->setWrapperLegendMsg( 'tags-create-heading' );
                        $subform->setHeaderText( $headerText );
@@ -377,7 +377,7 @@ class SpecialTags extends SpecialPage {
                        'required' => true,
                ];
 
-               $form = new HTMLForm( $fields, $this->getContext() );
+               $form = HTMLForm::factory( 'ooui', $fields, $this->getContext() );
                $form->setAction( $this->getPageTitle( 'delete' )->getLocalURL() );
                $form->tagAction = 'delete'; // custom property on HTMLForm object
                $form->setSubmitCallback( [ $this, 'processTagForm' ] );
@@ -428,7 +428,7 @@ class SpecialTags extends SpecialPage {
                        'required' => true,
                ];
 
-               $form = new HTMLForm( $fields, $this->getContext() );
+               $form = HTMLForm::factory( 'ooui', $fields, $this->getContext() );
                $form->setAction( $this->getPageTitle( $actionStr )->getLocalURL() );
                $form->tagAction = $actionStr;
                $form->setSubmitCallback( [ $this, 'processTagForm' ] );