From 125a384fe88726e385354ab364c692c0489fbbdb Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Sat, 19 Mar 2005 16:09:17 +0000 Subject: [PATCH] BUG#190 Hide your own edits on the watchlist --- RELEASE-NOTES | 1 + includes/SpecialWatchlist.php | 27 ++++++++++++++++++++++++--- languages/Language.php | 9 ++++++--- languages/LanguageDe.php | 10 +++++++--- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 78766a4801..e229dfb1cb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -15,6 +15,7 @@ New exciting things! Need further work and testing... * Schema reworking: http://meta.wikimedia.org/wiki/Proposed_Database_Schema_Changes/October_2004 * New WikiSyntax: -- turns into &emdash; or – depending on context * (bug 15) Allow editors to view diff of their change before actually submitting an edit +* (bug 190) Hide your own edits on the watchlist * ...and more! Need to merge: diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index 3d14b2a4d2..98a921db73 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -15,7 +15,7 @@ require_once( 'WatchedItem.php' ); * constructor */ function wfSpecialWatchlist() { - global $wgUser, $wgOut, $wgLang, $wgTitle, $wgMemc, $wgRequest; + global $wgUser, $wgOut, $wgLang, $wgTitle, $wgMemc, $wgRequest, $wgContLang;; global $wgUseWatchlistCache, $wgWLCacheTimeout, $wgDBname; global $wgEnotif, $wgShowUpdatedMarker, $wgRCShowWatchingUsers; $fname = 'wfSpecialWatchlist'; @@ -36,6 +36,7 @@ function wfSpecialWatchlist() { $days = $wgRequest->getVal( 'days' ); $action = $wgRequest->getVal( 'action' ); $remove = $wgRequest->getVal( 'remove' ); + $hideOwn = $wgRequest->getVal( 'hideOwn' ); $id = $wgRequest->getArray( 'id' ); if( $wgUser->getOption( 'enotifwatchlistpages' ) ) { @@ -56,6 +57,7 @@ function wfSpecialWatchlist() { $wgUser->clearAllNotifications( $uid ); } + if(($action == 'submit') && isset($remove) && is_array($id)) { $wgOut->addWikiText( wfMsg( 'removingchecked' ) ); $wgOut->addHTML( '

' ); @@ -128,6 +130,10 @@ function wfSpecialWatchlist() { $npages = $s->n; } + if ( is_null( $hideOwn ) ) { + # default is false (don't hide own edits) + $hideOwn = 0; + } if(isset($_REQUEST['magic'])) { $wgOut->addWikiText( wfMsg( 'watchlistcontains', $wgLang->formatNum( $nitems ) ) . @@ -187,7 +193,12 @@ function wfSpecialWatchlist() { $z = 'wl_namespace=page_namespace'; } - + if ( 0 == $hideOwn ) + $andHideOwn = ''; + else + $andHideOwn = "AND (rev_user <> $uid)"; + + $wgOut->addHTML( '' . wfMsg( 'watchdetails', $wgLang->formatNum( $nitems ), $wgLang->formatNum( $npages ), $y, $specialTitle->escapeLocalUrl( 'magic=yes' ) ) . "
\n" ); @@ -198,6 +209,7 @@ function wfSpecialWatchlist() { rev_user,rev_user_text,rev_timestamp,rev_minor_edit,page_is_new,wl_notificationtimestamp FROM $watchlist,$page,$revision $use_index WHERE wl_user=$uid + $andHideOwn AND $z AND wl_title=page_title AND page_latest=rev_id @@ -216,7 +228,16 @@ function wfSpecialWatchlist() { $wgOut->addHTML( "\n


\n{$note}\n
" ); $note = wlCutoffLinks( $days ); $wgOut->addHTML( "{$note}\n" ); - + + $sk = $wgUser->getSkin(); + $s = $sk->makeKnownLink( + $wgContLang->specialPage( 'Watchlist' ), + (0 == $hideOwn) ? wfMsg( 'wlhide' ) : wfMsg( 'wlshow' ), + 'hideOwn=' . $wgLang->formatNum( 1-$hideOwn ) ); + + $note = wfMsg( "wlhideshowown", $s ); + $wgOut->addHTML( "\n
{$note}\n
" ); + if ( $numRows == 0 ) { $wgOut->addHTML( '

' . wfMsg( 'watchnochange' ) . '

' ); return; diff --git a/languages/Language.php b/languages/Language.php index a0bb37d596..44908a0623 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -1226,9 +1226,12 @@ at the bottom of the screen (deleting a content page also deletes the accompanyi 'removingchecked' => 'Removing requested items from watchlist...', 'couldntremove' => "Couldn't remove item '$1'...", 'iteminvalidname' => "Problem with item '$1', invalid name...", -'wlnote' => "Below are the last $1 changes in the last $2 hours.", -'wlshowlast' => "Show last $1 hours $2 days $3", -'wlsaved' => 'This is a saved version of your watchlist.', +'wlnote' => 'Below are the last $1 changes in the last $2 hours.', +'wlshowlast' => 'Show last $1 hours $2 days $3', +'wlsaved' => 'This is a saved version of your watchlist.', +'wlhideshowown' => '$1 my edits.', +'wlshow' => 'Show', +'wlhide' => 'Hide', 'updatedmarker' => ' updated (since my last visit) ', diff --git a/languages/LanguageDe.php b/languages/LanguageDe.php index 6ecc114434..fdf182f0bf 100644 --- a/languages/LanguageDe.php +++ b/languages/LanguageDe.php @@ -844,9 +844,13 @@ $3... komplette Liste zeigen und bearbeiten.)", "removingchecked" => "Wunschgemäß werden die Einträge aus der Beobachtungsliste entfernt...", "couldntremove" => "Der Eintrag '$1' kann nicht gelöscht werden...", "iteminvalidname" => "Ploblem mit dem Eintrag '$1', ungültiger Name...", -"wlnote" => "Es folgen die letzten $1 Änderungen der letzten $2 Stunden.", -"wlshowlast" => "Zeige die letzen $1 Stunden $2 Tage $3", -"wlsaved" => "Dies ist eine gespeicherte Version Ihrer Beobachtungsliste.", +'wlnote' => 'Es folgen die letzten $1 Änderungen der letzten $2 Stunden.', +'wlshowlast' => 'Zeige die letzen $1 Stunden $2 Tage $3', +'wlsaved' => 'Dies ist eine gespeicherte Version Ihrer Beobachtungsliste.', +'wlhideshowown' => '$1 von mir bearbeitete Artikel.', +'wlshow' => 'Zeige ', +'wlhide' => 'Verstecke ', + # Delete/protect/revert # -- 2.20.1