You are here

function sms_devel_send_form in SMS Framework 7

Same name and namespace in other branches
  1. 6.2 modules/sms_devel/sms_devel.send_form.inc \sms_devel_send_form()
  2. 6 modules/sms_devel/sms_devel.send_form.inc \sms_devel_send_form()

Form constructor for sms_devel test send form.

See also

sms_devel_send_form_submit()

1 string reference to 'sms_devel_send_form'
sms_devel_menu in modules/sms_devel/sms_devel.module
Implements hook_menu().

File

modules/sms_devel/sms_devel.send_form.inc, line 17
Test send form include for the sms_devel module of the SMS Framework.

Code

function sms_devel_send_form($form, &$form_state) {

  // Message to the user about the form.
  $form['about'] = array(
    '#type' => 'item',
    '#value' => 'This is a basic form that contains:<ul><li>include sms_send_form()</li><li>message text field</li><li>submit button</li></ul>The form validation includes sms_send_form_validate().<br/>The form submission includes sms_send_form_submit() which sends the message, and a little note that the form submitted ok.',
  );

  // Include the sms_send_form from the SMS Framework core.
  $form = array_merge($form, sms_send_form());

  // Message text field for the send form.
  $form['message'] = array(
    '#type' => 'textarea',
    '#title' => t('Message'),
    '#rows' => 4,
    '#cols' => 40,
    '#resizable' => FALSE,
  );

  // Submit button for the send form.
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => 'Send Message',
    '#validate' => array(
      'sms_send_form_validate',
    ),
    '#submit' => array(
      'sms_send_form_submit',
      'sms_devel_send_form_submit',
    ),
  );

  // Receive Message Button for testing incoming messages.
  $form['receive'] = array(
    '#type' => 'submit',
    '#value' => 'Receive Message',
    '#submit' => array(
      'sms_devel_receive_form_submit',
    ),
  );
  return $form;
}