SpecialSearch Class Reference
[SpecialPage]

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

List of all members.

Public Member Functions

 __construct (&$request, &$user)
 Set up basic search parameters from the request and user settings.
 goResult ($term)
 If an exact title match can be found, jump straight ahead to it.
 showResults ($term)

Protected Member Functions

 showCreateLink ($t)
 setupPage ($term)
 powerSearch (&$request)
 Extract "power search" namespace settings from the request object, returning a list of index numbers to search.
 powerSearchOptions ()
 Reconstruct the 'power search' options for links.
 showMatches (&$matches)
 Show whole set of results.
 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.
 powerSearchBox ($term)
 Generates the power search box at bottom of [[Special:Search]].
 searchFocus ()
 getSearchProfiles ()
 formHeader ($term, $resultsShown, $totalNum)
 shortDialog ($term)
 makeSearchLink ($term, $namespaces, $label, $tooltip, $params=array())
 Make a search link with some target namespaces.
 startsWithImage ($term)
 Check if query starts with image: prefix.
 startsWithAll ($term)
 Check if query starts with all: prefix.


Detailed Description

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

Definition at line 53 of file SpecialSearch.php.


Constructor & Destructor Documentation

SpecialSearch::__construct ( &$  request,
&$  user 
)

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

Typically you'll pass $wgRequest and $wgUser.

Parameters:
WebRequest $request
User $user
Access:
public

Definition at line 63 of file SpecialSearch.php.

References powerSearch(), and SearchEngine::userNamespaces().


Member Function Documentation

SpecialSearch::formHeader ( term,
resultsShown,
totalNum 
) [protected]

SpecialSearch::getSearchProfiles (  )  [protected]

SpecialSearch::goResult ( term  ) 

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

Parameters:
string $term

Definition at line 83 of file SpecialSearch.php.

References $t, $wgGoToEdit, $wgOut, SearchEngine::getNearMatch(), Title::newFromText(), setupPage(), showResults(), and wfRunHooks().

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

Make a search link with some target namespaces.

Definition at line 962 of file SpecialSearch.php.

References $n, Xml::element(), SpecialPage::getTitleFor(), and wfMsg().

Referenced by formHeader().

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

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

Parameters:
WebRequest $request
Returns:
array

Definition at line 377 of file SpecialSearch.php.

References $name, and SearchEngine::searchableNamespaces().

Referenced by __construct().

SpecialSearch::powerSearchBox ( term  )  [protected]

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

Parameters:
$term string: search term
Returns:
$out string: HTML form

Definition at line 725 of file SpecialSearch.php.

References $i, $name, $rows, $wgContLang, $wgScript, Xml::check(), Xml::checkLabel(), Xml::closeElement(), Xml::element(), MWNamespace::getSubject(), SpecialPage::getTitleFor(), Xml::hidden(), Xml::label(), Xml::openElement(), SearchEngine::searchableNamespaces(), Xml::tags(), wfMsg(), and wfMsgExt().

Referenced by showResults().

SpecialSearch::powerSearchOptions (  )  [protected]

Reconstruct the 'power search' options for links.

Returns:
array

Definition at line 391 of file SpecialSearch.php.

References $n.

Referenced by showHit(), and showResults().

SpecialSearch::searchFocus (  )  [protected]

Definition at line 818 of file SpecialSearch.php.

References Html::inlineScript().

Referenced by showResults().

SpecialSearch::setupPage ( term  )  [protected]

Definition at line 342 of file SpecialSearch.php.

References $wgOut, getSearchProfiles(), SearchEngine::searchableNamespaces(), and wfMsg().

Referenced by goResult(), and showResults().

SpecialSearch::shortDialog ( term  )  [protected]

SpecialSearch::showCreateLink ( t  )  [protected]

Definition at line 319 of file SpecialSearch.php.

References $t, $wgOut, and wfEscapeWikiText().

Referenced by showResults().

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

Format a single hit result.

Parameters:
SearchResult $result
array $terms terms to highlight

Definition at line 437 of file SpecialSearch.php.

References $result, $section, $size, $t, $wgContLang, $wgLang, $wgUser, SpecialPage::getTitleFor(), powerSearchOptions(), wfFindFile(), wfMsg(), wfMsgExt(), wfMsgForContent(), wfProfileIn(), wfProfileOut(), and wfRunHooks().

Referenced by showMatches().

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

Show results from other wikis.

Parameters:
SearchResultSet $matches

Definition at line 605 of file SpecialSearch.php.

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

Referenced by showResults().

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

Show single interwiki link.

Parameters:
SearchResult $result
string $lastInterwiki
array $terms
string $query
array $customCaptions iw prefix -> caption

Definition at line 647 of file SpecialSearch.php.

References $out, $result, $t, $wgContLang, $wgLang, Title::newFromText(), wfMsg(), wfProfileIn(), and wfProfileOut().

Referenced by showInterwiki().

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

Show whole set of results.

Parameters:
SearchResultSet $matches

Definition at line 408 of file SpecialSearch.php.

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

Referenced by showResults().

SpecialSearch::showResults ( term  ) 

SpecialSearch::startsWithAll ( term  )  [protected]

Check if query starts with all: prefix.

Definition at line 1001 of file SpecialSearch.php.

References wfMsgForContent().

SpecialSearch::startsWithImage ( term  )  [protected]

Check if query starts with image: prefix.

Definition at line 990 of file SpecialSearch.php.

References $wgContLang.

Referenced by formHeader().


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

Generated on Sat Apr 30 22:57:50 2011 for MediaWiki by  doxygen 1.5.9