You are here

function addressfield_tokens_field_formatter_settings_summary in Addressfield Tokens 7

Implements hook_field_formatter_settings_summary().

File

./addressfield_tokens.module, line 138
Main components.

Code

function addressfield_tokens_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = '';
  if ($display['type'] == 'addressfield_components') {
    $comps = array_intersect_key(addressfield_tokens_components(), array_flip($settings['components']));
    $sep = str_replace('\\n', '<br/>', $settings['separator']);
    $summary = filter_xss(implode($sep, $comps));
  }
  return $summary;
}