Contributions API

Calling all Drupal developers!

Help us get this on the first page of Digg. DIGG NOW!

Modules in 6

i18n_get_links

Definition

i18n_get_links($path = '', $query = NULL, $names = NULL)
contributions/i18n/i18n.module, line 317

Description

Function i18n_get_links

Returns an array of links for all languages, with or without names/flags

Parameters

$path Drupal internal path

$query Query string

$names Names to use for the links. Defaults to native language names

Code

<?php
function i18n_get_links($path = '', $query = NULL, $names = NULL) {
  if($path == i18n_frontpage()) {
    $path = '';
  }
  $names = $names ? $names : locale_language_list('native');
  foreach (array_keys(i18n_supported_languages()) as $lang){
    $links[$lang]= theme('i18n_link', $names[$lang], i18n_path($path, $lang), $lang, $query);
  }
  return $links;  
}
?>