Index: trunk/phase3/includes/specials/SpecialListfiles.php |
— | — | @@ -24,6 +24,7 @@ |
25 | 25 | class ImageListPager extends TablePager { |
26 | 26 | var $mFieldNames = null; |
27 | 27 | var $mQueryConds = array(); |
| 28 | + var $mUserName = null; |
28 | 29 | |
29 | 30 | function __construct( $par = null ) { |
30 | 31 | global $wgRequest, $wgMiserMode; |
— | — | @@ -37,14 +38,15 @@ |
38 | 39 | if ( $userName ) { |
39 | 40 | $nt = Title::newFromText( $userName, NS_USER ); |
40 | 41 | if ( !is_null( $nt ) ) { |
41 | | - $this->mQueryConds['img_user_text'] = $nt->getText(); |
| 42 | + $this->mUserName = $nt->getText(); |
| 43 | + $this->mQueryConds['img_user_text'] = $this->mUserName; |
42 | 44 | } |
43 | 45 | } |
44 | 46 | |
45 | 47 | $search = $wgRequest->getText( 'ilsearch' ); |
46 | 48 | if ( $search != '' && !$wgMiserMode ) { |
47 | 49 | $nt = Title::newFromURL( $search ); |
48 | | - if( $nt ) { |
| 50 | + if ( $nt ) { |
49 | 51 | $dbr = wfGetDB( DB_SLAVE ); |
50 | 52 | $this->mQueryConds[] = 'LOWER(img_name)' . $dbr->buildLike( $dbr->anyString(), |
51 | 53 | strtolower( $nt->getDBkey() ), $dbr->anyString() ); |
— | — | @@ -200,4 +202,15 @@ |
201 | 203 | function getSortHeaderClass() { |
202 | 204 | return 'listfiles_sort ' . parent::getSortHeaderClass(); |
203 | 205 | } |
| 206 | + |
| 207 | + function getPagingQueries() { |
| 208 | + $queries = parent::getPagingQueries(); |
| 209 | + if ( !is_null( $this->mUserName ) ) { |
| 210 | + # Append the username to the query string |
| 211 | + foreach ( $queries as $key => &$query ) { |
| 212 | + $query['username'] = $this->mUserName; |
| 213 | + } |
| 214 | + } |
| 215 | + return $queries; |
| 216 | + } |
204 | 217 | } |