From 086ae52d12011746a75f5588e877347bc0457352 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Fri, 21 Mar 2008 11:49:34 +0100 Subject: Update auf MediaWiki 1.12.0 --- includes/WatchlistEditor.php | 40 +++++----------------------------------- 1 file changed, 5 insertions(+), 35 deletions(-) (limited to 'includes/WatchlistEditor.php') diff --git a/includes/WatchlistEditor.php b/includes/WatchlistEditor.php index e03225a3..7e37dca7 100644 --- a/includes/WatchlistEditor.php +++ b/includes/WatchlistEditor.php @@ -32,15 +32,8 @@ class WatchlistEditor { } switch( $mode ) { case self::EDIT_CLEAR: - $output->setPageTitle( wfMsg( 'watchlistedit-clear-title' ) ); - if( $request->wasPosted() && $this->checkToken( $request, $wgUser ) ) { - $this->clearWatchlist( $user ); - $user->invalidateCache(); - $output->addHtml( wfMsgExt( 'watchlistedit-clear-done', 'parse' ) ); - } else { - $this->showClearForm( $output, $user ); - } - break; + // The "Clear" link scared people too much. + // Pass on to the raw editor, from which it's very easy to clear. case self::EDIT_RAW: $output->setPageTitle( wfMsg( 'watchlistedit-raw-title' ) ); if( $request->wasPosted() && $this->checkToken( $request, $wgUser ) ) { @@ -333,27 +326,6 @@ class WatchlistEditor { } } } - - /** - * Show a confirmation form for users wishing to clear their watchlist - * - * @param OutputPage $output - * @param User $user - */ - private function showClearForm( $output, $user ) { - global $wgUser; - if( ( $count = $this->showItemCount( $output, $user ) ) > 0 ) { - $self = SpecialPage::getTitleFor( 'Watchlist' ); - $form = Xml::openElement( 'form', array( 'method' => 'post', - 'action' => $self->getLocalUrl( 'action=clear' ) ) ); - $form .= Xml::hidden( 'token', $wgUser->editToken( 'watchlistedit' ) ); - $form .= '
' . wfMsgHtml( 'watchlistedit-clear-legend' ) . ''; - $form .= wfMsgExt( 'watchlistedit-clear-confirm', 'parse' ); - $form .= '

' . Xml::submitButton( wfMsg( 'watchlistedit-clear-submit' ) ) . '

'; - $form .= '
'; - $output->addHtml( $form ); - } - } /** * Show the standard watchlist editing form @@ -481,11 +453,9 @@ class WatchlistEditor { */ public static function buildTools( $skin ) { $tools = array(); - $self = SpecialPage::getTitleFor( 'Watchlist' ); - $modes = array( 'view' => '', 'edit' => 'edit', 'raw' => 'raw', 'clear' => 'clear' ); - foreach( $modes as $mode => $action ) { - $action = $action ? "action={$action}" : ''; - $tools[] = $skin->makeKnownLinkObj( $self, wfMsgHtml( "watchlisttools-{$mode}" ), $action ); + $modes = array( 'view' => false, 'edit' => 'edit', 'raw' => 'raw' ); + foreach( $modes as $mode => $subpage ) { + $tools[] = $skin->makeKnownLinkObj( SpecialPage::getTitleFor( 'Watchlist', $subpage ), wfMsgHtml( "watchlisttools-{$mode}" ) ); } return implode( ' | ', $tools ); } -- cgit v1.2.3-54-g00ecf