function sms_send_form in SMS Framework 6
Same name and namespace in other branches
- 5 sms.module \sms_send_form()
- 6.2 sms.module \sms_send_form()
- 7 sms.module \sms_send_form()
Send 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().
@todo Show the ruleset selector if the form has previously validated False.
Parameters
$required: Specify if the user is required to provide information for the fields.
Return value
$form
5 calls to sms_send_form()
- sms_actions_send_action_form in modules/
sms_actions/ sms_actions.module - sms_devel_send_form in modules/
sms_devel/ sms_devel.send_form.inc - Test send form
- sms_sendtophone_form in modules/
sms_sendtophone/ sms_sendtophone.module - sms_user_register in modules/
sms_user/ sms_user.module - sms_user_settings_add_form in modules/
sms_user/ sms_user.module
File
- ./
sms.module, line 379 - The core of the SMS Framework. Provides gateway managment 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' => 255,
'#required' => $required,
);
// Show the ruleset selector if needed (eg: admin setting)
// Named 'country' for historical purposes.
if (function_exists('sms_valid_get_rulesets_for_form') && variable_get('sms_send_form_include_ruleset_selector', TRUE)) {
$title = variable_get('sms_send_form_ruleset_selector_title', 'Country');
$form['country'] = array(
'#type' => 'select',
'#title' => t($title),
'#multiple' => FALSE,
'#options' => sms_valid_get_rulesets_for_form(TRUE),
'#default_value' => -1,
);
}
// Add gateway defined fields
if (function_exists($gateway['send form'])) {
$form['gateway']['#tree'] = TRUE;
$form['gateway'] = array_merge($gateway['send form']($required), $form['gateway']);
}
return $form;
}