MediaWiki  REL1_23
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 ()
 Current namespaces.
 getProfile ()
 Current search profile.
 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

string $fulltext
int $offset
const NAMESPACES_CURRENT = 'sense'

Protected Member Functions

 formHeader ($term, $resultsShown, $totalNum)
 getGroupName ()
 Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.
 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 ($title, $num, $titleMatches, $textMatches)
 showHit ($result, $terms)
 Format a single hit result.
 showInterwiki ($matches, $query)
 Show results from other wikis.
 showInterwikiHit ($result, $lastInterwiki, $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

string $didYouMeanHtml
Array $extraParams = array()
 For links *.
int $limit
String $mPrefix
 No idea, apparently used by some other classes *.
array $namespaces
null string $profile
 Current search profile.
SearchEngine $searchEngine
 Search engine *.
String $searchEngineType
 Search engine type, if not default *.

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 62 of file SpecialSearch.php.


Member Function Documentation

Entry point.

Parameters:
string$paror null

Reimplemented from SpecialPage.

Definition at line 71 of file SpecialSearch.php.

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

Definition at line 1004 of file SpecialSearch.php.

SpecialSearch::getGroupName ( ) [protected]

Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-group-*' for valid names This method defaults to group 'other'.

Returns:
string
Since:
1.21

Reimplemented from SpecialPage.

Definition at line 1207 of file SpecialSearch.php.

Current namespaces.

Returns:
array

Definition at line 1190 of file SpecialSearch.php.

Current search profile.

Returns:
null|string

Definition at line 1182 of file SpecialSearch.php.

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

Definition at line 852 of file SpecialSearch.php.

Since:
1.18
Returns:
SearchEngine

Definition at line 1169 of file SpecialSearch.php.

Returns:
array

Definition at line 948 of file SpecialSearch.php.

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

Parameters:
$termString

Definition at line 159 of file SpecialSearch.php.

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

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

Definition at line 107 of file SpecialSearch.php.

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

Make a search link with some target namespaces.

Parameters:
$termString
array$namespacesignored
string$labellink's text
string$tooltiplink's tooltip
array$paramsquery string parameters
Returns:
String: HTML fragment

Definition at line 1105 of file SpecialSearch.php.

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 484 of file SpecialSearch.php.

References $name, array(), as, and SearchEngine\searchableNamespaces().

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

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

Parameters:
string$termsearch term
$optsarray
Returns:
String: HTML form

Definition at line 874 of file SpecialSearch.php.

References $key, $name, $term, $value, $wgContLang, array(), as, Xml\checkLabel(), Xml\closeElement(), Xml\element(), Html\element(), MWNamespace\getSubject(), global, Html\hidden(), SpecialPage\msg(), namespaces, Xml\openElement(), SearchEngine\searchableNamespaces(), tags(), text, and wfRunHooks().

Reconstruct the 'power search' options for links.

Returns:
Array

Definition at line 500 of file SpecialSearch.php.

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 1203 of file SpecialSearch.php.

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

Definition at line 462 of file SpecialSearch.php.

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

Definition at line 1076 of file SpecialSearch.php.

SpecialSearch::showCreateLink ( title,
num,
titleMatches,
textMatches 
) [protected]
Parameters:
$titleTitle
int$numThe number of search results found
$titleMatchesnull|SearchResultSet results from title search
$textMatchesnull|SearchResultSet results from text search

Definition at line 425 of file SpecialSearch.php.

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

Format a single hit result.

Parameters:
$resultSearchResult
array$termsterms to highlight
Returns:
string

Definition at line 548 of file SpecialSearch.php.

Referenced by showMatches().

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

Show results from other wikis.

Parameters:
$matchesSearchResultSet|array
$queryString
Returns:
string

Definition at line 728 of file SpecialSearch.php.

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

Show single interwiki link.

Parameters:
$resultSearchResult
$lastInterwikiString
$queryString
array$customCaptionsiw prefix -> caption
Returns:
string

Definition at line 780 of file SpecialSearch.php.

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

Show whole set of results.

Parameters:
$matchesSearchResultSet
Returns:
string

Definition at line 520 of file SpecialSearch.php.

References $matches, $out, $profile, $result, $wgContLang, global, and showHit().

Parameters:
$termString

Definition at line 202 of file SpecialSearch.php.

SpecialSearch::startsWithAll ( term) [protected]

Check if query starts with all: prefix.

Parameters:
string$termthe string to check
Returns:
Boolean

Definition at line 1152 of file SpecialSearch.php.

SpecialSearch::startsWithImage ( term) [protected]

Check if query starts with image: prefix.

Parameters:
string$termthe string to check
Returns:
Boolean

Definition at line 1135 of file SpecialSearch.php.


Member Data Documentation

string SpecialSearch::$didYouMeanHtml [protected]

Definition at line 58 of file SpecialSearch.php.

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

For links *.

Definition at line 44 of file SpecialSearch.php.

string SpecialSearch::$fulltext

Definition at line 58 of file SpecialSearch.php.

int SpecialSearch::$limit [protected]

Definition at line 50 of file SpecialSearch.php.

String SpecialSearch::$mPrefix [protected]

No idea, apparently used by some other classes *.

Definition at line 46 of file SpecialSearch.php.

array SpecialSearch::$namespaces [protected]

Definition at line 54 of file SpecialSearch.php.

int SpecialSearch::$offset

Definition at line 50 of file SpecialSearch.php.

null string 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.

Definition at line 38 of file SpecialSearch.php.

Referenced by showMatches().

SearchEngine SpecialSearch::$searchEngine [protected]

Search engine *.

Definition at line 40 of file SpecialSearch.php.

String SpecialSearch::$searchEngineType [protected]

Search engine type, if not default *.

Definition at line 42 of file SpecialSearch.php.

Definition at line 60 of file SpecialSearch.php.


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