3 * Formats credits for articles
5 * Copyright 2004, Evan Prodromou <evan@wikitravel.org>.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 * @author <evan@wikitravel.org>
26 class PurgeAction
extends FormAction
{
28 public function getName() {
32 public function getRestriction() {
36 public function requiresUnblock() {
40 public function getDescription() {
45 * Just get an empty form with a single submit button
48 protected function getFormFields() {
52 public function onSubmit( $data ) {
53 $this->page
->doPurge();
58 * purge is slightly wierd because it can be either formed or formless depending
61 public function show() {
64 // This will throw exceptions if there's a problem
65 $this->checkCanExecute( $this->getUser() );
67 if ( $this->getUser()->isAllowed( 'purge' ) ) {
68 $this->onSubmit( array() );
71 $form = $this->getForm();
72 if ( $form->show() ) {
78 protected function alterForm( HTMLForm
$form ) {
79 $form->setSubmitText( wfMsg( 'confirm_purge_button' ) );
82 protected function preText() {
83 return wfMessage( 'confirm-purge-top' )->parse();
86 protected function postText() {
87 return wfMessage( 'confirm-purge-bottom' )->parse();
90 public function onSuccess() {
91 $this->getOutput()->redirect( $this->getTitle() );