Do not include user column on Special:MyUploads
authorBrian Wolff <bawolff+wn@gmail.com>
Thu, 22 May 2014 19:28:16 +0000 (16:28 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Thu, 22 May 2014 19:28:16 +0000 (16:28 -0300)
If Special:ListFiles is being filtered to show only a specific
user, then there's not much point showing which user uploaded
the image, as they are all uploaded by the same user.

Bug: 30627
Change-Id: Ibe1be82cb8f3354889051ef00f3c0b9f9ea5180e

includes/specials/SpecialListfiles.php

index 6b54fe8..3715b8b 100644 (file)
@@ -170,9 +170,14 @@ class ImageListPager extends TablePager {
                                '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 ( is_null( $this->mUserName ) ) {
+                               // Do not show username if filtering by username
+                               $this->mFieldNames['img_user_text'] = $this->msg( 'listfiles_user' )->text();
+                       }
+                       // img_description down here, in order so that its still after the username field.
+                       $this->mFieldNames['img_description'] = $this->msg( 'listfiles_description' )->text();
+
                        if ( !$wgMiserMode && !$this->mShowAll ) {
                                $this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text();
                        }