You are here

function bat_unit_create_form_wrapper in Booking and Availability Management Tools for Drupal 7

Form callback wrapper: create a Unit.

Parameters

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

1 string reference to 'bat_unit_create_form_wrapper'
BatUnitUIController::hook_menu in modules/bat_unit/bat_unit.admin.inc
Overrides hook_menu() defaults.

File

modules/bat_unit/bat_unit.admin.inc, line 176
BatUnit editing UI.

Code

function bat_unit_create_form_wrapper($type) {
  global $user;

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