$out->addHTML( $dymWidget->render( $term, $textMatches ) );
}
- $out->addHTML( "<div class='searchresults'>" );
-
$hasErrors = $textStatus && $textStatus->getErrors();
$hasOtherResults = $textMatches &&
$textMatches->hasInterwikiResults( SearchResultSet::INLINE_RESULTS );
+ if ( $textMatches && $textMatches->hasInterwikiResults( SearchResultSet::SECONDARY_RESULTS ) ) {
+ $out->addHTML( '<div class="searchresults mw-searchresults-has-iw">' );
+ } else {
+ $out->addHTML( '<div class="searchresults">' );
+ }
+
if ( $hasErrors ) {
list( $error, $warning ) = $textStatus->splitByErrorType();
if ( $error->getErrors() ) {
$mainResultWidget = new FullSearchResultWidget( $this, $linkRenderer );
if ( $search->getFeatureData( 'enable-new-crossproject-page' ) ) {
-
$sidebarResultWidget = new InterwikiSearchResultWidget( $this, $linkRenderer );
$sidebarResultsWidget = new InterwikiSearchResultSetWidget(
$this,
$sidebarResultWidget,
$linkRenderer,
- MediaWikiServices::getInstance()->getInterwikiLookup()
+ MediaWikiServices::getInstance()->getInterwikiLookup(),
+ $search->getFeatureData( 'show-multimedia-search-results' )
);
} else {
$sidebarResultWidget = new SimpleSearchResultWidget( $this, $linkRenderer );
// prev/next links
if ( $totalRes > $this->limit || $this->offset ) {
+ // Allow matches to define the correct offset, as interleaved
+ // AB testing may require a different next page offset.
+ if ( $textMatches && $textMatches->getOffset() !== null ) {
+ $offset = $textMatches->getOffset();
+ } else {
+ $offset = $this->offset;
+ }
+
$prevnext = $this->getLanguage()->viewPrevNext(
$this->getPageTitle(),
- $this->offset,
+ $offset,
$this->limit,
$this->powerSearchOptions() + [ 'search' => $term ],
$this->limit + $this->offset >= $totalRes