mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-12-12 00:27:47 +00:00
3dc5e88842
Changes to the use statements done automatically via script Addition of missing use statement done manually Change-Id: I492ddae3c3e9f81d551ea8b348b7148893f4f590
52 lines
1.2 KiB
PHP
52 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Hooks;
|
|
|
|
use MediaWiki\Config\Config;
|
|
use MediaWiki\Context\IContextSource;
|
|
use MediaWiki\HookContainer\HookContainer;
|
|
use MessageLocalizer;
|
|
|
|
/**
|
|
* This is a hook runner class, see docs/Hooks.md in core.
|
|
* @internal
|
|
*/
|
|
class HookRunner implements
|
|
DiscussionToolsTermsOfUseMessagesHook,
|
|
DiscussionToolsAddOverflowMenuItemsHook
|
|
{
|
|
private HookContainer $hookContainer;
|
|
|
|
public function __construct( HookContainer $hookContainer ) {
|
|
$this->hookContainer = $hookContainer;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
public function onDiscussionToolsTermsOfUseMessages( array &$messages, MessageLocalizer $context, Config $config ) {
|
|
return $this->hookContainer->run(
|
|
'DiscussionToolsTermsOfUseMessages',
|
|
[ &$messages, $context, $config ]
|
|
);
|
|
}
|
|
|
|
/** @inheritDoc */
|
|
public function onDiscussionToolsAddOverflowMenuItems(
|
|
array &$overflowMenuItems,
|
|
array &$resourceLoaderModules,
|
|
array $threadItemData,
|
|
IContextSource $contextSource
|
|
) {
|
|
return $this->hookContainer->run(
|
|
'DiscussionToolsAddOverflowMenuItems',
|
|
[
|
|
&$overflowMenuItems,
|
|
&$resourceLoaderModules,
|
|
$threadItemData,
|
|
$contextSource,
|
|
]
|
|
);
|
|
}
|
|
}
|