From 7b6c7dfa63507a9d0adf65b7f534400c5a0dd1a7 Mon Sep 17 00:00:00 2001 From: Prateek Saxena Date: Thu, 20 Jul 2017 23:10:35 +0530 Subject: [PATCH] Special:AllPages: Use OOUI Also: * Use the usual $formDescriptor and $htmlForm * Fix typos Bug: T117724 Change-Id: I1e9b45d687492eed290a825de78c6ecc61013da8 --- includes/specials/SpecialAllPages.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialAllPages.php b/includes/specials/SpecialAllPages.php index ef05dd15b6..e96df0b5ea 100644 --- a/includes/specials/SpecialAllPages.php +++ b/includes/specials/SpecialAllPages.php @@ -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(); -- 2.20.1