You are here

function nodejs_settings in Node.js integration 6

Same name and namespace in other branches
  1. 7 nodejs.admin.inc \nodejs_settings()

Form builder function for module settings.

1 string reference to 'nodejs_settings'
nodejs_menu in ./nodejs.module
Implements hook_menu().

File

./nodejs.admin.inc, line 10
Admin page callbacks for the Node.js module.

Code

function nodejs_settings() {
  $form['server'] = array(
    '#type' => 'fieldset',
    '#title' => t('Node.js server'),
  );
  $form['server']['nodejs_server_scheme'] = array(
    '#type' => 'radios',
    '#title' => t('Protocol used by Node.js server'),
    '#default_value' => variable_get('nodejs_server_scheme', 'http'),
    '#options' => array(
      'http' => t('http'),
      'https' => t('https'),
    ),
    '#description' => t('The protocol used to communicate with the Node.js server.'),
  );
  $form['server']['nodejs_server_host'] = array(
    '#type' => 'textfield',
    '#title' => t('Node.js server host'),
    '#default_value' => variable_get('nodejs_server_host', 'localhost'),
    '#size' => 40,
    '#required' => TRUE,
    '#description' => t('The hostname of the Node.js server.'),
  );
  $form['server']['nodejs_server_port'] = array(
    '#type' => 'textfield',
    '#title' => t('Node.js server port'),
    '#default_value' => variable_get('nodejs_server_port', '8080'),
    '#size' => 10,
    '#required' => TRUE,
    '#description' => t('The port of the Node.js server.'),
  );
  return system_settings_form($form);
}