mediawiki-extensions-Replac.../ReplaceText.hooks.php
Reedy 44fecf5fc5 Replace SpecialPage::getTitle() with SpecialPage::getPageTitle()
Change-Id: Ic04461a1737dbd3c81a2fe099024677ab05cf4e9
2018-03-15 21:42:53 +00:00

37 lines
1.1 KiB
PHP

<?php
/**
*/
class ReplaceTextHooks {
public static function addToAdminLinks( ALTree &$adminLinksTree ) {
$generalSection = $adminLinksTree->getSection( wfMessage( 'adminlinks_general' )->text() );
$extensionsRow = $generalSection->getRow( 'extensions' );
if ( is_null( $extensionsRow ) ) {
$extensionsRow = new ALRow( 'extensions' );
$generalSection->addRow( $extensionsRow );
}
$extensionsRow->addItem( ALItem::newFromSpecialPage( 'ReplaceText' ) );
return true;
}
/**
* Adds link to ReplaceText page at the end of successful regular page move message
*
* @param FormLayout &$form MovePageForm
* @param Title &$ot Title object of the old article (moved from)
* @param Title &$nt Title object of the new article (moved to)
* @return bool
*/
public static function replaceTextReminder( &$form, &$ot , &$nt ) {
$out = $form->getOutput();
$page = SpecialPageFactory::getPage( 'ReplaceText' );
$pageLink = Linker::linkKnown( $page->getPageTitle() );
$out->addHTML( $form->msg( 'replacetext_reminder' )
->rawParams( $pageLink )->inContentLanguage()->parseAsBlock() );
return true;
}
}