MediaWiki  REL1_19
SpecialSearch Class Reference

implements Special:Search - Run text & title search and display the output More...

Inheritance diagram for SpecialSearch:
Collaboration diagram for SpecialSearch:

List of all members.

Public Member Functions

 __construct ()
 execute ($par)
 Entry point.
 getNamespaces ()
 getProfile ()
 getSearchEngine ()
 goResult ($term)
 If an exact title match can be found, jump straight ahead to it.
 load ()
 Set up basic search parameters from the request and user settings.
 setExtraParam ($key, $value)
 Users of hook SpecialSearchSetupEngine can use this to add more params to links to not lose selection when user navigates search results.
 showResults ($term)

Public Attributes

 $fulltext
 $offset
const NAMESPACES_CURRENT = 'sense'

Protected Member Functions

 formHeader ($term, $resultsShown, $totalNum)
 getProfileForm ($profile, $term)
 getSearchProfiles ()
 makeSearchLink ($term, $namespaces, $label, $tooltip, $params=array())
 Make a search link with some target namespaces.
 powerSearch (&$request)
 Extract "power search" namespace settings from the request object, returning a list of index numbers to search.
 powerSearchBox ($term, $opts)
 Generates the power search box at [[Special:Search]].
 powerSearchOptions ()
 Reconstruct the 'power search' options for links.
 setupPage ($term)
 shortDialog ($term)
 showCreateLink ($t)
 showHit ($result, $terms)
 Format a single hit result.
 showInterwiki (&$matches, $query)
 Show results from other wikis.
 showInterwikiHit ($result, $lastInterwiki, $terms, $query, $customCaptions)
 Show single interwiki link.
 showMatches (&$matches)
 Show whole set of results.
 startsWithAll ($term)
 Check if query starts with all: prefix.
 startsWithImage ($term)
 Check if query starts with image: prefix.

Protected Attributes

 $didYouMeanHtml
 $extraParams = array()
 For links.
 $limit
 $mPrefix
 No idea, apparently used by some other classes.
 $namespaces
 $profile
 Current search profile.
 $searchEngine
 Search engine.
 $searchRedirects

Detailed Description

implements Special:Search - Run text & title search and display the output

Definition at line 30 of file SpecialSearch.php.


Constructor & Destructor Documentation

Definition at line 74 of file SpecialSearch.php.


Member Function Documentation

Entry point.

Parameters:
$parString or null

Reimplemented from SpecialPage.

Definition at line 83 of file SpecialSearch.php.

References $out, SpecialPage\getOutput(), SpecialPage\getRequest(), goResult(), load(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), and showResults().

Here is the call graph for this function:

SpecialSearch::formHeader ( term,
resultsShown,
totalNum 
) [protected]
Parameters:
$term
$resultsShown
$totalNum
Returns:
string

Definition at line 1006 of file SpecialSearch.php.

References $out, $profile, Xml\closeElement(), Xml\element(), SpecialPage\getLanguage(), getSearchProfiles(), makeSearchLink(), Xml\openElement(), startsWithImage(), Xml\tags(), wfEscapeWikiText(), wfMsg(), and wfMsgExt().

Referenced by showResults().

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 60 of file SpecialSearch.php.

Definition at line 40 of file SpecialSearch.php.

SpecialSearch::getProfileForm ( profile,
term 
) [protected]
Parameters:
$profile
$term
Returns:
String

Definition at line 836 of file SpecialSearch.php.

References $profile, powerSearchBox(), and wfRunHooks().

Referenced by showResults().

Here is the call graph for this function:

Here is the caller graph for this function:

Since:
1.18
Returns:
SearchEngine

Definition at line 1169 of file SpecialSearch.php.

References SearchEngine\create().

Referenced by powerSearchBox(), and showResults().

Here is the call graph for this function:

Here is the caller graph for this function:

Returns:
array

Definition at line 952 of file SpecialSearch.php.

References SearchEngine\defaultNamespaces(), SearchEngine\helpNamespaces(), SearchEngine\namespacesAsText(), SearchEngine\searchableNamespaces(), and wfRunHooks().

Referenced by formHeader(), and load().

Here is the call graph for this function:

Here is the caller graph for this function:

If an exact title match can be found, jump straight ahead to it.

Parameters:
$termString

Definition at line 171 of file SpecialSearch.php.

References $t, $wgGoToEdit, false, SearchEngine\getNearMatch(), SpecialPage\getOutput(), Title\newFromText(), setupPage(), showResults(), wfDebugLog(), and wfRunHooks().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Set up basic search parameters from the request and user settings.

See also:
tests/phpunit/includes/specials/SpecialSearchTest.php

Definition at line 116 of file SpecialSearch.php.

References $profile, $user, SpecialPage\getRequest(), getSearchProfiles(), SpecialPage\getUser(), powerSearch(), and SearchEngine\userNamespaces().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::makeSearchLink ( term,
namespaces,
label,
tooltip,
params = array() 
) [protected]

Make a search link with some target namespaces.

Parameters:
$termString
$namespacesArray ignored
$labelString: link's text
$tooltipString: link's tooltip
$paramsArray: query string parameters
Returns:
String: HTML fragment

Definition at line 1107 of file SpecialSearch.php.

References $n, $namespaces, Xml\element(), SpecialPage\getTitle(), and wfMsg().

Referenced by formHeader().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::powerSearch ( &$  request) [protected]

Extract "power search" namespace settings from the request object, returning a list of index numbers to search.

Parameters:
$requestWebRequest
Returns:
Array

Definition at line 464 of file SpecialSearch.php.

References SearchEngine\searchableNamespaces().

Referenced by load().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::powerSearchBox ( term,
opts 
) [protected]

