MediaWiki
1.23.2
|
implements Special:Search - Run text & title search and display the output More...
Public Member Functions | |
__construct () | |
execute ( $par) | |
Entry point. More... | |
getNamespaces () | |
Current namespaces. More... | |
getProfile () | |
Current search profile. More... | |
getSearchEngine () | |
goResult ( $term) | |
If an exact title match can be found, jump straight ahead to it. More... | |
load () | |
Set up basic search parameters from the request and user settings. More... | |
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. More... | |
showResults ( $term) | |
Public Member Functions inherited from SpecialPage | |
__construct ( $name='', $restriction='', $listed=true, $function=false, $file='default', $includable=false) | |
Default constructor for special pages Derivative classes should call this from their constructor Note that if the user does not have the required level, an error message will be displayed by the default execute() method, without the global function ever being called. More... | |
checkPermissions () | |
Checks if userCanExecute, and if not throws a PermissionsError. More... | |
checkReadOnly () | |
If the wiki is currently in readonly mode, throws a ReadOnlyError. More... | |
displayRestrictionError () | |
Output an error message telling the user what access level they have to have. More... | |
getContext () | |
Gets the context this SpecialPage is executed in. More... | |
getDescription () | |
Returns the name that goes in the <h1> in the special page itself, and also the name that will be listed in Special:Specialpages. More... | |
getFile () | |
Get the file which will be included by SpecialPage::execute() if your extension is still stuck in the past and hasn't overridden the execute() method. More... | |
getFinalGroupName () | |
Get the group that the special page belongs in on Special:SpecialPage Use this method, instead of getGroupName to allow customization of the group name from the wiki side. More... | |
getFullTitle () | |
Return the full title, including $par. More... | |
getLang () | |
Shortcut to get user's language. More... | |
getLanguage () | |
Shortcut to get user's language. More... | |
getLocalName () | |
Get the localised name of the special page. More... | |
getName () | |
Get the name of this Special Page. More... | |
getOutput () | |
Get the OutputPage being used for this instance. More... | |
getPageTitle ( $subpage=false) | |
Get a self-referential title object. More... | |
getRequest () | |
Get the WebRequest being used for this instance. More... | |
getRestriction () | |
Get the permission that a user must have to execute this page. More... | |
getSkin () | |
Shortcut to get the skin being used for this instance. More... | |
getTitle ( $subpage=false) | |
Get a self-referential title object. More... | |
getUser () | |
Shortcut to get the User executing this instance. More... | |
including ( $x=null) | |
Whether the special page is being evaluated via transclusion. More... | |
isCached () | |
Is this page cached? Expensive pages are cached or disabled in miser mode. More... | |
isExpensive () | |
Is this page expensive (for some definition of expensive)? Expensive pages are disabled or cached in miser mode. More... | |
isIncludable () | |
Whether it's allowed to transclude the special page via {{Special:Foo/params}}. More... | |
isListed () | |
Whether this special page is listed in Special:SpecialPages. More... | |
isRestricted () | |
Can be overridden by subclasses with more complicated permissions schemes. More... | |
listed ( $x=null) | |
Get or set whether this special page is listed in Special:SpecialPages. More... | |
msg () | |
Wrapper around wfMessage that sets the current context. More... | |
outputHeader ( $summaryMessageKey='') | |
Outputs a summary message on top of special pages Per default the message key is the canonical name of the special page May be overridden, i.e. More... | |
requireLogin ( $reasonMsg=null, $titleMsg=null) | |
If the user is not logged in, throws UserNotLoggedIn error. More... | |
run ( $subPage) | |
Entry point. More... | |
setContext ( $context) | |
Sets the context this SpecialPage is executed in. More... | |
setHeaders () | |
Sets headers - this should be called from the execute() method of all derived classes! More... | |
setListed ( $listed) | |
Set whether this page is listed in Special:Specialpages, at run-time. More... | |
userCanExecute (User $user) | |
Checks if the given user (identified by an object) can execute this special page (as defined by $mRestriction). More... | |
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'. More... | |
getProfileForm ( $profile, $term) | |
getSearchProfiles () | |
makeSearchLink ( $term, $namespaces, $label, $tooltip, $params=array()) | |
Make a search link with some target namespaces. More... | |
powerSearch (&$request) | |
Extract "power search" namespace settings from the request object, returning a list of index numbers to search. More... | |
powerSearchBox ( $term, $opts) | |
Generates the power search box at [[Special:Search]]. More... | |
powerSearchOptions () | |
Reconstruct the 'power search' options for links. More... | |
setupPage ( $term) | |
shortDialog ( $term) | |
showCreateLink ( $title, $num, $titleMatches, $textMatches) | |
showHit ( $result, $terms) | |
Format a single hit result. More... | |
showInterwiki ( $matches, $query) | |
Show results from other wikis. More... | |
showInterwikiHit ( $result, $lastInterwiki, $query, $customCaptions) | |
Show single interwiki link. More... | |
showMatches (&$matches) | |
Show whole set of results. More... | |
startsWithAll ( $term) | |
Check if query starts with all: prefix. More... | |
startsWithImage ( $term) | |
Check if query starts with image: prefix. More... | |
Protected Member Functions inherited from SpecialPage | |
addFeedLinks ( $params) | |
Adds RSS/atom links. More... | |
afterExecute ( $subPage) | |
Gets called after. More... | |
beforeExecute ( $subPage) | |
Gets called before. More... | |
getRobotPolicy () | |
Return the robot policy. More... | |
Protected Attributes | |
string | $didYouMeanHtml |
Array | $extraParams = array() |
For links *. More... | |
int | $limit |
String | $mPrefix |
No idea, apparently used by some other classes *. More... | |
array | $namespaces |
null string | $profile |
Current search profile. More... | |
SearchEngine | $searchEngine |
Search engine *. More... | |
String | $searchEngineType |
Search engine type, if not default *. More... | |
Protected Attributes inherited from SpecialPage | |
IContextSource | $mContext |
Current request context. More... | |
$mIncludable | |
$mIncluding | |
$mName | |
Additional Inherited Members | |
Static Public Member Functions inherited from SpecialPage | |
static | getSafeTitleFor ( $name, $subpage=false) |
Get a localised Title object for a page name with a possibly unvalidated subpage. More... | |
static | getTitleFor ( $name, $subpage=false, $fragment='') |
Get a localised Title object for a specified special page name. More... | |
implements Special:Search - Run text & title search and display the output
Definition at line 30 of file SpecialSearch.php.
SpecialSearch::__construct | ( | ) |
Definition at line 62 of file SpecialSearch.php.
SpecialSearch::execute | ( | $par | ) |
Entry point.
string | $par | or null |
Reimplemented from SpecialPage.
Definition at line 71 of file SpecialSearch.php.
References $out, array(), SpecialPage\getOutput(), SpecialPage\getRequest(), goResult(), load(), SpecialPage\outputHeader(), SpecialPage\setHeaders(), and showResults().
|
protected |
$term | |
$resultsShown | |
$totalNum |
Definition at line 1004 of file SpecialSearch.php.
References $out, $profile, $term, array(), as, Xml\closeElement(), Xml\element(), SpecialPage\getLanguage(), getSearchProfiles(), makeSearchLink(), SpecialPage\msg(), Xml\openElement(), startsWithImage(), Xml\tags(), text, and wfEscapeWikiText().
Referenced by showResults().
|
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'.
Reimplemented from SpecialPage.
Definition at line 1207 of file SpecialSearch.php.
SpecialSearch::getNamespaces | ( | ) |
Current namespaces.
Definition at line 1190 of file SpecialSearch.php.
References $namespaces.
SpecialSearch::getProfile | ( | ) |
Current search profile.
Definition at line 1182 of file SpecialSearch.php.
References $profile.
|
protected |
$profile | |
$term |
Definition at line 852 of file SpecialSearch.php.
References $form, $profile, $term, array(), powerSearchBox(), and wfRunHooks().
Referenced by showResults().
SpecialSearch::getSearchEngine | ( | ) |
Definition at line 1169 of file SpecialSearch.php.
References $searchEngine, and SearchEngine\create().
Referenced by showResults().
|
protected |
Definition at line 948 of file SpecialSearch.php.
References array(), as, SearchEngine\defaultNamespaces(), SearchEngine\helpNamespaces(), SearchEngine\namespacesAsText(), NS_FILE, SearchEngine\searchableNamespaces(), and wfRunHooks().
Referenced by formHeader(), and load().
SpecialSearch::goResult | ( | $term | ) |
If an exact title match can be found, jump straight ahead to it.
$term | String |
Definition at line 159 of file SpecialSearch.php.
References $term, $title, array(), SearchEngine\getNearMatch(), SpecialPage\getOutput(), global, Title\newFromText(), setupPage(), showResults(), wfDebugLog(), and wfRunHooks().
Referenced by execute().
SpecialSearch::load | ( | ) |
Set up basic search parameters from the request and user settings.
Definition at line 107 of file SpecialSearch.php.
References $profile, $user, as, SpecialPage\getRequest(), getSearchProfiles(), SpecialPage\getUser(), list, namespaces, of, powerSearch(), and SearchEngine\userNamespaces().
Referenced by execute().
|
protected |
Make a search link with some target namespaces.
$term | String | |
array | $namespaces | ignored |
string | $label | link's text |
string | $tooltip | link's tooltip |
array | $params | query string parameters |
Definition at line 1105 of file SpecialSearch.php.
References $n, $namespaces, $params, $term, array(), as, Xml\element(), SpecialPage\getPageTitle(), SpecialPage\msg(), and text.
Referenced by formHeader().
|
protected |
Extract "power search" namespace settings from the request object, returning a list of index numbers to search.
$request | WebRequest |
Definition at line 484 of file SpecialSearch.php.
References $name, array(), as, and SearchEngine\searchableNamespaces().
Referenced by load().
|
protected |
Generates the power search box at [[Special:Search]].
string | $term | search term |
$opts | array |
Definition at line 874 of file SpecialSearch.php.
References $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(), Xml\tags(), text, and wfRunHooks().
Referenced by getProfileForm().
|
protected |
Reconstruct the 'power search' options for links.
Definition at line 500 of file SpecialSearch.php.
References $extraParams, $n, $profile, array(), as, and namespaces.
Referenced by showHit(), and showResults().
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.
$key | |
$value |
Definition at line 1203 of file SpecialSearch.php.
References $value.
|
protected |
$term | string |
Definition at line 462 of file SpecialSearch.php.
References $out, $term, SpecialPage\getOutput(), SpecialPage\msg(), and text.
Referenced by goResult(), and showResults().
|
protected |
$term | string |
Definition at line 1076 of file SpecialSearch.php.
References $didYouMeanHtml, $out, $term, array(), SpecialPage\getPageTitle(), Html\hidden(), Html\input(), SpecialPage\msg(), Xml\submitButton(), and text.
Referenced by showResults().
|
protected |
$title | Title | |
int | $num | The number of search results found |
$titleMatches | null|SearchResultSet results from title search | |
$textMatches | null|SearchResultSet results from text search |
Definition at line 425 of file SpecialSearch.php.
References $params, $title, array(), SpecialPage\getOutput(), wfEscapeWikiText(), and wfRunHooks().
Referenced by showResults().
|
protected |
Format a single hit result.
$result | SearchResult | |
array | $terms | terms to highlight |
Definition at line 548 of file SpecialSearch.php.
References $html, $link, $profile, $section, $size, $timestamp, $title, array(), SpecialPage\getLanguage(), SpecialPage\getTitleFor(), SpecialPage\getUser(), Linker\linkKnown(), SpecialPage\msg(), Category\newFromTitle(), NS_CATEGORY, NS_FILE, powerSearchOptions(), text, wfFindFile(), and wfRunHooks().
Referenced by showMatches().
|
protected |
Show results from other wikis.
$matches | SearchResultSet|array |
$query | String |
Definition at line 728 of file SpecialSearch.php.
References $line, $matches, $out, $profile, $query, $wgContLang, array(), as, global, SpecialPage\msg(), showInterwikiHit(), and text.
Referenced by showResults().
|
protected |
Show single interwiki link.
$result | SearchResult | |
$lastInterwiki | String | |
$query | String | |
array | $customCaptions | iw prefix -> caption |
Definition at line 780 of file SpecialSearch.php.
References $link, $out, $profile, $query, $title, array(), Linker\linkKnown(), SpecialPage\msg(), Title\newFromText(), text, and wfParseUrl().
Referenced by showInterwiki().
|
protected |
Show whole set of results.
$matches | SearchResultSet |
Definition at line 520 of file SpecialSearch.php.
References $matches, $out, $profile, $wgContLang, global, and showHit().
Referenced by showResults().
SpecialSearch::showResults | ( | $term | ) |
$term | String |
Definition at line 202 of file SpecialSearch.php.
References $fulltext, $mPrefix, $out, $profile, $term, $title, $wgContLang, array(), Xml\closeElement(), Xml\element(), formHeader(), SpecialPage\getLanguage(), SpecialPage\getOutput(), SpecialPage\getPageTitle(), getProfileForm(), getSearchEngine(), SpecialPage\getTitleFor(), global, ID, is(), Linker\linkKnown(), SpecialPage\msg(), name, namespaces, Title\newFromText(), NS_FILE, Xml\openElement(), powerSearchOptions(), setupPage(), shortDialog(), showCreateLink(), showInterwiki(), showMatches(), text, wfEscapeWikiText(), and wfRunHooks().
Referenced by execute(), and goResult().
|
protected |
Check if query starts with all: prefix.
string | $term | the string to check |
Definition at line 1152 of file SpecialSearch.php.
References $term, and SpecialPage\msg().
|
protected |
Check if query starts with image: prefix.
string | $term | the string to check |
Definition at line 1135 of file SpecialSearch.php.
References $term, $wgContLang, global, and NS_FILE.
Referenced by formHeader().
|
protected |
Definition at line 58 of file SpecialSearch.php.
Referenced by shortDialog().
|
protected |
string SpecialSearch::$fulltext |
Definition at line 58 of file SpecialSearch.php.
Referenced by showResults().
|
protected |
Definition at line 50 of file SpecialSearch.php.
|
protected |
No idea, apparently used by some other classes *.
Definition at line 46 of file SpecialSearch.php.
Referenced by showResults().
|
protected |
Definition at line 54 of file SpecialSearch.php.
Referenced by getNamespaces(), and makeSearchLink().
int SpecialSearch::$offset |
Definition at line 50 of file SpecialSearch.php.
|
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 formHeader(), getProfile(), getProfileForm(), load(), powerSearchOptions(), showHit(), showInterwiki(), showInterwikiHit(), showMatches(), and showResults().
|
protected |
|
protected |
Search engine type, if not default *.
Definition at line 42 of file SpecialSearch.php.
const SpecialSearch::NAMESPACES_CURRENT = 'sense' |
Definition at line 60 of file SpecialSearch.php.