MediaWiki REL1_34
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( $key,... $params)
This is the function for getting translated interface messages.
$wgReplaceTextUser
static getReservedNames(&$names)
Implements UserGetReservedNames hook.
static addToAdminLinks(ALTree &$adminLinksTree)
Implements AdminLinks hook from Extension:Admin_Links.
static replaceTextReminder(&$form, &$ot, &$nt)
Implements SpecialMovepageAfterMove hook.
static link(Title $title, $text=null)
Shim for compatibility.