You are here

function language_access_language_switch_links_alter in Language access 7

Same name and namespace in other branches
  1. 8 language_access.module \language_access_language_switch_links_alter()

Implementation of hook_language_switch_links_alter().

File

./language_access.module, line 56

Code

function language_access_language_switch_links_alter(&$links, $type, $path) {
  $languages = language_list('enabled');
  foreach ($languages[1] as $language) {
    if (!user_access('access language ' . $language->language)) {
      if (isset($links[$language->language])) {
        unset($links[$language->language]);
      }
    }
  }
}