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 $mSearch = '';
48 
49  protected $mIncluding = false;
50 
51  protected $mShowAll = false;
52 
53  protected $mTableName = 'image';
54 
56  private $localRepo;
57 
59  private $commentStore;
60 
62  private $userCache;
63 
67  private const INDEX_FIELDS = [
68  'img_timestamp' => [ 'img_timestamp', 'img_name' ],
69  'img_name' => [ 'img_name' ],
70  'img_size' => [ 'img_size', 'img_name' ],
71  ];
72 
86  public function __construct(
88  $userName,
89  $search,
90  $including,
91  $showAll,
93  RepoGroup $repoGroup,
94  ILoadBalancer $loadBalancer,
97  UserNameUtils $userNameUtils
98  ) {
99  $this->setContext( $context );
100 
101  $this->mIncluding = $including;
102  $this->mShowAll = $showAll;
103  $dbr = $loadBalancer->getConnectionRef( ILoadBalancer::DB_REPLICA );
104 
105  if ( $userName !== null && $userName !== '' ) {
106  $nt = Title::makeTitleSafe( NS_USER, $userName );
107  if ( $nt === null ) {
108  $this->outputUserDoesNotExist( $userName );
109  } else {
110  $this->mUserName = $nt->getText();
111  $user = User::newFromName( $this->mUserName, false );
112  if ( $user ) {
113  $this->mUser = $user;
114  }
115  if ( !$user || ( $user->isAnon() && !$userNameUtils->isIP( $user->getName() ) ) ) {
116  $this->outputUserDoesNotExist( $userName );
117  }
118  }
119  }
120 
121  if ( $search !== '' && !$this->getConfig()->get( 'MiserMode' ) ) {
122  $this->mSearch = $search;
123  $nt = Title::newFromText( $this->mSearch );
124 
125  if ( $nt ) {
126  $this->mQueryConds[] = 'LOWER(img_name)' .
127  $dbr->buildLike( $dbr->anyString(),
128  strtolower( $nt->getDBkey() ), $dbr->anyString() );
129  }
130  }
131 
132  if ( !$including ) {
133  if ( $this->getRequest()->getText( 'sort', 'img_date' ) == 'img_date' ) {
134  $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
135  } else {
136  $this->mDefaultDirection = IndexPager::DIR_ASCENDING;
137  }
138  } else {
139  $this->mDefaultDirection = IndexPager::DIR_DESCENDING;
140  }
141  // Set database before parent constructor to avoid setting it there with wfGetDB
142  $this->mDb = $dbr;
143 
144  parent::__construct( $context, $linkRenderer );
145  $this->localRepo = $repoGroup->getLocalRepo();
146  $this->commentStore = $commentStore;
147  $this->userCache = $userCache;
148  }
149 
155  public function getRelevantUser() {
156  return $this->mUser;
157  }
158 
164  protected function outputUserDoesNotExist( $userName ) {
165  $this->getOutput()->wrapWikiMsg(
166  "<div class=\"mw-userpage-userdoesnotexist error\">\n$1\n</div>",
167  [
168  'listfiles-userdoesnotexist',
169  wfEscapeWikiText( $userName ),
170  ]
171  );
172  }
173 
181  protected function buildQueryConds( $table ) {
182  $prefix = $table === 'image' ? 'img' : 'oi';
183  $conds = [];
184 
185  if ( $this->mUserName !== null ) {
186  // getQueryInfoReal() should have handled the tables and joins.
187  $conds['actor_name'] = $this->mUserName;
188  }
189 
190  if ( $this->mSearch !== '' ) {
191  $nt = Title::newFromText( $this->mSearch );
192  if ( $nt ) {
193  $dbr = $this->getDatabase();
194  $conds[] = 'LOWER(' . $prefix . '_name)' .
195  $dbr->buildLike( $dbr->anyString(),
196  strtolower( $nt->getDBkey() ), $dbr->anyString() );
197  }
198  }
199 
200  if ( $table === 'oldimage' ) {
201  // Don't want to deal with revdel.
202  // Future fixme: Show partial information as appropriate.
203  // Would have to be careful about filtering by username when username is deleted.
204  $conds['oi_deleted'] = 0;
205  }
206 
207  // Add mQueryConds in case anyone was subclassing and using the old variable.
208  return $conds + $this->mQueryConds;
209  }
210 
211  protected function getFieldNames() {
212  if ( !$this->mFieldNames ) {
213  $this->mFieldNames = [
214  'img_timestamp' => $this->msg( 'listfiles_date' )->text(),
215  'img_name' => $this->msg( 'listfiles_name' )->text(),
216  'thumb' => $this->msg( 'listfiles_thumb' )->text(),
217  'img_size' => $this->msg( 'listfiles_size' )->text(),
218  ];
219  if ( $this->mUserName === null ) {
220  // Do not show username if filtering by username
221  $this->mFieldNames['img_actor'] = $this->msg( 'listfiles_user' )->text();
222  }
223  // img_description down here, in order so that its still after the username field.
224  $this->mFieldNames['img_description'] = $this->msg( 'listfiles_description' )->text();
225 
226  if ( !$this->getConfig()->get( 'MiserMode' ) && !$this->mShowAll ) {
227  $this->mFieldNames['count'] = $this->msg( 'listfiles_count' )->text();
228  }
229  if ( $this->mShowAll ) {
230  $this->mFieldNames['top'] = $this->msg( 'listfiles-latestversion' )->text();
231  }
232  }
233 
234  return $this->mFieldNames;
235  }
236 
237  protected function isFieldSortable( $field ) {
238  if ( $this->mIncluding ) {
239  return false;
240  }
241  $sortable = array_keys( self::INDEX_FIELDS );
242  /* For reference, the indicies we can use for sorting are:
243  * On the image table: img_actor_timestamp, img_size, img_timestamp
244  * On oldimage: oi_actor_timestamp, oi_name_timestamp
245  *
246  * In particular that means we cannot sort by timestamp when not filtering
247  * by user and including old images in the results. Which is sad. (T279982)
248  */
249  if ( $this->getConfig()->get( 'MiserMode' ) && $this->mUserName !== null ) {
250  // If we're sorting by user, the index only supports sorting by time.
251  if ( $field === 'img_timestamp' ) {
252  return true;
253  } else {
254  return false;
255  }
256  } elseif ( $this->getConfig()->get( 'MiserMode' )
257  && $this->mShowAll /* && mUserName === null */
258  ) {
259  // no oi_timestamp index, so only alphabetical sorting in this case.
260  if ( $field === 'img_name' ) {
261  return true;
262  } else {
263  return false;
264  }
265  }
266 
267  return in_array( $field, $sortable );
268  }
269 
270  public function getQueryInfo() {
271  // Hacky Hacky Hacky - I want to get query info
272  // for two different tables, without reimplementing
273  // the pager class.
274  $qi = $this->getQueryInfoReal( $this->mTableName );
275 
276  return $qi;
277  }
278 
289  protected function getQueryInfoReal( $table ) {
290  $dbr = $this->getDatabase();
291  $prefix = $table === 'oldimage' ? 'oi' : 'img';
292 
293  $tables = [ $table, 'actor' ];
294  $join_conds = [];
295 
296  if ( $table === 'oldimage' ) {
297  $fields = [
298  'img_timestamp' => 'oi_timestamp',
299  'img_name' => 'oi_name',
300  'img_size' => 'oi_size',
301  'top' => $dbr->addQuotes( 'no' )
302  ];
303  $join_conds['actor'] = [ 'JOIN', 'actor_id=oi_actor' ];
304  } else {
305  $fields = [
306  'img_timestamp',
307  'img_name',
308  'img_size',
309  'top' => $dbr->addQuotes( 'yes' )
310  ];
311  $join_conds['actor'] = [ 'JOIN', 'actor_id=img_actor' ];
312  }
313 
314  $options = [];
315 
316  # Description field
317  $commentQuery = $this->commentStore->getJoin( $prefix . '_description' );
318  $tables += $commentQuery['tables'];
319  $fields += $commentQuery['fields'];
320  $join_conds += $commentQuery['joins'];
321  $fields['description_field'] = $dbr->addQuotes( "{$prefix}_description" );
322 
323  # Actor fields
324  $fields[] = 'actor_user';
325  $fields[] = 'actor_name';
326 
327  # Depends on $wgMiserMode
328  # Will also not happen if mShowAll is true.
329  if ( array_key_exists( 'count', $this->getFieldNames() ) ) {
330  $fields['count'] = $dbr->buildSelectSubquery(
331  'oldimage',
332  'COUNT(oi_archive_name)',
333  'oi_name = img_name',
334  __METHOD__
335  );
336  }
337 
338  return [
339  'tables' => $tables,
340  'fields' => $fields,
341  'conds' => $this->buildQueryConds( $table ),
342  'options' => $options,
343  'join_conds' => $join_conds
344  ];
345  }
346 
356  public function reallyDoQuery( $offset, $limit, $order ) {
357  $dbr = $this->getDatabase();
358  $prevTableName = $this->mTableName;
359  $this->mTableName = 'image';
360  list( $tables, $fields, $conds, $fname, $options, $join_conds ) =
361  $this->buildQueryInfo( $offset, $limit, $order );
362  $imageRes = $dbr->select( $tables, $fields, $conds, $fname, $options, $join_conds );
363  $this->mTableName = $prevTableName;
364 
365  if ( !$this->mShowAll ) {
366  return $imageRes;
367  }
368 
369  $this->mTableName = 'oldimage';
370 
371  # Hacky...
372  $oldIndex = $this->mIndexField;
373  foreach ( $this->mIndexField as &$index ) {
374  if ( substr( $index, 0, 4 ) !== 'img_' ) {
375  throw new MWException( "Expected to be sorting on an image table field" );
376  }
377  $index = 'oi_' . substr( $index, 4 );
378  }
379 
380  list( $tables, $fields, $conds, $fname, $options, $join_conds ) =
381  $this->buildQueryInfo( $offset, $limit, $order );
382  $oldimageRes = $dbr->select( $tables, $fields, $conds, $fname, $options, $join_conds );
383 
384  $this->mTableName = $prevTableName;
385  $this->mIndexField = $oldIndex;
386 
387  return $this->combineResult( $imageRes, $oldimageRes, $limit, $order );
388  }
389 
401  protected function combineResult( $res1, $res2, $limit, $order ) {
402  $res1->rewind();
403  $res2->rewind();
404  $topRes1 = $res1->next();
405  $topRes2 = $res2->next();
406  $resultArray = [];
407  for ( $i = 0; $i < $limit && $topRes1 && $topRes2; $i++ ) {
408  if ( strcmp( $topRes1->{$this->mIndexField[0]}, $topRes2->{$this->mIndexField[0]} ) > 0 ) {
409  if ( $order !== IndexPager::QUERY_ASCENDING ) {
410  $resultArray[] = $topRes1;
411  $topRes1 = $res1->next();
412  } else {
413  $resultArray[] = $topRes2;
414  $topRes2 = $res2->next();
415  }
416  } elseif ( $order !== IndexPager::QUERY_ASCENDING ) {
417  $resultArray[] = $topRes2;
418  $topRes2 = $res2->next();
419  } else {
420  $resultArray[] = $topRes1;
421  $topRes1 = $res1->next();
422  }
423  }
424 
425  for ( ; $i < $limit && $topRes1; $i++ ) {
426  $resultArray[] = $topRes1;
427  $topRes1 = $res1->next();
428  }
429 
430  for ( ; $i < $limit && $topRes2; $i++ ) {
431  $resultArray[] = $topRes2;
432  $topRes2 = $res2->next();
433  }
434 
435  return new FakeResultWrapper( $resultArray );
436  }
437 
438  public function getIndexField() {
439  return [ self::INDEX_FIELDS[$this->mSort] ];
440  }
441 
442  public function getDefaultSort() {
443  if ( $this->mShowAll && $this->getConfig()->get( 'MiserMode' ) && $this->mUserName === null ) {
444  // Unfortunately no index on oi_timestamp.
445  return 'img_name';
446  } else {
447  return 'img_timestamp';
448  }
449  }
450 
451  protected function doBatchLookups() {
452  $userIds = [];
453  $this->mResult->seek( 0 );
454  foreach ( $this->mResult as $row ) {
455  if ( $row->actor_user ) {
456  $userIds[] = $row->actor_user;
457  }
458  }
459  # Do a link batch query for names and userpages
460  $this->userCache->doQuery( $userIds, [ 'userpage' ], __METHOD__ );
461  }
462 
477  public function formatValue( $field, $value ) {
478  $linkRenderer = $this->getLinkRenderer();
479  switch ( $field ) {
480  case 'thumb':
481  $opt = [ 'time' => wfTimestamp( TS_MW, $this->mCurrentRow->img_timestamp ) ];
482  $file = $this->localRepo->findFile( $this->getCurrentRow()->img_name, $opt );
483  // If statement for paranoia
484  if ( $file ) {
485  $thumb = $file->transform( [ 'width' => 180, 'height' => 360 ] );
486  if ( $thumb ) {
487  return $thumb->toHtml( [ 'desc-link' => true ] );
488  } else {
489  return $this->msg( 'thumbnail_error', '' )->escaped();
490  }
491  } else {
492  return htmlspecialchars( $this->getCurrentRow()->img_name );
493  }
494  case 'img_timestamp':
495  // We may want to make this a link to the "old" version when displaying old files
496  return htmlspecialchars( $this->getLanguage()->userTimeAndDate( $value, $this->getUser() ) );
497  case 'img_name':
498  static $imgfile = null;
499  if ( $imgfile === null ) {
500  $imgfile = $this->msg( 'imgfile' )->text();
501  }
502 
503  // Weird files can maybe exist? T24227
504  $filePage = Title::makeTitleSafe( NS_FILE, $value );
505  if ( $filePage ) {
506  $link = $linkRenderer->makeKnownLink(
507  $filePage,
508  $filePage->getText()
509  );
510  $download = Xml::element(
511  'a',
512  [ 'href' => $this->localRepo->newFile( $filePage )->getUrl() ],
513  $imgfile
514  );
515  $download = $this->msg( 'parentheses' )->rawParams( $download )->escaped();
516 
517  // Add delete links if allowed
518  // From https://github.com/Wikia/app/pull/3859
519  if ( $this->getAuthority()->probablyCan( 'delete', $filePage ) ) {
520  $deleteMsg = $this->msg( 'listfiles-delete' )->text();
521 
522  $delete = $linkRenderer->makeKnownLink(
523  $filePage, $deleteMsg, [], [ 'action' => 'delete' ]
524  );
525  $delete = $this->msg( 'parentheses' )->rawParams( $delete )->escaped();
526 
527  return "$link $download $delete";
528  }
529 
530  return "$link $download";
531  } else {
532  return htmlspecialchars( $value );
533  }
534  case 'img_actor':
535  if ( $this->mCurrentRow->actor_user ) {
536  $name = $this->mCurrentRow->actor_name;
537  $link = $linkRenderer->makeLink(
538  Title::makeTitle( NS_USER, $name ),
539  $name
540  );
541  } else {
542  $link = htmlspecialchars( $value );
543  }
544 
545  return $link;
546  case 'img_size':
547  return htmlspecialchars( $this->getLanguage()->formatSize( $value ) );
548  case 'img_description':
549  $field = $this->mCurrentRow->description_field;
550  $value = $this->commentStore->getComment( $field, $this->mCurrentRow )->text;
551  return Linker::formatComment( $value );
552  case 'count':
553  return $this->getLanguage()->formatNum( intval( $value ) + 1 );
554  case 'top':
555  // Messages: listfiles-latestversion-yes, listfiles-latestversion-no
556  return $this->msg( 'listfiles-latestversion-' . $value )->escaped();
557  default:
558  throw new MWException( "Unknown field '$field'" );
559  }
560  }
561 
562  public function getForm() {
563  $formDescriptor = [];
564  $formDescriptor['limit'] = [
565  'type' => 'select',
566  'name' => 'limit',
567  'label-message' => 'table_pager_limit_label',
568  'options' => $this->getLimitSelectList(),
569  'default' => $this->mLimit,
570  ];
571 
572  if ( !$this->getConfig()->get( 'MiserMode' ) ) {
573  $formDescriptor['ilsearch'] = [
574  'type' => 'text',
575  'name' => 'ilsearch',
576  'id' => 'mw-ilsearch',
577  'label-message' => 'listfiles_search_for',
578  'default' => $this->mSearch,
579  'size' => '40',
580  'maxlength' => '255',
581  ];
582  }
583 
584  $formDescriptor['user'] = [
585  'type' => 'user',
586  'name' => 'user',
587  'id' => 'mw-listfiles-user',
588  'label-message' => 'username',
589  'default' => $this->mUserName,
590  'size' => '40',
591  'maxlength' => '255',
592  ];
593 
594  $formDescriptor['ilshowall'] = [
595  'type' => 'check',
596  'name' => 'ilshowall',
597  'id' => 'mw-listfiles-show-all',
598  'label-message' => 'listfiles-show-all',
599  'default' => $this->mShowAll,
600  ];
601 
602  $query = $this->getRequest()->getQueryValues();
603  unset( $query['title'] );
604  unset( $query['limit'] );
605  unset( $query['ilsearch'] );
606  unset( $query['ilshowall'] );
607  unset( $query['user'] );
608 
609  HTMLForm::factory( 'ooui', $formDescriptor, $this->getContext() )
610  ->setMethod( 'get' )
611  ->setId( 'mw-listfiles-form' )
612  ->setTitle( $this->getTitle() )
613  ->setSubmitTextMsg( 'table_pager_limit_submit' )
614  ->setWrapperLegendMsg( 'listfiles' )
615  ->addHiddenFields( $query )
616  ->prepareForm()
617  ->displayForm( '' );
618  }
619 
620  protected function getTableClass() {
621  return parent::getTableClass() . ' listfiles';
622  }
623 
624  protected function getNavClass() {
625  return parent::getNavClass() . ' listfiles_nav';
626  }
627 
628  protected function getSortHeaderClass() {
629  return parent::getSortHeaderClass() . ' listfiles_sort';
630  }
631 
632  public function getPagingQueries() {
633  $queries = parent::getPagingQueries();
634  if ( $this->mUserName !== null ) {
635  # Append the username to the query string
636  foreach ( $queries as &$query ) {
637  if ( $query !== false ) {
638  $query['user'] = $this->mUserName;
639  }
640  }
641  }
642 
643  return $queries;
644  }
645 
646  public function getDefaultQuery() {
647  $queries = parent::getDefaultQuery();
648  if ( !isset( $queries['user'] ) && $this->mUserName !== null ) {
649  $queries['user'] = $this->mUserName;
650  }
651 
652  return $queries;
653  }
654 
655  public function getTitle() {
656  return SpecialPage::getTitleFor( 'Listfiles' );
657  }
658 }
ImageListPager\reallyDoQuery
reallyDoQuery( $offset, $limit, $order)
Override reallyDoQuery to mix together two queries.
Definition: ImageListPager.php:356
ImageListPager\combineResult
combineResult( $res1, $res2, $limit, $order)
Combine results from 2 tables.
Definition: ImageListPager.php:401
ContextSource\$context
IContextSource $context
Definition: ContextSource.php:38
ContextSource\getConfig
getConfig()
Definition: ContextSource.php:71
Title\newFromText
static newFromText( $text, $defaultNamespace=NS_MAIN)
Create a new Title from text, such as what one would find in a link.
Definition: Title.php:385
ImageListPager\$mSearch
$mSearch
Definition: ImageListPager.php:47
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:628
ImageListPager\getPagingQueries
getPagingQueries()
Get a URL query array for the prev, next, first and last links.
Definition: ImageListPager.php:632
MediaWiki\Linker\LinkRenderer
Class that generates HTML links 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:1692
ImageListPager\getNavClass
getNavClass()
Definition: ImageListPager.php:624
ImageListPager\$mUser
User null $mUser
The relevant user.
Definition: ImageListPager.php:45
IndexPager\getDatabase
getDatabase()
Get the Database object in use.
Definition: IndexPager.php:244
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:592
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:107
ContextSource\getRequest
getRequest()
Definition: ContextSource.php:80
ImageListPager\doBatchLookups
doBatchLookups()
Called from getBody(), before getStartBody() is called and after doQuery() was called.
Definition: ImageListPager.php:451
Wikimedia\Rdbms\FakeResultWrapper
Overloads the relevant methods of the real ResultsWrapper so it doesn't go anywhere near an actual da...
Definition: FakeResultWrapper.php:11
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:438
$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:211
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:164
ImageListPager\$userCache
UserCache $userCache
Definition: ImageListPager.php:62
ImageListPager\getQueryInfo
getQueryInfo()
Provides all parameters needed for the main paged query.
Definition: ImageListPager.php:270
Wikimedia\Rdbms\IResultWrapper
Result wrapper for grabbing data queried from an IDatabase object.
Definition: IResultWrapper.php:24
IndexPager\buildQueryInfo
buildQueryInfo( $offset, $limit, $order)
Build variables to use by the database wrapper.
Definition: IndexPager.php:464
ContextSource\getOutput
getOutput()
Definition: ContextSource.php:125
ImageListPager\$mShowAll
$mShowAll
Definition: ImageListPager.php:51
TablePager
Table-based display with a user-selectable sort order.
Definition: TablePager.php:31
ImageListPager\getTitle
getTitle()
Definition: ImageListPager.php:655
Xml\element
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
Definition: Xml.php:41
ImageListPager\__construct
__construct(IContextSource $context, $userName, $search, $including, $showAll, LinkRenderer $linkRenderer, RepoGroup $repoGroup, ILoadBalancer $loadBalancer, CommentStore $commentStore, UserCache $userCache, UserNameUtils $userNameUtils)
Definition: ImageListPager.php:86
ImageListPager\INDEX_FIELDS
const INDEX_FIELDS
The unique sort fields for the sort options for unique pagniate.
Definition: ImageListPager.php:67
ImageListPager\$mTableName
$mTableName
Definition: ImageListPager.php:53
Title\makeTitle
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:650
DB_REPLICA
const DB_REPLICA
Definition: defines.php:25
ContextSource\setContext
setContext(IContextSource $context)
Definition: ContextSource.php:62
ImageListPager\$commentStore
CommentStore $commentStore
Definition: ImageListPager.php:59
ImageListPager\getTableClass
getTableClass()
TablePager relies on mw-datatable for styling, see T214208.
Definition: ImageListPager.php:620
ContextSource\msg
msg( $key,... $params)
Get a Message object with context set Parameters are the same as wfMessage()
Definition: ContextSource.php:196
Title\makeTitleSafe
static makeTitleSafe( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
Definition: Title.php:676
ImageListPager\getDefaultSort
getDefaultSort()
The database field name used as a default sort order.
Definition: ImageListPager.php:442
RepoGroup\getLocalRepo
getLocalRepo()
Get the local repository, i.e.
Definition: RepoGroup.php:370
ImageListPager\getQueryInfoReal
getQueryInfoReal( $table)
Actually get the query info.
Definition: ImageListPager.php:289
ImageListPager\$mIncluding
$mIncluding
Definition: ImageListPager.php:49
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:1456
ImageListPager\buildQueryConds
buildQueryConds( $table)
Build the where clause of the query.
Definition: ImageListPager.php:181
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:237
IContextSource
Interface for objects which can provide a MediaWiki context on request.
Definition: IContextSource.php:57
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:1208
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:56
RepoGroup
Prioritized list of file repositories.
Definition: RepoGroup.php:33
ImageListPager\getRelevantUser
getRelevantUser()
Get the user relevant to the ImageList.
Definition: ImageListPager.php:155
ImageListPager\formatValue
formatValue( $field, $value)
Definition: ImageListPager.php:477
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:326
LocalRepo
A repository that stores files in the local filesystem and registers them in the wiki's own database.
Definition: LocalRepo.php:40
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:646
ImageListPager\getForm
getForm()
Definition: ImageListPager.php:562
ImageListPager\$mUserName
$mUserName
Definition: ImageListPager.php:38
ImageListPager\$mFieldNames
$mFieldNames
Definition: ImageListPager.php:33