Returns the language switch links for the given language type.
$type: The language type.
$path: The internal path the switch links will be relative to.
A keyed array of links ready to be themed.
function language_negotiation_get_switch_links($type, $path) {
$links = FALSE;
$negotiation = variable_get("language_negotiation_{$type}", array());
foreach ($negotiation as $method_id => $method) {
if (isset($method['callbacks']['language_switch'])) {
if (isset($method['file'])) {
require_once DRUPAL_ROOT . '/' . $method['file'];
}
$callback = $method['callbacks']['language_switch'];
$result = $callback($type, $path);
if (!empty($result)) {
// Allow modules to provide translations for specific links.
drupal_alter('language_switch_links', $result, $type, $path);
$links = (object) array(
'links' => $result,
'method_id' => $method_id,
);
break;
}
}
}
return $links;
}