You are here

function addtocal_field_formatter_settings_summary in Add to Cal 7

Implements hook_field_formatter_settings_summary(). @todo: update for tokenized changes

File

./addtocal.module, line 322
addtocal.module General functions and hook implementations.

Code

function addtocal_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  if ($settings['location']['field'] == -1) {
    $location_output = 'None';
  }
  else {
    $location_output = $settings['location']['field'];
  }
  if ($settings['description']['field'] == -1) {
    $description_output = 'None';
  }
  else {
    $description_output = $settings['description']['field'];
  }
  $location_output = t('Location field: !field', array(
    '!field' => $location_output,
  ));
  $description_output = t('Description field: !field', array(
    '!field' => $description_output,
  ));
  $output = $location_output . ', ' . $description_output;
  if ($settings['past_events'] == 1) {
    $output .= '<br />' . t('Showing the widget for past events.');
  }
  return $output;
}