revert r106095, fix apparently not this simple
[lhc/web/wiklou.git] / includes / specials / SpecialListfiles.php
index 5fb199c..b575499 100644 (file)
@@ -35,8 +35,8 @@ class SpecialListFiles extends IncludableSpecialPage {
                        $userName = $par;
                        $search = '';
                } else {
-                       $userName = $this->getRequest()->getText( 'wpUsername', $par );
-                       $search = $this->getRequest()->getText( 'wpSearch', '' );
+                       $userName = $this->getRequest()->getText( 'user', $par );
+                       $search = $this->getRequest()->getText( 'ilsearch', '' );
                }
 
                $pager = new ImageListPager( $this->getContext(), $userName, $search, $this->including() );
@@ -44,7 +44,7 @@ class SpecialListFiles extends IncludableSpecialPage {
                if ( $this->including() ) {
                        $html = $pager->getBody();
                } else {
-                       $form = $pager->buildHTMLForm();
+                       $form = $pager->getForm();
                        $body = $pager->getBody();
                        $nav = $pager->getNavigationBar();
                        $html = "$form<br />\n$body<br />\n$nav";
@@ -234,35 +234,30 @@ class ImageListPager extends TablePager {
                }
        }
 
-       protected function getHTMLFormFields() {
-               global $wgMiserMode;
-               $f = array(
-                       'Limit' => $this->getHTMLFormLimitSelect(),
-               );
-
+       function getForm() {
+               global $wgScript, $wgMiserMode;
+               $inputForm = array();
+               $inputForm['table_pager_limit_label'] = $this->getLimitSelect();
                if ( !$wgMiserMode ) {
-                       $f['Search'] = array(
-                               'type' => 'text',
-                               'label-message' => 'listfiles_search_for',
-                               'maxlength' => 255,
-                       );
+                       $inputForm['listfiles_search_for'] = Html::input( 'ilsearch', $this->mSearch, 'text',
+                               array(
+                                       'size'          => '40',
+                                       'maxlength' => '255',
+                                       'id'            => 'mw-ilsearch',
+                       ) );
                }
-
-               $f['Username'] = array(
-                       'type' => 'text',
-                       'label-message' => 'username',
-                       'maxlength' => 255,
-               );
-
-               return $f;
-       }
-
-       protected function getHTMLFormLegend() {
-               return 'listfiles';
-       }
-
-       protected function getHTMLFormSubmit() {
-               return 'table_pager_limit_submit';
+               $inputForm['username'] = Html::input( 'user', $this->mUserName, 'text', array(
+                       'size'          => '40',
+                       'maxlength' => '255',
+                       'id'            => 'mw-listfiles-user',
+               ) );
+               return Html::openElement( 'form',
+                               array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
+                       Xml::fieldset( wfMsg( 'listfiles' ) ) .
+                       Xml::buildForm( $inputForm, 'table_pager_limit_submit' ) .
+                       $this->getHiddenFields( array( 'limit', 'ilsearch', 'user' ) ) .
+                       Html::closeElement( 'fieldset' ) .
+                       Html::closeElement( 'form' ) . "\n";
        }
 
        function getTableClass() {