You are here

function backup_migrate_source_db::backup_settings_form in Backup and Migrate 8.3

Same name and namespace in other branches
  1. 6.3 includes/sources.db.inc \backup_migrate_source_db::backup_settings_form()
  2. 7.3 includes/sources.db.inc \backup_migrate_source_db::backup_settings_form()

Get the form for the backup settings for this destination.

Overrides backup_migrate_location::backup_settings_form

File

includes/sources.db.inc, line 113
Functions to handle the direct to database destination.

Class

backup_migrate_source_db
A destination type for saving to a database server.

Code

function backup_settings_form($settings) {
  $objects = $this
    ->get_object_names();
  $form['#description'] = t("You may omit specific tables, or specific table data from the backup file. Only omit data that you know you will not need such as cache data, or tables from other applications. Excluding tables can break your Drupal install, so <strong>do not change these settings unless you know what you're doing</strong>.");
  $form['exclude_tables'] = array(
    "#type" => "select",
    "#multiple" => TRUE,
    "#title" => t("Exclude the following tables altogether"),
    "#options" => $objects,
    "#default_value" => $settings['exclude_tables'],
    "#description" => t("The selected tables will not be added to the backup file."),
  );
  $form['nodata_tables'] = array(
    "#type" => "select",
    "#multiple" => TRUE,
    "#title" => t("Exclude the data from the following tables"),
    "#options" => $objects,
    "#default_value" => $settings['nodata_tables'],
    "#description" => t("The selected tables will have their structure backed up but not their contents. This is useful for excluding cache data to reduce file size."),
  );
  $form['utils_lock_tables'] = array(
    '#type' => 'checkbox',
    '#title' => t('Lock tables during backup'),
    '#default_value' => !empty($settings['utils_lock_tables']) ? $settings['utils_lock_tables'] : NULL,
    '#description' => t('This can help reduce data corruption, but will make your site unresponsive.'),
  );
  return $form;
}