You are here

function birthdays_field_formatter_settings_summary in Birthdays 7

Implements hook_field_formatter_settings_summary().

File

./birthdays.module, line 443
The Birthdays module allows users to add their birthday to their profile. It lists birthdays on a seperate page and in different blocks. Users can receive an email on their birthday automatically, and the administrator can receive daily reminders of…

Code

function birthdays_field_formatter_settings_summary($field, $instance, $view_mode) {
  $display = $instance['display'][$view_mode];
  switch ($display['type']) {
    case 'birthdays_plaintext':
      $vars = array(
        '@format' => $display['settings']['dateformat'],
        '@noyear' => $display['settings']['dateformat_noyear'],
      );
      switch ($instance['settings']['hide_year']) {
        case BIRTHDAYS_HIDE_YEAR_USER:
          return t('Date format: <strong>@format</strong> respectively <strong>@noyear</strong>', $vars);
        case BIRTHDAYS_HIDE_YEAR_NO:
          return t('Date format: <strong>@format</strong>', $vars);
        case BIRTHDAYS_HIDE_YEAR_YES:
          return t('Date format: <strong>@noyear</strong>', $vars);
      }
      break;
    case 'birthdays_starsign':
      $summary = array();
      if ($display['settings']['starsign_with_yahoo_link']) {
        $summary[] = t('Starsign with link to Yahoo Astrology.');
      }
      else {
        $summary[] = t('Starsign without link to Yahoo Astrology.');
      }
      return implode('<br />', $summary);
  }
}