You are here

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

Form callback wrapper: edit a Bookable Unit.

Parameters

$unit: The RoomsUnit object being edited by this form.

See also

rooms_unit_edit_form()

1 string reference to 'rooms_unit_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 147
Rooms editing UI.

Code

function rooms_unit_form_wrapper($unit) {

  // Add the breadcrumb for the form's location.
  rooms_unit_set_breadcrumb();
  drupal_set_title(t('Edit @unit_name', array(
    '@unit_name' => $unit->name,
  )));
  $unit->date = format_date($unit->created, 'custom', 'Y-m-d H:i:s O');
  $account = user_load($unit->uid);
  $unit->author_name = isset($account->name) ? $account->name : '';
  return drupal_get_form('rooms_unit_edit_form', $unit);
}