You are here

function backup_migrate_ui_schedule_form_submit in Backup and Migrate 8.3

Same name and namespace in other branches
  1. 6.3 backup_migrate.module \backup_migrate_ui_schedule_form_submit()
  2. 7.3 backup_migrate.module \backup_migrate_ui_schedule_form_submit()

Submit the quick schedule form.

File

./backup_migrate.module, line 697
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_schedule_form_submit($form, &$form_state) {
  backup_migrate_include('schedules');
  if (user_access('adminsiter backup and migrate')) {

    // Override the backups.
    foreach ($form_state['values']['quickschedule'] as $key => $values) {
      $id = $values['id'];
      if ($schedule = backup_migrate_get_schedule($id)) {
        $schedule
          ->from_array($values);
        $schedule
          ->save();
      }
    }
    drupal_set_message(t('Your schedules have been saved'));
  }
}