Drupal 7, , Drupal 6. , , , Drupal 7.
"", node , , , , , node. .
, :

:
<?php
function sk_form_node_delete_confirm_alter(&$form, $form_state) {
if(empty($form['nid']['#value'])) {
return;
}
$node = node_load($form['nid']['#value']);
if(empty($node->nid)) {
return;
}
$children_nids = sk_get_all_menu_node_children_ids('node/' . $node->nid);
$children_count = count($children_nids);
if(!empty($children_nids)) {
$msg = '';
$t1 = '';
$t1 .= '%title is part of a menu and has %count child menu items. ';
$t1 .= 'If you delete it, the URL paths of its children will no longer work.';
$msg .= '<p>';
$msg .= t($t1, array('%title' => $node->title, '%count' => $children_count));
$msg .= '</p>';
$t2 = 'Please check the %count child menu items below and delete them first.';
$msg .= '<p>';
$msg .= t($t2, array('%count' => $children_count));
$msg .= '</p>';
$msg .= '<ol>';
$children_nodes = node_load_multiple($children_nids);
if(!empty($children_nodes)) {
foreach($children_nodes as $child_node) {
if(!empty($child_node->nid)) {
$msg .= '<li>';
$msg .= '<a href="' . url('node/' . $child_node->nid) . '">';
$msg .= $child_node->title;
$msg .= '</a>';
$msg .= '</li>';
}
}
}
$msg .= '</ol>';
$form['sk_children_exist_warning'] = array(
'#markup' => $msg,
'#weight' => -10,
);
unset($form['description']);
unset($form['actions']['submit']);
}
}
node Drupal 7. , , , , / , .
.