You are here

language_access.install in Language access 7

Same filename and directory in other branches
  1. 8 language_access.install

File

language_access.install
View source
<?php

/**
 * Implementation of hook_enable().
 */
function language_access_enable() {

  // Create array to store all enebled languages
  $languages = language_list('enabled');
  $enabled_languages = array();
  foreach ($languages[1] as $language) {
    array_push($enabled_languages, 'access language ' . $language->language, 'create language ' . $language->language);
  }

  // Now we allow all roles to access all languages
  $user_roles = user_roles();
  foreach ($user_roles as $role_id => $role) {
    user_role_grant_permissions($role_id, $enabled_languages);
  }
}

Functions

Namesort descending Description
language_access_enable Implementation of hook_enable().