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...
wfFindFile( $title, $options=[])
Find a file.
Implements some public methods and some protected utility functions which are required by multiple ch...
getImages()
Returns the list of images this gallery contains.
Handler for the "ParserMakeImageParams" and "AfterParserFetchFileAndTitle" hooks.
static onParserMakeImageParams(Title $title, $file, array &$params, Parser $parser)
ParserMakeImageParams hook handler, saves extended information about images used on page.
processThisTitle(Title $title)
Returns true if data for this title should be saved.
doAfterParserFetchFileAndTitle(Parser $parser, ImageGalleryBase $gallery)
doParserMakeImageParams(Title $title, $file, array &$params, Parser $parser)
static onAfterParserFetchFileAndTitle(Parser $parser, ImageGalleryBase $gallery)
AfterParserFetchFileAndTitle hook handler, saves information about gallery images.
calcWidth(array &$params, File $file)
Estimates image size as displayed if not explicitly provided.
processFile(Parser $parser, $file, $handlerParams)
PHP Parser - Processes wiki markup (which uses a more user-friendly syntax, such as "[[link]]" for ma...
getTitle()
Accessor for the Title object.
getOutput()
Get the ParserOutput object.
Represents a title within MediaWiki.
if(PHP_SAPI !='cli-server') if(!isset( $_SERVER['SCRIPT_FILENAME'])) $file
Item class for a filearchive table row.