56 'id' => $isPowerSearch ?
'powersearch' :
'search',
61 '<div id="mw-search-top-table">' .
64 "<div class='mw-search-visualclear'></div>" .
65 "<div class='mw-search-profile-tabs'>" .
67 "<div style='clear:both'></div>" .
87 'autofocus' => trim(
$term ) ===
'',
89 'dataLocation' =>
'content',
93 $layout = new \OOUI\ActionFieldLayout( $searchWidget,
new \OOUI\ButtonInputWidget( [
95 'label' => $this->specialSearch->msg(
'searchbutton' )->text(),
96 'flags' => [
'progressive',
'primary' ],
103 if ( $totalResults > 0 && $offset < $totalResults ) {
107 'class' =>
'results-info',
108 'data-mw-num-results-offset' => $offset,
109 'data-mw-num-results-total' => $totalResults
111 $this->specialSearch->msg(
'search-showingresults' )
112 ->numParams( $offset + 1, $offset + $numResults, $totalResults )
113 ->numParams( $numResults )
119 Html::hidden(
'title', $this->specialSearch->getPageTitle()->getPrefixedText() ) .
120 Html::hidden(
'profile', $profile ) .
121 Html::hidden(
'fulltext',
'1' );
137 $lang = $this->specialSearch->getLanguage();
139 foreach ( $this->profiles as $id => $profileConfig ) {
140 $profileConfig[
'parameters'][
'profile'] = $id;
141 $tooltipParam = isset( $profileConfig[
'namespace-messages'] )
142 ?
$lang->commaList( $profileConfig[
'namespace-messages'] )
146 [
'class' => $profile === $id ?
'current' :
'normal' ],
149 $this->specialSearch->msg( $profileConfig[
'message'] )->text(),
150 $this->specialSearch->msg( $profileConfig[
'tooltip'], $tooltipParam )->text(),
151 $profileConfig[
'parameters']
157 "<div class='search-types'>" .
158 "<ul>" . implode(
'', $items ) .
"</ul>" .
171 $parts = explode(
':',
$term );
172 return count( $parts ) > 1
195 'href' => $this->specialSearch->getPageTitle()->getLocalURL(
$params ),
214 if ( $isPowerSearch ) {
218 Hooks::run(
'SpecialSearchProfileForm', [
219 $this->specialSearch, &$form, $profile,
$term, []
237 $activeNamespaces = $this->specialSearch->getNamespaces();
238 foreach ( $this->searchConfig->searchableNamespaces() as $namespace => $name ) {
239 $subject = MWNamespace::getSubject( $namespace );
240 if ( !isset(
$rows[$subject] ) ) {
241 $rows[$subject] =
"";
244 $name =
$wgContLang->getConverter()->convertNamespace( $namespace );
245 if ( $name ===
'' ) {
246 $name = $this->specialSearch->msg(
'blanknamespace' )->text();
254 "mw-search-ns{$namespace}",
255 in_array( $namespace, $activeNamespaces )
263 foreach (
$rows as $row ) {
264 $tableRows[] =
"<tr>{$row}</tr>";
266 $namespaceTables = [];
267 foreach ( array_chunk( $tableRows, 4 ) as $chunk ) {
268 $namespaceTables[] = implode(
'', $chunk );
272 'namespaceTables' =>
"<table>" . implode(
'</table><table>', $namespaceTables ) .
'</table>',
274 Hooks::run(
'SpecialSearchPowerBox', [ &$showSections,
$term, $opts ] );
277 foreach ( $opts as $key =>
$value ) {
278 $hidden .= Html::hidden( $key,
$value );
281 $divider =
"<div class='divider'></div>";
284 $user = $this->specialSearch->getUser();
286 if ( $user->isLoggedIn() ) {
288 $this->specialSearch->msg(
'powersearch-remember' )->text(),
290 'mw-search-powersearch-remember',
294 [
'value' => $user->getEditToken(
296 $this->specialSearch->getRequest()
302 "<fieldset id='mw-searchoptions'>" .
303 "<legend>" . $this->specialSearch->msg(
'powersearch-legend' )->escaped() .
'</legend>' .
304 "<h4>" . $this->specialSearch->msg(
'powersearch-ns' )->parse() .
'</h4>' .
306 "<div id='mw-search-togglebox'></div>" .
wfScript( $script='index')
Get the path to a specified script file, respecting file extensions; this is a wrapper around $wgScri...
This class is a collection of static functions that serve two purposes:
This is a utility class with only static functions for dealing with namespaces that encodes all the "...
Configuration handling class for SearchEngine.
implements Special:Search - Run text & title search and display the output
Module of static functions for generating XML.
static openElement( $element, $attribs=null)
This opens an XML element.
static checkLabel( $label, $name, $id, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox with a label.
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
static element( $element, $attribs=null, $contents='', $allowShortTag=true)
Format an XML element with given attributes and, optionally, text content.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
external whereas SearchGetNearMatch runs after $term
do that in ParserLimitReportFormat instead use this to modify the parameters of the image all existing parser cache entries will be invalid To avoid you ll need to handle that somehow(e.g. with the RejectParserCacheValue hook) because MediaWiki won 't do it for you. & $defaults also a ContextSource after deleting those rows but within the same transaction $rows
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses & $html
if(!isset( $args[0])) $lang