From: Aaron Schulz Date: Sat, 3 Jan 2009 12:30:04 +0000 (+0000) Subject: (bug 14970) Add a number of revisions column to the Special:ImageList page X-Git-Tag: 1.31.0-rc.0~43586 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=b6fe54aefd24f3f11ec454eae7ea26576c47078e;p=lhc%2Fweb%2Fwiklou.git (bug 14970) Add a number of revisions column to the Special:ImageList page --- diff --git a/includes/specials/SpecialListfiles.php b/includes/specials/SpecialListfiles.php index 4ee29412ad..d2178ee02f 100644 --- a/includes/specials/SpecialListfiles.php +++ b/includes/specials/SpecialListfiles.php @@ -49,6 +49,7 @@ class ImageListPager extends TablePager { function getFieldNames() { if ( !$this->mFieldNames ) { + global $wgMiserMode; $this->mFieldNames = array( 'img_timestamp' => wfMsg( 'listfiles_date' ), 'img_name' => wfMsg( 'listfiles_name' ), @@ -56,6 +57,9 @@ class ImageListPager extends TablePager { 'img_size' => wfMsg( 'listfiles_size' ), 'img_description' => wfMsg( 'listfiles_description' ), ); + if( !$wgMiserMode ) { + $this->mFieldNames['COUNT(oi_archive_name)'] = wfMsg( 'listfiles_count' ); + } } return $this->mFieldNames; } @@ -66,13 +70,22 @@ class ImageListPager extends TablePager { } function getQueryInfo() { - $fields = $this->getFieldNames(); - $fields = array_keys( $fields ); + $tables = array( 'image' ); + $fields = array_keys( $this->getFieldNames() ); $fields[] = 'img_user'; + $options = $join_conds = array(); + # Depends on $wgMiserMode + if( isset($this->mFieldNames['COUNT(oi_archive_name)']) ) { + $tables[] = 'oldimage'; + $options = array('GROUP BY' => 'img_name'); + $join_conds = array('oldimage' => array('LEFT JOIN','oi_name = img_name') ); + } return array( - 'tables' => 'image', - 'fields' => $fields, - 'conds' => $this->mQueryConds + 'tables' => $tables, + 'fields' => $fields, + 'conds' => $this->mQueryConds, + 'options' => $options, + 'join_conds' => $join_conds ); } @@ -123,6 +136,8 @@ class ImageListPager extends TablePager { return $this->getSkin()->formatSize( $value ); case 'img_description': return $this->getSkin()->commentBlock( $value ); + case 'COUNT(oi_archive_name)': + return intval($value)+1; } } diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index f58e4ec416..506baf64c2 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1899,6 +1899,7 @@ A click on a column header changes the sorting.', 'listfiles_user' => 'User', 'listfiles_size' => 'Size', 'listfiles_description' => 'Description', +'listfiles_count' => 'Versions', # File description page 'filehist' => 'File history',