protected function JuiceboxDisplayStyle::buildContextualLinks in Juicebox HTML5 Responsive Image Galleries 8.3
Same name and namespace in other branches
- 8.2 src/Plugin/views/style/JuiceboxDisplayStyle.php \Drupal\juicebox\Plugin\views\style\JuiceboxDisplayStyle::buildContextualLinks()
Utility to build contextual links for a viewstyle-based gallery display.
Parameters
array $xml_route_info: Associative array of route info used to generate the XML.
Return value
array An associated array of calculated contextual link information.
1 call to JuiceboxDisplayStyle::buildContextualLinks()
- JuiceboxDisplayStyle::render in src/
Plugin/ views/ style/ JuiceboxDisplayStyle.php - Render the display in this style.
File
- src/
Plugin/ views/ style/ JuiceboxDisplayStyle.php, line 334
Class
- JuiceboxDisplayStyle
- Plugin implementation of the 'juicebox' display style.
Namespace
Drupal\juicebox\Plugin\views\styleCode
protected function buildContextualLinks(array $xml_route_info) {
$contextual = [];
// Add a contextual link to view the XML. Note that we include any query
// params as route paramaters. These won't be used in the actual route
// but they will be preserved as query paramaters on the contextual link
// (which may be needed during the XML request).
$xml_query = !empty($xml_route_info['options']['query']) ? $xml_route_info['options']['query'] : [];
// Add a contextual link to view the XML.
$contextual['juicebox_xml_viewsstyle'] = [
'route_parameters' => $xml_route_info['route_parameters'] + $xml_query,
];
return $contextual;
}