2023-06-04 18:12:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Hooks;
|
|
|
|
|
2023-09-28 11:00:36 +00:00
|
|
|
use IContextSource;
|
2023-12-11 15:38:02 +00:00
|
|
|
use MediaWiki\Config\Config;
|
2023-06-04 18:12:56 +00:00
|
|
|
use MediaWiki\HookContainer\HookContainer;
|
|
|
|
use MessageLocalizer;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* This is a hook runner class, see docs/Hooks.md in core.
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
class HookRunner implements
|
2023-09-28 11:00:36 +00:00
|
|
|
DiscussionToolsTermsOfUseMessagesHook,
|
|
|
|
DiscussionToolsAddOverflowMenuItemsHook
|
2023-06-04 18:12:56 +00:00
|
|
|
{
|
|
|
|
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 ]
|
|
|
|
);
|
|
|
|
}
|
2023-09-28 11:00:36 +00:00
|
|
|
|
|
|
|
/** @inheritDoc */
|
|
|
|
public function onDiscussionToolsAddOverflowMenuItems(
|
|
|
|
array &$overflowMenuItems,
|
|
|
|
array &$resourceLoaderModules,
|
|
|
|
array $threadItemData,
|
|
|
|
IContextSource $contextSource
|
|
|
|
) {
|
|
|
|
return $this->hookContainer->run(
|
|
|
|
'DiscussionToolsAddOverflowMenuItems',
|
|
|
|
[
|
|
|
|
&$overflowMenuItems,
|
|
|
|
&$resourceLoaderModules,
|
|
|
|
$threadItemData,
|
|
|
|
$contextSource,
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
2023-06-04 18:12:56 +00:00
|
|
|
}
|