function template_preprocess_tmgmt_local_translation_form_element_status in Translation Management Tool 8
Implements template_preprocess_HOOK().
File
- translators/
tmgmt_local/ tmgmt_local.theme.inc, line 53 - Theme file stub for tmgmt.
Code
function template_preprocess_tmgmt_local_translation_form_element_status(array &$variables) {
$classes = [
'tmgmt-ui-icon',
'tmgmt-ui-icon-32',
];
switch ($variables['status']['#value']) {
case TMGMT_DATA_ITEM_STATE_COMPLETED:
$title = t('Accepted');
$icon = 'core/misc/icons/73b355/check.svg';
break;
case TMGMT_DATA_ITEM_STATE_TRANSLATED:
$title = t('Translated');
$icon = drupal_get_path('module', 'tmgmt') . '/icons/gray-check.svg';
break;
case TMGMT_DATA_ITEM_STATE_UNTRANSLATED:
default:
$title = t('Untranslated');
$icon = drupal_get_path('module', 'tmgmt') . '/icons/ready.svg';
break;
}
$variables['wrapper_attributes'] = new Attribute([
'class' => $classes,
]);
$variables['icon_url'] = file_create_url($icon);
$variables['title'] = $title;
}