function rooms_booking_form_views_exposed_form_alter in Rooms - Drupal Booking for Hotels, B&Bs and Vacation Rentals 7
Implements hook_form_FORM_ID_alter().
FORM_ID = views_exposed_form
File
- modules/
rooms_booking/ rooms_booking.module, line 499 - Manage Bookings - Bookings are tied to a customer profile and possible a Unit ID and Order ID.
Code
function rooms_booking_form_views_exposed_form_alter(&$form, &$form_state) {
// Bookings admin view exposed filters.
if ($form['#id'] == 'views-exposed-form-bookings-page-1') {
$form['start_date']['#type'] = 'date_popup';
$form['start_date']['#date_format'] = variable_get('rooms_date_format', 'd-m-Y');
$form['start_date']['#date_label_position'] = 'before';
$form['end_date']['#type'] = 'date_popup';
$form['end_date']['#date_format'] = variable_get('rooms_date_format', 'd-m-Y');
$form['end_date']['#date_label_position'] = 'before';
$form['#attached']['css'][] = array(
'data' => '.views-exposed-form .views-exposed-widget { height: 70px; }',
'type' => 'inline',
);
}
}