You are here

function mobile_number_field_formatter_settings_summary in Mobile Number 7

Implements hook_field_formatter_settings_summary().

File

./mobile_number.module, line 221
mobile_number.module

Code

function mobile_number_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  $settings = $display['settings'];
  $summary = '';
  if (in_array($display['type'], array(
    'mobile_number_international',
    'mobile_number_local',
  ))) {
    if (!empty($settings['as_link'])) {
      $summary = t('Show as TEL link');
    }
    else {
      $summary = t('Show as plaintext');
    }
  }
  if ($display['type'] == 'mobile_number_country') {
    if (!empty($settings['type'])) {
      $texts = array(
        'name' => t('Show as country name'),
        'code' => t('Show as country code'),
      );
      $summary = $texts[$settings['type']];
    }
  }
  return $summary;
}