MediaWiki  master
ImageListPager.php
Go to the documentation of this file.
1 <?php
27 
31 class ImageListPager extends TablePager {
32 
33  protected $mFieldNames = null;
34 
35  // Subclasses should override buildQueryConds instead of using $mQueryConds variable.
36  protected $mQueryConds = [];
37 
38  protected $mUserName = null;
39 
45  protected $mUser = null;
46 
47  protected $mIncluding = false;
48 
49  protected $mShowAll = false;
50 
51  protected $mTableName = 'image';
52 
54  private $localRepo;
55 
57  private $commentStore;
58 
60  private $userCache;
61 
65  private const INDEX_FIELDS = [
66  'img_timestamp' => [ 'img_timestamp', 'img_name' ],
67  'img_name' => [ 'img_name' ],
68  'img_size' => [ 'img_size', 'img_name' ],
69  ];
70 
84  public function __construct(
86  $userName,
87  $search,
88  $including,
89  $showAll,
91  RepoGroup $repoGroup,
92  ILoadBalancer $loadBalancer,
95  UserNameUtils $userNameUtils
96  ) {
97  $this->setContext( $context );
98 
99  $this->mIncluding = $including;
100  $this->mShowAll = $showAll;
101  $dbr = $loadBalancer->getConnectionRef( ILoadBalancer::DB_REPLICA );
102 
103  if ( $userName !== null && $userName !== '' ) {
104  $nt = Title::makeTitleSafe( NS_USER, $userName );
105  if ( $nt === null ) {
106  $this->outputUserDoesNotExist( $userName );
107  } else {
108  $this->mUserName = $nt->getText();
109  $user = User::newFromName( $this->mUserName, false );
110  if ( $user ) {
111  $this->mUser = $user;
112  }
113  if ( !$user || ( $user->isAnon() && !$userNameUtils->isIP( $user->getName() ) ) ) {
114  $this->outputUserDoesNotExist( $userName );
115  }
116  }
117  }
118 
119  if ( !$including ) {
120  if ( $this->getRequest()->getText( 'sort', 'img_date' ) == 'img_date' ) {
121  $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
122  } else {
123  $this->mDefaultDirection = IndexPager::DIR_ASCENDING;
124  }
125  } else {
126  $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
127  }
128  // Set database before parent constructor to avoid setting it there with wfGetDB
129  $this->mDb = $dbr;
130 
131  parent::__construct( $context, $linkRenderer );
132  $this->localRepo = $repoGroup->getLocalRepo();
133  $this->commentStore = $commentStore;
134  $this->userCache = $userCache;
135  }
136 
142  public function getRelevantUser() {
143  return $this->mUser;
144  }
145 
151  protected function outputUserDoesNotExist( $userName ) {
152  $this->getOutput()->wrapWikiMsg(
153  "<div class=\"mw-userpage-userdoesnotexist error\">\n$1\n</div>",
154  [
155  'listfiles-userdoesnotexist',
156  wfEscapeWikiText( $userName ),
157  ]
158  );
159  }
160 
168  protected function buildQueryConds( $table ) {
169  $prefix = $table === 'image' ? 'img' : 'oi';
170  $conds = [];
171 
172  if ( $this->mUserName !== null ) {
173  // getQueryInfoReal() should have handled the tables and joins.
174  $conds['actor_name'] = $this->mUserName;
175  }
176 
177  if ( $table === 'oldimage' ) {
178  // Don't want to deal with revdel.
179  // Future fixme: Show partial information as appropriate.
180  // Would have to be careful about filtering by username when username is deleted.
181  $conds['oi_deleted'] = 0;
182  }
183 
184  // Add mQueryConds in case anyone was subclassing and using the old variable.
185  return $conds + $this->mQueryConds;
186  }
187 
188  protected function getFieldNames() {
189  if ( !$this->mFieldNames ) {
190  $this->mFieldNames = [
191  'img_timestamp' => $this->msg( 'listfiles_date' )->text(),
192  'img_name' => $this->msg( 'listfiles_name' )->text(),
193  'thumb' => $this->msg( 'listfiles_thumb' )->text(),
194  'img_size' => $this->msg( 'listfiles_size' )->text(),
195  ];
196  if ( $this->mUserName === null ) {
197  // Do not show username if filtering by username
198  $this->mFieldNames['img_actor'] = $this->msg( 'listfiles_user' )->text();
199  }
200  // img_description down here, in order so that its still after the username field.
201  $this->mFieldNames['img_description'] = $this->msg( 'listfiles_description' )->text();
202 
203  if ( !$this->getConfig()->get( 'MiserMode' ) && !$this->mShowAll ) {
204  $this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text();
205  }
206  if ( $this->mShowAll ) {
207  $this->mFieldNames['top'] = $this->msg( 'listfiles-latestversion' )->text();
208  }
209  }
210 
211  return $this->mFieldNames;
212  }
213 
214  protected function isFieldSortable( $field ) {
215  if ( $this->mIncluding ) {
216  return false;
217  }
218  $sortable = array_keys( self::INDEX_FIELDS );
219  /* For reference, the indices we can use for sorting are:
220  * On the image table: img_actor_timestamp, img_size, img_timestamp
221  * On oldimage: oi_actor_timestamp, oi_name_timestamp
222  *
223  * In particular that means we cannot sort by timestamp when not filtering
224  * by user and including old images in the results. Which is sad. (T279982)
225  */
226  if ( $this->getConfig()->get( 'MiserMode' ) && $this->mUserName !== null ) {
227  // If we're sorting by user, the index only supports sorting by time.
228  return $field === 'img_timestamp';
229  } elseif ( $this->getConfig()->get( 'MiserMode' )
230  && $this->mShowAll /* && mUserName === null */
231  ) {
232  // no oi_timestamp index, so only alphabetical sorting in this case.
233  return $field === 'img_name';
234  }
235 
236  return in_array( $field, $sortable );
237  }
238 
239  public function getQueryInfo() {
240  // Hacky Hacky Hacky - I want to get query info
241  // for two different tables, without reimplementing
242  // the pager class.
243  $qi = $this->getQueryInfoReal( $this->mTableName );
244 
245  return $qi;
246  }
247 
258  protected function getQueryInfoReal( $table ) {
259  $dbr = $this->getDatabase();
260  $prefix = $table === 'oldimage' ? 'oi' : 'img';
261 
262  $tables = [ $table, 'actor' ];
263  $join_conds = [];
264 
265  if ( $table === 'oldimage' ) {
266  $fields = [
267  'img_timestamp' => 'oi_timestamp',
268  'img_name' => 'oi_name',
269  'img_size' => 'oi_size',
270  'top' => $dbr->addQuotes( 'no' )
271  ];
272  $join_conds['actor'] = [ 'JOIN', 'actor_id=oi_actor' ];
273  } else {
274  $fields = [
275  'img_timestamp',
276  'img_name',
277  'img_size',
278  'top' => $dbr->addQuotes( 'yes' )
279  ];
280  $join_conds['actor'] = [ 'JOIN', 'actor_id=img_actor' ];
281  }
282 
283  $options = [];
284 
285  # Description field
286  $commentQuery = $this->commentStore->getJoin( $prefix . '_description' );
287  $tables += $commentQuery['tables'];
288  $fields += $commentQuery['fields'];
289  $join_conds += $commentQuery['joins'];
290  $fields['description_field'] = $dbr->addQuotes( "{$prefix}_description" );
291 
292  # Actor fields
293  $fields[] = 'actor_user';
294  $fields[] = 'actor_name';
295 
296  # Depends on $wgMiserMode
297  # Will also not happen if mShowAll is true.
298  if ( array_key_exists( 'count', $this->getFieldNames() ) ) {
299  $fields['count'] = $dbr->buildSelectSubquery(
300  'oldimage',
301  'COUNT(oi_archive_name)',
302  'oi_name = img_name',
303  __METHOD__
304  );
305  }
306 
307  return [
308  'tables' => $tables,
309  'fields' => $fields,
310  'conds' => $this->buildQueryConds( $table ),
311  'options' => $options,
312  'join_conds' => $join_conds
313  ];
314  }
315 
325  public function reallyDoQuery( $offset, $limit, $order ) {
326  $dbr = $this->getDatabase();
327  $prevTableName = $this->mTableName;
328  $this->mTableName = 'image';
329  list( $tables, $fields, $conds, $fname, $options, $join_conds ) =
330  $this->buildQueryInfo( $offset, $limit, $order );
331  $imageRes = $dbr->select( $tables, $fields, $conds, $fname, $options, $join_conds );
332  $this->mTableName = $prevTableName;
333 
334  if ( !$this->mShowAll ) {
335  return $imageRes;
336  }
337 
338  $this->mTableName = 'oldimage';
339 
340  # Hacky...
341  $oldIndex = $this->mIndexField;
342  foreach ( $this->mIndexField as &$index ) {
343  if ( substr( $index, 0, 4 ) !== 'img_' ) {
344  throw new MWException( "Expected to be sorting on an image table field" );
345  }
346  $index = 'oi_' . substr( $index, 4 );
347  }
348 
349  list( $tables, $fields, $conds, $fname, $options, $join_conds ) =
350  $this->buildQueryInfo( $offset, $limit, $order );
351  $oldimageRes = $dbr->select( $tables, $fields, $conds, $fname, $options, $join_conds );
352 
353  $this->mTableName = $prevTableName;
354  $this->mIndexField = $oldIndex;
355 
356  return $this->combineResult( $imageRes, $oldimageRes, $limit, $order );
357  }
358 
370  protected function combineResult( $res1, $res2, $limit, $order ) {
371  $res1->rewind();
372  $res2->rewind();
373  $topRes1 = $res1->next();
374  $topRes2 = $res2->next();
375  $resultArray = [];
376  for ( $i = 0; $i < $limit && $topRes1 && $topRes2; $i++ ) {
377  if ( strcmp( $topRes1->{$this->mIndexField[0]}, $topRes2->{$this->mIndexField[0]} ) > 0 ) {
378  if ( $order !== IndexPager::QUERY_ASCENDING ) {
379  $resultArray[] = $topRes1;
380  $topRes1 = $res1->next();
381  } else {
382  $resultArray[] = $topRes2;
383  $topRes2 = $res2->next();
384  }
385  } elseif ( $order !== IndexPager::QUERY_ASCENDING ) {
386  $resultArray[] = $topRes2;
387  $topRes2 = $res2->next();
388  } else {
389  $resultArray[] = $topRes1;
390  $topRes1 = $res1->next();
391  }
392  }
393 
394  for ( ; $i < $limit && $topRes1; $i++ ) {
395  $resultArray[] = $topRes1;
396  $topRes1 = $res1->next();
397  }
398 
399  for ( ; $i < $limit && $topRes2; $i++ ) {
400  $resultArray[] = $topRes2;
401  $topRes2 = $res2->next();
402  }
403 
404  return new FakeResultWrapper( $resultArray );
405  }
406 
407  public function getIndexField() {
408  return [ self::INDEX_FIELDS[$this->mSort] ];
409  }
410 
411  public function getDefaultSort() {
412  if ( $this->mShowAll && $this->getConfig()->get( 'MiserMode' ) && $this->mUserName === null ) {
413  // Unfortunately no index on oi_timestamp.
414  return 'img_name';
415  } else {
416  return 'img_timestamp';
417  }
418  }
419 
420  protected function doBatchLookups() {
421  $userIds = [];
422  $this->mResult->seek( 0 );
423  foreach ( $this->mResult as $row ) {
424  if ( $row->actor_user ) {
425  $userIds[] = $row->actor_user;
426  }
427  }
428  # Do a link batch query for names and userpages
429  $this->userCache->doQuery( $userIds, [ 'userpage' ], __METHOD__ );
430  }
431 
438  public function formatValue( $field, $value ) {
439  $linkRenderer = $this->getLinkRenderer();
440  switch ( $field ) {
441  case 'thumb':
442  $opt = [ 'time' => wfTimestamp( TS_MW, $this->mCurrentRow->img_timestamp ) ];
443  $file = $this->localRepo->findFile( $this->getCurrentRow()->img_name, $opt );
444  // If statement for paranoia
445  if ( $file ) {
446  $thumb = $file->transform( [ 'width' => 180, 'height' => 360 ] );
447  if ( $thumb ) {
448  return $thumb->toHtml( [ 'desc-link' => true ] );
449  } else {
450  return $this->msg( 'thumbnail_error', '' )->escaped();
451  }
452  } else {
453  return htmlspecialchars( $this->getCurrentRow()->img_name );
454  }
455  case 'img_timestamp':
456  // We may want to make this a link to the "old" version when displaying old files
457  return htmlspecialchars( $this->getLanguage()->userTimeAndDate( $value, $this->getUser() ) );
458  case 'img_name':
459  static $imgfile = null;
460  if ( $imgfile === null ) {
461  $imgfile = $this->msg( 'imgfile' )->text();
462  }
463 
464  // Weird files can maybe exist? T24227
465  $filePage = Title::makeTitleSafe( NS_FILE, $value );
466  if ( $filePage ) {
467  $link = $linkRenderer->makeKnownLink(
468  $filePage,
469  $filePage->getText()
470  );
471  $download = Xml::element(
472  'a',
473  [ 'href' => $this->localRepo->newFile( $filePage )->getUrl() ],
474  $imgfile
475  );
476  $download = $this->msg( 'parentheses' )->rawParams( $download )->escaped();
477 
478  // Add delete links if allowed
479  // From https://github.com/Wikia/app/pull/3859
480  if ( $this->getAuthority()->probablyCan( 'delete', $filePage ) ) {
481  $deleteMsg = $this->msg( 'listfiles-delete' )->text();
482 
483  $delete = $linkRenderer->makeKnownLink(
484  $filePage, $deleteMsg, [], [ 'action' => 'delete' ]
485  );
486  $delete = $this->msg( 'parentheses' )->rawParams( $delete )->escaped();
487 
488  return "$link $download $delete";
489  }
490 
491  return "$link $download";
492  } else {
493  return htmlspecialchars( $value );
494  }
495  case 'img_actor':
496  if ( $this->mCurrentRow->actor_user ) {
497  $name = $this->mCurrentRow->actor_name;
498  $link = $linkRenderer->makeLink(
499  Title::makeTitle( NS_USER, $name ),
500  $name
501  );
502  } else {
503  $link = htmlspecialchars( $value );
504  }
505 
506  return $link;
507  case 'img_size':
508  return htmlspecialchars( $this->getLanguage()->formatSize( $value ) );
509  case 'img_description':
510  $field = $this->mCurrentRow->description_field;
511  $value = $this->commentStore->getComment( $field, $this->mCurrentRow )->text;
512  return Linker::formatComment( $value );
513  case 'count':
514  return htmlspecialchars( $this->getLanguage()->formatNum( intval( $value ) + 1 ) );
515  case 'top':
516  // Messages: listfiles-latestversion-yes, listfiles-latestversion-no
517  return $this->msg( 'listfiles-latestversion-' . $value )->escaped();
518  default:
519  throw new MWException( "Unknown field '$field'" );
520  }
521  }
522 
523  public function getForm() {
524  $formDescriptor = [];
525  $formDescriptor['limit'] = [
526  'type' => 'select',
527  'name' => 'limit',
528  'label-message' => 'table_pager_limit_label',
529  'options' => $this->getLimitSelectList(),
530  'default' => $this->mLimit,
531  ];
532 
533  $formDescriptor['user'] = [
534  'type' => 'user',
535  'name' => 'user',
536  'id' => 'mw-listfiles-user',
537  'label-message' => 'username',
538  'default' => $this->mUserName,
539  'size' => '40',
540  'maxlength' => '255',
541  ];
542 
543  $formDescriptor['ilshowall'] = [
544  'type' => 'check',
545  'name' => 'ilshowall',
546  'id' => 'mw-listfiles-show-all',
547  'label-message' => 'listfiles-show-all',
548  'default' => $this->mShowAll,
549  ];
550 
551  $query = $this->getRequest()->getQueryValues();
552  unset( $query['title'] );
553  unset( $query['limit'] );
554  unset( $query['ilsearch'] );
555  unset( $query['ilshowall'] );
556  unset( $query['user'] );
557 
558  HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() )
559  ->setMethod( 'get' )
560  ->setId( 'mw-listfiles-form' )
561  ->setTitle( $this->getTitle() )
562  ->setSubmitTextMsg( 'table_pager_limit_submit' )
563  ->setWrapperLegendMsg( 'listfiles' )
564  ->addHiddenFields( $query )
565  ->prepareForm()
566  ->displayForm( '' );
567  }
568 
569  protected function getTableClass() {
570  return parent::getTableClass() . ' listfiles';
571  }
572 
573  protected function getNavClass() {
574  return parent::getNavClass() . ' listfiles_nav';
575  }
576 
577  protected function getSortHeaderClass() {
578  return parent::getSortHeaderClass() . ' listfiles_sort';
579  }
580 
581  public function getPagingQueries() {
582  $queries = parent::getPagingQueries();
583  if ( $this->mUserName !== null ) {
584  # Append the username to the query string
585  foreach ( $queries as &$query ) {
586  if ( $query !== false ) {
587  $query['user'] = $this->mUserName;
588  }
589  }
590  }
591 
592  return $queries;
593  }
594 
595  public function getDefaultQuery() {
596  $queries = parent::getDefaultQuery();
597  if ( !isset( $queries['user'] ) && $this->mUserName !== null ) {
598  $queries['user'] = $this->mUserName;
599  }
600 
601  return $queries;
602  }
603 
604  public function getTitle() {
605  return SpecialPage::getTitleFor( 'Listfiles' );
606  }
607 }
ImageListPager\reallyDoQuery
reallyDoQuery( $offset, $limit, $order)
Override reallyDoQuery to mix together two queries.
Definition: ImageListPager.php:325
ImageListPager\combineResult
combineResult( $res1, $res2, $limit, $order)
Combine results from 2 tables.
Definition: ImageListPager.php:370
ContextSource\$context
IContextSource $context
Definition: ContextSource.php:39
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:72
UserCache
Definition: UserCache.php:32
IndexPager\QUERY_ASCENDING
const QUERY_ASCENDING
Backwards-compatible constant for reallyDoQuery() (do not change)
Definition: IndexPager.php:83
ImageListPager\getSortHeaderClass
getSortHeaderClass()
Definition: ImageListPager.php:577
ImageListPager\getPagingQueries
getPagingQueries()
Get a URL query array for the prev, next, first and last links.
Definition: ImageListPager.php:581
MediaWiki\Linker\LinkRenderer
Class that generates HTML anchor link elements for pages.
Definition: LinkRenderer.php:43
wfTimestamp
wfTimestamp( $outputtype=TS_UNIX, $ts=0)
Get a timestamp string in one of various formats.
Definition: GlobalFunctions.php:1649
ImageListPager\getNavClass
getNavClass()
Definition: ImageListPager.php:573
ImageListPager\$mUser
User null $mUser
The relevant user.
Definition: ImageListPager.php:45
IndexPager\getDatabase
getDatabase()
Get the Database object in use.
Definition: IndexPager.php:248
getAuthority
getAuthority()
MediaWiki\User\UserNameUtils\isIP
isIP(string $name)
Does the string match an anonymous IP address?
Definition: UserNameUtils.php:337
CommentStore
Handle database storage of comments such as edit summaries and log reasons.
Definition: CommentStore.php:42
$file
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
Definition: router.php:42
User\newFromName
static newFromName( $name, $validate='valid')
Definition: User.php:595
IndexPager\$linkRenderer
LinkRenderer $linkRenderer
Definition: IndexPager.php:167
SpecialPage\getTitleFor
static getTitleFor( $name, $subpage=false, $fragment='')
Get a localised Title object for a specified special page name If you don't need a full Title object,...
Definition: SpecialPage.php:131
ContextSource\getRequest
getRequest()
Definition: ContextSource.php:81
ImageListPager\doBatchLookups
doBatchLookups()
Called from getBody(), before getStartBody() is called and after doQuery() was called.
Definition: ImageListPager.php:420
Wikimedia\Rdbms\FakeResultWrapper
Overloads the relevant methods of the real ResultWrapper so it doesn't go anywhere near an actual dat...
Definition: FakeResultWrapper.php:12
getContext
getContext()
IndexPager\DIR_ASCENDING
const DIR_ASCENDING
Backwards-compatible constant for $mDefaultDirection field (do not change)
Definition: IndexPager.php:78
Wikimedia\Rdbms\ILoadBalancer\getConnectionRef
getConnectionRef( $i, $groups=[], $domain=false, $flags=0)
Get a live database handle reference for a server index.
ImageListPager\getIndexField
getIndexField()
Returns the name of the index field.If the pager supports multiple orders, it may return an array of ...
Definition: ImageListPager.php:407
$dbr
$dbr
Definition: testCompression.php:54
IndexPager\$mIndexField
string string[] $mIndexField
The index to actually be used for ordering.
Definition: IndexPager.php:110
ImageListPager\getFieldNames
getFieldNames()
An array mapping database field names to a textual description of the field name, for use in the tabl...
Definition: ImageListPager.php:188
getUser
getUser()
MWException
MediaWiki exception.
Definition: MWException.php:29
ImageListPager\outputUserDoesNotExist
outputUserDoesNotExist( $userName)
Add a message to the output stating that the user doesn't exist.
Definition: ImageListPager.php:151
ImageListPager\$userCache
UserCache $userCache
Definition: ImageListPager.php:60
ImageListPager\getQueryInfo
getQueryInfo()
Provides all parameters needed for the main paged query.
Definition: ImageListPager.php:239
Wikimedia\Rdbms\IResultWrapper
Result wrapper for grabbing data queried from an IDatabase object.
Definition: IResultWrapper.php:26
IndexPager\buildQueryInfo
buildQueryInfo( $offset, $limit, $order)
Build variables to use by the database wrapper.
Definition: IndexPager.php:475
ContextSource\getOutput
getOutput()
Definition: ContextSource.php:126
ImageListPager\$mShowAll
$mShowAll
Definition: ImageListPager.php:49
TablePager
Table-based display with a user-selectable sort order.
Definition: TablePager.php:31
ImageListPager\getTitle
getTitle()
Definition: ImageListPager.php:604
Xml\element
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
Definition: Xml.php:42
ImageListPager\__construct
__construct(IContextSource $context, $userName, $search, $including, $showAll, LinkRenderer $linkRenderer, RepoGroup $repoGroup, ILoadBalancer $loadBalancer, CommentStore $commentStore, UserCache $userCache, UserNameUtils $userNameUtils)
Definition: ImageListPager.php:84
ImageListPager\INDEX_FIELDS
const INDEX_FIELDS
The unique sort fields for the sort options for unique paginate.
Definition: ImageListPager.php:65
ImageListPager\$mTableName
$mTableName
Definition: ImageListPager.php:51
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:648
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
ContextSource\setContext
setContext(IContextSource $context)
Definition: ContextSource.php:63
ImageListPager\$commentStore
CommentStore $commentStore
Definition: ImageListPager.php:57
ImageListPager\getTableClass
getTableClass()
TablePager relies on mw-datatable for styling, see T214208.
Definition: ImageListPager.php:569
ContextSource\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:197
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:674
ImageListPager\getDefaultSort
getDefaultSort()
The database field name used as a default sort order.
Definition: ImageListPager.php:411
RepoGroup\getLocalRepo
getLocalRepo()
Get the local repository, i.e.
Definition: RepoGroup.php:341
ImageListPager\getQueryInfoReal
getQueryInfoReal( $table)
Actually get the query info.
Definition: ImageListPager.php:258
ImageListPager\$mIncluding
$mIncluding
Definition: ImageListPager.php:47
ImageListPager\$mQueryConds
$mQueryConds
Definition: ImageListPager.php:36
wfEscapeWikiText
wfEscapeWikiText( $text)
Escapes the given text so that it may be output using addWikiText() without any linking,...
Definition: GlobalFunctions.php:1440
ImageListPager\buildQueryConds
buildQueryConds( $table)
Build the where clause of the query.
Definition: ImageListPager.php:168
NS_USER
const NS_USER
Definition: Defines.php:66
ImageListPager\isFieldSortable
isFieldSortable( $field)
Return true if the named field should be sortable by the UI, false otherwise.
Definition: ImageListPager.php:214
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:58
Linker\formatComment
static formatComment( $comment, $title=null, $local=false, $wikiId=null)
This function is called by all recent changes variants, by the page history, and by the user contribu...
Definition: Linker.php:1413
IndexPager\DIR_DESCENDING
const DIR_DESCENDING
Backwards-compatible constant for $mDefaultDirection field (do not change)
Definition: IndexPager.php:80
ImageListPager
Definition: ImageListPager.php:31
MediaWiki\User\UserNameUtils
UserNameUtils service.
Definition: UserNameUtils.php:42
getTitle
getTitle()
Definition: RevisionSearchResultTrait.php:81
ImageListPager\$localRepo
LocalRepo $localRepo
Definition: ImageListPager.php:54
RepoGroup
Prioritized list of file repositories.
Definition: RepoGroup.php:32
ImageListPager\getRelevantUser
getRelevantUser()
Get the user relevant to the ImageList.
Definition: ImageListPager.php:142
ImageListPager\formatValue
formatValue( $field, $value)
Definition: ImageListPager.php:438
NS_FILE
const NS_FILE
Definition: Defines.php:70
User
The User object encapsulates all of the user-specific settings (user_id, name, rights,...
Definition: User.php:67
HTMLForm\factory
static factory( $displayFormat,... $arguments)
Construct a HTMLForm object for given display type.
Definition: HTMLForm.php:332
LocalRepo
A repository that stores files in the local filesystem and registers them in the wiki's own database.
Definition: LocalRepo.php:41
Wikimedia\Rdbms\ILoadBalancer
Database cluster connection, tracking, load balancing, and transaction manager interface.
Definition: ILoadBalancer.php:81
ImageListPager\getDefaultQuery
getDefaultQuery()
Get an array of query parameters that should be put into self-links.
Definition: ImageListPager.php:595
ImageListPager\getForm
getForm()
Definition: ImageListPager.php:523
ImageListPager\$mUserName
$mUserName
Definition: ImageListPager.php:38
ImageListPager\$mFieldNames
$mFieldNames
Definition: ImageListPager.php:33