You are here

function lingotek_render_configuration in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 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 1762

Code

function lingotek_render_configuration($row, $profiles, $disabled_class) {
  $configuration = '';
  if ($row->lingotek['create_lingotek_document']) {
    $configuration .= '<i class="fa fa-arrow-up' . $disabled_class . '" title="' . t('Automatic Upload') . '"></i> ';
  }
  if ($row->lingotek['sync_method']) {
    $configuration .= '<i class="fa fa-arrow-down' . $disabled_class . '" title="' . t('Automatic Download') . '"></i> ';
  }
  if ($row->lingotek['allow_community_translation']) {
    $configuration .= '<i class="fa fa-globe' . $disabled_class . '" title="' . t('Crowdsourcing Enabled') . '"></i> ';
  }
  if ($row->lingotek['profile'] == LingotekSync::PROFILE_CUSTOM) {
    $configuration = t('Custom') . ' <span class="node-configuration">' . $configuration . '</span>';
  }
  elseif ($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]['name']);
    }
    else {
      $configuration = t('Unknown');

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