62 if ( $this->showMultimedia ) {
63 $this->output->addModules(
'mediawiki.special.search.commonsInterwikiWidget' );
65 $this->output->addModuleStyles(
'mediawiki.special.search.interwikiwidget.styles' );
68 foreach ( $resultSets as $resultSet ) {
69 foreach ( $resultSet as $result ) {
70 if ( !$result->isBrokenTitle() ) {
71 $iwResults[$result->getTitle()->getInterwiki()][] =
$result;
77 $iwResultListOutput =
'';
79 foreach ( $iwResults as $iwPrefix => $results ) {
82 $iwResultItemOutput =
'';
84 foreach ( $results as $result ) {
85 $iwResultItemOutput .= $this->resultWidget->render( $result,
$term, $position++ );
89 $iwResultListOutput .= Html::rawElement(
'li',
91 'class' =>
'iw-resultset',
92 'data-iw-resultset-pos' => $iwResultSetPos,
93 'data-iw-resultset-source' => $iwPrefix
103 return Html::rawElement(
105 [
'id' =>
'mw-interwiki-results' ],
108 [
'class' =>
'iw-headline' ],
109 $this->specialSearch->msg(
'search-interwiki-caption' )->parse()
112 'ul', [
'class' =>
'iw-results', ], $iwResultListOutput
125 $href = Title::makeTitle(
NS_SPECIAL,
'Search',
null, $iwPrefix )->getLocalURL(
126 [
'search' =>
$term,
'fulltext' => 1 ]
129 $interwiki = $this->iwLookup->fetch( $iwPrefix );
132 $caption = $this->customCaptions[
$iwPrefix] ??
133 $this->specialSearch->msg(
'search-interwiki-default', $parsed[
'host'] )->escaped();
135 $searchLink = Html::rawElement(
'em',
null,
136 Html::rawElement(
'a', [
'href' => $href,
'target' =>
'_blank' ], $caption )
139 return Html::rawElement(
'div',
140 [
'class' =>
'iw-result__footer' ],
141 $this->
iwIcon( $iwPrefix ) . $searchLink );
145 if ( $this->customCaptions !==
null ) {
149 $this->customCaptions = [];
150 $customLines = explode(
"\n", $this->specialSearch->msg(
'search-interwiki-custom' )->escaped() );
151 foreach ( $customLines as
$line ) {
152 $parts = explode(
':',
$line, 2 );
153 if ( count( $parts ) === 2 ) {
154 $this->customCaptions[$parts[0]] = $parts[1];
169 $interwiki = $this->iwLookup->fetch( $iwPrefix );
172 $iwIconUrl = $parsed[
'scheme'] .
173 $parsed[
'delimiter'] .
175 (
isset( $parsed[
'port'] ) ?
':' . $parsed[
'port'] :
'' ) .
182 $iwIcon->setAttributes( [
'style' =>
"background-image:url($iwIconUrl);" ] );
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two and(2) offer you this license which gives you legal permission to copy
wfParseUrl( $url)
parse_url() work-alike, but non-broken.
wfExpandUrl( $url, $defaultProto=PROTO_CURRENT)
Expand a potentially local URL to a fully-qualified URL.
This class is a collection of static functions that serve two purposes:
getOutput()
Get the OutputPage being used for this instance.
implements Special:Search - Run text & title search and display the output
Represents a title within MediaWiki.
namespace being checked & $result
whereas SearchGetNearMatch runs after $term