mediawiki-extensions-Replac.../ReplaceText.hooks.php
nikhil 70d3cc145d Add Replace Text reminder message at end of page move
Bug: T187410
Change-Id: I1c3f90400e1a6f41f95fed90d9d706891d2e3eaa
2018-02-20 21:34:48 +05:30

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->getTitle() );
$out->addHTML( $form->msg( 'replacetext_reminder' )
->rawParams( $pageLink )->inContentLanguage()->parseAsBlock() );
return true;
}
}