You are here

function _scheduler_delete_row_confirm_submit in Scheduler 7

Form submission handler for _scheduler_delete_row_confirm().

File

./scheduler.admin.inc, line 677
Administration forms for the Scheduler module.

Code

function _scheduler_delete_row_confirm_submit($form, &$form_state) {

  // This is a special case, where we only want to delete the row in the
  // Scheduler table. The associated node does not exist any more so we cannot
  // use the normal node/$nid/delete process as that requires a node object.
  if ($form_state['values']['confirm']) {
    $nid = $form_state['values']['nid'];
    db_delete('scheduler')
      ->condition('nid', $nid)
      ->execute();
    watchdog('scheduler', 'Row for missing node @nid deleted from scheduler table.', array(
      '@nid' => $nid,
    ));
    drupal_set_message(t('The scheduler data for missing node @nid has been deleted.', array(
      '@nid' => $nid,
    )));
  }
}