MediaWiki REL1_34
PageImages Class Reference

Static Public Member Functions

static getPageImage (Title $title)
 Returns page image for a given title.
 
static getPropName ( $isFree)
 Get property name used in page_props table.
 
static onApiOpenSearchSuggest (array &$results)
 ApiOpenSearchSuggest hook handler, enhances ApiOpenSearch results with this extension's data.
 
static onBeforePageDisplay (OutputPage &$out, Skin &$skin)
 
static onInfoAction (IContextSource $context, &$pageInfo)
 InfoAction hook handler, adds the page image to the info=action page.
 
static onSpecialMobileEditWatchlistImages (IContextSource $context, array $watchlist, array &$images)
 SpecialMobileEditWatchlist::images hook handler, adds images to mobile watchlist A-Z view.
 

Public Attributes

const PROP_NAME = 'page_image'
 Page property used to store the best page image information.
 
const PROP_NAME_FREE = 'page_image_free'
 Page property used to store the best free page image information Note changing this value is not advised as it will invalidate all existing page property names on a production instance and cause them to be regenerated.
 

Static Private Member Functions

static getImages (array $pageIds, $size=0)
 Returns image information for pages with given ids.
 

Detailed Description

Note
WTFPL
Author
Max Semenik
Brad Jorsch
Thiemo Kreuz

Definition at line 9 of file PageImages.php.

Member Function Documentation

◆ getImages()

static PageImages::getImages ( array $pageIds,
$size = 0 )
staticprivate

Returns image information for pages with given ids.

Parameters
int[]$pageIds
int$size
Returns
array[]

Definition at line 172 of file PageImages.php.

◆ getPageImage()

static PageImages::getPageImage ( Title $title)
static

Returns page image for a given title.

Parameters
Title$titleTitle to get page image for
Returns
File|bool

Definition at line 49 of file PageImages.php.

References $dbr, $file, $title, DB_REPLICA, NS_FILE, wfFindFile(), and wfGetDB().

◆ getPropName()

static PageImages::getPropName ( $isFree)
static

Get property name used in page_props table.

When a page image is stored it will be stored under this property name on the corresponding article.

Parameters
bool$isFreeWhether the image is a free-license image
Returns
string

Definition at line 38 of file PageImages.php.

◆ onApiOpenSearchSuggest()

static PageImages::onApiOpenSearchSuggest ( array & $results)
static

ApiOpenSearchSuggest hook handler, enhances ApiOpenSearch results with this extension's data.

Parameters
array[]&$resultsArray of results to add page images too

Definition at line 115 of file PageImages.php.

◆ onBeforePageDisplay()

static PageImages::onBeforePageDisplay ( OutputPage & $out,
Skin & $skin )
static
Parameters
OutputPage&$outThe page being output.
Skin&$skinSkin object used to generate the page. Ignored

Definition at line 202 of file PageImages.php.

References OutputPage\addMeta(), ContextSource\getContext(), PROTO_CANONICAL, and wfExpandUrl().

◆ onInfoAction()

static PageImages::onInfoAction ( IContextSource $context,
& $pageInfo )
static

InfoAction hook handler, adds the page image to the info=action page.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/InfoAction
Parameters
IContextSource$contextContext, used to extract the title of the page
array[]&$pageInfoAuxillary information about the page.

Definition at line 81 of file PageImages.php.

References $context, and $wgThumbLimits.

◆ onSpecialMobileEditWatchlistImages()

static PageImages::onSpecialMobileEditWatchlistImages ( IContextSource $context,
array $watchlist,
array & $images )
static

SpecialMobileEditWatchlist::images hook handler, adds images to mobile watchlist A-Z view.

Parameters
IContextSource$contextContext object. Ignored
array[]$watchlistArray of relevant pages on the watchlist, sorted by namespace
array[]&$imagesArray of images to populate

Definition at line 140 of file PageImages.php.

References $title.

Member Data Documentation

◆ PROP_NAME

const PageImages::PROP_NAME = 'page_image'

Page property used to store the best page image information.

If the best image is the same as the best image with free license, then nothing is stored under this property. Note changing this value is not advised as it will invalidate all existing page property names on a production instance and cause them to be regenerated.

See also
PageImages::PROP_NAME_FREE

Definition at line 20 of file PageImages.php.

◆ PROP_NAME_FREE

const PageImages::PROP_NAME_FREE = 'page_image_free'

Page property used to store the best free page image information Note changing this value is not advised as it will invalidate all existing page property names on a production instance and cause them to be regenerated.

Definition at line 28 of file PageImages.php.


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