Debian Codegraph @

extensions/ReplaceText/src/AdminLinksHooks.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Extension\ReplaceText;
4
5 use AdminLinksHook;
6 use ALItem;
7 use ALRow;
8 use ALTree;
9
10 class AdminLinksHooks implements AdminLinksHook {
11
12 /**
13 * Implements AdminLinks hook from Extension:Admin_Links.
14 *
15 * @param ALTree &$adminLinksTree
16 */
17 public function onAdminLinks( ALTree &$adminLinksTree ) {
18 $generalSection = $adminLinksTree->getSection( wfMessage( 'adminlinks_general' )->text() );
19
20 if ( !$generalSection ) {
21 return;
22 }
23 $extensionsRow = $generalSection->getRow( 'extensions' );
24
25 if ( $extensionsRow === null ) {
26 $extensionsRow = new ALRow( 'extensions' );
27 $generalSection->addRow( $extensionsRow );
28 }
29
30 $extensionsRow->addItem( ALItem::newFromSpecialPage( 'ReplaceText' ) );
31 }
32 }