Fix title inside form on Special:ListFiles
authorumherirrender <umherirrender_de.wp@web.de>
Wed, 8 Aug 2012 20:07:34 +0000 (22:07 +0200)
committerAlexandre Emsenhuber <ialex.wiki@gmail.com>
Wed, 8 Aug 2012 20:17:12 +0000 (22:17 +0200)
The form reused the title from the query, but when calling the page with
a subpage as parameter (Special:ListFiles/User), than the title contains
this subpage also, that looks not good, when resubmit the form.

This way is a copy from Special:AllMessages.

Change-Id: I431be530ad65e36c26c5a02fe78e436254131592

includes/specials/SpecialListfiles.php

index ddab164..e5aed18 100644 (file)
@@ -254,8 +254,9 @@ class ImageListPager extends TablePager {
                return Html::openElement( 'form',
                                array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
                        Xml::fieldset( $this->msg( 'listfiles' )->text() ) .
+                       Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) .
                        Xml::buildForm( $inputForm, 'table_pager_limit_submit' ) .
-                       $this->getHiddenFields( array( 'limit', 'ilsearch', 'user' ) ) .
+                       $this->getHiddenFields( array( 'limit', 'ilsearch', 'user', 'title' ) ) .
                        Html::closeElement( 'fieldset' ) .
                        Html::closeElement( 'form' ) . "\n";
        }
@@ -290,4 +291,8 @@ class ImageListPager extends TablePager {
                }
                return $queries;
        }
+
+       function getTitle() {
+               return SpecialPage::getTitleFor( 'Listfiles' );
+       }
 }