You are here

function book_remove_form in Drupal 7

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

Form constructor to confirm removal of a node from a book.

Parameters

$node: The node to delete.

See also

book_remove_form_submit()

Related topics

1 string reference to 'book_remove_form'
book_menu in modules/book/book.module
Implements hook_menu().

File

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

Code

function book_remove_form($form, &$form_state, $node) {
  $form['#node'] = $node;
  $title = array(
    '%title' => $node->title,
  );
  if ($node->book['has_children']) {
    $description = t('%title has associated child pages, which will be relocated automatically to maintain their connection to the book. To recreate the hierarchy (as it was before removing this page), %title may be added again using the Outline tab, and each of its former child pages will need to be relocated manually.', $title);
  }
  else {
    $description = t('%title may be added to hierarchy again using the Outline tab.', $title);
  }
  return confirm_form($form, t('Are you sure you want to remove %title from the book hierarchy?', $title), 'node/' . $node->nid, $description, t('Remove'));
}