diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-01-18 16:46:04 +0100 |
commit | 63601400e476c6cf43d985f3e7b9864681695ed4 (patch) | |
tree | f7846203a952e38aaf66989d0a4702779f549962 /includes/specials/SpecialListfiles.php | |
parent | 8ff01378c9e0207f9169b81966a51def645b6a51 (diff) |
Update to MediaWiki 1.20.2
this update includes:
* adjusted Arch Linux skin
* updated FluxBBAuthPlugin
* patch for https://bugzilla.wikimedia.org/show_bug.cgi?id=44024
Diffstat (limited to 'includes/specials/SpecialListfiles.php')
-rw-r--r-- | includes/specials/SpecialListfiles.php | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index b5754991..cc055221 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -107,15 +107,15 @@ class ImageListPager extends TablePager { if ( !$this->mFieldNames ) { global $wgMiserMode; $this->mFieldNames = array( - 'img_timestamp' => wfMsg( 'listfiles_date' ), - 'img_name' => wfMsg( 'listfiles_name' ), - 'thumb' => wfMsg( 'listfiles_thumb' ), - 'img_size' => wfMsg( 'listfiles_size' ), - 'img_user_text' => wfMsg( 'listfiles_user' ), - 'img_description' => wfMsg( 'listfiles_description' ), + 'img_timestamp' => $this->msg( 'listfiles_date' )->text(), + 'img_name' => $this->msg( 'listfiles_name' )->text(), + 'thumb' => $this->msg( 'listfiles_thumb' )->text(), + 'img_size' => $this->msg( 'listfiles_size' )->text(), + 'img_user_text' => $this->msg( 'listfiles_user' )->text(), + 'img_description' => $this->msg( 'listfiles_description' )->text(), ); if( !$wgMiserMode ) { - $this->mFieldNames['count'] = wfMsg( 'listfiles_count' ); + $this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text(); } } return $this->mFieldNames; @@ -156,9 +156,8 @@ class ImageListPager extends TablePager { if( $dbr->implicitGroupby() ) { $options = array( 'GROUP BY' => 'img_name' ); } else { - $columnlist = implode( ',', - preg_grep( '/^img/', array_keys( $this->getFieldNames() ) ) ); - $options = array( 'GROUP BY' => "img_user, $columnlist" ); + $columnlist = preg_grep( '/^img/', array_keys( $this->getFieldNames() ) ); + $options = array( 'GROUP BY' => array_merge( array( 'img_user' ), $columnlist ) ); } $join_conds = array( 'oldimage' => array( 'LEFT JOIN', 'oi_name = img_name' ) ); } @@ -175,20 +174,14 @@ class ImageListPager extends TablePager { return 'img_timestamp'; } - function getStartBody() { - # Do a link batch query for user pages - if ( $this->mResult->numRows() ) { - $lb = new LinkBatch; - $this->mResult->seek( 0 ); - foreach ( $this->mResult as $row ) { - if ( $row->img_user ) { - $lb->add( NS_USER, str_replace( ' ', '_', $row->img_user_text ) ); - } - } - $lb->execute(); + function doBatchLookups() { + $userIds = array(); + $this->mResult->seek( 0 ); + foreach ( $this->mResult as $row ) { + $userIds[] = $row->img_user; } - - return parent::getStartBody(); + # Do a link batch query for names and userpages + UserCache::singleton()->doQuery( $userIds, array( 'userpage' ), __METHOD__ ); } function formatValue( $field, $value ) { @@ -198,10 +191,10 @@ class ImageListPager extends TablePager { $thumb = $file->transform( array( 'width' => 180, 'height' => 360 ) ); return $thumb->toHtml( array( 'desc-link' => true ) ); case 'img_timestamp': - return htmlspecialchars( $this->getLanguage()->timeanddate( $value, true ) ); + return htmlspecialchars( $this->getLanguage()->userTimeAndDate( $value, $this->getUser() ) ); case 'img_name': static $imgfile = null; - if ( $imgfile === null ) $imgfile = wfMsg( 'imgfile' ); + if ( $imgfile === null ) $imgfile = $this->msg( 'imgfile' )->text(); // Weird files can maybe exist? Bug 22227 $filePage = Title::makeTitleSafe( NS_FILE, $value ); @@ -211,15 +204,17 @@ class ImageListPager extends TablePager { array( 'href' => wfLocalFile( $filePage )->getURL() ), $imgfile ); - return "$link ($download)"; + $download = $this->msg( 'parentheses' )->rawParams( $download )->escaped(); + return "$link $download"; } else { return htmlspecialchars( $value ); } case 'img_user_text': if ( $this->mCurrentRow->img_user ) { + $name = User::whoIs( $this->mCurrentRow->img_user ); $link = Linker::link( - Title::makeTitle( NS_USER, $value ), - htmlspecialchars( $value ) + Title::makeTitle( NS_USER, $name ), + htmlspecialchars( $name ) ); } else { $link = htmlspecialchars( $value ); @@ -253,9 +248,10 @@ class ImageListPager extends TablePager { ) ); return Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'mw-listfiles-form' ) ) . - Xml::fieldset( wfMsg( 'listfiles' ) ) . + 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 +286,8 @@ class ImageListPager extends TablePager { } return $queries; } + + function getTitle() { + return SpecialPage::getTitleFor( 'Listfiles' ); + } } |