You are here

function backup_migrate_location_remote::edit_form in Backup and Migrate 6.3

Same name and namespace in other branches
  1. 8.3 includes/locations.inc \backup_migrate_location_remote::edit_form()
  2. 7.3 includes/locations.inc \backup_migrate_location_remote::edit_form()

location configuration callback.

Overrides backup_migrate_location::edit_form

File

includes/locations.inc, line 486

Class

backup_migrate_location_remote
A base class for creating locations.

Code

function edit_form() {
  $form = parent::edit_form();
  $form['scheme'] = array(
    "#type" => "select",
    "#title" => t("Scheme"),
    "#default_value" => @$this->dest_url['scheme'] ? $this->dest_url['scheme'] : 'mysql',
    "#required" => TRUE,
    "#options" => array(
      $GLOBALS['db_type'] => $GLOBALS['db_type'],
    ),
    "#weight" => 0,
  );
  $form['host'] = array(
    "#type" => "textfield",
    "#title" => t("Host"),
    "#default_value" => @$this->dest_url['host'] ? $this->dest_url['host'] : 'localhost',
    "#required" => TRUE,
    "#weight" => 10,
  );
  $form['path'] = array(
    "#type" => "textfield",
    "#title" => t("Path"),
    "#default_value" => @$this->dest_url['path'],
    "#required" => TRUE,
    "#weight" => 20,
  );
  $form['user'] = array(
    "#type" => "textfield",
    "#title" => t("Username"),
    "#default_value" => @$this->dest_url['user'],
    "#required" => TRUE,
    "#weight" => 30,
  );
  $form['pass'] = array(
    "#type" => "password",
    "#title" => t("Password"),
    "#default_value" => @$this->dest_url['pass'],
    '#description' => '',
    "#weight" => 40,
  );
  if (@$this->dest_url['pass']) {
    $form['old_password'] = array(
      "#type" => "value",
      "#value" => @$this->dest_url['pass'],
    );
    $form['pass']["#description"] .= t(' You do not need to enter a password unless you wish to change the currently saved password.');
  }
  return $form;
}