- /**
- * Generates an appropriate HTML header for the given interwiki prefix
- *
- * @param string $term User provided search term
- * @param string $iwPrefix Interwiki prefix of wiki to show header for
- * @return string HTML
- */
- protected function headerHtml( $term, $iwPrefix ) {
-
- $iwDisplayType = isset( $this->iwPrefixDisplayTypes[$iwPrefix] )
- ? $this->iwPrefixDisplayTypes[$iwPrefix]
- : "";
-
- if ( isset( $this->customCaptions[$iwPrefix] ) ) {
- /* customCaptions composed by loadCustomCaptions() with pre-escaped content.*/
- $caption = $this->customCaptions[$iwPrefix];
- } else {
- $interwiki = $this->iwLookup->fetch( $iwPrefix );
- $parsed = wfParseUrl( wfExpandUrl( $interwiki ? $interwiki->getURL() : '/' ) );
- $caption = $this->specialSearch->msg( 'search-interwiki-default', $parsed['host'] )->escaped();
- }
-
- return Html::rawElement( 'div', [ 'class' => 'iw-result__header' ],
- Html::rawElement( 'span', [ 'class' => 'iw-result__icon iw-result__icon--' . $iwDisplayType ] )
- . $caption
- );
- }
-