function sms_simplegateway_admin_form in SMS Framework 6
Configuration form for gateway module
Parameters
$configuration:
Return value
Drupal form array
1 string reference to 'sms_simplegateway_admin_form'
- sms_simplegateway_gateway_info in modules/
sms_simplegateway/ sms_simplegateway.module - Implement hook_gateway_info()
File
- modules/
sms_simplegateway/ sms_simplegateway.module, line 55 - Simple gateway module for Drupal SMS Framework. Outbound+Inbound
Code
function sms_simplegateway_admin_form($configuration) {
$form['sms_simplegateway_send'] = array(
'#type' => 'fieldset',
'#title' => 'Sender (outgoing messages)',
'#collapsible' => TRUE,
);
$form['sms_simplegateway_send']['sms_simplegateway_base_url'] = array(
'#type' => 'textfield',
'#title' => t('Base URL for sending messages'),
'#description' => t('Eg: http://simplegateway.example.com:13031/sendsms'),
'#size' => 60,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_base_url'],
);
$form['sms_simplegateway_send']['sms_simplegateway_method'] = array(
'#type' => 'radios',
'#title' => t('HTTP method'),
'#default_value' => $configuration['sms_simplegateway_method'],
'#options' => array(
'GET' => 'GET',
'POST' => 'POST',
),
);
$form['sms_simplegateway_send']['sms_simplegateway_user_field'] = array(
'#type' => 'textfield',
'#title' => t('Username field name'),
'#description' => t('Optional. The argument/field name for the field that holds the username. Eg: user, username, authid.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_user_field'],
);
$form['sms_simplegateway_send']['sms_simplegateway_user_value'] = array(
'#type' => 'textfield',
'#title' => t('Username field value'),
'#description' => t('Optional. Your username for this gateway account.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_user_value'],
);
$form['sms_simplegateway_send']['sms_simplegateway_pass_field'] = array(
'#type' => 'textfield',
'#title' => t('Password field name'),
'#description' => t('Optional. The argument/field name for the field that holds the password. Eg: pass, password, passwd.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_pass_field'],
);
$form['sms_simplegateway_send']['sms_simplegateway_pass_value'] = array(
'#type' => 'textfield',
'#title' => t('Password field value'),
'#description' => t('Optional. Your password for this gateway account.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_pass_value'],
);
$form['sms_simplegateway_send']['sms_simplegateway_sender_field'] = array(
'#type' => 'textfield',
'#title' => t('Sender (from) field name'),
'#description' => t('The argument/field name for the field that holds the sender number data. Eg: from, sender'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_sender_field'],
);
$form['sms_simplegateway_send']['sms_simplegateway_number_field'] = array(
'#type' => 'textfield',
'#title' => t('Number (to) field name'),
'#description' => t('The argument/field name for the field that holds the number data. Eg: number, to, no'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_number_field'],
);
$form['sms_simplegateway_send']['sms_simplegateway_message_field'] = array(
'#type' => 'textfield',
'#title' => t('Message field name'),
'#description' => t('The argument/field name for the field that holds the message text. Eg: message, text, content'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_message_field'],
);
$form['sms_simplegateway_receive'] = array(
'#type' => 'fieldset',
'#title' => 'Receiver (incoming messages)',
'#collapsible' => TRUE,
);
$form['sms_simplegateway_receive']['sms_simplegateway_recv_url'] = array(
'#type' => 'item',
'#title' => 'Target URL for the message receiver',
'#value' => url('sms/simplegateway/receiver', array(
'absolute' => TRUE,
)),
);
$form['sms_simplegateway_receive']['sms_simplegateway_recv_number_field'] = array(
'#type' => 'textfield',
'#title' => t('Sender (from) field name'),
'#description' => t('The argument/field name for the field that holds the sender number. Eg: sender, from.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_recv_number_field'],
);
$form['sms_simplegateway_receive']['sms_simplegateway_recv_gwnumber_field'] = array(
'#type' => 'textfield',
'#title' => t('Receiver (to) field name'),
'#description' => t('Optional. The argument/field name for the field that holds the gateway receiver number. Eg: to, inNumber, receiver.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_recv_gwnumber_field'],
);
$form['sms_simplegateway_receive']['sms_simplegateway_recv_message_field'] = array(
'#type' => 'textfield',
'#title' => t('Message field name'),
'#description' => t('The argument/field name for the field that holds the message. Eg: message, text, content.'),
'#size' => 40,
'#maxlength' => 255,
'#default_value' => $configuration['sms_simplegateway_recv_message_field'],
);
return $form;
}