protected function doNormalMovePage( $par ) { $sp = new MovePageForm(); $sp->execute( $par ); }
/** * Partially copies from SpecialMovepage.php, because it cannot be * extended in other ways. */ public function execute($par) { $request = $this->getRequest(); $user = $this->getUser(); // Yes, the use of getVal() and getText() is wanted, see bug T22365 $this->oldText = $request->getVal('wpOldTitle', $request->getVal('target', $par)); $this->newText = $request->getText('wpNewTitle'); $this->oldTitle = Title::newFromText($this->oldText); $this->newTitle = Title::newFromText($this->newText); $this->reason = $request->getText('reason'); // Checkboxes that default being checked are tricky $this->moveSubpages = $request->getBool('subpages', !$request->wasPosted()); if ($this->doBasicChecks() !== true) { return; } // Real stuff starts here $page = TranslatablePage::newFromTitle($this->oldTitle); if ($page->getMarkedTag() !== false) { $this->page = $page; $this->getOutput()->setPagetitle($this->msg('pt-movepage-title', $this->oldText)); if (!$user->isAllowed('pagetranslation')) { throw new PermissionsError('pagetranslation'); } // Is there really no better way to do this? $subactionText = $request->getText('subaction'); switch ($subactionText) { case $this->msg('pt-movepage-action-check')->text(): $subaction = 'check'; break; case $this->msg('pt-movepage-action-perform')->text(): $subaction = 'perform'; break; case $this->msg('pt-movepage-action-other')->text(): $subaction = ''; break; default: $subaction = ''; } if ($subaction === 'check' && $this->checkToken() && $request->wasPosted()) { $blockers = $this->checkMoveBlockers(); if (count($blockers)) { $this->showErrors($blockers); $this->showForm(); } else { $this->showConfirmation(); } } elseif ($subaction === 'perform' && $this->checkToken() && $request->wasPosted()) { $this->performAction(); } else { $this->showForm(); } } else { // Delegate... don't want to reimplement this $sp = new MovePageForm(); $sp->execute($par); } }