MediaWiki
1.34.0
|
Static Public Member Functions | |
static | getPageImage (Title $title) |
Returns page image for a given title. More... | |
static | getPropName ( $isFree) |
Get property name used in page_props table. More... | |
static | onApiOpenSearchSuggest (array &$results) |
ApiOpenSearchSuggest hook handler, enhances ApiOpenSearch results with this extension's data. More... | |
static | onBeforePageDisplay (OutputPage &$out, Skin &$skin) |
static | onInfoAction (IContextSource $context, &$pageInfo) |
InfoAction hook handler, adds the page image to the info=action page. More... | |
static | onSpecialMobileEditWatchlistImages (IContextSource $context, array $watchlist, array &$images) |
SpecialMobileEditWatchlist::images hook handler, adds images to mobile watchlist A-Z view. More... | |
Public Attributes | |
const | PROP_NAME = 'page_image' |
Page property used to store the best page image information. More... | |
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. More... | |
Static Private Member Functions | |
static | getImages (array $pageIds, $size=0) |
Returns image information for pages with given ids. More... | |
Definition at line 9 of file PageImages.php.
|
staticprivate |
Returns image information for pages with given ids.
int[] | $pageIds | |
int | $size |
Definition at line 172 of file PageImages.php.
References ApiBase\LIMIT_SML1.
Referenced by onApiOpenSearchSuggest(), and onSpecialMobileEditWatchlistImages().
|
static |
Returns page image for a given title.
Definition at line 49 of file PageImages.php.
References $dbr, $file, $title, DB_REPLICA, NS_FILE, PROP_NAME, PROP_NAME_FREE, wfFindFile(), and wfGetDB().
Referenced by onBeforePageDisplay(), onInfoAction(), and PageImages\Tests\PageImagesTest\testGivenNonExistingPageGetPageImageReturnsFalse().
|
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.
bool | $isFree | Whether the image is a free-license image |
Definition at line 38 of file PageImages.php.
References PROP_NAME, and PROP_NAME_FREE.
Referenced by PageImages\Hooks\LinksUpdateHookHandler\doLinksUpdate(), ApiQueryPageImages\execute(), ApiQueryPageImages\getPropNames(), PageImages\Tests\ApiQueryPageImagesTest\testExecute(), and PageImages\Tests\PageImagesTest\testGetPropName().
|
static |
ApiOpenSearchSuggest hook handler, enhances ApiOpenSearch results with this extension's data.
array[] | &$results | Array of results to add page images too |
Definition at line 115 of file PageImages.php.
References getImages().
|
static |
OutputPage | &$out | The page being output. |
Skin | &$skin | Skin object used to generate the page. Ignored |
Definition at line 202 of file PageImages.php.
References getPageImage(), PROTO_CANONICAL, and wfExpandUrl().
Referenced by PageImages\Tests\PageImagesTest\testGivenNonExistingPageOnBeforePageDisplayDoesNotAddMeta().
|
static |
InfoAction hook handler, adds the page image to the info=action page.
IContextSource | $context | Context, used to extract the title of the page |
array[] | &$pageInfo | Auxillary information about the page. |
Definition at line 81 of file PageImages.php.
References $context, $wgThumbLimits, and getPageImage().
|
static |
SpecialMobileEditWatchlist::images hook handler, adds images to mobile watchlist A-Z view.
IContextSource | $context | Context object. Ignored |
array[] | $watchlist | Array of relevant pages on the watchlist, sorted by namespace |
array[] | &$images | Array of images to populate |
Definition at line 140 of file PageImages.php.
References $title, getImages(), and Title\makeTitle().
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.
Definition at line 20 of file PageImages.php.
Referenced by getPageImage(), getPropName(), PageImages\Tests\ApiQueryPageImagesTest\provideExecute(), PageImages\Tests\ApiQueryPageImagesTest\provideGetPropName(), PageImages\Tests\Hooks\LinksUpdateHookHandlerTest\testDoLinksUpdate(), and PageImages\Tests\PageImagesTest\testPagePropertyNames().
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.
Referenced by getPageImage(), getPropName(), PageImages\Tests\ApiQueryPageImagesTest\provideExecute(), PageImages\Tests\ApiQueryPageImagesTest\provideGetPropName(), PageImages\Tests\Hooks\LinksUpdateHookHandlerTest\testDoLinksUpdate(), and PageImages\Tests\PageImagesTest\testPagePropertyNames().