You are here

function lingotek_render_configuration in Lingotek Translation 7.7

Same name and namespace in other branches
  1. 7.6 lingotek.bulk_grid.inc \lingotek_render_configuration()
1 call to lingotek_render_configuration()
lingotek_bulk_grid_parse_table_data in ./lingotek.bulk_grid.inc

File

./lingotek.bulk_grid.inc, line 2677

Code

function lingotek_render_configuration($row, $profiles, $disabled_class) {
  $configuration = '';
  if (!empty($row->lingotek['auto_upload'])) {
    $configuration .= '<i class="fa fa-arrow-up' . $disabled_class . '" title="' . t('Automatic Upload') . '"></i> ';
  }
  if (!empty($row->lingotek['auto_download'])) {
    $configuration .= '<i class="fa fa-arrow-down' . $disabled_class . '" title="' . t('Automatic Download') . '"></i> ';
  }
  if (!empty($row->lingotek['allow_community_translation'])) {
    $configuration .= '<i class="fa fa-globe' . $disabled_class . '" title="' . t('Crowdsourcing Enabled') . '"></i> ';
  }
  if ($row->lingotek['profile'] == LingotekSync::PROFILE_DISABLED) {
    $configuration = t('Disabled');
  }
  else {
    $profile_key = $row->lingotek['profile'];
    if (array_key_exists($profile_key, $profiles)) {
      $configuration = t($profiles[$profile_key]
        ->getName());
    }
    else {
      $configuration = t('Unknown');

      // profile id does not exist in profiles (this state should be unobtainable)
    }
  }
  return $configuration;
}