You are here

function _backup_migrate_get_destination_pulldown in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/destinations.inc \_backup_migrate_get_destination_pulldown()
  2. 7.3 includes/destinations.inc \_backup_migrate_get_destination_pulldown()

Get pulldown to select existing source options.

4 calls to _backup_migrate_get_destination_pulldown()
backup_migrate_schedule::edit_form in includes/schedules.inc
Get the edit form.
backup_migrate_ui_manual_backup_form in ./backup_migrate.module
The backup/export form.
backup_migrate_ui_manual_quick_backup_form in ./backup_migrate.module
The quick backup form.
backup_migrate_ui_schedule_form in ./backup_migrate.module
The quick schedule form.

File

includes/destinations.inc, line 500

Code

function _backup_migrate_get_destination_pulldown($op, $destination_id = NULL, $copy_destination_id = NULL) {
  drupal_add_js(drupal_get_path('module', 'backup_migrate') . '/backup_migrate.js');
  $destinations = _backup_migrate_get_destination_form_item_options($op);
  $form = array(
    '#element_validate' => array(
      '_backup_migrate_destination_pulldown_validate',
    ),
    '#after_build' => array(
      '_backup_migrate_process_destination_pulldown',
    ),
  );
  $form['destination_id'] = array(
    '#type' => 'select',
    '#title' => t('Backup Destination'),
    '#options' => $destinations,
    '#default_value' => $destination_id,
  );
  if (user_access('administer backup and migrate')) {
    $form['destination_id']['#description'] = l(t("Create new destination"), BACKUP_MIGRATE_MENU_PATH . "/destination/add");
  }
  $form['copy'] = array(
    '#type' => 'checkbox',
    '#title' => '<span class="backup-migrate-destination-copy-label">' . t('Save a copy to a second destination') . '</span>',
    '#default_value' => !empty($copy_destination_id),
  );
  $form['copy_destination'] = array(
    '#type' => 'backup_migrate_dependent',
    '#dependencies' => array(
      'copy' => TRUE,
    ),
  );
  $form['copy_destination']['copy_destination_id'] = array(
    '#type' => 'select',
    '#title' => t('Second Backup Destination'),
    '#options' => $destinations,
    '#default_value' => $copy_destination_id,
  );
  return $form;
}