You are here

function book_remove_form_submit in Drupal 7

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

Form submission handler for book_remove_form().

File

modules/book/book.pages.inc, line 237
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();
    drupal_set_message(t('The post has been removed from the book.'));
  }
  $form_state['redirect'] = 'node/' . $node->nid;
}