On this page
function book_form_node_delete_confirm_alter
book_form_node_delete_confirm_alter(&$form, $form_state)
Implements hook_form_FORM_ID_alter() for node_delete_confirm().
Alters the confirm form for a single node deletion.
See also
File
- modules/book/book.module, line 1037
- Allows users to create and organize related content in an outline.
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,
);
}
}
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!book!book.module/function/book_form_node_delete_confirm_alter/7.x