2023-06-04 18:12:56 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Hooks;
|
|
|
|
|
|
|
|
use Config;
|
2023-09-28 11:00:36 +00:00
|
|
|
use IContextSource;
|
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,
|
|
|
|
bool $isSectionEditable,
|
|
|
|
array $threadItemData,
|
|
|
|
IContextSource $contextSource
|
|
|
|
) {
|
|
|
|
return $this->hookContainer->run(
|
|
|
|
'DiscussionToolsAddOverflowMenuItems',
|
|
|
|
[
|
|
|
|
&$overflowMenuItems,
|
|
|
|
&$resourceLoaderModules,
|
|
|
|
$isSectionEditable,
|
|
|
|
$threadItemData,
|
|
|
|
$contextSource,
|
|
|
|
]
|
|
|
|
);
|
|
|
|
}
|
2023-06-04 18:12:56 +00:00
|
|
|
}
|