node_type_delete_confirm
function node_type_delete_confirm
node_type_delete_confirm($form, &$form_state, $type)
Menu callback; delete a single content type.
Related topics
File
- modules/node/content_types.inc, line 415
- Content type editing user interface.
Code
function node_type_delete_confirm($form, &$form_state, $type) { $form['type'] = array('#type' => 'value', '#value' => $type->type); $form['name'] = array('#type' => 'value', '#value' => $type->name); $message = t('Are you sure you want to delete the content type %type?', array('%type' => $type->name)); $caption = ''; $num_nodes = db_query("SELECT COUNT(*) FROM {node} WHERE type = :type", array(':type' => $type->type))->fetchField(); if ($num_nodes) { $caption .= '<p>' . format_plural($num_nodes, '%type is used by 1 piece of content on your site. If you remove this content type, you will not be able to edit the %type content and it may not display correctly.', '%type is used by @count pieces of content on your site. If you remove %type, you will not be able to edit the %type content and it may not display correctly.', array('%type' => $type->name)) . '</p>'; } $caption .= '<p>' . t('This action cannot be undone.') . '</p>'; return confirm_form($form, $message, 'admin/structure/types', $caption, t('Delete')); }
© 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!node!content_types.inc/function/node_type_delete_confirm/7.x