Merge "RevisionStoreDbTestBase, remove redundant needsDB override"
[lhc/web/wiklou.git] / includes / specials / SpecialAllPages.php
index 17f6cca..e96df0b 100644 (file)
@@ -44,8 +44,6 @@ class SpecialAllPages extends IncludableSpecialPage {
        protected $nsfromMsg = 'allpagesfrom';
 
        /**
-        * Constructor
-        *
         * @param string $name Name of the special page, as seen in links and URLs (default: 'Allpages')
         */
        function __construct( $name = 'Allpages' ) {
@@ -99,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',
@@ -128,7 +126,7 @@ class SpecialAllPages extends IncludableSpecialPage {
                                'id' => 'namespace',
                                'label-message' => 'namespace',
                                'all' => null,
-                               'value' => $namespace,
+                               'default' => $namespace,
                        ],
                        'hideredirects' => [
                                'type' => 'check',
@@ -140,11 +138,14 @@ class SpecialAllPages extends IncludableSpecialPage {
                ];
 
                if ( $miserMode ) {
-                       unset( $fields['hideredirects'] );
+                       unset( $formDescriptor['hideredirects'] );
                }
 
-               $form = HTMLForm::factory( 'table', $fields, $this->getContext() );
-               $form->setMethod( 'get' )
+               $context = new DerivativeContext( $this->getContext() );
+               $context->setTitle( $this->getPageTitle() ); // Remove subpage
+               $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();
@@ -343,7 +344,7 @@ class SpecialAllPages extends IncludableSpecialPage {
        /**
         * @param int $ns The namespace of the article
         * @param string $text The name of the article
-        * @return array( int namespace, string dbkey, string pagename ) or null on error
+        * @return array|null [ int namespace, string dbkey, string pagename ] or null on error
         */
        protected function getNamespaceKeyAndText( $ns, $text ) {
                if ( $text == '' ) {