MediaWiki  master
MediaWiki\Search\SearchWidgets\SearchFormWidget Class Reference
Collaboration diagram for MediaWiki\Search\SearchWidgets\SearchFormWidget:

Public Member Functions

 __construct (SpecialSearch $specialSearch, SearchEngineConfig $searchConfig, HookContainer $hookContainer, ILanguageConverter $languageConverter, NamespaceInfo $namespaceInfo, array $profiles)
 
 render ( $profile, $term, $numResults, $totalResults, $offset, $isPowerSearch, array $options=[])
 

Protected Member Functions

 getHookContainer ()
 
 getHookRunner ()
 
 makeSearchLink ( $term, $label, $tooltip, array $params=[])
 Make a search link with some target namespaces. More...
 
 optionsHtml ( $term, $isPowerSearch, $profile)
 Generates HTML for advanced options available with the currently selected search profile. More...
 
 powerSearchBox ( $term, array $opts)
 
 profileTabsHtml ( $profile, $term)
 Generates HTML for the list of available search profiles. More...
 
 shortDialogHtml ( $profile, $term, $numResults, $totalResults, $offset, array $options=[])
 
 startsWithImage ( $term)
 Check if query starts with image: prefix. More...
 

Protected Attributes

array $profiles
 
SearchEngineConfig $searchConfig
 
SpecialSearch $specialSearch
 

Private Member Functions

 createCheckboxesForEverySearchableNamespace ()
 
 createHiddenOptsHtml (array $opts)
 
 createNamespaceCheckbox (int $namespace, array $activeNamespaces)
 
 createNamespaceToggleBoxHtml ()
 
 createPowerSearchRememberCheckBoxHtml ()
 
 createSearchBoxHeadHtml ()
 
 getNamespaceDisplayName (int $namespace)
 
 searchFilterSeparatorHtml ()
 

Private Attributes

HookContainer $hookContainer
 
HookRunner $hookRunner
 
ILanguageConverter $languageConverter
 
NamespaceInfo $namespaceInfo
 

Detailed Description

Definition at line 15 of file SearchFormWidget.php.

Constructor & Destructor Documentation

◆ __construct()

Member Function Documentation

◆ createCheckboxesForEverySearchableNamespace()

MediaWiki\Search\SearchWidgets\SearchFormWidget::createCheckboxesForEverySearchableNamespace ( )
private

◆ createHiddenOptsHtml()

MediaWiki\Search\SearchWidgets\SearchFormWidget::createHiddenOptsHtml ( array  $opts)
private

◆ createNamespaceCheckbox()

MediaWiki\Search\SearchWidgets\SearchFormWidget::createNamespaceCheckbox ( int  $namespace,
array  $activeNamespaces 
)
private

Definition at line 354 of file SearchFormWidget.php.

◆ createNamespaceToggleBoxHtml()

MediaWiki\Search\SearchWidgets\SearchFormWidget::createNamespaceToggleBoxHtml ( )
private

Definition at line 328 of file SearchFormWidget.php.

◆ createPowerSearchRememberCheckBoxHtml()

MediaWiki\Search\SearchWidgets\SearchFormWidget::createPowerSearchRememberCheckBoxHtml ( )
private

◆ createSearchBoxHeadHtml()

MediaWiki\Search\SearchWidgets\SearchFormWidget::createSearchBoxHeadHtml ( )
private

◆ getHookContainer()

MediaWiki\Search\SearchWidgets\SearchFormWidget::getHookContainer ( )
protected

◆ getHookRunner()

MediaWiki\Search\SearchWidgets\SearchFormWidget::getHookRunner ( )
protected
Returns
HookRunner
Since
1.35
Access: internal
This is for use by core only. Hook interfaces may be removed without notice.

Definition at line 302 of file SearchFormWidget.php.

References MediaWiki\Search\SearchWidgets\SearchFormWidget\$hookRunner.

Referenced by MediaWiki\Search\SearchWidgets\SearchFormWidget\optionsHtml(), and MediaWiki\Search\SearchWidgets\SearchFormWidget\powerSearchBox().

◆ getNamespaceDisplayName()

MediaWiki\Search\SearchWidgets\SearchFormWidget::getNamespaceDisplayName ( int  $namespace)
private

Definition at line 371 of file SearchFormWidget.php.

◆ makeSearchLink()

MediaWiki\Search\SearchWidgets\SearchFormWidget::makeSearchLink (   $term,
  $label,
  $tooltip,
array  $params = [] 
)
protected

Make a search link with some target namespaces.

Parameters
string$termThe term to search for
string$labelLink's text
string$tooltipLink's tooltip
array$paramsQuery string parameters
Returns
string HTML fragment

