| 1 | <?php |
| 2 | |
| 3 | namespace MediaWiki\Hook; |
| 4 | |
| 5 | use MediaWiki\Language\Language; |
| 6 | use MediaWiki\Title\Title; |
| 7 | use Skin; |
| 8 | |
| 9 | /** |
| 10 | * This is a hook handler interface, see docs/Hooks.md. |
| 11 | * Use the hook name "SkinEditSectionLinks" to register handlers implementing this interface. |
| 12 | * |
| 13 | * @stable to implement |
| 14 | * @ingroup Hooks |
| 15 | */ |
| 16 | interface SkinEditSectionLinksHook { |
| 17 | /** |
| 18 | * Use this hook to modify section edit links. |
| 19 | * |
| 20 | * @since 1.35 |
| 21 | * |
| 22 | * @param Skin $skin Skin object rendering the UI |
| 23 | * @param Title $title Title being linked to (may not be the same as the page title, |
| 24 | * if the section is included from a template) |
| 25 | * @param string $section Designation of the section being pointed to, to be included in |
| 26 | * the link, like "§ion=$section" |
| 27 | * @param string $sectionTitle Section title, used in the default tooltip. Escape before using. |
| 28 | * By default, this is wrapped in the 'editsectionhint' message. |
| 29 | * @param array &$result Array containing all link detail arrays. Each link detail array should |
| 30 | * contain the following keys: |
| 31 | * - `targetTitle`: Target Title object |
| 32 | * - `text`: String for the text |
| 33 | * - `attribs`: Array of attributes |
| 34 | * - `query`: Array of query parameters to add to the URL |
| 35 | * @param Language $lang Language to use for the link in the wfMessage function |
| 36 | * @return bool|void True or no return value to continue or false to abort |
| 37 | */ |
| 38 | public function onSkinEditSectionLinks( $skin, $title, $section, $sectionTitle, |
| 39 | &$result, $lang |
| 40 | ); |
| 41 | } |