r91575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91574‎ | r91575 | r91576 >
Date:18:13, 6 July 2011
Author:demon
Status:ok (Comments)
Tags:
Comment:
Move wfShowingResultsNum() back into SpecialSearch where it belongs. No need for a global function for something thats only used once in core or extensions
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/specials/SpecialSearch.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -1477,25 +1477,6 @@
14781478 }
14791479
14801480 /**
1481 - * @todo document
1482 - *
1483 - * @param $offset Int
1484 - * @param $limit Int
1485 - * @param $num Int
1486 - * @return String
1487 - */
1488 -function wfShowingResultsNum( $offset, $limit, $num ) {
1489 - global $wgLang;
1490 - return wfMsgExt(
1491 - 'showingresultsnum',
1492 - array( 'parseinline' ),
1493 - $wgLang->formatNum( $limit ),
1494 - $wgLang->formatNum( $offset + 1 ),
1495 - $wgLang->formatNum( $num )
1496 - );
1497 -}
1498 -
1499 -/**
15001481 * Generate (prev x| next x) (20|50|100...) type links for paging
15011482 *
15021483 * @param $offset String
Index: trunk/phase3/includes/specials/SpecialSearch.php
@@ -986,7 +986,11 @@
987987 } elseif ( $resultsShown >= $this->limit ) {
988988 $top = wfShowingResults( $this->offset, $this->limit );
989989 } else {
990 - $top = wfShowingResultsNum( $this->offset, $this->limit, $resultsShown );
 990+ $top = wfMsgExt( 'showingresultsnum', array( 'parseinline' ),
 991+ $wgLang->formatNum( $this->limit ),
 992+ $wgLang->formatNum( $this->offset + 1 ),
 993+ $wgLang->formatNum( $resultsShown )
 994+ );
991995 }
992996 $out .= Xml::tags( 'div', array( 'class' => 'results-info' ),
993997 Xml::tags( 'ul', null, Xml::tags( 'li', null, $top ) )

Comments

#Comment by IAlex (talk | contribs)   18:42, 6 July 2011

\o/

Status & tagging log