r68096 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68095‎ | r68096 | r68097 >
Date:18:16, 15 June 2010
Author:raymond
Status:ok
Tags:
Comment:
Follow-up r65013: Add an input field for the username. Use the nice Xml::buildForm() function
Modified paths:
  • /trunk/phase3/includes/specials/SpecialListfiles.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -2979,6 +2979,7 @@
29802980 'table_pager_first',
29812981 'table_pager_last',
29822982 'table_pager_limit',
 2983+ 'table_pager_limit_label',
29832984 'table_pager_limit_submit',
29842985 'table_pager_empty',
29852986 ),
Index: trunk/phase3/includes/specials/SpecialListfiles.php
@@ -173,21 +173,28 @@
174174 function getForm() {
175175 global $wgRequest, $wgScript, $wgMiserMode;
176176 $search = $wgRequest->getText( 'ilsearch' );
177 -
178 - $s = Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
179 - Xml::openElement( 'fieldset' ) .
180 - Xml::element( 'legend', null, wfMsg( 'listfiles' ) ) .
181 - Xml::tags( 'label', null, wfMsgHtml( 'table_pager_limit', $this->getLimitSelect() ) );
182 -
 177+ $inputForm = array();
 178+ $inputForm['table_pager_limit_label'] = $this->getLimitSelect();
183179 if ( !$wgMiserMode ) {
184 - $s .= "<br />\n" .
185 - Xml::inputLabel( wfMsg( 'listfiles_search_for' ), 'ilsearch', 'mw-ilsearch', 20, $search );
 180+ $inputForm['listfiles_search_for'] = Html::input( 'ilsearch', $search, 'text', array(
 181+ 'size' => '40',
 182+ 'maxlength' => '255',
 183+ 'id' => 'mw-ilsearch',
 184+ ) );
186185 }
187 - $s .= ' ' .
188 - Xml::submitButton( wfMsg( 'table_pager_limit_submit' ) ) ."\n" .
189 - $this->getHiddenFields( array( 'limit', 'ilsearch' ) ) .
190 - Xml::closeElement( 'fieldset' ) .
191 - Xml::closeElement( 'form' ) . "\n";
 186+ $inputForm['username'] = Html::input( 'username', $this->mUserName, 'text', array(
 187+ 'size' => '40',
 188+ 'maxlength' => '255',
 189+ 'id' => 'mw-listfiles-username',
 190+ ) );
 191+ $s = Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
 192+ Xml::fieldset( wfMsg( 'listfiles' ) ) .
 193+ Html::openElement( 'table', array( 'mw-listfiles-table' ) ) .
 194+ Xml::buildForm( $inputForm, 'table_pager_limit_submit' ) .
 195+ $this->getHiddenFields( array( 'limit', 'ilsearch', 'username' ) ) .
 196+ Html::closeElement( 'table' ) .
 197+ Html::closeElement( 'fieldset' ) .
 198+ Html::closeElement( 'form' ) . "\n";
192199 return $s;
193200 }
194201
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -4050,6 +4050,7 @@
40514051 'table_pager_first' => 'First page',
40524052 'table_pager_last' => 'Last page',
40534053 'table_pager_limit' => 'Show $1 items per page',
 4054+'table_pager_limit_label' => 'Items per page:',
40544055 'table_pager_limit_submit' => 'Go',
40554056 'table_pager_empty' => 'No results',
40564057

Follow-up revisions

RevisionCommit summaryAuthorDate
r82081* (bug 27377) Fix Special:Listfile user selector when initial form parameters...brion21:20, 13 February 2011
r82411Fix invalid HTML introduced in r68096: Xml::buildForm() adds <table></table> tooraymond18:35, 18 February 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65013Special:Listfiles now supports a username parameter. This is indexed using th...btongminh09:03, 14 April 2010

Status & tagging log