$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
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.
*
*
* @return array
*/
- private function getWatchlistInfo() {
+ protected function getWatchlistInfo() {
$titles = array();
$dbr = wfGetDB( DB_MASTER );
private function buildRemoveLine( $title ) {
$link = Linker::link( $title );
- if ( $title->isRedirect() ) {
- // Linker already makes class mw-redirect, so this is redundant
- $link = '<span class="watchlistredir">' . $link . '</span>';
- }
-
$tools[] = Linker::link( $title->getTalkPage(), $this->msg( 'talkpagelinktext' )->escaped() );
if ( $title->exists() ) {
wfRunHooks(
'WatchlistEditorBuildRemoveLine',
- array( &$tools, $title, $title->isRedirect(), $this->getSkin() )
+ array( &$tools, $title, $title->isRedirect(), $this->getSkin(), &$link )
);
+ if ( $title->isRedirect() ) {
+ // Linker already makes class mw-redirect, so this is redundant
+ $link = '<span class="watchlistredir">' . $link . '</span>';
+ }
+
return $link . " (" . $this->getLanguage()->pipeList( $tools ) . ")";
}