getTablePrefix() is used to show the inline legend and inline switcher. It is not yet part of a released stable interface. Theoretically there may be multiple text slots on a page, and we don't want multiple inline legends. There was already a fragment assembly system, for the benefit of hook handlers, so move that up to the page level, so that it can also deduplicate prefix fragments coming from each slot. Add tests. Bug: T324759 Change-Id: I9baa5c24128c63bc318ba13e83a024843f4ab15e
33 lines
942 B
PHP
33 lines
942 B
PHP
<?php
|
|
|
|
namespace MediaWiki\Diff\Hook;
|
|
|
|
use IContextSource;
|
|
use TextSlotDiffRenderer;
|
|
|
|
/**
|
|
* This is a hook handler interface, see docs/Hooks.md.
|
|
* Use the hook name "TextSlotDiffRendererTablePrefix" to register handlers implementing this interface.
|
|
*
|
|
* @stable to implement
|
|
* @ingroup Hooks
|
|
*/
|
|
interface TextSlotDiffRendererTablePrefixHook {
|
|
|
|
/**
|
|
* Use this hook to change the HTML that is included in a prefix container directly before the diff table.
|
|
*
|
|
* @since 1.41
|
|
*
|
|
* @param TextSlotDiffRenderer $textSlotDiffRenderer
|
|
* @param IContextSource $context
|
|
* @param (string|null)[] &$parts HTML strings to add to a container above the diff table.
|
|
* Will be sorted by key before being output.
|
|
* @return bool|void True or no return value to continue or false to abort
|
|
*/
|
|
public function onTextSlotDiffRendererTablePrefix(
|
|
TextSlotDiffRenderer $textSlotDiffRenderer,
|
|
IContextSource $context,
|
|
array &$parts
|
|
);
|
|
}
|