$this->mDefaultDirection = false;
}
- $userName = $wgRequest->getText( 'username', $par );
+ $userName = $wgRequest->getText( 'user', $par );
if ( $userName ) {
$nt = Title::newFromText( $userName, NS_USER );
if ( !is_null( $nt ) ) {
if ( !$this->mFieldNames ) {
global $wgMiserMode;
$this->mFieldNames = array(
+ 'thumb' => wfMsg( 'listfiles_thumb' ),
'img_timestamp' => wfMsg( 'listfiles_date' ),
'img_name' => wfMsg( 'listfiles_name' ),
'img_user_text' => wfMsg( 'listfiles_user' ),
$tables = array( 'image' );
$fields = array_keys( $this->getFieldNames() );
$fields[] = 'img_user';
+ $fields[array_search('thumb', $fields)] = 'img_name AS thumb';
$options = $join_conds = array();
# Depends on $wgMiserMode
$tables[] = 'oldimage';
# Need to rewrite this one
- foreach ( $fields as &$field )
- if ( $field == 'count' )
- $field = 'COUNT(oi_archive_name) as count';
+ foreach ( $fields as &$field ) {
+ if ( $field == 'count' ) {
+ $field = 'COUNT(oi_archive_name) AS count';
+ }
+ }
unset( $field );
$dbr = wfGetDB( DB_SLAVE );
function formatValue( $field, $value ) {
global $wgLang;
switch ( $field ) {
+ case 'thumb':
+ $file = wfLocalFile( $value );
+ $thumb = $file->transform( array( 'width' => 180 ) );
+ return $thumb->toHtml( array( 'desc-link' => true ) );
case 'img_timestamp':
return htmlspecialchars( $wgLang->timeanddate( $value, true ) );
case 'img_name':
'id' => 'mw-ilsearch',
) );
}
- $inputForm['username'] = Html::input( 'username', $this->mUserName, 'text', array(
+ $inputForm['username'] = Html::input( 'user', $this->mUserName, 'text', array(
'size' => '40',
'maxlength' => '255',
- 'id' => 'mw-listfiles-username',
+ 'id' => 'mw-listfiles-user',
) );
$s = Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) .
Xml::fieldset( wfMsg( 'listfiles' ) ) .
$queries = parent::getPagingQueries();
if ( !is_null( $this->mUserName ) ) {
# Append the username to the query string
- foreach ( $queries as $key => &$query ) {
+ foreach ( $queries as &$query ) {
$query['username'] = $this->mUserName;
}
}