function title_field_formatter_settings_summary in Title 7
Implements hook_field_formatter_settings_summary().
File
- ./
title.field.inc, line 97 - Implement a title field formater.
Code
function title_field_formatter_settings_summary($field, $instance, $view_mode) {
$settings = $instance['display'][$view_mode]['settings'];
$summary = array();
$tag = isset($settings['title_style']) && $settings['title_style'] != '' && $settings['title_style'] != '_none' ? $settings['title_style'] : t('- None -');
$summary[] = t('Title wrap tag: @tag', array(
'@tag' => $tag,
));
$link_types = array(
'content' => t('Linked to content'),
'content_absolute' => t('Linked to content(absolute url)'),
);
// Display this setting only if field is linked.
if (isset($link_types[$settings['title_link']])) {
$summary[] = $link_types[$settings['title_link']];
}
// Display this setting only if wrapper has a class.
if (isset($settings['title_class']) && $settings['title_class'] != '_none' && $settings['title_class'] != '') {
$summary[] = t('Wrap tag classes: @classes', array(
'@classes' => $settings['title_class'],
));
}
// Display this setting only if trim is enabled.
if (!empty($settings['enable_trim'])) {
$summary[] = t('Trim length: @length', array(
'@length' => $settings['trim_length'],
));
}
return implode('<br />', $summary);
}