MediaWiki REL1_34
PageImages\Hooks\ParserFileProcessingHookHandlers Class Reference

Handler for the "ParserMakeImageParams" and "AfterParserFetchFileAndTitle" hooks. More...

Public Member Functions

 doAfterParserFetchFileAndTitle (Parser $parser, ImageGalleryBase $gallery)
 
 doParserMakeImageParams (Title $title, $file, array &$params, Parser $parser)
 

Static Public Member Functions

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.
 

Private Member Functions

 calcWidth (array &$params, File $file)
 Estimates image size as displayed if not explicitly provided.
 
 processFile (Parser $parser, $file, $handlerParams)
 
 processThisTitle (Title $title)
 Returns true if data for this title should be saved.
 

Detailed Description

Handler for the "ParserMakeImageParams" and "AfterParserFetchFileAndTitle" hooks.

Note
WTFPL
Author
Max Semenik
Thiemo Kreuz

Definition at line 17 of file ParserFileProcessingHookHandlers.php.

Member Function Documentation

◆ calcWidth()

PageImages\Hooks\ParserFileProcessingHookHandlers::calcWidth ( array & $params,
File $file )
private

Estimates image size as displayed if not explicitly provided.

We don't follow the core size calculation algorithm precisely because it's not required and editor's intentions are more important than the precise number.

Parameters
array[]&$params
File$file

Definition at line 138 of file ParserFileProcessingHookHandlers.php.

References $file, $wgDefaultUserOptions, and $wgThumbLimits.

Referenced by PageImages\Hooks\ParserFileProcessingHookHandlers\processFile().

◆ doAfterParserFetchFileAndTitle()

PageImages\Hooks\ParserFileProcessingHookHandlers::doAfterParserFetchFileAndTitle ( Parser $parser,
ImageGalleryBase $gallery )
Parameters
Parser$parserParser that is parsing the gallery
ImageGalleryBase$galleryObject representing the gallery being created

Definition at line 71 of file ParserFileProcessingHookHandlers.php.

References ImageGalleryBase\getImages(), and PageImages\Hooks\ParserFileProcessingHookHandlers\processFile().

◆ doParserMakeImageParams()

PageImages\Hooks\ParserFileProcessingHookHandlers::doParserMakeImageParams ( Title $title,
$file,
array & $params,
Parser $parser )
Parameters
Title$titleThe title of the image
File | bool$fileThe file name of the image
array[]&$paramsThe parameters used to generate the image
Parser$parserParser that called the hook

Definition at line 58 of file ParserFileProcessingHookHandlers.php.

References $file, and PageImages\Hooks\ParserFileProcessingHookHandlers\processFile().

◆ onAfterParserFetchFileAndTitle()

static PageImages\Hooks\ParserFileProcessingHookHandlers::onAfterParserFetchFileAndTitle ( Parser $parser,
ImageGalleryBase $gallery )
static

AfterParserFetchFileAndTitle hook handler, saves information about gallery images.

Parameters
Parser$parserParser that is parsing the gallery
ImageGalleryBase$galleryObject representing the gallery being created

Definition at line 45 of file ParserFileProcessingHookHandlers.php.

◆ onParserMakeImageParams()

static PageImages\Hooks\ParserFileProcessingHookHandlers::onParserMakeImageParams ( Title $title,
$file,
array & $params,
Parser $parser )
static

ParserMakeImageParams hook handler, saves extended information about images used on page.

See also
https://www.mediawiki.org/wiki/Manual:Hooks/ParserMakeImageParams
Parameters
Title$titleThe title of the image
File | bool$fileThe file name of the image
array[]&$paramsThe parameters used to generate the image
Parser$parserParser that is parsing this image

Definition at line 29 of file ParserFileProcessingHookHandlers.php.

References $file, and $title.

◆ processFile()

◆ processThisTitle()

PageImages\Hooks\ParserFileProcessingHookHandlers::processThisTitle ( Title $title)
private

Returns true if data for this title should be saved.

Parameters
Title$title
Returns
bool

Definition at line 119 of file ParserFileProcessingHookHandlers.php.

References $title.

Referenced by PageImages\Hooks\ParserFileProcessingHookHandlers\processFile().


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