Commit 1bacca2d authored by mark burdett's avatar mark burdett
Browse files

Issue #3116573 by mfb, shadowwolf218: Does noscript inherit role/page...

Issue #3116573 by mfb, shadowwolf218: Does noscript inherit role/page restrictions from Matomo Analytics module?
parent eb88b5ad
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -66,6 +66,18 @@ function piwik_noscript_page_bottom(array &$page_bottom) {
    return;
  }

  // Respect Matomo module visibility settings.
  foreach (['matomo', 'piwik'] as $module) {
    $function = "_{$module}_visibility_pages";
    if (function_exists($function) && !$function()) {
      return;
    }
    $function = "_{$module}_visibility_user";
    if (function_exists($function) && !$function(\Drupal::currentUser())) {
      return;
    }
  }

  $options = piwik_noscript_options();
  $page_bottom['piwik_noscript'] = piwik_noscript_image($options);
  $page_bottom['piwik_noscript']['#prefix'] = new FormattableMarkup('<noscript>', []);