r88520 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88519‎ | r88520 | r88521 >
Date:15:03, 21 May 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
get rid of strict error
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_QueryPage.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/specials/QueryPages/SMW_QueryPage.php
@@ -37,9 +37,8 @@
3838 *
3939 * @param $offset database query offset
4040 * @param $limit database query limit
41 - * @param $shownavigation show navigation like "next 200"?
4241 */
43 - function doQuery( $offset, $limit, $shownavigation = true ) {
 42+ function doQuery( $offset = false, $limit = false ) {
4443 global $wgOut, $wgContLang;
4544
4645 $options = new SMWRequestOptions();
@@ -52,27 +51,26 @@
5352 $sk = $this->getSkin();
5453 $sname = $this->getName();
5554
56 - if ( $shownavigation ) {
57 - $wgOut->addHTML( $this->getPageHeader() );
 55+ $wgOut->addHTML( $this->getPageHeader() );
5856
59 - // if list is empty, show it
60 - if ( $num == 0 ) {
61 - smwfLoadExtensionMessages( 'SemanticMediaWiki' );
62 - $wgOut->addHTML( '<p>' . wfMsgHTML( 'specialpage-empty' ) . '</p>' );
63 - return;
64 - }
 57+ // if list is empty, show it
 58+ if ( $num == 0 ) {
 59+ smwfLoadExtensionMessages( 'SemanticMediaWiki' );
 60+ $wgOut->addHTML( '<p>' . wfMsgHTML( 'specialpage-empty' ) . '</p>' );
 61+ return;
 62+ }
6563
66 - $top = wfShowingResults( $offset, $num );
67 - $wgOut->addHTML( "<p>{$top}\n" );
 64+ $top = wfShowingResults( $offset, $num );
 65+ $wgOut->addHTML( "<p>{$top}\n" );
6866
69 - // often disable 'next' link when we reach the end
70 - $atend = $num < $limit;
 67+ // often disable 'next' link when we reach the end
 68+ $atend = $num < $limit;
7169
72 - $sl = wfViewPrevNext( $offset, $limit ,
73 - $wgContLang->specialPage( $sname ),
74 - wfArrayToCGI( $this->linkParameters() ), $atend );
75 - $wgOut->addHTML( "<br />{$sl}</p>\n" );
76 - }
 70+ $sl = wfViewPrevNext( $offset, $limit ,
 71+ $wgContLang->specialPage( $sname ),
 72+ wfArrayToCGI( $this->linkParameters() ), $atend );
 73+ $wgOut->addHTML( "<br />{$sl}</p>\n" );
 74+
7775 if ( $num > 0 ) {
7876 $s = array();
7977 if ( ! $this->listoutput )
@@ -90,9 +88,9 @@
9189 $str = $this->listoutput ? $wgContLang->listToText( $s ) : implode( '', $s );
9290 $wgOut->addHTML( $str );
9391 }
94 - if ( $shownavigation ) {
95 - $wgOut->addHTML( "<p>{$sl}</p>\n" );
96 - }
 92+
 93+ $wgOut->addHTML( "<p>{$sl}</p>\n" );
 94+
9795 return $num;
9896 }
9997
@@ -114,4 +112,3 @@
115113 }
116114
117115 }
118 -

Status & tagging log