You are here

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

Form callback wrapper: create a Unit.

Parameters

$type: The Unit type for the unit to be created.

1 string reference to 'rooms_unit_create_form_wrapper'
RoomsUnitUIController::hook_menu in modules/rooms_unit/rooms_unit.admin.inc
Overrides hook_menu() defaults. Main reason for doing this is that parent class hook_menu() is optimized for entity type administration.

File

modules/rooms_unit/rooms_unit.admin.inc, line 163
Rooms editing UI.

Code

function rooms_unit_create_form_wrapper($type) {
  global $user;

  // Add the breadcrumb for the form's location.
  rooms_unit_set_breadcrumb();
  $unit = rooms_unit_create(array(
    'type' => $type,
    'uid' => $user->uid,
  ));
  $unit->created = REQUEST_TIME;
  $unit->author_name = $user->name;
  $unit->status = 1;
  return drupal_get_form('rooms_unit_edit_form', $unit);
}