protected function FileTransferAuthorizeForm::addConnectionSettings in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/FileTransfer/Form/FileTransferAuthorizeForm.php \Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm::addConnectionSettings()
Generates the Form API array for a given connection backend's settings.
Parameters
string $backend: The name of the backend (e.g. 'ftp', 'ssh', etc).
Return value
array Form API array of connection settings for the given backend.
See also
hook_filetransfer_backends()
1 call to FileTransferAuthorizeForm::addConnectionSettings()
- FileTransferAuthorizeForm::buildForm in core/
lib/ Drupal/ Core/ FileTransfer/ Form/ FileTransferAuthorizeForm.php - Form constructor.
File
- core/
lib/ Drupal/ Core/ FileTransfer/ Form/ FileTransferAuthorizeForm.php, line 287 - Contains \Drupal\Core\FileTransfer\Form\FileTransferAuthorizeForm.
Class
- FileTransferAuthorizeForm
- Provides the file transfer authorization form.
Namespace
Drupal\Core\FileTransfer\FormCode
protected function addConnectionSettings($backend) {
$auth_connection_config = $this
->config('system.authorize')
->get('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 = $this
->getFiletransfer($backend);
if ($filetransfer) {
$form = $filetransfer
->getSettingsForm();
}
// Fill in the defaults based on the saved settings, if any.
$this
->setConnectionSettingsDefaults($form, NULL, $defaults);
return $form;
}