function sms_test_gateway_config_form in SMS Framework 7
Form builder for configure form.
1 string reference to 'sms_test_gateway_config_form'
- sms_test_gateway_gateway_info in tests/
sms_test_gateway/ sms_test_gateway.module - Implements hook_gateway_info().
File
- tests/
sms_test_gateway/ sms_test_gateway.module, line 91 - A test gateway to be used for testing the sms framework
Code
function sms_test_gateway_config_form($configuration) {
$configuration += array(
'ssl' => false,
'username' => '',
'password' => '',
'method' => '',
'server' => '',
);
$form['ssl'] = array(
'#type' => 'checkbox',
'#title' => t('Use SSL Encyption'),
'#description' => t('Drupal\'s built-in HTTP client only supports SSL on PHP 4.3 compiled with OpenSSL.'),
'#default_value' => $configuration['ssl'] ?: '',
);
$form['username'] = array(
'#type' => 'textfield',
'#title' => t('User'),
'#description' => t('The username of the Test gateway account.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['username'] ?: '',
);
$form['password'] = array(
'#type' => 'textfield',
'#title' => t('Password'),
'#description' => t('The current password on the Test gateway account.'),
'#size' => 30,
'#maxlength' => 64,
'#default_value' => $configuration['password'] ?: '',
);
$form['method'] = array(
'#type' => 'radios',
'#title' => t('Send Method'),
'#description' => t('The method to use for sending sms.'),
'#options' => array(
t('HTTP GET (Split server request if recipients > 400)'),
t('HTTP GET (Use POST if recipients > 500)'),
t('HTTP POST'),
t('SMPP (Not yet implemented)'),
),
'#default_value' => $configuration['method'] ?: '',
);
$form['server'] = array(
'#type' => 'textfield',
'#title' => t('API Server URL'),
'#description' => t('The url for accessing the Test api server.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['server'] ?: '',
);
return $form;
}