config = $config; $this->specialPageFactory = $specialPageFactory; } /** * Implements SpecialMovepageAfterMove hook. * * Adds a link to the Special:ReplaceText page at the end of a successful * regular page move message. * * @param SpecialMovePage $form * @param Title $ot Title object of the old article (moved from) * @param Title $nt Title object of the new article (moved to) */ public function onSpecialMovepageAfterMove( $form, $ot, $nt ) { if ( !$form->getUser()->isAllowed( 'replacetext' ) ) { return; } $out = $form->getOutput(); $page = $this->specialPageFactory->getPage( 'ReplaceText' ); $pageLink = $form->getLinkRenderer()->makeLink( $page->getPageTitle() ); $out->addHTML( $form->msg( 'replacetext_reminder' ) ->rawParams( $pageLink )->parseAsBlock() ); } /** * Implements UserGetReservedNames hook. * @param array &$names */ public function onUserGetReservedNames( &$names ) { $replaceTextUser = $this->config->get( 'ReplaceTextUser' ); if ( $replaceTextUser !== null ) { $names[] = $replaceTextUser; } } }