You are here

function lingotek_get_entity_edit_link in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lingotek.bulk_grid.inc \lingotek_get_entity_edit_link()
  2. 7.6 lingotek.bulk_grid.inc \lingotek_get_entity_edit_link()
1 call to lingotek_get_entity_edit_link()
lingotek_grid_get_rows in ./lingotek.bulk_grid.inc
Dynamic query processing function for the grid Since the header defines which columns are shown, this query gets all possible values and refines the header using the columns selected in the UI The filters are also processed here

File

./lingotek.bulk_grid.inc, line 1432
Bulk Grid form

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,
  ));
}