From 31933f09ff42e90d49dc591737224a39afce13ff Mon Sep 17 00:00:00 2001 From: robertgarrigos Date: Tue, 29 Aug 2023 11:09:50 +0200 Subject: [PATCH 1/2] Fixes #21: add better descrition when creating a new snapshot --- demo.admin.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/demo.admin.inc b/demo.admin.inc index 94c4689..adf2256 100644 --- a/demo.admin.inc +++ b/demo.admin.inc @@ -135,7 +135,7 @@ function demo_dump_form($form, &$form_state) { '#autocomplete_path' => 'demo/autocomplete', '#required' => TRUE, '#maxlength' => 128, - '#description' => t('Allowed characters: a-z, 0-9, dashes ("-"), underscores ("_") and dots.'), + '#description' => t('Suggested names are existing snapshots. Use the same name of an existing snapshot to replace it, otherwise you will be creating a new one. Allowed characters: a-z, 0-9, dashes ("-"), underscores ("_") and dots.'), ); $form['dump']['description'] = array( '#title' => t('Description'), @@ -156,12 +156,13 @@ function demo_dump_form($form, &$form_state) { ); } else { + $description = '
' . t('A snapshot with the same name already exists and will be replaced. This action cannot be undone.') . '
'; $form = confirm_form($form, t('Are you sure you want to replace the existing %name snapshot?', array( '%name' => $form_state['values']['dump']['filename'], )), 'admin/structure/demo', - t('A snapshot with the same name already exists and will be replaced. This action cannot be undone.') + $description ); } return $form; From 3b1823eba78c065a87fb9c9b3944845208e9a390 Mon Sep 17 00:00:00 2001 From: robertgarrigos Date: Tue, 29 Aug 2023 17:44:41 +0200 Subject: [PATCH 2/2] Alternate description --- demo.admin.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo.admin.inc b/demo.admin.inc index adf2256..a8aa608 100644 --- a/demo.admin.inc +++ b/demo.admin.inc @@ -135,7 +135,7 @@ function demo_dump_form($form, &$form_state) { '#autocomplete_path' => 'demo/autocomplete', '#required' => TRUE, '#maxlength' => 128, - '#description' => t('Suggested names are existing snapshots. Use the same name of an existing snapshot to replace it, otherwise you will be creating a new one. Allowed characters: a-z, 0-9, dashes ("-"), underscores ("_") and dots.'), + '#description' => t('Use a new name to create a new snapshot or the name of an existing snapshot to replace it. Allowed characters: a-z, 0-9, dashes ("-"), underscores ("_") and dots.'), ); $form['dump']['description'] = array( '#title' => t('Description'),