function languagefield_field_formatter_settings_summary in Custom Language field 7
Implements hook_field_formatter_settings_summary().
File
- ./
languagefield.module, line 234 - Provides a list of languages from ISO 639 standard. All variables of a $language-object can be found here: http://api.drupal.org/api/drupal/developer--globals.php/global/language
Code
function languagefield_field_formatter_settings_summary($field, $instance, $view_mode) {
$display = $instance['display'][$view_mode];
$settings = $display['settings']['format'];
$options = _languagefield_settings_options();
$summary = array();
if (empty($settings)) {
$summary[] = t('** Not set **');
}
else {
foreach ($settings as $value) {
switch ($value) {
case '0':
// Option is not selected.
break;
default:
$summary[] = isset($options[$value]) ? $options[$value] : '...';
break;
}
}
}
return implode(' + ', $summary);
}