You are here

function backup_migrate_ui_manual_backup_form_submit in Backup and Migrate 8.2

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

Submit the form. Save the values as defaults if desired and output the backup file.

1 string reference to 'backup_migrate_ui_manual_backup_form_submit'
backup_migrate_ui_manual_backup_form in ./backup_migrate.module
The backup/export form.

File

./backup_migrate.module, line 532
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_submit($form, &$form_state) {

  // Save the settings profile if the save box is checked.
  //  $form_state['values']['nodata_tables'] = array_filter((array)$form_state['values']['nodata_tables']);
  //  $form_state['values']['exclude_tables'] = array_filter((array)$form_state['values']['exclude_tables']);
  $profile = backup_migrate_crud_create_item('profile', $form_state['values']);

  // Save the settings profile if the save box is checked.
  if ($form_state['values']['save_settings'] && user_access('administer backup and migrate')) {
    if (@$form_state['values']['create_new']) {

      // Reset the id and storage so a new item will be saved.
      $profile
        ->set_id(NULL);
      $profile->storage = BACKUP_MIGRATE_STORAGE_NONE;
    }
    $profile
      ->save();
    variable_set("backup_migrate_profile_id", $profile
      ->get_id());
    variable_set("backup_migrate_destination_id", $form_state['values']['destination_id']);
  }

  // Perform the actual backup if that is what was selected.
  if ($form_state['values']['op'] == t('Backup now') && user_access('perform backup')) {
    backup_migrate_ui_manual_backup_perform($profile);
  }
  $form_state['redirect'] = BACKUP_MIGRATE_MENU_PATH . "/export/advanced";
}