function eu_cookie_compliance_footer in EU Cookie Compliance (GDPR Compliance) 6
Same name and namespace in other branches
- 5 eu_cookie_compliance.module \eu_cookie_compliance_footer()
Implements hook_footer().
File
- ./
eu_cookie_compliance.module, line 42 - This module intends to deal with the EU Directive on Privacy and Electronic Communications that comes into effect in the UK on 26th May 2012.
Code
function eu_cookie_compliance_footer() {
$popup_settings = eu_cookie_compliance_get_settings();
if (!empty($popup_settings['popup_enabled']) && user_access('see EU Cookie Compliance popup')) {
global $language;
$popup_text_info = str_replace(array(
"\r",
"\n",
), '', $popup_settings['popup_info']['value']);
$popup_text_agreed = str_replace(array(
"\r",
"\n",
), '', $popup_settings['popup_agreed']['value']);
$html_info = theme('eu_cookie_compliance_popup_info', check_markup($popup_text_info, $popup_settings['popup_info']['format'], FALSE), $popup_settings['popup_agree_button_message'], $popup_settings['popup_disagree_button_message']);
$html_agreed = theme('eu_cookie_compliance_popup_agreed', check_markup($popup_text_agreed, $popup_settings['popup_agreed']['format'], FALSE), $popup_settings['popup_hide_button_message'], $popup_settings['popup_find_more_button_message']);
$clicking_confirmation = isset($popup_settings['popup_clicking_confirmation']) ? $popup_settings['popup_clicking_confirmation'] : TRUE;
$variables = array(
'popup_enabled' => $popup_settings['popup_enabled'],
'custom_cookie_enabled' => $popup_settings['custom_cookie_domain_enable'],
'custom_cookie_domain' => $popup_settings['custom_cookie_domain'],
'popup_agreed_enabled' => $popup_settings['popup_agreed_enabled'],
'popup_hide_agreed' => isset($popup_settings['popup_hide_agreed']) ? $popup_settings['popup_hide_agreed'] : FALSE,
'popup_clicking_confirmation' => $clicking_confirmation,
'popup_html_info' => empty($html_info) ? FALSE : $html_info,
'popup_html_agreed' => empty($html_agreed) ? FALSE : $html_agreed,
'popup_height' => $popup_settings['popup_height'] ? (int) $popup_settings['popup_height'] : 'auto',
'popup_width' => drupal_substr($popup_settings['popup_width'], -1) == '%' ? $popup_settings['popup_width'] : (int) $popup_settings['popup_width'],
'popup_delay' => (int) ($popup_settings['popup_delay'] * 1000),
'popup_link' => empty($popup_settings['popup_link']) ? FALSE : $popup_settings['popup_link'],
'popup_position' => empty($popup_settings['popup_position']) ? NULL : $popup_settings['popup_position'],
'popup_language' => $language->language,
);
drupal_add_js(array(
'eu_cookie_compliance' => $variables,
), 'setting', 'footer');
}
}