1.12.x book.pages.inc book_remove_form_submit($form, &$form_state)
1.10.x book.pages.inc book_remove_form_submit($form, &$form_state)
1.11.x book.pages.inc book_remove_form_submit($form, &$form_state)
1.7.x book.pages.inc book_remove_form_submit($form, &$form_state)
1.8.x book.pages.inc book_remove_form_submit($form, &$form_state)
1.9.x book.pages.inc book_remove_form_submit($form, &$form_state)

Form submission handler for book_remove_form().

File

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

Code

function book_remove_form_submit($form, &$form_state) {
  $node = $form['#node'];
  if (_book_node_is_removable($node)) {
    menu_link_delete($node->book['mlid']);
    db_delete('book')
      ->condition('nid', $node->nid)
      ->execute();
    backdrop_set_message(t('The post has been removed from the book.'));
  }
  $form_state['redirect'] = 'node/' . $node->nid;
}