You are here

function sms_twilio_admin_form in Twilio SMS Integration 6

Same name and namespace in other branches
  1. 7.2 sms_twilio.module \sms_twilio_admin_form()
  2. 7 sms_twilio.module \sms_twilio_admin_form()

Admin/settings form.

1 string reference to 'sms_twilio_admin_form'
sms_twilio_gateway_info in ./sms_twilio.module
Implementation of hook_gateway_info().

File

./sms_twilio.module, line 26
Adds support for sending SMS messages using the Twilio gateway.

Code

function sms_twilio_admin_form($configuration) {
  $form['sms_twilio_api_sid'] = array(
    '#type' => 'textfield',
    '#title' => t('Account SID'),
    '#description' => t('Twilio Account SID - the 34 character string beginning with AC'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => $configuration['sms_twilio_api_sid'],
  );
  $form['sms_twilio_api_auth_token'] = array(
    '#type' => 'textfield',
    '#title' => t('API ID'),
    '#description' => t('Twilio auth token - <a href="https://www.twilio.com/user/account">available on your dashboard</a>'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => $configuration['sms_twilio_api_auth_token'],
  );
  $form['sms_twilio_number'] = array(
    '#type' => 'textfield',
    '#title' => t('Number'),
    '#description' => t('A <a href="https://www.twilio.com/user/account/phone-numbers" target="_new">phone number</a> from your Twilio account'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => $configuration['sms_twilio_number'],
  );
  $form['sms_twilio_path'] = array(
    '#type' => 'textfield',
    '#title' => t('Twilio library path'),
    '#description' => t('The path to the twilio library'),
    '#size' => 40,
    '#maxlength' => 255,
    '#default_value' => !empty($configuration['sms_twilio_path']) ? $configuration['sms_twilio_path'] : 'sites/all/libraries/twilio',
  );
  return $form;
}