r8017 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r8016‎ | r8017 | r8018 >
Date:11:57, 1 April 2005
Author:avar
Status:old
Tags:
Comment:
* Changed the $invert datatype from 'integer' to 'bool'
* Documented
Modified paths:
  • /trunk/phase3/includes/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialAllpages.php
@@ -17,7 +17,7 @@
1818 # GET values
1919 $from = $wgRequest->getVal( 'from' );
2020 $namespace = $wgRequest->getInt( 'namespace' );
21 - $invert = $wgRequest->getInt( 'invert' );
 21+ $invert = $wgRequest->getBool( 'invert' );
2222
2323 $names = $wgContLang->getNamespaces();
2424
@@ -50,8 +50,9 @@
5151 * HTML for the top form
5252 * @param integer $namespace A namespace constant (default NS_MAIN).
5353 * @param string $from Article name we are starting listing at.
 54+ * @param bool $invert true if we want the namespaces inverted (default false)
5455 */
55 -function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert = 0) {
 56+function namespaceForm ( $namespace = NS_MAIN, $from = '', $invert = false) {
5657 global $wgContLang, $wgScript;
5758 $t = Title::makeTitle( NS_SPECIAL, "Allpages" );
5859
@@ -70,7 +71,7 @@
7172 . htmlspecialchars ( $from ) . '"/>';
7273 $submitbutton = '<input type="submit" value="' . wfMsg( 'allpagessubmit' ) . '" />';
7374
74 - $invertbox = "<input type='checkbox' name='invert' value='1'" . ( $invert == 1 ? ' checked="checked"' : '' ) . ' />';
 75+ $invertbox = "<input type='checkbox' name='invert' value='1'" . ( $invert ? ' checked="checked"' : '' ) . ' />';
7576
7677 $out = "<div class='namespaceselector'><form method='get' action='{$wgScript}'>";
7778 $out .= '<input type="hidden" name="title" value="'.$t->getPrefixedText().'" />';
@@ -80,8 +81,8 @@
8182 }
8283
8384 /**
84 - * @todo Document
8585 * @param integer $namespace (default NS_MAIN)
 86+ * @param bool $invert true if we want the namespaces inverted (default false)
8687 */
8788 function indexShowToplevel ( $namespace = NS_MAIN, $invert = 0 ) {
8889 global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser;
@@ -209,6 +210,11 @@
210211 return '<tr><td align="right">'.$out.'</td></tr>';
211212 }
212213
 214+/**
 215+ * @param integer $namespace (Default NS_MAIN)
 216+ * @param string $from list all pages from this name (default FALSE)
 217+ * @param bool $invert true if we want the namespaces inverted (default false)
 218+ */
213219 function indexShowChunk( $namespace = NS_MAIN, $from, $invert ) {
214220 global $wgOut, $wgUser, $indexMaxperpage, $wgContLang;
215221 $sk = $wgUser->getSkin();

Status & tagging log