You are here

public function i18n_translation_set::get_links in Internationalization 7

Get items as renderable links

File

i18n_translation/i18n_translation.inc, line 269
Internationalization (i18n) module - Translation set

Class

i18n_translation_set
@file Internationalization (i18n) module - Translation set

Code

public function get_links() {
  $language_list = language_list();
  $items = array();
  foreach ($this
    ->get_objects() as $langcode => $object) {
    $title = $object
      ->get_title();
    $path = $object
      ->get_path();
    $language = isset($language_list[$langcode]) ? $language_list[$langcode] : NULL;
    $items[$langcode] = array(
      'title' => $title,
      'href' => $path ? $path : NULL,
      'language' => $language,
    );
    if ($language && function_exists('languageicons_link_add')) {
      languageicons_link_add($items[$langcode]);
    }
  }
  return $items;
}