You are here

function theme_translation_overview_translation_link in Translation Overview 6

Same name and namespace in other branches
  1. 6.2 translation_overview.module \theme_translation_overview_translation_link()
1 theme call to theme_translation_overview_translation_link()
translation_overview_translation_link in ./translation_overview.module
Build a link to the translated node.

File

./translation_overview.module, line 132

Code

function theme_translation_overview_translation_link($status, $path, $options = array(), $show_long = FALSE) {
  switch ($status) {
    case 'original':
      $long = t('Original');
      $options['attributes'] = array(
        'title' => t('View original'),
      );
      break;
    case 'current':
      $long = t('Complete');
      if (preg_match('/node\\/\\d*\\/edit/', $path)) {
        $options['attributes'] = array(
          'title' => t('Translation is up-to-date, edit it'),
        );
      }
      else {
        $options['attributes'] = array(
          'title' => t('Translation is up-to-date, view it'),
        );
      }
      break;
    case 'outofdate':
      $long = t('Out-of-date');
      if (preg_match('/node\\/\\d*\\/edit/', $path)) {
        $options['attributes'] = array(
          'title' => t('Translation is out-of-date, edit it'),
        );
      }
      else {
        $options['attributes'] = array(
          'title' => t('Translation is out-of-date, view it'),
        );
      }
      break;
    case 'missing':
      $long = t('Untranslated');
      $options['attributes'] = array(
        'title' => t('Translation does not exist, create it'),
      );
      break;
  }
  $text = theme('translation_overview_status_img', $status, $long) . ($show_long ? ' ' . $long : '');
  $options['html'] = TRUE;
  if ($path) {
    return l($text, $path, $options);
  }
  return $text;
}