public function TMGMTI18nStringSourcePluginController::getLabel in Translation Management Tool 7
Return a title for this job item.
Parameters
TMGMTJobItem $job_item: The job item entity.
Overrides TMGMTDefaultSourcePluginController::getLabel
File
- sources/
i18n_string/ tmgmt_i18n_string.plugin.inc, line 75 - Provides the i18n string source controller.
Class
- TMGMTI18nStringSourcePluginController
- Translation plugin controller for i18n strings.
Code
public function getLabel(TMGMTJobItem $job_item) {
if ($i18n_object = $this
->getI18nObjectWrapper($job_item)) {
// Get the label, default to the get_title() method, fall back to the
// first string if that is empty.
$title = t('Unknown');
if ($i18n_object
->get_title()) {
$title = $i18n_object
->get_title();
}
elseif ($strings = $i18n_object
->get_strings(array(
'empty' => TRUE,
))) {
$title = reset($strings)
->get_string();
}
return t('@title (@id)', array(
'@title' => strip_tags(drupal_substr($title, 0, 64)),
'@id' => $job_item->item_id,
));
}
return parent::getLabel($job_item);
}