Display the file sha1 value in the file info page
[lhc/web/wiklou.git] / includes / actions / WatchAction.php
index 23505c0..528e0e2 100644 (file)
@@ -35,11 +35,8 @@ class WatchAction extends FormAction {
                return false;
        }
 
-       /**
-        * @return string HTML
-        */
        protected function getDescription() {
-               return $this->msg( 'addwatch' )->escaped();
+               return '';
        }
 
        public function onSubmit( $data ) {
@@ -57,22 +54,32 @@ class WatchAction extends FormAction {
                parent::checkCanExecute( $user );
        }
 
+       protected function usesOOUI() {
+               return true;
+       }
+
+       protected function getFormFields() {
+               return [
+                       'intro' => [
+                               'type' => 'info',
+                               'vertical-label' => true,
+                               'raw' => true,
+                               'default' => $this->msg( 'confirm-watch-top' )->parse()
+                       ]
+               ];
+       }
+
        protected function alterForm( HTMLForm $form ) {
+               $form->setWrapperLegendMsg( 'addwatch' );
                $form->setSubmitTextMsg( 'confirm-watch-button' );
                $form->setTokenSalt( 'watch' );
        }
 
-       protected function preText() {
-               return $this->msg( 'confirm-watch-top' )->parse();
-       }
-
        public function onSuccess() {
                $msgKey = $this->getTitle()->isTalkPage() ? 'addedwatchtext-talk' : 'addedwatchtext';
                $this->getOutput()->addWikiMsg( $msgKey, $this->getTitle()->getPrefixedText() );
        }
 
-       /* Static utility methods */
-
        /**
         * Watch or unwatch a page
         * @since 1.22