You are here

function bat_fullcalendar_settings in Booking and Availability Management Tools for Drupal 7

Allows us to define the license to use with Scheduler.

1 string reference to 'bat_fullcalendar_settings'
bat_fullcalendar_menu in modules/bat_fullcalendar/bat_fullcalendar.module
Implements hook_menu().

File

modules/bat_fullcalendar/bat_fullcalendar.module, line 775
Manages the display of FullCalendar and provides ways for other modules to easily modify it.

Code

function bat_fullcalendar_settings($form, &$form_state) {
  $form['bat_fullcalendar_scheduler'] = array(
    '#type' => 'container',
    '#prefix' => '<div id="label-settings">',
    '#suffix' => '</div>',
  );
  $form['bat_fullcalendar_scheduler']['bat_fullcalendar_scheduler_key'] = array(
    '#type' => 'radios',
    '#title' => t('FullCalendar Scheduler License'),
    '#default_value' => variable_get('bat_fullcalendar_scheduler_key', ''),
    '#options' => array(
      'commercial' => t('Commercial License'),
      'non-commercial' => t('Non-Commercial Creative Commons'),
      'gpl' => t('GPL License'),
      'none' => t('None'),
    ),
    '#description' => t('Please visit http://fullcalendar.io/scheduler/license/ to find out about the license terms for the Scheduler View of FullCalendar'),
    '#ajax' => array(
      'callback' => 'bat_fullcalendar_settings_ajax_callback',
      'wrapper' => 'label-settings',
    ),
  );
  if (!isset($form_state['values']['bat_fullcalendar_scheduler_key']) && $form['bat_fullcalendar_scheduler']['bat_fullcalendar_scheduler_key']['#default_value'] == 'commercial' || isset($form_state['values']['bat_fullcalendar_scheduler_key']) && $form_state['values']['bat_fullcalendar_scheduler_key'] == 'commercial') {
    $form['bat_fullcalendar_scheduler']['bat_fullcalendar_scheduler_commercial_key'] = array(
      '#type' => 'textfield',
      '#title' => t('FullCalendar Scheduler Commercial License Key'),
      '#required' => TRUE,
      '#default_value' => variable_get('bat_fullcalendar_scheduler_commercial_key', ''),
    );
  }
  return system_settings_form($form);
}