- Patch #456722 by akahn: use format_plural() on node delete.
parent
b166ca9b3c
commit
de97864969
|
|
@ -634,10 +634,13 @@ function node_multiple_delete_confirm(&$form_state, $nodes) {
|
||||||
}
|
}
|
||||||
$form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
|
$form['operation'] = array('#type' => 'hidden', '#value' => 'delete');
|
||||||
$form['#submit'][] = 'node_multiple_delete_confirm_submit';
|
$form['#submit'][] = 'node_multiple_delete_confirm_submit';
|
||||||
return confirm_form($form,
|
$confirm_question = format_plural(count($nodes),
|
||||||
t('Are you sure you want to delete these items?'),
|
'Are you sure you want to delete this item?',
|
||||||
'admin/content/node', t('This action cannot be undone.'),
|
'Are you sure you want to delete these items?');
|
||||||
t('Delete all'), t('Cancel'));
|
return confirm_form($form,
|
||||||
|
$confirm_question,
|
||||||
|
'admin/content/node', t('This action cannot be undone.'),
|
||||||
|
t('Delete'), t('Cancel'));
|
||||||
}
|
}
|
||||||
|
|
||||||
function node_multiple_delete_confirm_submit($form, &$form_state) {
|
function node_multiple_delete_confirm_submit($form, &$form_state) {
|
||||||
|
|
@ -645,7 +648,10 @@ function node_multiple_delete_confirm_submit($form, &$form_state) {
|
||||||
foreach ($form_state['values']['nodes'] as $nid => $value) {
|
foreach ($form_state['values']['nodes'] as $nid => $value) {
|
||||||
node_delete($nid);
|
node_delete($nid);
|
||||||
}
|
}
|
||||||
drupal_set_message(t('The items have been deleted.'));
|
$message = format_plural(count($form_state['values']['nodes']),
|
||||||
|
'The item has been deleted.',
|
||||||
|
'The items have been deleted.');
|
||||||
|
drupal_set_message($message);
|
||||||
}
|
}
|
||||||
$form_state['redirect'] = 'admin/content/node';
|
$form_state['redirect'] = 'admin/content/node';
|
||||||
return;
|
return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue