function globallink_menu_get_translation_status in GlobalLink Connect for Drupal 7.6
Same name and namespace in other branches
- 7.5 globallink_menu/globallink_menu.inc \globallink_menu_get_translation_status()
Gets menu translation status.
Parameters
string $mlid: The menu ID.
string $tgt_locale: The target locale.
string $title: The translation title.
Return value
string Status message.
1 call to globallink_menu_get_translation_status()
- globallink_menu_receive_form in globallink_menu/
globallink_menu_receive.inc - Builds form to receive a menu submission.
File
- globallink_menu/
globallink_menu.inc, line 246
Code
function globallink_menu_get_translation_status($mlid, $tgt_locale, &$title) {
$query = db_select('globallink_core_menu', 'tco');
$query
->condition('object_id', $mlid, '=');
$query
->condition('target', $tgt_locale, '=');
$query
->distinct();
$query
->fields('tco');
$results = $query
->execute();
foreach ($results as $row) {
$title = $row->title;
$s_link = menu_link_load($mlid);
if (!$s_link) {
return 'Source Deleted';
}
elseif ($row->status == 'Sent for Translations') {
return 'Translation Completed';
}
elseif ($row->status == 'Error') {
return 'Error';
}
}
return 'Sent for Translations';
}