page->getRevision(); if ( !$curRev ) { throw new ErrorPageError( 'mcrundofailed', 'nopagetext' ); } $this->curRev = $curRev->getRevisionRecord(); $this->cur = $this->getRequest()->getInt( 'cur', $this->curRev->getId() ); $this->undo = $this->cur; $this->undoafter = $this->getRequest()->getInt( 'restore' ); if ( $this->undo == 0 || $this->undoafter == 0 ) { throw new ErrorPageError( 'mcrundofailed', 'mcrundo-missingparam' ); } } protected function addStatePropagationFields( HTMLForm $form ) { $form->addHiddenField( 'restore', $this->undoafter ); $form->addHiddenField( 'cur', $this->curRev->getId() ); } protected function alterForm( HTMLForm $form ) { parent::alterForm( $form ); $form->setWrapperLegendMsg( 'confirm-mcrrestore-title' ); } }