You are here

function oa_events_oa_settings_form in Open Atrium Events 7.2

Implements hook_oa_settings_form().

File

./oa_events.module, line 394
Code for the OA Events feature.

Code

function oa_events_oa_settings_form(&$form_state) {
  $forms = array();
  $form = array();
  $form['oa_events_send_reminders'] = array(
    '#type' => 'checkbox',
    '#title' => t('Send event reminders to subscribed users?'),
    '#default_value' => variable_get('oa_events_send_reminders', OA_EVENTS_SEND_REMINDERS),
  );
  $form['oa_events_reminder_interval'] = array(
    '#type' => 'select',
    '#title' => t('How long prior to event start should users get a reminder?'),
    '#default_value' => variable_get('oa_events_reminder_interval', OA_EVENTS_REMINDER_INTERVAL),
    '#options' => array(
      900 => t('15 Minutes'),
      1800 => t('30 Minutes'),
      3600 => t('1 Hour'),
      86400 => t('1 Day'),
      604800 => t('1 Week'),
    ),
  );
  $form['oa_events_date2_format'] = array(
    '#type' => 'textfield',
    '#title' => t('Date format for Event listings ?'),
    '#default_value' => variable_get('oa_events_date2_format', OA_EVENTS_DATE2_FORMAT),
  );
  $form['oa_events_time_format'] = array(
    '#type' => 'textfield',
    '#title' => t('Time format for Event listings ?'),
    '#default_value' => variable_get('oa_events_time_format', OA_EVENTS_TIME_FORMAT),
  );
  $form['oa_events_addthis'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable the Add to Calendar button'),
    '#description' => t('NOTE: Using the AddThisEvent service requires a license from addevent.com for non-personal use.'),
    '#default_value' => variable_get('oa_events_addthis', FALSE),
  );
  $form['oa_events_date_format'] = array(
    '#type' => 'textfield',
    '#title' => t('Date format for "Add to Calendar" ?'),
    '#default_value' => variable_get('oa_events_date_format', OA_EVENTS_DATE_FORMAT),
    '#states' => array(
      'visible' => array(
        ':input[name="oa_events_addthis"]' => array(
          'checked' => TRUE,
        ),
      ),
    ),
  );
  $forms[] = array(
    'caption' => t('Event settings'),
    'form' => $form,
  );
  return $forms;
}