Go to the documentation of this file.
55 $fileName =
$dbr->selectField(
'page_props',
58 'pp_page' =>
$title->getArticleID(),
62 [
'ORDER BY' =>
'pp_propname' ]
90 $thumbSetting =
$context->getUser()->getOption(
'thumbsize' );
93 $thumb = $imageFile->transform( [
'width' => $thumbSize ] );
97 $imageHtml = $thumb->toHtml(
99 'alt' => $imageFile->getTitle()->getText(),
104 $pageInfo[
'header-basic'][] = [
105 $context->msg(
'pageimages-info-label' ),
116 global $wgPageImagesExpandOpenSearchXml;
118 if ( !$wgPageImagesExpandOpenSearchXml || !count( $results ) ) {
122 $pageIds = array_keys( $results );
124 foreach ( $pageIds as $id ) {
125 if ( isset( $data[$id][
'thumbnail'] ) ) {
126 $results[$id][
'image'] = $data[$id][
'thumbnail'];
128 $results[$id][
'image'] =
null;
144 foreach ( $watchlist as $ns => $pages ) {
145 foreach ( array_keys( $pages ) as $dbKey ) {
149 $id =
$title->getArticleID();
157 foreach ( $data as $id => $page ) {
158 if ( isset( $page[
'pageimage'] ) ) {
159 $images[ $page[
'ns'] ][ $ids[$id] ] = $page[
'pageimage'];
172 private static function getImages( array $pageIds, $size = 0 ) {
177 'prop' =>
'pageimages',
179 'pageids' => implode(
'|', $chunk ),
184 $request[
'piprop'] =
'thumbnail';
185 $request[
'pithumbsize'] = $size;
191 $ret += (array)$api->getResult()->getResultData(
192 [
'query',
'pages' ], [
'Strip' =>
'base' ]
209 $thumb = $imageFile->transform( [
'width' => 1200 ] );
This is the main API class, used for both external and internal processing.
WebRequest clone which takes values from a provided array.
$wgThumbLimits
Adjust thumbnails on image pages according to a user setting.
const PROP_NAME_FREE
Page property used to store the best free page image information Note changing this value is not advi...
static onSpecialMobileEditWatchlistImages(IContextSource $context, array $watchlist, array &$images)
SpecialMobileEditWatchlist::images hook handler, adds images to mobile watchlist A-Z view.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
static getPageImage(Title $title)
Returns page image for a given title.
static onBeforePageDisplay(OutputPage &$out, Skin &$skin)
static onInfoAction(IContextSource $context, &$pageInfo)
InfoAction hook handler, adds the page image to the info=action page.
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
static makeTitle( $ns, $title, $fragment='', $interwiki='')
Create a new Title from a namespace index and a DB key.
const PROP_NAME
Page property used to store the best page image information.
wfFindFile( $title, $options=[])
Find a file.
Interface for objects which can provide a MediaWiki context on request.
Represents a title within MediaWiki.
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 getImages(array $pageIds, $size=0)
Returns image information for pages with given ids.
The main skin class which provides methods and properties for all other skins.
const LIMIT_SML1
Slow query, standard limit.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.