You are here

function eu_cookie_compliance_install in EU Cookie Compliance (GDPR Compliance) 7

Same name and namespace in other branches
  1. 8 eu_cookie_compliance.install \eu_cookie_compliance_install()
  2. 5 eu_cookie_compliance.install \eu_cookie_compliance_install()
  3. 6 eu_cookie_compliance.install \eu_cookie_compliance_install()
  4. 7.2 eu_cookie_compliance.install \eu_cookie_compliance_install()
  5. 2.0.x eu_cookie_compliance.install \eu_cookie_compliance_install()

Implements hook_install().

File

./eu_cookie_compliance.install, line 72
Installation file.

Code

function eu_cookie_compliance_install() {
  $popup_settings = _eu_cookie_compliance_get_popup_default_setting();
  variable_set('eu_cookie_compliance', $popup_settings);

  // Enable banner for all roles.
  $roles = user_roles();
  $permission = 'display EU Cookie Compliance popup';
  foreach ($roles as $rid => $value) {
    user_role_grant_permissions($rid, array(
      $permission,
    ));
  }
  eu_cookie_compliance_module_set_weight();
}