You are here

function eu_cookie_compliance_get_settings in EU Cookie Compliance (GDPR Compliance) 7

Same name and namespace in other branches
  1. 5 eu_cookie_compliance.module \eu_cookie_compliance_get_settings()
  2. 6 eu_cookie_compliance.module \eu_cookie_compliance_get_settings()
  3. 7.2 eu_cookie_compliance.module \eu_cookie_compliance_get_settings()

Retrieves settings from the database for a current language.

Parameters

string $setting: Setting to retrieve.

Return value

string|null|array The requested setting or an array of all settings.

6 calls to eu_cookie_compliance_get_settings()
eu_cookie_compliance_admin_form in ./eu_cookie_compliance.admin.inc
Provides form for cookie control banner.
eu_cookie_compliance_js_alter in ./eu_cookie_compliance.module
Implements hook_js_alter().
eu_cookie_compliance_page_build in ./eu_cookie_compliance.module
Implements hook_page_build().
eu_cookie_compliance_requirements in ./eu_cookie_compliance.install
Implements hook_requirements().
eu_cookie_compliance_store_consent in ./eu_cookie_compliance.module
Callback for the consent storage JSON call.

... See full list

File

./eu_cookie_compliance.module, line 637
EU cookie compliance primary module file.

Code

function eu_cookie_compliance_get_settings($setting = 'all') {
  $popup_settings = variable_get('eu_cookie_compliance', array());

  // Ensure a default value exists for each setting.
  $popup_settings_dafaults = array(
    'consent_storage_method' => 'do_not_store',
    'enable_save_preferences_button' => NULL,
    'show_disagree_button' => TRUE,
    'withdraw_button_on_info_popup' => NULL,
  );
  $popup_settings = array_merge($popup_settings_dafaults, $popup_settings);
  if ($setting === 'all') {
    return $popup_settings;
  }
  return isset($popup_settings[$setting]) ? $popup_settings[$setting] : NULL;
}