summaryrefslogtreecommitdiff
path: root/modules/filter/filter.admin.inc
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-09-18 02:18:35 +0000
committerDries Buytaert <dries@buytaert.net>2010-09-18 02:18:35 +0000
commit35e7c83ddb11302098d49979f5fb35c19673bda1 (patch)
tree765169c9dda1233e7f9abc968272c78651023744 /modules/filter/filter.admin.inc
parentf94b014ca73a4e77bc7f31b8cf3adabb9c23bf7a (diff)
downloadbrdo-35e7c83ddb11302098d49979f5fb35c19673bda1.tar.gz
brdo-35e7c83ddb11302098d49979f5fb35c19673bda1.tar.bz2
- Patch #914458 by Damien Tournoud, chx: remove the format delete reassignment 'feature'.
Diffstat (limited to 'modules/filter/filter.admin.inc')
-rw-r--r--modules/filter/filter.admin.inc38
1 files changed, 12 insertions, 26 deletions
diff --git a/modules/filter/filter.admin.inc b/modules/filter/filter.admin.inc
index 008b2391e..9464f98d0 100644
--- a/modules/filter/filter.admin.inc
+++ b/modules/filter/filter.admin.inc
@@ -20,7 +20,7 @@ function filter_admin_overview($form) {
$form['#tree'] = TRUE;
foreach ($formats as $id => $format) {
// Check whether this is the fallback text format. This format is available
- // to all roles and cannot be deleted via the admin interface.
+ // to all roles and cannot be disabled via the admin interface.
$form['formats'][$id]['#is_fallback'] = ($id == $fallback_format);
if ($form['formats'][$id]['#is_fallback']) {
$form['formats'][$id]['name'] = array('#markup' => drupal_placeholder($format->name));
@@ -33,7 +33,7 @@ function filter_admin_overview($form) {
}
$form['formats'][$id]['roles'] = array('#markup' => $roles_markup);
$form['formats'][$id]['configure'] = array('#type' => 'link', '#title' => t('configure'), '#href' => 'admin/config/content/formats/' . $id);
- $form['formats'][$id]['delete'] = array('#type' => 'link', '#title' => t('delete'), '#href' => 'admin/config/content/formats/' . $id . '/delete', '#access' => !$form['formats'][$id]['#is_fallback']);
+ $form['formats'][$id]['disable'] = array('#type' => 'link', '#title' => t('disable'), '#href' => 'admin/config/content/formats/' . $id . '/disable', '#access' => !$form['formats'][$id]['#is_fallback']);
$form['formats'][$id]['weight'] = array('#type' => 'weight', '#default_value' => $format->weight);
}
$form['actions'] = array('#type' => 'actions');
@@ -76,7 +76,7 @@ function theme_filter_admin_overview($variables) {
drupal_render($form['formats'][$id]['roles']),
drupal_render($form['formats'][$id]['weight']),
drupal_render($form['formats'][$id]['configure']),
- drupal_render($form['formats'][$id]['delete']),
+ drupal_render($form['formats'][$id]['disable']),
),
'class' => array('draggable'),
);
@@ -317,40 +317,26 @@ function filter_admin_format_form_submit($form, &$form_state) {
* Menu callback; confirm deletion of a format.
*
* @ingroup forms
- * @see filter_admin_delete_submit()
+ * @see filter_admin_disable_submit()
*/
-function filter_admin_delete($form, &$form_state, $format) {
+function filter_admin_disable($form, &$form_state, $format) {
$form['#format'] = $format;
- $fallback_options = array();
- foreach (filter_formats() as $id => $fallback_format) {
- if ($id != $format->format) {
- $fallback_options[$id] = $fallback_format->name;
- }
- }
- $form['fallback'] = array(
- '#type' => 'select',
- '#title' => t('Replacement text format'),
- '#options' => $fallback_options,
- '#default_value' => filter_fallback_format(),
- '#description' => t('Content assigned to the deleted text format will be reassigned to the chosen one.'),
- );
-
return confirm_form($form,
- t('Are you sure you want to delete the text format %format?', array('%format' => $format->name)),
+ t('Are you sure you want to disable the text format %format?', array('%format' => $format->name)),
'admin/config/content/formats',
- NULL,
- t('Delete')
+ t('This action cannot be undone.'),
+ t('Disable')
);
}
/**
- * Process filter delete form submission.
+ * Process filter disable form submission.
*/
-function filter_admin_delete_submit($form, &$form_state) {
+function filter_admin_disable_submit($form, &$form_state) {
$format = $form['#format'];
- filter_format_delete($format, $form_state['values']['fallback']);
- drupal_set_message(t('Deleted text format %format.', array('%format' => $format->name)));
+ filter_format_disable($format);
+ drupal_set_message(t('Disabled text format %format.', array('%format' => $format->name)));
$form_state['redirect'] = 'admin/config/content/formats';
}