diff --git a/recurring_events.tokens.inc b/recurring_events.tokens.inc index 3e0436f35e246f82be039bc4a22c152798933ae8..b26e571fea3b5bd17da30c3f670cefaad46f96f2 100644 --- a/recurring_events.tokens.inc +++ b/recurring_events.tokens.inc @@ -19,22 +19,22 @@ function recurring_events_token_info() { ]; $eventinstance['title'] = [ - 'name' => t('Event Title'), + 'name' => t('Event Instance Inherited Title'), 'description' => t('The title of the event instance.'), ]; $eventinstance['description'] = [ - 'name' => t('Event Description'), + 'name' => t('Event Instance Inherited Description'), 'description' => t('The description of the event instance.'), ]; $eventinstance['date'] = [ - 'name' => t('Event Date'), + 'name' => t('Event Instance Date'), 'description' => t('The date of the event instance.'), ]; $eventinstance['url'] = [ - 'name' => t('Event URL'), + 'name' => t('Event Instance URL'), 'description' => t('The URL of the event instance.'), ]; @@ -46,12 +46,12 @@ function recurring_events_token_info() { ]; $eventseries['title'] = [ - 'name' => t('Event Title'), + 'name' => t('Event Series Title'), 'description' => t('The title of the event series.'), ]; - $eventseries['description'] = [ - 'name' => t('Event Description'), + $eventseries['body'] = [ + 'name' => t('Event Series Body'), 'description' => t('The description of the event series.'), ]; @@ -78,18 +78,16 @@ function recurring_events_tokens($type, $tokens, array $data, array $options, Bu foreach ($tokens as $name => $original) { switch ($name) { case 'title': - // TODO: Should use the inheritance plugin manager. $replacements[$original] = $event_instance->getInheritedTitle(); break; case 'description': - // TODO: Should use the inheritance plugin manager. $replacements[$original] = $event_instance->getInheritedDescription(); break; case 'date': - // TODO: Should format according to what? - $replacements[$original] = $event_instance->date->start_date->format('F jS, Y h:iA'); + $format = \Drupal::config('recurring_events.eventinstance.config')->get('date_format'); + $replacements[$original] = $event_instance->date->start_date->format($format); break; case 'url': @@ -106,7 +104,7 @@ function recurring_events_tokens($type, $tokens, array $data, array $options, Bu $replacements[$original] = $event_series->title->value; break; - case 'description': + case 'body': $replacements[$original] = $event_series->body->value; break;