From 88a20cb0562bced5d77daeb68fc3bf89a5ad772c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Thu, 28 Apr 2005 07:51:48 +0000 Subject: [PATCH] * Using getBool() instead of getVal() for hideOwn which allowed for some code cleanup * Using $wgRequest->getBool() for 'magic' instead of $_REQUEST --- includes/SpecialWatchlist.php | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/includes/SpecialWatchlist.php b/includes/SpecialWatchlist.php index e36cf7da39..d18de4a134 100644 --- a/includes/SpecialWatchlist.php +++ b/includes/SpecialWatchlist.php @@ -36,7 +36,7 @@ function wfSpecialWatchlist() { $days = $wgRequest->getVal( 'days' ); $action = $wgRequest->getVal( 'action' ); $remove = $wgRequest->getVal( 'remove' ); - $hideOwn = $wgRequest->getVal( 'hideOwn' ); + $hideOwn = $wgRequest->getBool( 'hideOwn' ); $id = $wgRequest->getArray( 'id' ); if( $wgUser->getOption( 'enotifwatchlistpages' ) ) { @@ -100,8 +100,8 @@ function wfSpecialWatchlist() { $nitems = $s->n; if($nitems == 0) { - $wgOut->addWikiText( wfMsg( 'nowatchlist' ) ); - return; + $wgOut->addWikiText( wfMsg( 'nowatchlist' ) ); + return; } if ( is_null( $days ) ) { @@ -130,14 +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'])) { + + if($wgRequest->getBool('magic')) { $wgOut->addWikiText( wfMsg( 'watchlistcontains', $wgLang->formatNum( $nitems ) ) . - '

' . wfMsg( 'watcheditlist' ) . "

\n" ); + "\n\n" . wfMsg( 'watcheditlist' ) ); $wgOut->addHTML( '
escapeLocalUrl( 'action=submit' ) . @@ -193,11 +189,7 @@ function wfSpecialWatchlist() { $z = 'wl_namespace=page_namespace'; } - if ( 0 == $hideOwn ) - $andHideOwn = ''; - else - $andHideOwn = "AND (rev_user <> $uid)"; - + $andHideOwn = $hideOwn ? "AND (rev_user <> $uid)" : ''; $wgOut->addHTML( '' . wfMsg( 'watchdetails', $wgLang->formatNum( $nitems ), $wgLang->formatNum( $npages ), $y, -- 2.20.1