r45364 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r45363‎ | r45364 | r45365 >
Date:12:30, 3 January 2009
Author:aaron
Status:ok
Tags:
Comment:
(bug 14970) Add a number of revisions column to the Special:ImageList page
Modified paths:
  • /trunk/phase3/includes/specials/SpecialListfiles.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialListfiles.php
@@ -49,6 +49,7 @@
5050
5151 function getFieldNames() {
5252 if ( !$this->mFieldNames ) {
 53+ global $wgMiserMode;
5354 $this->mFieldNames = array(
5455 'img_timestamp' => wfMsg( 'listfiles_date' ),
5556 'img_name' => wfMsg( 'listfiles_name' ),
@@ -56,6 +57,9 @@
5758 'img_size' => wfMsg( 'listfiles_size' ),
5859 'img_description' => wfMsg( 'listfiles_description' ),
5960 );
 61+ if( !$wgMiserMode ) {
 62+ $this->mFieldNames['COUNT(oi_archive_name)'] = wfMsg( 'listfiles_count' );
 63+ }
6064 }
6165 return $this->mFieldNames;
6266 }
@@ -66,13 +70,22 @@
6771 }
6872
6973 function getQueryInfo() {
70 - $fields = $this->getFieldNames();
71 - $fields = array_keys( $fields );
 74+ $tables = array( 'image' );
 75+ $fields = array_keys( $this->getFieldNames() );
7276 $fields[] = 'img_user';
 77+ $options = $join_conds = array();
 78+ # Depends on $wgMiserMode
 79+ if( isset($this->mFieldNames['COUNT(oi_archive_name)']) ) {
 80+ $tables[] = 'oldimage';
 81+ $options = array('GROUP BY' => 'img_name');
 82+ $join_conds = array('oldimage' => array('LEFT JOIN','oi_name = img_name') );
 83+ }
7384 return array(
74 - 'tables' => 'image',
75 - 'fields' => $fields,
76 - 'conds' => $this->mQueryConds
 85+ 'tables' => $tables,
 86+ 'fields' => $fields,
 87+ 'conds' => $this->mQueryConds,
 88+ 'options' => $options,
 89+ 'join_conds' => $join_conds
7790 );
7891 }
7992
@@ -123,6 +136,8 @@
124137 return $this->getSkin()->formatSize( $value );
125138 case 'img_description':
126139 return $this->getSkin()->commentBlock( $value );
 140+ case 'COUNT(oi_archive_name)':
 141+ return intval($value)+1;
127142 }
128143 }
129144
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1899,6 +1899,7 @@
19001900 'listfiles_user' => 'User',
19011901 'listfiles_size' => 'Size',
19021902 'listfiles_description' => 'Description',
 1903+'listfiles_count' => 'Versions',
19031904
19041905 # File description page
19051906 'filehist' => 'File history',

Status & tagging log