function lingotek_lang_icons in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 lingotek.bulk_grid.inc \lingotek_lang_icons()
- 7.5 lingotek.bulk_grid.inc \lingotek_lang_icons()
- 7.6 lingotek.bulk_grid.inc \lingotek_lang_icons()
1 call to lingotek_lang_icons()
- 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 1433 - Bulk Grid form
Code
function lingotek_lang_icons($languages, $locales, $statuses, $nid = NULL, $convert = FALSE) {
$html = "";
$legend = array(
LingotekSync::STATUS_PENDING => 'In Progress',
LingotekSync::STATUS_READY => 'Ready to Download',
LingotekSync::STATUS_CURRENT => 'Current',
LingotekSync::STATUS_EDITED => 'Source needs to be uploaded',
LingotekSync::STATUS_DISABLED => 'Disabled',
);
$default_link = 'node/' . $nid . '/lingotekworkbench/';
$manual_link = 'node/' . $nid . '/lingotek_pm/';
$link_map = array(
LingotekSync::STATUS_PENDING => $default_link,
LingotekSync::STATUS_READY => $default_link,
LingotekSync::STATUS_CURRENT => $default_link,
LingotekSync::STATUS_EDITED => $manual_link,
LingotekSync::STATUS_DISABLED => $manual_link,
);
foreach ($locales as $key => $original_locale) {
$locale = $convert ? Lingotek::convertLingotek2Drupal($original_locale) : $original_locale;
if ($locale) {
// exclude language translations that are not lingotek_enabled (we may consider showing everything later)
$status = $statuses[$key];
$css_class = 'target-' . $status;
$tip = $languages[$locale]->name . ' - ' . $legend[strtoupper($status)];
$html .= l($locale, $link_map[strtoupper($status)] . $original_locale, array(
'attributes' => array(
'target' => '_blank',
'title' => $tip,
'class' => array(
'language-icon',
$css_class,
),
),
));
}
}
return $html;
}