function eu_cookie_compliance_get_settings in EU Cookie Compliance (GDPR Compliance) 6
Same name and namespace in other branches
- 5 eu_cookie_compliance.module \eu_cookie_compliance_get_settings()
- 7.2 eu_cookie_compliance.module \eu_cookie_compliance_get_settings()
- 7 eu_cookie_compliance.module \eu_cookie_compliance_get_settings()
Retrieves settings from the database for a current language.
@global object $language
Parameters
object $setting: A string indicating which setting to return (optional).
Return value
array|string|NULL All settings are returned as an array if the function is called without arguments, or with the argument 'all'. If an argument is passed, a matching setting from the array stored in the variable is returned, otherwise NULL.
3 calls to eu_cookie_compliance_get_settings()
- eu_cookie_compliance_admin_form in ./
eu_cookie_compliance.admin.inc - Provides form for cookie control popup.
- eu_cookie_compliance_footer in ./
eu_cookie_compliance.module - Implements hook_footer().
- eu_cookie_compliance_init in ./
eu_cookie_compliance.module - Implements hook_init().
File
- ./
eu_cookie_compliance.module, line 115 - 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_get_settings($setting = 'all') {
global $language;
$popup_settings = variable_get('eu_cookie_compliance_' . $language->language, array());
if ($setting == 'all') {
return $popup_settings;
}
if (isset($popup_settings[$setting])) {
return $popup_settings[$setting];
}
else {
return NULL;
}
}