function sms_user_send_sms_action_validate in SMS Framework 6.2
Same name and namespace in other branches
- 7 modules/sms_user/sms_user.actions.inc \sms_user_send_sms_action_validate()
File
- modules/
sms_user/ sms_user.actions.inc, line 50 - SMS User Action Implementation.
Code
function sms_user_send_sms_action_validate($form, $form_state) {
$sms_text = $form_state['values']['sms_text'];
if (empty($sms_text)) {
form_set_error('sms_text', t('This field is required'));
}
$length = drupal_strlen($sms_text);
if ($length > variable_get('sms_user_max_chars', SMS_USER_MAX_CHARS)) {
$error = t('SMS too long: (@text) [length=@len]', array(
'@text' => $sms_text,
'@len' => $length,
));
form_set_error('sms_text', $error);
}
}