You are here

function languageicons_language_switch_links_alter in Language Icons 7

Same name and namespace in other branches
  1. 8 languageicons.module \languageicons_language_switch_links_alter()

Implements hook_language_switch_links_alter().

Adds language icons to language switcher block links.

@todo Figure out a way to either ignore node links or specifically target them here. See http://drupal.org/node/1005144 for more info.

File

./languageicons.module, line 68
Icons for language links.

Code

function languageicons_language_switch_links_alter(array &$links, $type, $path) {
  if (variable_get('languageicons_show_block', 1) || variable_get('languageicons_show_node', 1)) {
    foreach (array_keys($links) as $langcode) {
      if (!isset($links[$langcode]['language'])) {
        $lang_obj['language'] = $langcode;
        $links[$langcode]['language'] = (object) $lang_obj;
      }
      languageicons_link_add($links[$langcode]);
    }
  }
}