FileTransfer::getSettingsForm

public function FileTransfer::getSettingsForm

public FileTransfer::getSettingsForm()

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.

File

includes/filetransfer/filetransfer.inc, line 329

Class

FileTransfer

Code

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!filetransfer!filetransfer.inc/function/FileTransfer::getSettingsForm/7.x

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部