r7177 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r7176‎ | r7177 | r7178 >
Date:14:05, 19 January 2005
Author:hashar
Status:old
Tags:
Comment:
* Dummy phpdoc comments.
* Double to single quote.
Modified paths:
  • /trunk/phase3/includes/SpecialAllpages.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialAllpages.php
@@ -6,7 +6,8 @@
77 */
88
99 /**
10 - *
 10+ * Entry point : initialise variables and call subfunctions.
 11+ * @param string $par ????? (default NULL)
1112 */
1213 function wfSpecialAllpages( $par=NULL ) {
1314 global $indexMaxperpage, $toplevelMaxperpage, $wgRequest, $wgOut, $wgContLang;
@@ -30,6 +31,11 @@
3132 }
3233 }
3334
 35+/**
 36+ * HTML for the top form
 37+ * @param integer $namespace A namespace constant (default NS_MAIN).
 38+ * @param string $from Article name we are starting listing at.
 39+ */
3440 function namespaceForm ( $namespace = NS_MAIN, $from = '' ) {
3541 global $wgContLang, $wgScript;
3642
@@ -38,7 +44,7 @@
3945 $namespaceselect = '<select name="namespace">';
4046 $arr = $wgContLang->getNamespaces();
4147 for ( $i = 0; $i < 14; $i++ ) {
42 - $namespacename = str_replace ( "_", " ", $arr[$i] );
 48+ $namespacename = str_replace ( '_', ' ', $arr[$i] );
4349 $n = ($i == 0) ? wfMsg ( 'articlenamespace' ) : $namespacename;
4450 $sel = ($i == $namespace) ? ' selected="selected"' : '';
4551 $namespaceselect .= "<option value='{$i}'{$sel}>{$n}</option>";
@@ -57,6 +63,10 @@
5864 return $out;
5965 }
6066
 67+/**
 68+ * @todo Document
 69+ * @param integer $namespace (default NS_MAIN)
 70+ */
6171 function indexShowToplevel ( $namespace = NS_MAIN ) {
6272 global $wgOut, $indexMaxperpage, $toplevelMaxperpage, $wgContLang, $wgRequest, $wgUser;
6373 $sk = $wgUser->getSkin();
@@ -124,29 +134,29 @@
125135 $outpoint = array_shift ( $lines );
126136 $out .= indexShowline ( $inpoint, $outpoint, $namespace );
127137 }
128 - $out .= "</table>";
 138+ $out .= '</table>';
129139
130140 $nsForm = namespaceForm ( $namespace );
131141
132142 # Is there more?
133 - $morelinks = "";
 143+ $morelinks = '';
134144 if ( $offset > 0 ) {
135145 $morelinks = $sk->makeKnownLink (
136 - $wgContLang->specialPage ( "Allpages" ),
 146+ $wgContLang->specialPage ( 'Allpages' ),
137147 wfMsg ( 'allpagesprev' ),
138148 ( $offset > $toplevelMaxperpage ) ? 'offset='.($offset-$toplevelMaxperpage) : ''
139149 );
140150 }
141151 if ( $stopat < $sections-1 ) {
142 - if ( $morelinks != "" ) { $morelinks .= " | "; }
 152+ if ( $morelinks != '' ) { $morelinks .= " | "; }
143153 $morelinks .= $sk->makeKnownLink (
144 - $wgContLang->specialPage ( "Allpages" ),
 154+ $wgContLang->specialPage ( 'Allpages' ),
145155 wfMsg ( 'allpagesnext' ),
146156 'offset=' . ($offset + $toplevelMaxperpage)
147157 );
148158 }
149159
150 - if ( $morelinks != "" ) {
 160+ if ( $morelinks != '' ) {
151161 $out2 = '<table style="background: inherit;" width="100%" cellpadding="0" cellspacing="0" border="0">';
152162 $out2 .= '<tr valign="top"><td align="left">' . $nsForm;
153163 $out2 .= '</td><td align="right" style="font-size: smaller; margin-bottom: 1em;">';
@@ -158,13 +168,18 @@
159169 $wgOut->addHtml( $out2 . $out );
160170 }
161171
 172+/**
 173+ * @todo Document
 174+ * @param string $from
 175+ * @param integer $namespace (Default NS_MAIN)
 176+ */
162177 function indexShowline( $inpoint, $outpoint, $namespace = NS_MAIN ) {
163178 global $wgOut, $wgLang, $wgUser;
164179 $sk = $wgUser->getSkin();
165180 $dbr =& wfGetDB( DB_SLAVE );
166181
167 - $inpointf = htmlspecialchars( str_replace( "_", " ", $inpoint ) );
168 - $outpointf = htmlspecialchars( str_replace( "_", " ", $outpoint ) );
 182+ $inpointf = htmlspecialchars( str_replace( '_', ' ', $inpoint ) );
 183+ $outpointf = htmlspecialchars( str_replace( '_', ' ', $outpoint ) );
169184 $queryparams = $namespace ? ('namespace='.intval($namespace)) : '';
170185 $special = Title::makeTitle( NS_SPECIAL, 'Allpages/' . $inpoint );
171186 $link = $special->escapeLocalUrl( $queryparams );
@@ -183,7 +198,7 @@
184199 $maxPlusOne = $indexMaxperpage + 1;
185200 $namespacee = intval($namespace);
186201
187 - $out = "";
 202+ $out = '';
188203 $dbr =& wfGetDB( DB_SLAVE );
189204 $page = $dbr->tableName( 'page' );
190205
@@ -193,7 +208,7 @@
194209 $sql = "SELECT page_title FROM $page WHERE page_namespace=$namespacee" .
195210 " AND page_title >= ". $dbr->addQuotes( $fromKey ) .
196211 " ORDER BY page_title LIMIT " . $maxPlusOne;
197 - $res = $dbr->query( $sql, "indexShowChunk" );
 212+ $res = $dbr->query( $sql, 'indexShowChunk' );
198213
199214 ### FIXME: side link to previous
200215

Status & tagging log