node_type_delete_confirm
modules/node/content_types.inc, строка 382
- Версии
- 5
node_type_delete_confirm($type)
- 6
node_type_delete_confirm(&$form_state, $type)
Menu callback; delete a single content type.
Код
<?php
function node_type_delete_confirm($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_num_rows(db_query("SELECT * FROM {node} WHERE type = '%s'", $type->type));
if ($num_nodes) {
$caption .= '<p>'. strtr(format_plural($num_nodes, '<strong>Warning:</strong> there is currently @count %type post on your site. It may not be able to be displayed or edited correctly, once you have removed this content type.', '<strong>Warning:</strong> there are currently @count %type posts on your site. They may not be able to be displayed or edited correctly, once you have removed this content type.'), array('%type' => theme('placeholder', $type->name))) .'</p>';
}
$caption .= '<p>'. t('This action cannot be undone.') .'</p>';
return confirm_form($form, $message, 'admin/content/types', $caption, t('Delete'));
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии