diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-01 00:23:36 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-12-01 00:23:36 +0000 |
commit | 9f5cd5395a9bae17fbbacf11da5bb1e90fda82a6 (patch) | |
tree | 0961b4fd416bf22236517894b982bdbe017141db /includes/filetransfer/filetransfer.inc | |
parent | 5c3fdc3ee1635b06a4136e7accc0a7f360840e92 (diff) | |
download | brdo-9f5cd5395a9bae17fbbacf11da5bb1e90fda82a6.tar.gz brdo-9f5cd5395a9bae17fbbacf11da5bb1e90fda82a6.tar.bz2 |
#609772 by dww, JacobSingh, ksenzee: Fixed Impossible to extend the FileTransfer class system in contrib
Diffstat (limited to 'includes/filetransfer/filetransfer.inc')
-rw-r--r-- | includes/filetransfer/filetransfer.inc | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/includes/filetransfer/filetransfer.inc b/includes/filetransfer/filetransfer.inc index a917ff7cd..8d4271760 100644 --- a/includes/filetransfer/filetransfer.inc +++ b/includes/filetransfer/filetransfer.inc @@ -313,6 +313,42 @@ abstract class FileTransfer { $this->chroot = $this->findChroot(); $this->jail = $this->fixRemotePath($this->jail); } + + /** + * Returns a form to collect connection settings credentials. + * + * Implementing classes can either extend this form with fields collecting the + * specific information they need, or override it entirely. + */ + public function getSettingsForm() { + $form['username'] = array( + '#type' => 'textfield', + '#title' => t('Username'), + ); + $form['password'] = array( + '#type' => 'password', + '#title' => t('Password'), + '#description' => t('Your password is not saved in the database and is only used to establish a connection.'), + ); + $form['advanced'] = array( + '#type' => 'fieldset', + '#title' => t('Advanced settings'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + ); + $form['advanced']['hostname'] = array( + '#type' => 'textfield', + '#title' => t('Host'), + '#default_value' => 'localhost', + '#description' => t('The connection will be created between your web server and the machine hosting the web server files. In the vast majority of cases, this will be the same machine, and "localhost" is correct.'), + ); + $form['advanced']['port'] = array( + '#type' => 'textfield', + '#title' => t('Port'), + '#default_value' => NULL, + ); + return $form; + } } /** |