wiki.techinc.nl/includes/actions/UnwatchAction.php
Chad Horohoe aa21e125a3 Remove obvious function-level profiling
Xhprof generates this data now. Custom profiling of various
sub-function units are kept.

Calls to profiler represented about 3% of page execution
time on Special:BlankPage (1.5% in/out); after this change
it's down to about 0.98% of page execution time.

Change-Id: Id9a1dc9d8f80bbd52e42226b724a1e1213d07af7
2015-01-07 11:14:24 -08:00

55 lines
1.5 KiB
PHP

<?php
/**
* Performs the unwatch actions on a page
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*
* @file
* @ingroup Actions
*/
/**
* Page removal from a user's watchlist
*
* @ingroup Actions
*/
class UnwatchAction extends WatchAction {
public function getName() {
return 'unwatch';
}
protected function getDescription() {
return $this->msg( 'removewatch' )->escaped();
}
public function onSubmit( $data ) {
self::doUnwatch( $this->getTitle(), $this->getUser() );
return true;
}
protected function alterForm( HTMLForm $form ) {
$form->setSubmitTextMsg( 'confirm-unwatch-button' );
}
protected function preText() {
return $this->msg( 'confirm-unwatch-top' )->parse();
}
public function onSuccess() {
$this->getOutput()->addWikiMsg( 'removedwatchtext', $this->getTitle()->getPrefixedText() );
}
}