function globallink_get_node_source_languages in GlobalLink Connect for Drupal 7.5
Same name and namespace in other branches
- 7.7 globallink.inc \globallink_get_node_source_languages()
- 7.6 globallink.inc \globallink_get_node_source_languages()
Gets node source languages by id.
Parameters
int $nid: The node id.
Return value
string The source language.
2 calls to globallink_get_node_source_languages()
- globallink_dashboard_node_filter_form in ./
globallink_send_translations.inc - Builds form to filter GlobalLink nodes to send for translation on dashboard.
- globallink_entity_dashboard_filter_form in globallink_entity/
globallink_entity_send.inc - Builds form to filter entities to send for translation on dashboard.
File
- ./
globallink.inc, line 380 - Miscellaneous GlobalLink functions for node translations (non-entity).
Code
function globallink_get_node_source_languages($nid) {
$d_query = db_select('node', 'n');
$d_query
->condition('nid', $nid, '=');
$d_query
->join('languages', 'l', 'l.language = n.language');
$d_query
->fields('l', array(
'language',
));
$results = $d_query
->execute();
foreach ($results as $item) {
return $item->language;
}
return '';
}