From: jenkins-bot Date: Wed, 30 Jul 2014 23:54:34 +0000 (+0000) Subject: Merge "Refactor Watchlist code so mobile can be more consistent" X-Git-Tag: 1.31.0-rc.0~14648 X-Git-Url: https://git.heureux-cyclage.org/?a=commitdiff_plain;h=b74456fca841445a1c9f356fc8e53551eea14dd4;hp=c05b86558d185e9be76b4279b6e8876b4fcb2077;p=lhc%2Fweb%2Fwiklou.git Merge "Refactor Watchlist code so mobile can be more consistent" --- diff --git a/includes/specials/SpecialEditWatchlist.php b/includes/specials/SpecialEditWatchlist.php index 6c258e0879..76f2f4a940 100644 --- a/includes/specials/SpecialEditWatchlist.php +++ b/includes/specials/SpecialEditWatchlist.php @@ -70,9 +70,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { $this->checkReadOnly(); $this->outputHeader(); - - $out->addSubtitle( $this->msg( 'watchlistfor2', $this->getUser()->getName() ) - ->rawParams( SpecialEditWatchlist::buildTools( null ) ) ); + $this->outputSubtitle(); # B/C: $mode used to be waaay down the parameter list, and the first parameter # was $wgUser @@ -104,19 +102,37 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { case self::EDIT_NORMAL: default: - $out->setPageTitle( $this->msg( 'watchlistedit-normal-title' ) ); - $form = $this->getNormalForm(); - if ( $form->show() ) { - $out->addHTML( $this->successMessage ); - $out->addReturnTo( SpecialPage::getTitleFor( 'Watchlist' ) ); - } elseif ( $this->toc !== false ) { - $out->prependHTML( $this->toc ); - $out->addModules( 'mediawiki.toc' ); - } + $this->executeViewEditWatchlist(); break; } } + /** + * Renders a subheader on the watchlist page. + */ + protected function outputSubtitle() { + $out = $this->getOutput(); + $out->addSubtitle( $this->msg( 'watchlistfor2', $this->getUser()->getName() ) + ->rawParams( SpecialEditWatchlist::buildTools( null ) ) ); + } + + /** + * Executes an edit mode for the watchlist view, from which you can manage your watchlist + * + */ + protected function executeViewEditWatchlist() { + $out = $this->getOutput(); + $out->setPageTitle( $this->msg( 'watchlistedit-normal-title' ) ); + $form = $this->getNormalForm(); + if ( $form->show() ) { + $out->addHTML( $this->successMessage ); + $out->addReturnTo( SpecialPage::getTitleFor( 'Watchlist' ) ); + } elseif ( $this->toc !== false ) { + $out->prependHTML( $this->toc ); + $out->addModules( 'mediawiki.toc' ); + } + } + /** * Return an array of subpages beginning with $search that this special page will accept. * @@ -331,7 +347,7 @@ class SpecialEditWatchlist extends UnlistedSpecialPage { * * @return array */ - private function getWatchlistInfo() { + protected function getWatchlistInfo() { $titles = array(); $dbr = wfGetDB( DB_MASTER );