function globallink_taxonomy_get_translation_status in GlobalLink Connect for Drupal 7.6
Same name and namespace in other branches
- 7.5 globallink_taxonomy/globallink_taxonomy.inc \globallink_taxonomy_get_translation_status()
Gets taxonomy translation status.
Parameters
string $bid: The taxonomy object ID.
string $tgt_locale: The target locale.
string $title: The translation title.
Return value
string Status message.
1 call to globallink_taxonomy_get_translation_status()
- globallink_taxonomy_receive_form in globallink_taxonomy/
globallink_taxonomy_receive.inc - Builds form to receive a taxonomy submission.
File
- globallink_taxonomy/
globallink_taxonomy.inc, line 391
Code
function globallink_taxonomy_get_translation_status($bid, $tgt_locale, &$title) {
$query = db_select('globallink_core_taxonomy', 'tco');
$query
->condition('object_id', $bid, '=');
$query
->condition('target', $tgt_locale, '=');
$query
->distinct();
$query
->fields('tco');
$results = $query
->execute();
foreach ($results as $row) {
$title = $row->title;
$s_taxonomy = taxonomy_term_load($bid);
if (!$s_taxonomy || is_null($s_taxonomy)) {
return 'Source Deleted';
}
elseif ($row->status == 'Sent for Translations') {
return 'Translation Completed';
}
elseif ($row->status == 'Error') {
return 'Error';
}
}
return 'Sent for Translations';
}