Index: demo_profile.profile
===================================================================
RCS file: /cvs/drupal-contrib/contributions/profiles/demo_profile/demo_profile.profile,v
retrieving revision 1.5
diff -u -p -r1.5 demo_profile.profile
--- demo_profile.profile	12 Nov 2009 23:32:44 -0000	1.5
+++ demo_profile.profile	4 Sep 2010 02:28:32 -0000
@@ -46,9 +46,30 @@ function demo_profile_install_tasks_alte
 function demo_profile_form($form, &$form_state, &$install_state) {
   drupal_set_title(st('Choose snapshot'));
 
-  // Display the available database dumps.
-  module_load_include('inc', 'demo', 'demo.admin');
-  $fileconfig = demo_get_fileconfig();
+  // @todo
+  drupal_static_reset('file_get_stream_wrappers');
+  $GLOBALS['conf']['file_private_path'] = 'sites/default/private/files';
+
+  $form['file_private_path'] = array(
+    '#type' => 'textfield',
+    '#title' => t('Private file system path'),
+    '#default_value' => variable_get('file_private_path', ''),
+    '#maxlength' => 255,
+    '#description' => t('A local file system path where private files will be stored. This directory must exist and be writable by Drupal. This directory should not be accessible over the web.'),
+    '#after_build' => array('system_check_directory'),
+  );
+  foreach(file_get_stream_wrappers(STREAM_WRAPPERS_WRITE_VISIBLE) as $scheme => $info) {
+    $options[$scheme] = check_plain($info['description']);
+  }
+  $form['file_default_scheme'] = array(
+    '#type' => 'radios',
+    '#title' => t('Default download method'),
+    '#default_value' => isset($options['private']) ? 'private' : key($options),
+    '#options' => $options,
+    // @todo
+    '#value' => 'private',
+    '#disabled' => TRUE,
+  );
 
   $form['demo'] = array(
     '#type' => 'fieldset',
@@ -57,7 +78,7 @@ function demo_profile_form($form, &$form
   $form['demo']['demo_dump_path'] = array(
     '#type' => 'textfield',
     '#title' => t('Dump path'),
-    '#default_value' => $fileconfig['path'],
+    '#default_value' => variable_get('demo_dump_path', 'demo'),
     '#description' => t('The path where the database dumps can be found.'),
     // @todo Not implemented yet (move into separate step).
     '#disabled' => TRUE,
@@ -65,11 +86,14 @@ function demo_profile_form($form, &$form
   // @todo Validate the given path to dumps.
   // $form['#validate'][] = 'demo_admin_settings_validate';
 
+  $options['#attributes']['class'][] = 'demo-snapshots-widget';
   $form['dump'] = array(
     '#type' => 'fieldset',
     '#title' => t('Snapshot'),
     '#description' => t('Which snapshot would you like to restore?'),
   );
+  // Display the available database dumps.
+  module_load_include('inc', 'demo', 'demo.admin');
   $form['dump'] += demo_profile_get_dumps();
 
   $form['submit'] = array('#type' => 'submit', '#value' => t('Restore'));
@@ -120,6 +144,10 @@ function demo_profile_get_dumps() {
     '#required' => TRUE,
     '#title' => t('Snapshot'),
   );
+
+  $options['#attributes']['class'][] = 'demo-snapshots-widget';
+  $options['#attached']['js'][] = drupal_get_path('module', 'demo') . '/demo.admin.js';
+
   foreach ($files as $filename => $file) {
     // Build basic file info
     $files[$filename] = (array) $file;
@@ -135,7 +163,6 @@ function demo_profile_get_dumps() {
       '#return_value' => $info['filename'],
       '#file' => $file,
       '#info' => $info,
-      '#attributes' => array('onclick' => "jQuery('.description', this.parentNode.parentNode).slideToggle();"),
     );
     if (!empty($info['description'])) {
       $option['#description'] .= '<p>' . $info['description'] . '</p>';
@@ -143,7 +170,7 @@ function demo_profile_get_dumps() {
 
     if (count($info['modules']) > 1) {
       // Remove required core modules and obvious modules from module list.
-      $info['modules'] = array_diff($info['modules'], array('filter', 'node', 'system', 'user', 'watchdog', 'demo'));
+      $info['modules'] = array_diff($info['modules'], array('filter', 'node', 'system', 'user', 'demo'));
       // Sort module list alphabetically.
       sort($info['modules']);
       $option['#description'] .= t('Modules: ') . implode(', ', $info['modules']);
@@ -152,9 +179,6 @@ function demo_profile_get_dumps() {
     $options[$info['filename']] = $option;
   }
 
-  // Attach stylesheet to initially hide descriptions
-  drupal_add_js("jQuery('div.form-item div.description', jQuery('form')).hide();", array('type' => 'inline', 'scope' => 'footer'));
-
   return $options;
 }
 
