r8020 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r8019‎ | r8020 | r8021 >
Date:13:01, 1 April 2005
Author:avar
Status:old
Tags:
Comment:
* "$invert = false" in function declerations is redundant, changed it to
"$invert".
* Fixed a bug: indexShowline() didn't support $invert.
Modified paths:
  • /trunk/phase3/includes/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialAllpages.php
@@ -52,7 +52,7 @@
5353 * @param string $from Article name we are starting listing at.
5454 * @param bool $invert true if we want the namespaces inverted (default false)
5555 */
56 -function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert = false) {
 56+function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert ) {
5757 global $wgContLang, $wgScript;
5858 $t = Title::makeTitle( NS_SPECIAL, "Allpages" );
5959
@@ -84,7 +84,7 @@
8585 * @param integer $namespace (default NS_MAIN)
8686 * @param bool $invert true if we want the namespaces inverted (default false)
8787 */
88 -function indexShowToplevel ( $namespace = NS_MAIN, $invert = 0 ) {
 88+function indexShowToplevel ( $namespace = NS_MAIN, $invert ) {
8989 global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser;
9090 $sk = $wgUser->getSkin();
9191 $fname = "indexShowToplevel";
@@ -150,7 +150,7 @@
151151 while ( count ( $lines ) > 0 ) {
152152 $inpoint = array_shift ( $lines );
153153 $outpoint = array_shift ( $lines );
154 - $out .= indexShowline ( $inpoint, $outpoint, $namespace );
 154+ $out .= indexShowline ( $inpoint, $outpoint, $namespace, $invert );
155155 }
156156 $out .= '</table>';
157157
@@ -190,15 +190,16 @@
191191 * @todo Document
192192 * @param string $from
193193 * @param integer $namespace (Default NS_MAIN)
 194+ * @param bool $invert true if we want the namespaces inverted (default false)
194195 */
195 -function indexShowline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
 196+function indexShowline( $inpoint, $outpoint, $namespace = NS_MAIN, $invert ) {
196197 global $wgOut, $wgLang, $wgUser;
197198 $sk = $wgUser->getSkin();
198199 $dbr =& wfGetDB( DB_SLAVE );
199200
200201 $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) );
201202 $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) );
202 - $queryparams = $namespace ? ('namespace='.intval($namespace)) : '';
 203+ $queryparams = ($namespace ? ('namespace='.intval($namespace)) : '') . ($invert ? "&invert=$invert" : '');
203204 $special = Title::makeTitle( NS_SPECIAL, 'Allpages/' . $inpoint );
204205 $link = $special->escapeLocalUrl( $queryparams );
205206

Status & tagging log