diff options
author | Pierre Schmitz <pierre@archlinux.de> | 2008-03-21 11:49:34 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2008-03-21 11:49:34 +0100 |
commit | 086ae52d12011746a75f5588e877347bc0457352 (patch) | |
tree | e73263c7a29d0f94fafb874562610e16eb292ba8 /includes/WatchlistEditor.php | |
parent | 749e7fb2bae7bbda855de3c9e319435b9f698ff7 (diff) |
Update auf MediaWiki 1.12.0
Diffstat (limited to 'includes/WatchlistEditor.php')
-rw-r--r-- | includes/WatchlistEditor.php | 40 |
1 files changed, 5 insertions, 35 deletions
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 .= '<fieldset><legend>' . wfMsgHtml( 'watchlistedit-clear-legend' ) . '</legend>'; - $form .= wfMsgExt( 'watchlistedit-clear-confirm', 'parse' ); - $form .= '<p>' . Xml::submitButton( wfMsg( 'watchlistedit-clear-submit' ) ) . '</p>'; - $form .= '</fieldset></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 ); } |