Merge "pass user object for delete/undelete/filerevert in api/gui"
[lhc/web/wiklou.git] / includes / actions / PurgeAction.php
index 74f6e7d..cd58889 100644 (file)
@@ -31,10 +31,6 @@ class PurgeAction extends FormAction {
                return 'purge';
        }
 
-       public function getRestriction() {
-               return null;
-       }
-
        public function requiresUnblock() {
                return false;
        }
@@ -52,12 +48,11 @@ class PurgeAction extends FormAction {
        }
 
        public function onSubmit( $data ) {
-               $this->page->doPurge();
-               return true;
+               return $this->page->doPurge();
        }
 
        /**
-        * purge is slightly wierd because it can be either formed or formless depending
+        * purge is slightly weird because it can be either formed or formless depending
         * on user permissions
         */
        public function show() {
@@ -71,8 +66,9 @@ class PurgeAction extends FormAction {
                                $this->getRequest()->getQueryValues(),
                                array( 'title' => null, 'action' => null )
                        ) );
-                       $this->onSubmit( array() );
-                       $this->onSuccess();
+                       if( $this->onSubmit( array() ) ) {
+                               $this->onSuccess();
+                       }
                } else {
                        $this->redirectParams = $this->getRequest()->getVal( 'redirectparams', '' );
                        $form = $this->getForm();
@@ -83,15 +79,15 @@ class PurgeAction extends FormAction {
        }
 
        protected function alterForm( HTMLForm $form ) {
-               $form->setSubmitText( wfMsg( 'confirm_purge_button' ) );
+               $form->setSubmitTextMsg( 'confirm_purge_button' );
        }
 
        protected function preText() {
-               return wfMessage( 'confirm-purge-top' )->parse();
+               return $this->msg( 'confirm-purge-top' )->parse();
        }
 
        protected function postText() {
-               return wfMessage( 'confirm-purge-bottom' )->parse();
+               return $this->msg( 'confirm-purge-bottom' )->parse();
        }
 
        public function onSuccess() {