Definition at line 224 of file SearchFormWidget.php.

References Xml\element().

Referenced by MediaWiki\Search\SearchWidgets\SearchFormWidget\profileTabsHtml().

◆ optionsHtml()

MediaWiki\Search\SearchWidgets\SearchFormWidget::optionsHtml (   $term,
  $isPowerSearch,
  $profile 
)
protected

Generates HTML for advanced options available with the currently selected search profile.

Parameters
string$termUser provided search term
bool$isPowerSearchIs the advanced search profile enabled?
string$profileThe current search profile
Returns
string HTML

Definition at line 249 of file SearchFormWidget.php.

References MediaWiki\Search\SearchWidgets\SearchFormWidget\getHookRunner(), and MediaWiki\Search\SearchWidgets\SearchFormWidget\powerSearchBox().

Referenced by MediaWiki\Search\SearchWidgets\SearchFormWidget\render().

◆ powerSearchBox()

◆ profileTabsHtml()

MediaWiki\Search\SearchWidgets\SearchFormWidget::profileTabsHtml (   $profile,
  $term 
)
protected

Generates HTML for the list of available search profiles.

Parameters
string$profileThe currently selected profile
string$termThe user provided search terms
Returns
string HTML

Definition at line 173 of file SearchFormWidget.php.

References $lang, MediaWiki\Search\SearchWidgets\SearchFormWidget\makeSearchLink(), Html\rawElement(), MediaWiki\Search\SearchWidgets\SearchFormWidget\startsWithImage(), and Xml\tags().

Referenced by MediaWiki\Search\SearchWidgets\SearchFormWidget\render().

◆ render()

MediaWiki\Search\SearchWidgets\SearchFormWidget::render (   $profile,
  $term,
  $numResults,
  $totalResults,
  $offset,
  $isPowerSearch,
array  $options = [] 
)
Parameters
string$profileThe current search profile
string$termThe current search term
int$numResultsThe number of results shown
int$totalResultsThe total estimated results found
int$offsetCurrent offset in search results
bool$isPowerSearchIs the 'advanced' section open?
array$optionsWidget options
Returns
string HTML

Definition at line 66 of file SearchFormWidget.php.

References Xml\closeElement(), Xml\openElement(), MediaWiki\Search\SearchWidgets\SearchFormWidget\optionsHtml(), MediaWiki\Search\SearchWidgets\SearchFormWidget\profileTabsHtml(), Html\rawElement(), MediaWiki\Search\SearchWidgets\SearchFormWidget\shortDialogHtml(), and wfScript().

◆ searchFilterSeparatorHtml()

MediaWiki\Search\SearchWidgets\SearchFormWidget::searchFilterSeparatorHtml ( )
private

◆ shortDialogHtml()

MediaWiki\Search\SearchWidgets\SearchFormWidget::shortDialogHtml (   $profile,
  $term,
  $numResults,
  $totalResults,
  $offset,
array  $options = [] 
)
protected
Parameters
string$profileThe current search profile
string$termThe current search term
int$numResultsThe number of results shown
int$totalResultsThe total estimated results found
int$offsetCurrent offset in search results
array$optionsWidget options
Returns
string HTML

Definition at line 113 of file SearchFormWidget.php.

References Html\hidden(), and Xml\tags().

Referenced by MediaWiki\Search\SearchWidgets\SearchFormWidget\render().

◆ startsWithImage()

MediaWiki\Search\SearchWidgets\SearchFormWidget::startsWithImage (   $term)
protected

Check if query starts with image: prefix.

Parameters
string$termThe string to check
Returns
bool

Definition at line 209 of file SearchFormWidget.php.

References NS_FILE.

Referenced by MediaWiki\Search\SearchWidgets\SearchFormWidget\profileTabsHtml().

Member Data Documentation

◆ $hookContainer

HookContainer MediaWiki\Search\SearchWidgets\SearchFormWidget::$hookContainer
private

◆ $hookRunner

HookRunner MediaWiki\Search\SearchWidgets\SearchFormWidget::$hookRunner
private

◆ $languageConverter

ILanguageConverter MediaWiki\Search\SearchWidgets\SearchFormWidget::$languageConverter
private

◆ $namespaceInfo

NamespaceInfo MediaWiki\Search\SearchWidgets\SearchFormWidget::$namespaceInfo
private

◆ $profiles

array MediaWiki\Search\SearchWidgets\SearchFormWidget::$profiles
protected

◆ $searchConfig

SearchEngineConfig MediaWiki\Search\SearchWidgets\SearchFormWidget::$searchConfig
protected

◆ $specialSearch

SpecialSearch MediaWiki\Search\SearchWidgets\SearchFormWidget::$specialSearch
protected

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