function book_form_node_delete_confirm_alter

Implements hook_form_FORM_ID_alter() for node_delete_confirm().

Alters the confirm form for a single node deletion.

See also

node_delete_confirm()

File

modules/book/book.module, line 1040

Code

function book_form_node_delete_confirm_alter(&$form, $form_state) {
    $node = node_load($form['nid']['#value']);
    if (isset($node->book) && $node->book['has_children']) {
        $form['book_warning'] = array(
            '#markup' => '<p>' . t('%title is part of a book outline, and has associated child pages. If you proceed with deletion, the child pages will be relocated automatically.', array(
                '%title' => $node->title,
            )) . '</p>',
            '#weight' => -10,
        );
    }
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.