OpenUrl
extends AbstractHelper
in package
OpenUrl view helper
Tags
Table of Contents
- $area : string
- OpenURL context ('results', 'record' or 'holdings')
- $config : Config
- VuFind OpenURL configuration
- $context : Context
- Context helper
- $openUrlRules : array<string|int, mixed>
- OpenURL rules
- $recordDriver : RecordDriver
- Current RecordDriver
- $resolverPluginManager : PluginManager
- Resolver plugin manager
- __construct() : mixed
- Constructor
- __invoke() : object
- Set up context for helper
- getImageBasedLinkingMode() : string|bool
- Public method to check ImageBased Linking mode
- imageBasedLinkingIsActive() : bool
- Public method to check if ImageBased Linking is enabled
- isActive() : bool
- Public method to check whether OpenURLs are active for current record
- renderTemplate() : string
- Public method to render the OpenURL template
- addImageBasedParams() : void
- Support method for renderTemplate() -- process image based parameters.
- checkContext() : bool
- Does the OpenURL configuration indicate that we should display OpenURLs in the specified context?
- checkExcludedRecordsRules() : bool
- Check if "exclude" rules from the OpenUrlRules.json file apply to the current record
- checkIfRulesApply() : bool
- Check if the rulesets found apply to the current record. First match counts.
- checkMethodRules() : bool
- Check if method rules match.
- checkRules() : bool
- Checks if rules from the OpenUrlRules.json file apply to the current record
- checkSupportedRecordsRules() : bool
- Check if "include" rules from the OpenUrlRules.json file apply to the current record
- hasNonEmptyValue() : bool
- Check if an array contains a non-empty value.
Properties
$area
OpenURL context ('results', 'record' or 'holdings')
protected
string
$area
$config
VuFind OpenURL configuration
protected
Config
$config
$context
Context helper
protected
Context
$context
$openUrlRules
OpenURL rules
protected
array<string|int, mixed>
$openUrlRules
$recordDriver
Current RecordDriver
protected
RecordDriver
$recordDriver
$resolverPluginManager
Resolver plugin manager
protected
PluginManager
$resolverPluginManager
Methods
__construct()
Constructor
public
__construct(Context $context, array<string|int, mixed> $openUrlRules, PluginManager $pluginManager[, Config $config = null ]) : mixed
Parameters
- $context : Context
-
Context helper
- $openUrlRules : array<string|int, mixed>
-
VuFind OpenURL rules
- $pluginManager : PluginManager
-
Resolver plugin manager
- $config : Config = null
-
VuFind OpenURL config
Return values
mixed —__invoke()
Set up context for helper
public
__invoke(RecordDriver $driver, string $area) : object
Parameters
- $driver : RecordDriver
-
The current record driver
- $area : string
-
OpenURL context ('results', 'record' or 'holdings'
Return values
object —getImageBasedLinkingMode()
Public method to check ImageBased Linking mode
public
getImageBasedLinkingMode() : string|bool
Return values
string|bool —false if image based linking is not active, config image_based_linking_mode otherwise (default = 'both')
imageBasedLinkingIsActive()
Public method to check if ImageBased Linking is enabled
public
imageBasedLinkingIsActive() : bool
Return values
bool —isActive()
Public method to check whether OpenURLs are active for current record
public
isActive() : bool
Return values
bool —renderTemplate()
Public method to render the OpenURL template
public
renderTemplate([bool $imagebased = null ]) : string
Parameters
- $imagebased : bool = null
-
Indicates if an image based link should be displayed or not (null for system default)
Return values
string —addImageBasedParams()
Support method for renderTemplate() -- process image based parameters.
protected
addImageBasedParams(bool $imagebased, array<string|int, mixed> &$params) : void
Parameters
- $imagebased : bool
-
Indicates if an image based link should be displayed or not (null for system default)
- $params : array<string|int, mixed>
-
OpenUrl parameters set so far
Return values
void —checkContext()
Does the OpenURL configuration indicate that we should display OpenURLs in the specified context?
protected
checkContext() : bool
Return values
bool —checkExcludedRecordsRules()
Check if "exclude" rules from the OpenUrlRules.json file apply to the current record
protected
checkExcludedRecordsRules(array<string|int, mixed> $resolverDriverRules) : bool
Parameters
- $resolverDriverRules : array<string|int, mixed>
-
Array of rules for a specific resolverDriver
Return values
bool —checkIfRulesApply()
Check if the rulesets found apply to the current record. First match counts.
protected
checkIfRulesApply() : bool
Return values
bool —checkMethodRules()
Check if method rules match.
protected
checkMethodRules(array<string|int, mixed> $rules) : bool
Parameters
- $rules : array<string|int, mixed>
-
Rules to check.
Return values
bool —checkRules()
Checks if rules from the OpenUrlRules.json file apply to the current record
protected
checkRules(array<string|int, mixed> $ruleset) : bool
Parameters
- $ruleset : array<string|int, mixed>
-
Array of rules to be checked
Return values
bool —checkSupportedRecordsRules()
Check if "include" rules from the OpenUrlRules.json file apply to the current record
protected
checkSupportedRecordsRules(array<string|int, mixed> $resolverDriverRules) : bool
Parameters
- $resolverDriverRules : array<string|int, mixed>
-
Array of rules for a specific resolverDriver
Return values
bool —hasNonEmptyValue()
Check if an array contains a non-empty value.
protected
hasNonEmptyValue(array<string|int, mixed> $in) : bool
Parameters
- $in : array<string|int, mixed>
-
Array to check