mediawiki-extensions-Discus.../includes/Hooks/HookRunner.php
Ed Sanders f8b76afef3 [BREAKING CHANGE] Remove isSectionEditable from overflow hook
Instead make isUneditableSection an optional property of
ContentHeadingItem.

Change-Id: Icfddf28aa789b5014ac183ff9f9699f38d78c121
2023-10-18 12:56:46 +01:00

52 lines
1.1 KiB
PHP

<?php
namespace MediaWiki\Extension\DiscussionTools\Hooks;
use Config;
use 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,
]
);
}
}