2020-03-03 22:50:34 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace MediaWiki\Hook;
|
|
|
|
|
|
2020-03-16 23:31:05 +00:00
|
|
|
use Parser;
|
|
|
|
|
use Title;
|
|
|
|
|
|
2020-03-03 22:50:34 +00:00
|
|
|
/**
|
2020-09-26 13:18:43 +00:00
|
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
|
|
|
* Use the hook name "BeforeParserFetchFileAndTitle" to register handlers implementing this interface.
|
|
|
|
|
*
|
2020-07-13 09:05:49 +00:00
|
|
|
* @stable to implement
|
2020-03-03 22:50:34 +00:00
|
|
|
* @ingroup Hooks
|
|
|
|
|
*/
|
|
|
|
|
interface BeforeParserFetchFileAndTitleHook {
|
|
|
|
|
/**
|
2020-03-16 23:31:05 +00:00
|
|
|
* This hook is called before an image is rendered by Parser.
|
2020-03-03 22:50:34 +00:00
|
|
|
*
|
|
|
|
|
* @since 1.35
|
|
|
|
|
*
|
2020-03-16 23:31:05 +00:00
|
|
|
* @param Parser $parser
|
|
|
|
|
* @param Title $nt Image title
|
|
|
|
|
* @param array &$options Array of options to RepoGroup::findFile. If it contains 'broken'
|
2020-03-03 22:50:34 +00:00
|
|
|
* as a key then the file will appear as a broken thumbnail.
|
2021-05-26 19:43:17 +00:00
|
|
|
* If it contains `private` as a key, the value must be an Authority object.
|
2020-03-16 23:31:05 +00:00
|
|
|
* @param string &$descQuery Query string to add to thumbnail URL
|
2020-03-03 22:50:34 +00:00
|
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
|
|
|
*/
|
|
|
|
|
public function onBeforeParserFetchFileAndTitle( $parser, $nt, &$options,
|
|
|
|
|
&$descQuery
|
|
|
|
|
);
|
|
|
|
|
}
|