Go to the documentation of this file.
35 $handler =
new self();
36 $handler->doParserMakeImageParams(
$title,
$file, $params, $parser );
48 $handler =
new self();
49 $handler->doAfterParserFetchFileAndTitle( $parser, $gallery );
72 foreach ( $gallery->
getImages() as $image ) {
95 if ( is_array( $handlerParams ) ) {
96 $myParams = $handlerParams;
102 $myParams[
'filename'] =
$file->getTitle()->getDBkey();
103 $myParams[
'fullwidth'] =
$file->getWidth();
104 $myParams[
'fullheight'] =
$file->getHeight();
107 $pageImages = $out->getExtensionData(
'pageImages' ) ?: [];
108 $pageImages[] = $myParams;
109 $out->setExtensionData(
'pageImages', $pageImages );
120 global $wgPageImagesNamespaces;
121 static $flipped =
false;
123 if ( $flipped ===
false ) {
124 $flipped = array_flip( $wgPageImagesNamespaces );
127 return isset( $flipped[
$title->getNamespace()] );
141 if ( isset( $params[
'handler'][
'width'] ) ) {
145 if ( isset( $params[
'handler'][
'height'] ) &&
$file->getHeight() > 0 ) {
146 $params[
'handler'][
'width'] =
147 $file->getWidth() * ( $params[
'handler'][
'height'] /
$file->getHeight() );
148 } elseif ( isset( $params[
'frame'][
'thumbnail'] )
149 || isset( $params[
'frame'][
'thumb'] )
150 || isset( $params[
'frame'][
'frameless'] )
155 $params[
'handler'][
'width'] =
$file->getWidth();
$wgThumbLimits
Adjust thumbnails on image pages according to a user setting.
$wgDefaultUserOptions
Settings added to this array will override the default globals for the user preferences used by anony...
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.
doAfterParserFetchFileAndTitle(Parser $parser, ImageGalleryBase $gallery)
getTitle()
Accessor for the Title object.
processFile(Parser $parser, $file, $handlerParams)
Implements some public methods and some protected utility functions which are required by multiple ch...
processThisTitle(Title $title)
Returns true if data for this title should be saved.
getImages()
Returns the list of images this gallery contains.
static onAfterParserFetchFileAndTitle(Parser $parser, ImageGalleryBase $gallery)
AfterParserFetchFileAndTitle hook handler, saves information about gallery images.
static onParserMakeImageParams(Title $title, $file, array &$params, Parser $parser)
ParserMakeImageParams hook handler, saves extended information about images used on page.
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
wfFindFile( $title, $options=[])
Find a file.
calcWidth(array &$params, File $file)
Estimates image size as displayed if not explicitly provided.
Represents a title within MediaWiki.
doParserMakeImageParams(Title $title, $file, array &$params, Parser $parser)
getOutput()
Get the ParserOutput object.
Handler for the "ParserMakeImageParams" and "AfterParserFetchFileAndTitle" hooks.