You are here

function backup_migrate_ui_destination_configure_form in Backup and Migrate 5.2

Get a form to configure the destination.

2 string references to 'backup_migrate_ui_destination_configure_form'
backup_migrate_ui_destination_configure in includes/destinations.inc
Get a form to configure the destination.
backup_migrate_ui_destination_create in includes/destinations.inc
Get a form to create a destination, or links for the available types.

File

includes/destinations.inc, line 442
All of the destination handling code needed for Backup and Migrate.

Code

function backup_migrate_ui_destination_configure_form($destination) {
  if ($destination) {
    $form = array();
    $form['type'] = array(
      "#type" => "value",
      '#default_value' => $destination['type'],
    );
    $form['destination_id'] = array(
      "#type" => "value",
      "#default_value" => $destination['destination_id'],
    );
    $form['name'] = array(
      "#type" => "textfield",
      "#title" => t("Destination name"),
      "#default_value" => $destination['name'],
      "#required" => TRUE,
    );
    $form['submit'] = array(
      "#type" => 'submit',
      "#weight" => 99,
      "#value" => t('Save Backup Destination'),
    );

    // Include the necessary file if specified by the download type.
    if (!empty($destination['file'])) {
      require_once './' . $destination['file'];
    }

    // Call the specified load callback.
    if (!empty($destination['conf_callback'])) {
      $form = $destination['conf_callback']($destination, $form);
    }
    return $form;
  }
  return array();
}