You are here

function rng_event_field_config_definition in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 rng.field.defaults.inc \rng_event_field_config_definition()
  2. 8 rng.field.defaults.inc \rng_event_field_config_definition()
2 calls to rng_event_field_config_definition()
EventTypeFieldMappingForm::buildForm in src/Form/EventTypeFieldMappingForm.php
Form constructor.
rng_add_event_field_config in ./rng.field.defaults.inc

File

./rng.field.defaults.inc, line 82
Creates field config if they do not exist.

Code

function rng_event_field_config_definition($field_name) {
  $definition = [];
  switch ($field_name) {
    case EventManagerInterface::FIELD_REGISTRATION_TYPE:
      $definition = [
        'label' => 'Registration type',
        'settings' => [
          'handler' => 'default',
        ],
        'description' => t('Select which registration types are valid for this event.'),
      ];
      break;
    case EventManagerInterface::FIELD_REGISTRATION_GROUPS:
      $definition = [
        'label' => 'Registration groups',
        'settings' => [
          'handler' => 'default',
        ],
        'description' => t('New registrations will be added to these groups.'),
      ];
      break;
    case EventManagerInterface::FIELD_STATUS:
      $definition = [
        'label' => 'Accept new registrations',
        'settings' => [
          'on_label' => t('Accepting new registrations'),
          'off_label' => t('Not accepting new registrations'),
        ],
        'description' => t('Accept new registrations for this event'),
      ];
      break;
    case EventManagerInterface::FIELD_CAPACITY_CONFIRMED_ONLY:
      $definition = [
        'label' => t('Capacity based on confirmed registrations'),
        'settings' => [
          'on_label' => t('Capacity based on confirmed registrations'),
          'off_label' => t('Capacity based on all registrations, including unconfirmed'),
        ],
        'description' => t('When nearing capacity, do unconfirmed registrations count towards the used capacity, or only confirmed registrations?'),
      ];
      break;
    case EventManagerInterface::FIELD_REGISTRANTS_CAPACITY:
      $definition = [
        'label' => 'Maximum registrants',
        'description' => t('Maximum amount of registrants for this event.'),
        'settings' => [
          'min' => 1,
        ],
      ];
      break;
    case EventManagerInterface::FIELD_WAIT_LIST:
      $definition = [
        'label' => 'Allow a wait list',
        'description' => t('Allow a waiting list for the event.'),
        'settings' => [
          'on_label' => t('Allow a waiting list for this event'),
          'off_label' => t('Do not allow a waiting list for this event'),
        ],
      ];
      break;
    case EventManagerInterface::FIELD_EMAIL_REPLY_TO:
      $definition = [
        'label' => t('Reply-to e-mail address'),
        'description' => t('E-mail address that appears as reply-to when emails are sent from this event. Leave empty to use site default.'),
      ];
      break;
    case EventManagerInterface::FIELD_ALLOW_DUPLICATE_REGISTRANTS:
      $definition = [
        'label' => 'Allow duplicate registrants',
        'description' => t('Allows a registrant to create more than one registration for this event.'),
        'settings' => [
          'on_label' => t('Allow duplicate registrants for this event'),
          'off_label' => t('Do not allow duplicate registrants for this event'),
        ],
      ];
      break;
  }
  return $definition;
}