1 authorize.inc _authorize_filetransfer_connection_settings($backend)

Generates the Form API array for a given connection backend's settings.

Parameters

$backend: The name of the backend (e.g. 'ftp', 'ssh', etc).

Return value

Form API array of connection settings for the given backend.:

See also

hook_filetransfer_backends()

File

core/includes/authorize.inc, line 140
Helper functions and form handlers used for the authorize.php script.

Code

function _authorize_filetransfer_connection_settings($backend) {
  $auth_connection_config = config_get('system.authorize', 'authorize_filetransfer_connection_settings_' . $backend);
  $defaults = $auth_connection_config ? $auth_connection_config : array();
  $form = array();

  // Create an instance of the file transfer class to get its settings form.
  $filetransfer = authorize_get_filetransfer($backend);
  if ($filetransfer) {
    $form = $filetransfer->getSettingsForm();
  }
  // Fill in the defaults based on the saved settings, if any.
  _authorize_filetransfer_connection_settings_set_defaults($form, NULL, $defaults);
  return $form;
}