You are here

function globallink_get_tpt_sent_rows in GlobalLink Connect for Drupal 7.7

Same name and namespace in other branches
  1. 7.5 globallink.module \globallink_get_tpt_sent_rows()
  2. 7.6 globallink.module \globallink_get_tpt_sent_rows()

Retrieve languages with in progress translations.

Parameters

int $nid: The node id.

string $source: The drupal locale code.

Return value

array An array containing all drupal locale codes with in progress translations.

1 call to globallink_get_tpt_sent_rows()
globallink_menu_local_tasks_alter in ./globallink.module
Implements hook_menu_local_tasks_alter().

File

./globallink.module, line 1201
GlobalLink translation module.

Code

function globallink_get_tpt_sent_rows($nid, $source) {
  module_load_include("inc", "globallink", "globallink");
  $arr = array();
  $query = db_select('globallink_document', 'gd')
    ->fields('gd')
    ->condition('object_id', $nid, '=')
    ->condition('entity_type', GLOBALLINK_ENTITY_TYPE_NODE, '=')
    ->condition('target_status', array(
    GLOBALLINK_STATUS_TRANSLATION_SENT,
    GLOBALLINK_STATUS_TRANSLATION_ERROR,
    GLOBALLINK_STATUS_TRANSLATION_COMPLETED,
  ), 'IN');
  $result = $query
    ->execute()
    ->fetchAll();
  foreach ($result as $row) {
    $arr[] = globallink_get_drupal_locale_code($row->target_lang_code);
  }
  return $arr;
}