You are here

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

Form callback wrapper: create a Booking.

Parameters

$booking: The Booking object being edited by this form.

See also

rooms_booking_edit_form()

1 string reference to 'rooms_booking_create_form_wrapper'
RoomsBookingUIController::hook_menu in modules/rooms_booking/rooms_booking.admin.inc
Overrides hook_menu() defaults.

File

modules/rooms_booking/rooms_booking.admin.inc, line 161
Rooms editing UI.

Code

function rooms_booking_create_form_wrapper($type) {
  global $user;

  // Add the breadcrumb for the form's location.
  rooms_booking_set_breadcrumb();

  // Create a booking object.
  $booking = rooms_booking_create(array(
    'type' => $type,
  ));
  $booking->created = REQUEST_TIME;
  $booking->owner_name = $user->name;
  return drupal_get_form('rooms_booking_edit_form', $booking);
}