-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbluecadet_accessibility.module
42 lines (36 loc) · 1.11 KB
/
bluecadet_accessibility.module
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
* @file
* Main helper functions for Carter website accessibility.
*/
use Drupal\views\ViewExecutable;
/**
* Implements hook_page_attachments().
*/
// function bluecadet_accessibility_page_attachments(array &$attachments) {
// $attachments['#attached']['library'][] = 'bluecadet_accessibility/bluecadet_accessibility';
// }
/**
* Implements hook_form_views_pre_render().
*
* Add instance dates to view results.
*/
function bluecadet_accessibility_views_pre_render(ViewExecutable $view) {
// Grab the current view display.
$display = $view->getDisplay();
// Grab the options set on the view display.
$display_extenders_options = $view->display_handler->getOption('display_extenders');
if (
(
$view->ajaxEnabled() &&
(
isset($display_extenders_options['ajax_ally_option']['enable_ally']) &&
$display_extenders_options['ajax_ally_option']['enable_ally'] == TRUE
)
) &&
empty($view->is_attachment) && empty($view->live_preview)
) {
// Attach the library.
$view->element['#attached']['library'][] = 'bluecadet_accessibility/viewsAjaxA11y';
}
}