X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Factions%2FUnwatchAction.php;h=aa17b89c8d658a07d5c5f5fbd347fe1017c22556;hb=3defb5a11a9f6a9a5cd890865cd086de4c7b30df;hp=f8f1dc1f4404d8d8aefc96f4c3be1f0350e8b16c;hpb=2f885ee6b797e5a176ce7b270b674a04b5945b06;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/actions/UnwatchAction.php b/includes/actions/UnwatchAction.php index f8f1dc1f44..aa17b89c8d 100644 --- a/includes/actions/UnwatchAction.php +++ b/includes/actions/UnwatchAction.php @@ -31,26 +31,32 @@ class UnwatchAction extends WatchAction { 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 getFormFields() { + return [ + 'intro' => [ + 'type' => 'info', + 'vertical-label' => true, + 'raw' => true, + 'default' => $this->msg( 'confirm-unwatch-top' )->parse() + ] + ]; } - protected function preText() { - return $this->msg( 'confirm-unwatch-top' )->parse(); + protected function alterForm( HTMLForm $form ) { + parent::alterForm( $form ); + $form->setWrapperLegendMsg( 'removewatch' ); + $form->setSubmitTextMsg( 'confirm-unwatch-button' ); } public function onSuccess() { - $this->getOutput()->addWikiMsg( 'removedwatchtext', $this->getTitle()->getPrefixedText() ); + $msgKey = $this->getTitle()->isTalkPage() ? 'removedwatchtext-talk' : 'removedwatchtext'; + $this->getOutput()->addWikiMsg( $msgKey, $this->getTitle()->getPrefixedText() ); } public function doesWrites() {