You are here

function backup_migrate_ui_manual_backup_form in Backup and Migrate 5.2

Same name and namespace in other branches
  1. 8.2 backup_migrate.module \backup_migrate_ui_manual_backup_form()
  2. 8.3 backup_migrate.module \backup_migrate_ui_manual_backup_form()
  3. 6.3 backup_migrate.module \backup_migrate_ui_manual_backup_form()
  4. 6.2 backup_migrate.module \backup_migrate_ui_manual_backup_form()
  5. 7.3 backup_migrate.module \backup_migrate_ui_manual_backup_form()
  6. 7.2 backup_migrate.module \backup_migrate_ui_manual_backup_form()

The backup/export form.

1 string reference to 'backup_migrate_ui_manual_backup_form'
backup_migrate_ui_manual_backup in ./backup_migrate.module
The menu call back for manual backups.

File

./backup_migrate.module, line 377
Create (manually or scheduled) and restore backups of your Drupal MySQL database with an option to exclude table data (e.g. cache_*)

Code

function backup_migrate_ui_manual_backup_form($profile = array()) {
  drupal_add_js(drupal_get_path('module', 'backup_migrate') . '/backup_migrate.js');
  $form = array();
  $form += _backup_migrate_ui_backup_settings_form($profile);
  $form['profile_id'] = array(
    "#type" => "value",
    '#default_value' => $profile['profile_id'],
  );
  $form['destination'] = array(
    "#type" => "fieldset",
    "#title" => t("Backup Destination"),
    "#collapsible" => TRUE,
    "#collapsed" => FALSE,
    "#tree" => FALSE,
    "#description" => t("Choose where the backup file will be saved. Backup files contain sensitive data, so be careful where you save them. Select 'Download' to download the file to your desktop."),
  );
  $form['destination']['destination_id'] = array(
    "#type" => "select",
    "#title" => t("Destination"),
    "#options" => _backup_migrate_get_destination_form_item_options('manual backup'),
    "#default_value" => variable_get("backup_migrate_destination_id", "download"),
  );
  $form['destination']['destination_id']['#description'] .= ' ' . l(t("Create new destination..."), "admin/content/backup_migrate/destination/add");
  $form['save_settings'] = array(
    "#type" => "checkbox",
    "#title" => t('Save these settings.'),
    "#default_value" => FALSE,
  );
  $form['save_options'] = array(
    '#prefix' => '<div class="backup-migrate-save-options">',
    '#suffix' => '</div>',
  );
  $name = array(
    '#default_value' => $profile['name'],
    '#type' => 'textfield',
    '#title' => t('Save the settings as'),
  );
  if ($profile['profile_id']) {
    $form['save_options']['create_new'] = array(
      '#default_value' => $profile['name'],
      '#type' => 'radios',
      '#default_value' => 0,
      '#options' => array(
        0 => t("Replace the '%profile' profile", array(
          '%profile' => $profile['name'],
        )),
        1 => t('Create new profile'),
      ),
    );
    $name["#title"] = t('Profile name');
    $name["#description"] = t("This will be the name of your new profile if you select 'Create new profile' otherwise will replace the name of the '%profile' profile.", array(
      '%profile' => $profile['name'],
    ));
  }
  else {
    $name["#title"] = t('Save the settings as');
    $name["#description"] = t('Pick a name for the settings. Your settings will be saved as a profile and will appear in the <a href="!url">Profiles Tab</a>.', array(
      '!url' => url('admin/content/backup_migrate/profile'),
    ));
  }
  $form['save_options']['name'] = $name;
  $form[] = array(
    '#type' => 'submit',
    '#value' => t('Backup Database'),
  );
  return $form;
}