MediaWiki  1.34.0
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. More...
 
static onParserMakeImageParams (Title $title, $file, array &$params, Parser $parser)
 ParserMakeImageParams hook handler, saves extended information about images used on page. More...
 

Private Member Functions

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

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()

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 Hooks\ParserFileProcessingHookHandlers\processFile().

◆ doAfterParserFetchFileAndTitle()

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 Hooks\ParserFileProcessingHookHandlers\processFile().

◆ doParserMakeImageParams()

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 Hooks\ParserFileProcessingHookHandlers\processFile().

◆ onAfterParserFetchFileAndTitle()

static 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 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()

Hooks\ParserFileProcessingHookHandlers::processFile ( Parser  $parser,
  $file,
  $handlerParams 
)
private

◆ processThisTitle()

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 Hooks\ParserFileProcessingHookHandlers\processFile().


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