You are here

function lingotek_get_entity_edit_link in Lingotek Translation 7.6

Same name and namespace in other branches
  1. 7.7 lingotek.bulk_grid.inc \lingotek_get_entity_edit_link()
  2. 7.5 lingotek.bulk_grid.inc \lingotek_get_entity_edit_link()
1 call to lingotek_get_entity_edit_link()
lingotek_render_actions in ./lingotek.bulk_grid.inc

File

./lingotek.bulk_grid.inc, line 1806

Code

function lingotek_get_entity_edit_link($entity_type, $entity_id, $url_only = FALSE) {
  $edit_link = "";
  $query = array();
  $query['destination'] = 'admin/settings/lingotek/manage/' . $entity_type;
  switch ($entity_type) {
    case 'fieldable_panels_pane':
      $edit_link = 'admin/structure/fieldable-panels-panes/view/' . $entity_id . '/edit';
      break;
    case 'taxonomy_term':
      $edit_link = 'taxonomy/term/' . $entity_id . '/edit';
      break;
    case 'message_type':
      return '';
    default:
      $edit_link = $entity_type . '/' . $entity_id . '/edit';
      break;
  }
  return $url_only ? url($edit_link, array(
    'query' => $query,
  )) : l('<i title="' . t('Edit') . '" class="fa fa-edit"></i>', $edit_link, array(
    'html' => TRUE,
    'attributes' => array(
      'target' => '_blank',
    ),
    'query' => $query,
  ));
}