You are here

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

Submit callback for unit_delete_form

1 string reference to 'rooms_unit_delete_form_submit'
rooms_unit_delete_form in modules/rooms_unit/rooms_unit.admin.inc
Form callback: confirmation form for deleting a unit.

File

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

Code

function rooms_unit_delete_form_submit($form, &$form_state) {
  $unit = $form_state['rooms_unit'];
  rooms_unit_delete($unit);
  drupal_set_message(t('The unit %name has been deleted.', array(
    '%name' => $unit->name,
  )));
  watchdog('rooms', 'Deleted unit %name.', array(
    '%name' => $unit->name,
  ));
  $form_state['redirect'] = 'admin/rooms/units';
}