| Versionen | |
|---|---|
| drupal6 – drupal7 | filter_admin_delete() |
Menu callback; confirm deletion of a format.
modules/
<?php
function filter_admin_delete() {
$format = arg(4);
$format = db_query('SELECT * FROM {filter_format} WHERE format = :format', array(':format' => $format))->fetchObject();
if ($format) {
if ($format->format != variable_get('filter_default_format', 1)) {
$form['format'] = array('#type' => 'hidden', '#value' => $format->format);
$form['name'] = array('#type' => 'hidden', '#value' => $format->name);
return confirm_form($form, t('Are you sure you want to delete the text format %format?', array('%format' => $format->name)), 'admin/settings/filter', t('If you have any content left in this text format, it will be switched to the default text format. This action cannot be undone.'), t('Delete'), t('Cancel'));
}
else {
drupal_set_message(t('The default format cannot be deleted.'));
drupal_goto('admin/settings/filter');
}
}
else {
drupal_not_found();
}
}
?>
Kommentare
Kommentar hinzufügen