Generates the power search box at [[Special:Search]].

Parameters:
$termString: search term
$optsarray
Returns:
String: HTML form

Definition at line 858 of file SpecialSearch.php.

References $rows, Xml\checkLabel(), Xml\closeElement(), Xml\element(), getSearchEngine(), MWNamespace\getSubject(), Html\hidden(), Xml\label(), Xml\openElement(), SearchEngine\searchableNamespaces(), Xml\tags(), wfMsg(), wfMsgExt(), and wfRunHooks().

Referenced by getProfileForm().

Here is the call graph for this function:

Here is the caller graph for this function:

Reconstruct the 'power search' options for links.

Returns:
Array

Definition at line 480 of file SpecialSearch.php.

References $n.

Referenced by showHit(), and showResults().

Here is the caller graph for this function:

SpecialSearch::setExtraParam ( key,
value 
)

Users of hook SpecialSearchSetupEngine can use this to add more params to links to not lose selection when user navigates search results.

Since:
1.18
Parameters:
$key
$value

Definition at line 1185 of file SpecialSearch.php.

SpecialSearch::setupPage ( term) [protected]
Parameters:
$termstring

Definition at line 445 of file SpecialSearch.php.

References $out, SpecialPage\getOutput(), and SpecialPage\msg().

Referenced by goResult(), and showResults().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::shortDialog ( term) [protected]
Parameters:
$termstring
Returns:
string

Definition at line 1083 of file SpecialSearch.php.

References $out, SpecialPage\getTitle(), Html\hidden(), Html\input(), Xml\submitButton(), and wfMsg().

Referenced by showResults().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::showCreateLink ( t) [protected]
Parameters:
$tTitle

Definition at line 412 of file SpecialSearch.php.

References $t, SpecialPage\getOutput(), wfEscapeWikiText(), and wfRunHooks().

Referenced by showResults().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::showHit ( result,
terms 
) [protected]

Format a single hit result.

Parameters:
$resultSearchResult
$termsArray: terms to highlight
Returns:
string

Definition at line 533 of file SpecialSearch.php.

References $result, $section, $size, $t, SpecialPage\getLanguage(), SpecialPage\getTitleFor(), Linker\linkKnown(), Category\newFromTitle(), powerSearchOptions(), wfFindFile(), wfMsg(), wfMsgExt(), wfMsgForContent(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by showMatches().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::showInterwiki ( &$  matches,
query 
) [protected]

Show results from other wikis.

Parameters:
$matchesSearchResultSet
$queryString
Returns:
string

Definition at line 715 of file SpecialSearch.php.

References $matches, $out, $result, $wgContLang, showInterwikiHit(), wfMsg(), wfProfileIn(), and wfProfileOut().

Referenced by showResults().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::showInterwikiHit ( result,
lastInterwiki,
terms,
query,
customCaptions 
) [protected]

Show single interwiki link.

Parameters:
$resultSearchResult
$lastInterwikiString
$termsArray
$queryString
$customCaptionsArray: iw prefix -> caption
Returns:
string

Definition at line 760 of file SpecialSearch.php.

References $out, $result, $t, Linker\linkKnown(), Title\newFromText(), wfMsg(), wfParseUrl(), wfProfileIn(), and wfProfileOut().

Referenced by showInterwiki().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::showMatches ( &$  matches) [protected]

Show whole set of results.

Parameters:
$matchesSearchResultSet
Returns:
string

Definition at line 500 of file SpecialSearch.php.

References $matches, $out, $result, $wgContLang, showHit(), wfProfileIn(), and wfProfileOut().

Referenced by showResults().

Here is the call graph for this function:

Here is the caller graph for this function:

SpecialSearch::startsWithAll ( term) [protected]

Check if query starts with all: prefix.

Parameters:
$termString: the string to check
Returns:
Boolean

Definition at line 1153 of file SpecialSearch.php.

References wfMsgForContent().

Here is the call graph for this function:

SpecialSearch::startsWithImage ( term) [protected]

Check if query starts with image: prefix.

Parameters:
$termString: the string to check
Returns:
Boolean

Definition at line 1137 of file SpecialSearch.php.

References $wgContLang.

Referenced by formHeader().

Here is the caller graph for this function:


Member Data Documentation

SpecialSearch::$didYouMeanHtml [protected]

Definition at line 70 of file SpecialSearch.php.

SpecialSearch::$extraParams = array() [protected]

For links.

Definition at line 46 of file SpecialSearch.php.

SpecialSearch::$fulltext

Definition at line 70 of file SpecialSearch.php.

SpecialSearch::$limit [protected]

Definition at line 54 of file SpecialSearch.php.

SpecialSearch::$mPrefix [protected]

No idea, apparently used by some other classes.

Definition at line 49 of file SpecialSearch.php.

SpecialSearch::$namespaces [protected]

Definition at line 59 of file SpecialSearch.php.

Referenced by makeSearchLink().

SpecialSearch::$offset

Definition at line 54 of file SpecialSearch.php.

SpecialSearch::$profile [protected]

Current search profile.

Search profile is just a name that identifies the active search tab on the search page (content, help, discussions...) For users tt replaces the set of enabled namespaces from the query string when applicable. Extensions can add new profiles with hooks with custom search options just for that profile. null|string

Definition at line 39 of file SpecialSearch.php.

Referenced by formHeader(), getProfileForm(), and load().

SpecialSearch::$searchEngine [protected]

Search engine.

Definition at line 43 of file SpecialSearch.php.

SpecialSearch::$searchRedirects [protected]

Definition at line 65 of file SpecialSearch.php.

Definition at line 72 of file SpecialSearch.php.


The documentation for this class was generated from the following file: