You are here

function sms_send_form in SMS Framework 7

Same name and namespace in other branches
  1. 5 sms.module \sms_send_form()
  2. 6.2 sms.module \sms_send_form()
  3. 6 sms.module \sms_send_form()

Form builder for send sms form.

Generates a SMS sending form and adds gateway defined elements. The form array that is returned can be merged with an existing form using array_merge().

Parameters

bool $required: (optional) true if phone number field is required, false otherwise.

See also

sms_send_form_submit_validate()

sms_send_form_submit_submit()

5 calls to sms_send_form()
sms_actions_send_action_form in modules/sms_actions/sms_actions.module
Form constructor for sms_actions_send_action form
sms_devel_send_form in modules/sms_devel/sms_devel.send_form.inc
Form constructor for sms_devel test send form.
sms_sendtophone_form in modules/sms_sendtophone/sms_sendtophone.module
Form constructor for sms_sendtophone_form.
sms_user_form_alter in modules/sms_user/sms_user.module
Implements hook_form_alter().
sms_user_settings_add_form in modules/sms_user/sms_user.module
Form constructor for the user number confirmation request form.

File

./sms.module, line 447
The core of the SMS Framework. Provides gateway management and API for sending and receiving SMS messages.

Code

function sms_send_form($required = FALSE) {
  $gateway = sms_default_gateway();
  $form['number'] = array(
    '#type' => 'textfield',
    '#title' => t('Phone number'),
    '#size' => 40,
    '#maxlength' => 16,
    '#required' => $required,
  );

  // Add gateway defined fields
  if (!empty($gateway['send form']) && function_exists($gateway['send form'])) {
    $form['gateway']['#tree'] = TRUE;
    $form['gateway'] = array_merge($gateway['send form']($required), $form['gateway']);
  }
  return $form;
}