- /**
- * Temporarily unused message keys due to T88044/T136375:
- * - confirm-rollback-top
- * - confirm-rollback-button
- * - rollbackfailed
- * - rollback-missingparam
- * - rollback-success-notify
- */
+ protected function usesOOUI() {
+ return true;
+ }
+
+ protected function getDescription() {
+ return '';
+ }
+
+ public function doesWrites() {
+ return true;
+ }
+
+ public function onSuccess() {
+ return false;
+ }
+
+ public function onSubmit( $data ) {
+ return false;
+ }
+
+ protected function alterForm( HTMLForm $form ) {
+ $form->setWrapperLegendMsg( 'confirm-rollback-top' );
+ $form->setSubmitTextMsg( 'confirm-rollback-button' );
+ $form->setTokenSalt( 'rollback' );
+
+ $from = $this->getRequest()->getVal( 'from' );
+ if ( $from === null ) {
+ throw new BadRequestError( 'rollbackfailed', 'rollback-missingparam' );
+ }
+ foreach ( [ 'from', 'bot', 'hidediff', 'summary', 'token' ] as $param ) {
+ $val = $this->getRequest()->getVal( $param );
+ if ( $val !== null ) {
+ $form->addHiddenField( $param, $val );
+ }
+ }
+ }