MediaWiki  1.34.0
ReplaceTextHooks.php
Go to the documentation of this file.
1 <?php
24 
31  public static function addToAdminLinks( ALTree &$adminLinksTree ) {
32  $generalSection = $adminLinksTree->getSection( wfMessage( 'adminlinks_general' )->text() );
33 
34  if ( !$generalSection ) {
35  return true;
36  }
37  $extensionsRow = $generalSection->getRow( 'extensions' );
38 
39  if ( is_null( $extensionsRow ) ) {
40  $extensionsRow = new ALRow( 'extensions' );
41  $generalSection->addRow( $extensionsRow );
42  }
43 
44  $extensionsRow->addItem( ALItem::newFromSpecialPage( 'ReplaceText' ) );
45 
46  return true;
47  }
48 
59  public static function replaceTextReminder( &$form, &$ot, &$nt ) {
60  $out = $form->getOutput();
61  $page = SpecialPageFactory::getPage( 'ReplaceText' );
62  $pageLink = ReplaceTextUtils::link( $page->getPageTitle() );
63  $out->addHTML( $form->msg( 'replacetext_reminder' )
64  ->rawParams( $pageLink )->inContentLanguage()->parseAsBlock() );
65  }
66 
71  public static function getReservedNames( &$names ) {
72  global $wgReplaceTextUser;
73  if ( !is_null( $wgReplaceTextUser ) ) {
74  $names[] = $wgReplaceTextUser;
75  }
76  }
77 }
wfMessage
wfMessage( $key,... $params)
This is the function for getting translated interface messages.
Definition: GlobalFunctions.php:1264
ReplaceTextHooks\addToAdminLinks
static addToAdminLinks(ALTree &$adminLinksTree)
Implements AdminLinks hook from Extension:Admin_Links.
Definition: ReplaceTextHooks.php:31
ReplaceTextUtils\link
static link(Title $title, $text=null)
Shim for compatibility.
Definition: ReplaceTextUtils.php:31
ReplaceTextHooks
Definition: ReplaceTextHooks.php:23
ReplaceTextHooks\getReservedNames
static getReservedNames(&$names)
Implements UserGetReservedNames hook.
Definition: ReplaceTextHooks.php:71
SpecialPageFactory\getPage
static getPage( $name)
Definition: SpecialPageFactory_deprecated.php:47
ReplaceTextHooks\replaceTextReminder
static replaceTextReminder(&$form, &$ot, &$nt)
Implements SpecialMovepageAfterMove hook.
Definition: ReplaceTextHooks.php:59
$wgReplaceTextUser
$wgReplaceTextUser
Definition: ReplaceText.php:73