MediaWiki  REL1_24
ImageListPager Class Reference
Inheritance diagram for ImageListPager:
Collaboration diagram for ImageListPager:

List of all members.

Public Member Functions

 __construct (IContextSource $context, $userName=null, $search= '', $including=false, $showAll=false)
 doBatchLookups ()
 Called from getBody(), before getStartBody() is called and after doQuery() was called.
 formatValue ($field, $value)
 getDefaultQuery ()
 Get an array of query parameters that should be put into self-links.
 getDefaultSort ()
 The database field name used as a default sort order.
 getFieldNames ()
 getForm ()
 getNavClass ()
 getPagingQueries ()
 Get a URL query array for the prev, next, first and last links.
 getQueryInfo ()
 This function should be overridden to provide all parameters needed for the main paged query.
 getSortHeaderClass ()
 getTableClass ()
 getTitle ()
 Get the Title object.
 isFieldSortable ($field)
 Return true if the named field should be sortable by the UI, false otherwise.
 reallyDoQuery ($offset, $limit, $asc)
 Override reallyDoQuery to mix together two queries.

Protected Member Functions

 buildQueryConds ($table)
 Build the where clause of the query.
 combineResult ($res1, $res2, $limit, $ascending)
 Combine results from 2 tables.
 getQueryInfoReal ($table)
 Actually get the query info.

Protected Attributes

 $mFieldNames = null
 $mIncluding = false
 $mQueryConds = array()
 $mSearch = ''
 $mShowAll = false
 $mTableName = 'image'
 $mUserName = null

Detailed Description

Definition at line 68 of file SpecialListfiles.php.


Constructor & Destructor Documentation

ImageListPager::__construct ( IContextSource context,
userName = null,
search = '',
including = false,
showAll = false 
)

Member Function Documentation

ImageListPager::buildQueryConds ( table) [protected]

Build the where clause of the query.

Replaces the older mQueryConds member variable.

Parameters:
string$tableEither "image" or "oldimage"
Returns:
array The query conditions.

Definition at line 129 of file SpecialListfiles.php.

References $conds, $dbr, array(), Title\newFromURL(), and wfGetDB().

Referenced by getQueryInfoReal().

ImageListPager::combineResult ( res1,
res2,
limit,
ascending 
) [protected]

Combine results from 2 tables.

Note: This will throw away some results

Parameters:
ResultWrapper$res1
ResultWrapper$res2
int$limit
bool$ascendingSee note about $asc in $this->reallyDoQuery
Returns:
FakeResultWrapper $res1 and $res2 combined

Definition at line 346 of file SpecialListfiles.php.

References $limit, and array().

Referenced by reallyDoQuery().

Called from getBody(), before getStartBody() is called and after doQuery() was called.

This will be called only if there are rows in the result set.

Returns:
void

Reimplemented from IndexPager.

Definition at line 398 of file SpecialListfiles.php.

References array(), as, and UserCache\singleton().

ImageListPager::formatValue ( field,
value 
)
Parameters:
string$field
string$value
Returns:
Message|string|int The return type depends on the value of $field:
  • thumb: string
  • img_timestamp: string
  • img_name: string
  • img_user_text: string
  • img_size: string
  • img_description: string
  • count: int
  • top: Message
Exceptions:
MWException

Reimplemented from TablePager.

Definition at line 422 of file SpecialListfiles.php.

References $file, $link, $name, $value, array(), Xml\element(), Linker\formatComment(), Linker\link(), Linker\linkKnown(), Title\makeTitle(), Title\makeTitleSafe(), RepoGroup\singleton(), wfLocalFile(), and User\whoIs().

Get an array of query parameters that should be put into self-links.

By default, all parameters passed in the URL are used, except for a short blacklist.

Returns:
array Associative array

Reimplemented from IndexPager.

Definition at line 585 of file SpecialListfiles.php.

References $queries.

The database field name used as a default sort order.

Access:
protected
Returns:
string

Reimplemented from TablePager.

Definition at line 389 of file SpecialListfiles.php.

Returns:
array

Reimplemented from TablePager.

Definition at line 161 of file SpecialListfiles.php.

References array(), ContextSource\getConfig(), ContextSource\msg(), and text.

Referenced by getQueryInfoReal().

Definition at line 500 of file SpecialListfiles.php.

References $form, $query, and array().

Access:
protected
Returns:
string

Reimplemented from TablePager.

Definition at line 563 of file SpecialListfiles.php.

Get a URL query array for the prev, next, first and last links.

Returns:
array

Reimplemented from IndexPager.

Definition at line 571 of file SpecialListfiles.php.

References $queries, $query, and as.

This function should be overridden to provide all parameters needed for the main paged query.

It returns an associative array with the following elements: tables => Table(s) for passing to Database::select() fields => Field(s) for passing to Database::select(), may be * conds => WHERE conditions options => option array join_conds => JOIN conditions

Returns:
array

Reimplemented from IndexPager.

Definition at line 218 of file SpecialListfiles.php.

References getQueryInfoReal().

ImageListPager::getQueryInfoReal ( table) [protected]

Actually get the query info.

This is to allow displaying both stuff from image and oldimage table.

This is a bit hacky.

Parameters:
string$tableEither 'image' or 'oldimage'
Returns:
array Query info

Definition at line 237 of file SpecialListfiles.php.

References $dbr, $options, $tables, array(), as, buildQueryConds(), getFieldNames(), and wfGetDB().

Referenced by getQueryInfo().

Access:
protected
Returns:
string

Reimplemented from TablePager.

Definition at line 567 of file SpecialListfiles.php.

Access:
protected
Returns:
string

Reimplemented from TablePager.

Definition at line 559 of file SpecialListfiles.php.

Get the Title object.

Since:
1.18
Returns:
Title|null

Reimplemented from ContextSource.

Definition at line 594 of file SpecialListfiles.php.

References SpecialPage\getTitleFor().

Return true if the named field should be sortable by the UI, false otherwise.

Parameters:
string$field

Reimplemented from TablePager.

Definition at line 187 of file SpecialListfiles.php.

References array(), and ContextSource\getConfig().

ImageListPager::reallyDoQuery ( offset,
limit,
asc 
)

Override reallyDoQuery to mix together two queries.

Note:
$asc is named $descending in IndexPager base class. However it is true when the order is ascending, and false when the order is descending, so I renamed it to $asc here.
Parameters:
int$offset
int$limit
bool$asc
Returns:
array

Reimplemented from IndexPager.

Definition at line 304 of file SpecialListfiles.php.

References $conds, $fname, $limit, $options, $tables, IndexPager\buildQueryInfo(), combineResult(), and list.


Member Data Documentation

ImageListPager::$mFieldNames = null [protected]

Definition at line 69 of file SpecialListfiles.php.

ImageListPager::$mIncluding = false [protected]

Definition at line 78 of file SpecialListfiles.php.

ImageListPager::$mQueryConds = array() [protected]

Definition at line 72 of file SpecialListfiles.php.

ImageListPager::$mSearch = '' [protected]

Definition at line 76 of file SpecialListfiles.php.

ImageListPager::$mShowAll = false [protected]

Definition at line 80 of file SpecialListfiles.php.

ImageListPager::$mTableName = 'image' [protected]

Definition at line 82 of file SpecialListfiles.php.

ImageListPager::$mUserName = null [protected]

Definition at line 74 of file SpecialListfiles.php.


The documentation for this class was generated from the following file: