You are here

function simple_cookie_compliance_preprocess_page in Simple Cookie Compliance 6

Implements hook_preprocess_page().

File

./simple_cookie_compliance.module, line 69
All the necessary functions for configuring and output.

Code

function simple_cookie_compliance_preprocess_page(&$vars) {
  global $user;
  global $language;

  // Get the text.
  $message = filter_xss(variable_get('simple_cookie_compliance_content_' . $language->language, t('This website uses cookies to help us give you the best experience when you visit our website. By continuing to use this website, you consent to our use of these cookies.')));

  // Add base style, update styles is needed
  drupal_add_css(drupal_get_path('module', 'simple_cookie_compliance') . '/css/simple_cookie_compliance.css');
  $vars['styles'] = drupal_get_css();

  // Render form and update scripts since 'drupal_get_form' is adding js
  $form = drupal_get_form('simple_cookie_compliance_dismiss_form');
  $vars['scripts'] = drupal_get_js();

  // Add the text and form.
  $vars['simple_cookie_compliance'] = theme('cookie_compliance', $message, $form);
}