53 return Xml::openElement(
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'] )
144 $items[] = Xml::tags(
146 [
'class' => $profile === $id ?
'current' :
'normal' ],
149 $this->specialSearch->msg( $profileConfig[
'message'] )->text(),
150 $this->specialSearch->msg( $profileConfig[
'tooltip'], $tooltipParam )->text(),
151 $profileConfig[
'parameters']
156 return "<div class='search-types'>" .
157 "<ul>" . implode(
'', $items ) .
"</ul>" .
170 $parts = explode(
':',
$term );
171 return count( $parts ) > 1
194 'href' => $this->specialSearch->getPageTitle()->getLocalURL(
$params ),
213 if ( $isPowerSearch ) {
217 Hooks::run(
'SpecialSearchProfileForm', [
218 $this->specialSearch, &$form, $profile,
$term, []
236 $activeNamespaces = $this->specialSearch->getNamespaces();
237 foreach ( $this->searchConfig->searchableNamespaces()
as $namespace =>
$name ) {
238 $subject = MWNamespace::getSubject( $namespace );
239 if ( !isset(
$rows[$subject] ) ) {
240 $rows[$subject] =
"";
244 if (
$name ===
'' ) {
245 $name = $this->specialSearch->msg(
'blanknamespace' )->text();
253 "mw-search-ns{$namespace}",
254 in_array( $namespace, $activeNamespaces )
263 $tableRows[] =
"<tr>{$row}</tr>";
265 $namespaceTables = [];
266 foreach ( array_chunk( $tableRows, 4 )
as $chunk ) {
267 $namespaceTables[] = implode(
'', $chunk );
271 'namespaceTables' =>
"<table>" . implode(
'</table><table>', $namespaceTables ) .
'</table>',
273 Hooks::run(
'SpecialSearchPowerBox', [ &$showSections,
$term, $opts ] );
276 foreach ( $opts
as $key =>
$value ) {
277 $hidden .= Html::hidden( $key,
$value );
280 $divider =
"<div class='divider'></div>";
283 $user = $this->specialSearch->getUser();
285 if (
$user->isLoggedIn() ) {
286 $remember = $divider . Xml::checkLabel(
287 $this->specialSearch->msg(
'powersearch-remember' )->text(),
289 'mw-search-powersearch-remember',
293 [
'value' =>
$user->getEditToken(
295 $this->specialSearch->getRequest()
300 return "<fieldset id='mw-searchoptions'>" .
301 "<legend>" . $this->specialSearch->msg(
'powersearch-legend' )->escaped() .
'</legend>' .
302 "<h4>" . $this->specialSearch->msg(
'powersearch-ns' )->parse() .
'</h4>' .
304 "<div id='mw-search-togglebox'></div>" .
Apache License January AND DISTRIBUTION Definitions License shall mean the terms and conditions for use
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.
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
when a variable name is used in a it is silently declared as a new local masking the global
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
the array() calling protocol came about after MediaWiki 1.4rc1.
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
For QUnit the mediawiki tests qunit testrunner dependency will be added to any module whereas SearchGetNearMatch runs after $term
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
Allows to change the fields on the form that will be generated $name
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a local account $user
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
if(!isset( $args[0])) $lang