backup_migrate_ui_manual_backup_form_submit

  1. drupal
    1. 6 backup_migrate.module function
    2. 7 backup_migrate.module function
Drupal 7 backup_migrate_ui_manual_backup_form_submit($form, &$form_state)

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'

File

sites/all/modules/backup_migrate/backup_migrate.module, line 536
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";
}