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

 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 ()
 powerSearchFocus ()
 formHeader ($term)
 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.
 namespaceTables ($namespaces, $rowsPerTable=3)


Detailed Description

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

Definition at line 54 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 64 of file SpecialSearch.php.

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


Member Function Documentation

SpecialSearch::formHeader ( term  )  [protected]

SpecialSearch::goResult ( term  ) 

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

Parameters:
string $term

Definition at line 84 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 777 of file SpecialSearch.php.

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

Referenced by formHeader().

SpecialSearch::namespaceTables ( namespaces,
rowsPerTable = 3 
) [protected]

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

References $name, $ns, 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 609 of file SpecialSearch.php.

References $out, $t, $wgScript, Xml::check(), Xml::closeElement(), Xml::element(), formHeader(), SpecialPage::getTitleFor(), Xml::hidden(), Xml::inputLabel(), Xml::label(), namespaceTables(), Title::newFromText(), Xml::openElement(), SearchEngine::searchableNamespaces(), Xml::submitButton(), wfMsg(), and wfMsgExt().

Referenced by showResults().

SpecialSearch::powerSearchFocus (  )  [protected]

Definition at line 664 of file SpecialSearch.php.

References $wgJsMimeType.

Referenced by showResults().

SpecialSearch::powerSearchOptions (  )  [protected]

Reconstruct the 'power search' options for links.

Returns:
array

Definition at line 348 of file SpecialSearch.php.

References $n.

Referenced by showHit(), and showResults().

SpecialSearch::searchFocus (  )  [protected]

Definition at line 655 of file SpecialSearch.php.

References $wgJsMimeType.

Referenced by showResults().

SpecialSearch::setupPage ( term  )  [protected]

SpecialSearch::shortDialog ( term  )  [protected]

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

Format a single hit result.

Parameters:
SearchResult $result
array $terms terms to highlight

Definition at line 394 of file SpecialSearch.php.

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

Referenced by showMatches().

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

Show results from other wikis.

Parameters:
SearchResultSet $matches

Definition at line 514 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 556 of file SpecialSearch.php.

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

Referenced by showInterwiki().

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

Show whole set of results.

Parameters:
SearchResultSet $matches

Definition at line 365 of file SpecialSearch.php.

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

Referenced by showResults().

SpecialSearch::showResults ( term  ) 

SpecialSearch::startsWithImage ( term  )  [protected]

Check if query starts with image: prefix.

Definition at line 793 of file SpecialSearch.php.

References $wgContLang.

Referenced by formHeader(), and setupPage().


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

Generated on Sat Sep 5 02:08:47 2009 for MediaWiki by  doxygen 1.5.9