function eu_cookie_compliance_footer in EU Cookie Compliance (GDPR Compliance) 5
Same name and namespace in other branches
- 6 eu_cookie_compliance.module \eu_cookie_compliance_footer()
Implements hook_footer().
File
- ./
eu_cookie_compliance.module, line 165 - 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 ($popup_settings['popup_enabled'] && user_access('see EU Cookie Compliance popup')) {
global $locale;
$ln = $locale;
$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));
$html_agreed = theme('eu_cookie_compliance_popup_agreed', check_markup($popup_text_agreed, $popup_settings['popup_agreed']['format'], FALSE));
$clicking_confirmation = isset($popup_settings['popup_clicking_confirmation']) ? $popup_settings['popup_clicking_confirmation'] : TRUE;
$variables = array(
'popup_enabled' => $popup_settings['popup_enabled'],
'popup_clicking_confirmation' => $clicking_confirmation,
'popup_html_info' => $html_info,
'popup_html_agreed' => $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' => $popup_settings['popup_link'],
'popup_position' => $popup_settings['popup_position'],
'popup_language' => $ln,
);
drupal_add_js(array(
'eu_cookie_compliance' => $variables,
), "setting", 'footer');
}
}