Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
1 | <?php |
2 | |
3 | namespace MediaWiki\Extension\DiscussionTools\Hooks; |
4 | |
5 | use MediaWiki\Context\IContextSource; |
6 | use MediaWiki\Extension\DiscussionTools\OverflowMenuItem; |
7 | |
8 | /** |
9 | * This is a hook handler interface, see docs/Hooks.md in core. |
10 | * Use the hook name "DiscussionToolsAddOverflowMenuItems" to register handlers implementing this interface. |
11 | * |
12 | * @stable to implement |
13 | * @ingroup Hooks |
14 | */ |
15 | interface DiscussionToolsAddOverflowMenuItemsHook { |
16 | |
17 | /** |
18 | * Register menu items to add to the DiscussionTools overflow menu. |
19 | * |
20 | * These menu items appear in an overflow menu that opens via a button with an ellipsis icon. |
21 | * The button can be displayed adjacent to: |
22 | * - topic headings |
23 | * - individual comments |
24 | * |
25 | * @param OverflowMenuItem[] &$overflowMenuItems Menu items to add to the DiscussionTools |
26 | * overflow/ellipsis menu adjacent to topic headings and individual comments. |
27 | * @param string[] &$resourceLoaderModules List of ResourceLoader modules that DiscussionTools |
28 | * will load when adding the menu item to the overflow menu. Implementations of this hook |
29 | * would typically add at least one item to the list. Make sure to include the relevant OOUI icon |
30 | * ResourceLoader module associated with the 'icon' property of the OverflowMenuItem. |
31 | * @param array $threadItemData The relevant thread item for the overflow menu. |
32 | * @param IContextSource $contextSource Use this to obtain Title, User, Skin, Config, etc objects as needed. |
33 | * @return bool|void True or no return value to continue or false to abort |
34 | */ |
35 | public function onDiscussionToolsAddOverflowMenuItems( |
36 | array &$overflowMenuItems, |
37 | array &$resourceLoaderModules, |
38 | array $threadItemData, |
39 | IContextSource $contextSource |
40 | ); |
41 | } |