You are here

function rooms_booking_settings in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7

Main booking settings form.

2 string references to 'rooms_booking_settings'
rooms_booking_manager_form_alter in modules/rooms_booking_manager/rooms_booking_manager.module
Implements hook_form_alter().
rooms_ui_menu in ./rooms_ui.module
Implements hook_menu().

File

./rooms_ui.module, line 64
Interface support to the Rooms family of modules.

Code

function rooms_booking_settings($form, &$form_state) {

  // Management vertical tabs.
  $form['rooms_settings'] = array(
    '#type' => 'vertical_tabs',
    '#weight' => 99,
    '#attached' => array(
      'css' => array(
        array(
          'data' => '#rooms-booking-settings .vertical-tabs .form-type-textfield input { width: auto; }',
          'type' => 'inline',
        ),
      ),
    ),
  );
  $form['rooms_booking_settings'] = array(
    '#type' => 'fieldset',
    '#group' => 'rooms_settings',
    '#title' => t('Rooms booking settings'),
  );
  $form['rooms_booking_settings']['rooms_booking_start_date'] = array(
    '#type' => 'select',
    '#title' => t('How soon a booking can start'),
    '#description' => t('Users with the "Make same-day bookings" permission will not be affected by this setting.'),
    '#options' => array(
      '0' => t('Same day bookings'),
      '1' => t('1 day in advance'),
      '2' => t('@count days in advance', array(
        '@count' => 2,
      )),
      '3' => t('@count days in advance', array(
        '@count' => 3,
      )),
      '4' => t('@count days in advance', array(
        '@count' => 4,
      )),
      '5' => t('@count days in advance', array(
        '@count' => 5,
      )),
      '6' => t('@count days in advance', array(
        '@count' => 6,
      )),
      '7' => t('@count days in advance', array(
        '@count' => 7,
      )),
    ),
    '#default_value' => variable_get('rooms_booking_start_date', 1),
  );
  return system_settings_form($form);
}