You are here

function book_remove_form_submit in Drupal 6

Same name and namespace in other branches
  1. 7 modules/book/book.pages.inc \book_remove_form_submit()

Confirm form submit function to remove a node from the book.

See also

book_remove_form()

File

modules/book/book.pages.inc, line 217
User page callbacks for the book module.

Code

function book_remove_form_submit($form, &$form_state) {
  $node = $form['#node'];
  if ($node->nid != $node->book['bid']) {

    // Only allowed when this is not a book (top-level page).
    menu_link_delete($node->book['mlid']);
    db_query('DELETE FROM {book} WHERE nid = %d', $node->nid);
    drupal_set_message(t('The post has been removed from the book.'));
  }
  $form_state['redirect'] = 'node/' . $node->nid;
}