*/
public function load() {
$request = $this->getRequest();
- list( $this->limit, $this->offset ) = $request->getLimitOffset( 20 );
+ list( $this->limit, $this->offset ) = $request->getLimitOffset( 20, '' );
$this->mPrefix = $request->getVal( 'prefix', '' );
$user = $this->getUser();
$profile = new ProfileSection( __METHOD__ );
$search = $this->getSearchEngine();
- // Request an extra result to determine whether a "next page" link is useful
- $search->setLimitOffset( $this->limit + 1, $this->offset );
+ $search->setLimitOffset( $this->limit, $this->offset );
$search->setNamespaces( $this->namespaces );
$this->saveNamespaces();
$search->prefix = $this->mPrefix;
$this->offset,
$this->limit,
$this->powerSearchOptions() + array( 'search' => $term ),
- max( $titleMatchesNum, $textMatchesNum ) <= $this->limit
+ $this->limit + $this->offset >= $totalRes
);
}
wfRunHooks( 'SpecialSearchResults', array( $term, &$titleMatches, &$textMatches ) );
$out = "<ul class='mw-search-results'>\n";
$result = $matches->next();
- $count = 0;
- while ( $result && $count < $this->limit ) {
+ while ( $result ) {
$out .= $this->showHit( $result, $terms );
$result = $matches->next();
- $count++;
}
$out .= "</ul>\n";
$thumb->toHtml( array( 'desc-link' => true ) ) .
'</td>' .
'<td style="vertical-align: top;">' .
- "{$link} {$fileMatch}" .
+ "{$link} {$redirect} {$section} {$fileMatch}" .
$extract .
"<div class='mw-search-result-data'>{$score}{$desc} - {$date}{$related}</div>" .
'</td>' .
}
$rows[$subject] .=
- Xml::openElement(
- 'td', array( 'style' => 'white-space: nowrap' )
- ) .
+ Xml::openElement( 'td' ) .
Xml::checkLabel(
$name,
"ns{$namespace}",
}
// Return final output
- return Xml::openElement(
- 'fieldset',
- array( 'id' => 'mw-searchoptions', 'style' => 'margin:0em;' )
- ) .
+ return Xml::openElement( 'fieldset', array( 'id' => 'mw-searchoptions' ) ) .
Xml::element( 'legend', null, $this->msg( 'powersearch-legend' )->text() ) .
Xml::tags( 'h4', null, $this->msg( 'powersearch-ns' )->parse() ) .
Html::element( 'div', array( 'id' => 'mw-search-togglebox' ) ) .
->params( wfEscapeWikiText( $term ) )
->numParams( $resultsShown )
->parse();
- $out .= Xml::tags( 'div', array( 'class' => 'results-info' ), $top );
+ $out .= Xml::tags( 'div', array( 'class' => 'results-info' ), $top ) .
+ Xml::element( 'div', array( 'style' => 'clear:both' ), '', false );
}
return $out . $this->didYouMeanHtml;