455ae362a51e9ae159a03a1bdd2d504ebb44fff9
[yaffs-website] / web / modules / contrib / eu_cookie_compliance / eu_cookie_compliance.api.php
1 <?php
2
3 /**
4  * @file
5  * Hooks specific to the EU Cookie Compliance module.
6  */
7
8 /**
9  * @addtogroup hooks
10  * @{
11  * Hooks that extend the EU Cookie Compliance module.
12  */
13
14 /**
15  * Alter the geo_ip_match variable.
16  *
17  * @param bool &$geoip_match
18  *   Whether to show the cookie compliance banner.
19  */
20 function hook_eu_cookie_compliance_geoip_match_alter(&$geoip_match) {
21   $geoip_match = FALSE;
22 }
23
24 /**
25  * Take control of EU Cookie Compliance path exclusion.
26  *
27  * @param bool $excluded
28  *   Whether this path is excluded from cookie compliance behavior.
29  * @param string $path
30  *   Current string path.
31  * @param string $exclude_paths
32  *   Admin variable of excluded paths.
33  */
34 function hook_eu_cookie_compliance_path_match_alter(&$excluded, $path, $exclude_paths) {
35   $node = \Drupal::routeMatch()->getParameter('node');
36   if ($node && $node->type === 'my_type') {
37     $excluded = TRUE;
38   }
39 }
40
41 /**
42  * Alter hook to provide advanced logic for hiding the banner.
43  *
44  * @param bool $show_popup
45  *   Whether to show the banner.
46  */
47 function hook_eu_cookie_compliance_show_popup_alter(&$show_popup) {
48   $node = \Drupal::routeMatch()->getParameter('node');
49   if ($node && $node->type === 'my_type') {
50     $show_popup = FALSE;
51   }
52 }
53
54 /**
55  * @} End of "addtogroup hooks".
56  */