VuFind API Documentation

SearchBox extends AbstractHelper
in package

Search box view helper

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Table of Contents

$alphabrowseConfig  : array<string|int, mixed>
Alphabrowse settings for search box.
$cachedConfigs  : array<string|int, mixed>
Cache for configurations
$config  : array<string|int, mixed>
Configuration for search box.
$optionsManager  : PluginManager
Search options plugin manager
$placeholders  : array<string|int, mixed>
Placeholders from config.ini
__construct()  : mixed
Constructor
alphaBrowseOptionsEnabled()  : bool
Are alphabrowse options configured to display in the search options drop-down?
autocompleteAutoSubmit()  : bool
Is autocomplete enabled for the current context?
autocompleteEnabled()  : bool
Is autocomplete enabled for the current context?
autocompleteFormattingRulesJson()  : string
Get JSON-encoded configuration for autocomplete query formatting.
combinedHandlersActive()  : bool
Are combined handlers enabled?
getFilterCount()  : int
Get number of active filters
getFilterDetails()  : array<string|int, mixed>
Get an array of filter information for use by the "retain filters" feature of the search box. Returns an array of arrays with 'id' and 'value' keys used for generating hidden checkboxes.
getHandlers()  : array<string|int, mixed>
Get an array of information on search handlers for use in generating a drop-down or hidden field. Returns an array of arrays with 'value', 'label', 'indent' and 'selected' keys.
getKeyboardLayouts()  : array<string|int, mixed>
Get an array of the configured virtual keyboard layouts
getPlaceholderText()  : string
Get placeholder text from config using the activeSearchClass as key
getAlphabrowseHandlers()  : array<string|int, mixed>
Support method for getCombinedHandlers(): get alphabrowse options.
getBasicHandlers()  : array<string|int, mixed>
Support method for getHandlers() -- load basic settings.
getCombinedHandlerConfig()  : array<string|int, mixed>
Support method for getCombinedHandlers() -- retrieve/validate configuration.
getCombinedHandlers()  : array<string|int, mixed>
Support method for getHandlers() -- load combined settings.
getOperatorCharacter()  : string
Helper method: get special character to represent operator in filter

Properties

$alphabrowseConfig

Alphabrowse settings for search box.

protected array<string|int, mixed> $alphabrowseConfig

$cachedConfigs

Cache for configurations

protected array<string|int, mixed> $cachedConfigs = []

$config

Configuration for search box.

protected array<string|int, mixed> $config

$placeholders

Placeholders from config.ini

protected array<string|int, mixed> $placeholders

Methods

__construct()

Constructor

public __construct(PluginManager $optionsManager[, array<string|int, mixed> $config = [] ][, array<string|int, mixed> $placeholders = [] ][, array<string|int, mixed> $alphabrowseConfig = [] ]) : mixed
Parameters
$optionsManager : PluginManager

Search options plugin manager

$config : array<string|int, mixed> = []

Configuration for search box

$placeholders : array<string|int, mixed> = []

Array of placeholders keyed by backend

$alphabrowseConfig : array<string|int, mixed> = []

source => label config for alphabrowse options to display in combined box (empty for none)

Return values
mixed

alphaBrowseOptionsEnabled()

Are alphabrowse options configured to display in the search options drop-down?

public alphaBrowseOptionsEnabled() : bool
Return values
bool

autocompleteAutoSubmit()

Is autocomplete enabled for the current context?

public autocompleteAutoSubmit(string $activeSearchClass) : bool
Parameters
$activeSearchClass : string

Active search class ID

Return values
bool

autocompleteEnabled()

Is autocomplete enabled for the current context?

public autocompleteEnabled(string $activeSearchClass) : bool
Parameters
$activeSearchClass : string

Active search class ID

Return values
bool

autocompleteFormattingRulesJson()

Get JSON-encoded configuration for autocomplete query formatting.

public autocompleteFormattingRulesJson(string $activeSearchClass) : string
Parameters
$activeSearchClass : string

Active search class ID

Return values
string

combinedHandlersActive()

Are combined handlers enabled?

public combinedHandlersActive() : bool
Return values
bool

getFilterCount()

Get number of active filters

public getFilterCount(array<string|int, mixed> $checkboxFilters, array<string|int, mixed> $filterList) : int
Parameters
$checkboxFilters : array<string|int, mixed>

Checkbox filters

$filterList : array<string|int, mixed>

Other filters

Return values
int

getFilterDetails()

Get an array of filter information for use by the "retain filters" feature of the search box. Returns an array of arrays with 'id' and 'value' keys used for generating hidden checkboxes.

public getFilterDetails(array<string|int, mixed> $filterList, array<string|int, mixed> $checkboxFilters) : array<string|int, mixed>
Parameters
$filterList : array<string|int, mixed>

Standard filter information

$checkboxFilters : array<string|int, mixed>

Checkbox filter information

Return values
array<string|int, mixed>

getHandlers()

Get an array of information on search handlers for use in generating a drop-down or hidden field. Returns an array of arrays with 'value', 'label', 'indent' and 'selected' keys.

public getHandlers(string $activeSearchClass, string $activeHandler) : array<string|int, mixed>
Parameters
$activeSearchClass : string

Active search class ID

$activeHandler : string

Active search handler

Return values
array<string|int, mixed>

getKeyboardLayouts()

Get an array of the configured virtual keyboard layouts

public getKeyboardLayouts() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPlaceholderText()

Get placeholder text from config using the activeSearchClass as key

public getPlaceholderText(string $activeSearchClass) : string
Parameters
$activeSearchClass : string

Active search class ID

Return values
string

getAlphabrowseHandlers()

Support method for getCombinedHandlers(): get alphabrowse options.

protected getAlphabrowseHandlers(string $activeHandler[, bool $indent = true ]) : array<string|int, mixed>
Parameters
$activeHandler : string

Current active search handler

$indent : bool = true

Should we indent these options?

Return values
array<string|int, mixed>

getBasicHandlers()

Support method for getHandlers() -- load basic settings.

protected getBasicHandlers(string $activeSearchClass, string $activeHandler) : array<string|int, mixed>
Parameters
$activeSearchClass : string

Active search class ID

$activeHandler : string

Active search handler

Return values
array<string|int, mixed>

getCombinedHandlerConfig()

Support method for getCombinedHandlers() -- retrieve/validate configuration.

protected getCombinedHandlerConfig(string $activeSearchClass) : array<string|int, mixed>
Parameters
$activeSearchClass : string

Active search class ID

Return values
array<string|int, mixed>

getCombinedHandlers()

Support method for getHandlers() -- load combined settings.

protected getCombinedHandlers(string $activeSearchClass, string $activeHandler) : array<string|int, mixed>
Parameters
$activeSearchClass : string

Active search class ID

$activeHandler : string

Active search handler

Return values
array<string|int, mixed>

getOperatorCharacter()

Helper method: get special character to represent operator in filter

protected getOperatorCharacter(string $operator) : string
Parameters
$operator : string

Operator

Return values
string

Search results