From ccb6d0a734d15bba9c33749a944b69492f73a64f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Fri, 1 Apr 2005 13:01:54 +0000 Subject: [PATCH] * "$invert = false" in function declerations is redundant, changed it to "$invert". * Fixed a bug: indexShowline() didn't support $invert. --- includes/SpecialAllpages.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/includes/SpecialAllpages.php b/includes/SpecialAllpages.php index cfd9fc01fb..f4ddfcb9fe 100644 --- a/includes/SpecialAllpages.php +++ b/includes/SpecialAllpages.php @@ -52,7 +52,7 @@ function wfSpecialAllpages( $par=NULL ) { * @param string $from Article name we are starting listing at. * @param bool $invert true if we want the namespaces inverted (default false) */ -function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert = false) { +function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert ) { global $wgContLang, $wgScript; $t = Title::makeTitle( NS_SPECIAL, "Allpages" ); @@ -84,7 +84,7 @@ function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert = false) { * @param integer $namespace (default NS_MAIN) * @param bool $invert true if we want the namespaces inverted (default false) */ -function indexShowToplevel ( $namespace = NS_MAIN, $invert = 0 ) { +function indexShowToplevel ( $namespace = NS_MAIN, $invert ) { global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser; $sk = $wgUser->getSkin(); $fname = "indexShowToplevel"; @@ -150,7 +150,7 @@ function indexShowToplevel ( $namespace = NS_MAIN, $invert = 0 ) { while ( count ( $lines ) > 0 ) { $inpoint = array_shift ( $lines ); $outpoint = array_shift ( $lines ); - $out .= indexShowline ( $inpoint, $outpoint, $namespace ); + $out .= indexShowline ( $inpoint, $outpoint, $namespace, $invert ); } $out .= ''; @@ -190,15 +190,16 @@ function indexShowToplevel ( $namespace = NS_MAIN, $invert = 0 ) { * @todo Document * @param string $from * @param integer $namespace (Default NS_MAIN) + * @param bool $invert true if we want the namespaces inverted (default false) */ -function indexShowline( $inpoint, $outpoint, $namespace = NS_MAIN ) { +function indexShowline( $inpoint, $outpoint, $namespace = NS_MAIN, $invert ) { global $wgOut, $wgLang, $wgUser; $sk = $wgUser->getSkin(); $dbr =& wfGetDB( DB_SLAVE ); $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) ); $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) ); - $queryparams = $namespace ? ('namespace='.intval($namespace)) : ''; + $queryparams = ($namespace ? ('namespace='.intval($namespace)) : '') . ($invert ? "&invert=$invert" : ''); $special = Title::makeTitle( NS_SPECIAL, 'Allpages/' . $inpoint ); $link = $special->escapeLocalUrl( $queryparams ); -- 2.20.1