Special:AllPages: Use OOUI
authorPrateek Saxena <prtksxna@gmail.com>
Thu, 20 Jul 2017 17:40:35 +0000 (23:10 +0530)
committerVolkerE <volker.e@wikimedia.org>
Tue, 11 Sep 2018 00:22:08 +0000 (00:22 +0000)
Also:
* Use the usual $formDescriptor and $htmlForm
* Fix typos

Bug: T117724
Change-Id: I1e9b45d687492eed290a825de78c6ecc61013da8

includes/specials/SpecialAllPages.php

index ef05dd1..e96df0b 100644 (file)
@@ -97,13 +97,13 @@ class SpecialAllPages extends IncludableSpecialPage {
         * @param int $namespace A namespace constant (default NS_MAIN).
         * @param string $from DbKey we are starting listing at.
         * @param string $to DbKey we are ending listing at.
-        * @param bool $hideRedirects Dont show redirects  (default false)
+        * @param bool $hideRedirects Don't show redirects  (default false)
         */
        protected function outputHTMLForm( $namespace = NS_MAIN,
                $from = '', $to = '', $hideRedirects = false
        ) {
                $miserMode = (bool)$this->getConfig()->get( 'MiserMode' );
-               $fields = [
+               $formDescriptor = [
                        'from' => [
                                'type' => 'text',
                                'name' => 'from',
@@ -138,13 +138,14 @@ class SpecialAllPages extends IncludableSpecialPage {
                ];
 
                if ( $miserMode ) {
-                       unset( $fields['hideredirects'] );
+                       unset( $formDescriptor['hideredirects'] );
                }
 
                $context = new DerivativeContext( $this->getContext() );
                $context->setTitle( $this->getPageTitle() ); // Remove subpage
-               $form = HTMLForm::factory( 'table', $fields, $context );
-               $form->setMethod( 'get' )
+               $htmlForm = HTMLForm::factory( 'ooui', $formDescriptor, $context );
+               $htmlForm
+                       ->setMethod( 'get' )
                        ->setWrapperLegendMsg( 'allpages' )
                        ->setSubmitTextMsg( 'allpagessubmit' )
                        ->prepareForm()
@@ -155,7 +156,7 @@ class SpecialAllPages extends IncludableSpecialPage {
         * @param int $namespace (default NS_MAIN)
         * @param string $from List all pages from this name
         * @param string $to List all pages to this name
-        * @param bool $hideredirects Dont show redirects (default false)
+        * @param bool $hideredirects Don't show redirects (default false)
         */
        function showToplevel( $namespace = NS_MAIN, $from = '', $to = '', $hideredirects = false ) {
                $from = Title::makeTitleSafe( $namespace, $from );
@@ -170,7 +171,7 @@ class SpecialAllPages extends IncludableSpecialPage {
         * @param int $namespace Namespace (Default NS_MAIN)
         * @param string $from List all pages from this name (default false)
         * @param string $to List all pages to this name (default false)
-        * @param bool $hideredirects Dont show redirects (default false)
+        * @param bool $hideredirects Don't show redirects (default false)
         */
        function showChunk( $namespace = NS_MAIN, $from = false, $to = false, $hideredirects = false ) {
                $output = $this->getOutput();