language_access.install in Language access 7
Same filename and directory in other branches
File
language_access.installView 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
Name | Description |
---|---|
language_access_enable | Implementation of hook_enable(). |