You are here

function smart_date_recur_field_widget_settings_summary_alter in Smart Date 3.1.x

Same name and namespace in other branches
  1. 3.2.x modules/smart_date_recur/smart_date_recur.module \smart_date_recur_field_widget_settings_summary_alter()
  2. 3.3.x modules/smart_date_recur/smart_date_recur.module \smart_date_recur_field_widget_settings_summary_alter()
  3. 3.4.x modules/smart_date_recur/smart_date_recur.module \smart_date_recur_field_widget_settings_summary_alter()

Implements hook_field_formatter_settings_summary_alter().

File

modules/smart_date_recur/smart_date_recur.module, line 813
Field hooks for a field that stores a start and end date as timestamps.

Code

function smart_date_recur_field_widget_settings_summary_alter(&$summary, $context) {

  // Append messages to the summary.
  if ($context['field_definition']
    ->getType() == 'smartdate' && SmartDateRule::getThirdPartyFallback($context['field_definition'], 'allow_recurring')) {
    if (SmartDateRule::getThirdPartyFallback($context['widget'], 'modal', 1)) {
      $summary[] = t('Use modal for managing instances.');
    }
    if ($freq_values = SmartDateRule::getThirdPartyFallback($context['widget'], 'allowed_recur_freq_values', _smart_date_recur_get_freq_defaults())) {
      $labels = _smart_date_recur_label_freq_defaults($freq_values);
      $summary[] = t('Dates can recur: ') . implode(', ', $labels);
    }
  }
}