Index: demo.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/demo/demo.admin.inc,v
retrieving revision 1.1.2.19
diff -u -p -r1.1.2.19 demo.admin.inc
--- demo.admin.inc	17 Jan 2010 19:00:10 -0000	1.1.2.19
+++ demo.admin.inc	27 Mar 2010 14:48:55 -0000
@@ -12,6 +12,17 @@
 define('DEMO_DUMP_VERSION', '1.1');
 
 /**
+ * Default SQL dump file name.
+ */
+define ('DEMO_FILE_NAME', 'snapshot');
+
+/**
+ * Default time and date format to be appended to dump file name.
+ */
+define('DEMO_FILE_APPEND_DATE', 'Y-m-d-H:i');
+
+
+/**
  * Form builder for Demo module settings.
  */
 function demo_admin_settings() {
@@ -39,6 +50,19 @@ function demo_admin_settings() {
     '#title' => t('Dump settings'),
   );
 
+  $form['dump']['demo_file_name'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Dump file name'),
+    '#default_value' => variable_get('demo_file_name', DEMO_FILE_NAME),
+    '#description' => t('Enter the dump file name. This file name will be used when creating snapshot.'),
+  );
+
+  $form['dump']['demo_file_append_date'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Append date and time'),
+    '#default_value' => variable_get('demo_file_append_date', DEMO_FILE_APPEND_DATE),
+    '#description' => t('Enter the custom date time format. The output date can have only a-z, 0-9, dashes ("-"), underscores ("_") and dots. See the <a href="!url"> PHP manual </a> for available options. Leave empty if you do not want to append.', array('!url' => 'http://php.net/manual/en/function.date.php')),
+  );
 
   $form['dump']['demo_dump_path'] = array(
     '#type' => 'textfield',
@@ -115,6 +139,10 @@ function demo_delete_confirm_submit($for
  * Form builder to create a new snapshot.
  */
 function demo_dump_form() {
+  $file_name = variable_get('demo_file_name', DEMO_FILE_NAME);
+  $append_time = variable_get('demo_file_append_date', DEMO_FILE_APPEND_DATE);
+  $filename_default_value = !empty($append_time) ?  $file_name . '-' . date($append_time, $_SERVER['REQUEST_TIME']) : $file_name;
+
   $form['dump']['filename'] = array(
     '#title' => t('File name'),
     '#type' => 'textfield',
@@ -122,6 +150,7 @@ function demo_dump_form() {
     '#required' => TRUE,
     '#maxlength' => 128,
     '#description' => t('Enter the snapshot file name without file extension. Allowed characters are a-z, 0-9, dashes ("-"), underscores ("_") and dots.'),
+    '#default_value' => str_replace(array(' ', ',', '+', ':'), '-', drupal_strtolower($filename_default_value)),
   );
   $form['dump']['description'] = array(
     '#title' => t('Description'),
