You are here

function messaging_admin_test_post_form in Messaging 7

Same name and namespace in other branches
  1. 6.4 messaging.admin.inc \messaging_admin_test_post_form()

Incoming message form

2 string references to 'messaging_admin_test_post_form'
messaging_devel_block in messaging_devel/messaging_devel.module
Implementation of hook_block()
messaging_menu in ./messaging.module
Implementation of hook_menu()

File

./messaging.admin.inc, line 110
Messaging Framework - Admin UI

Code

function messaging_admin_test_post_form() {
  global $user;

  // Availbable sending methods
  $form['method'] = array(
    '#title' => t('Send method'),
    '#type' => 'select',
    '#options' => messaging_method_info(NULL, 'title'),
    '#default_value' => messaging_method_default(),
  );
  $form['to'] = array(
    '#type' => 'textfield',
    '#title' => t('Destination'),
    '#size' => 20,
    '#autocomplete_path' => 'user/autocomplete',
    '#default_value' => $user->name,
    '#description' => t('Enter a user name or a destination address for this method.'),
  );
  $form['subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#size' => 40,
    '#default_value' => t('Test message'),
  );
  $form['body'] = array(
    '#type' => 'fieldset',
    '#title' => t('Body'),
    '#tree' => TRUE,
  );
  $form['body']['header'] = array(
    '#type' => 'textarea',
    '#title' => t('Header'),
    '#default_value' => t('Hello @name,', array(
      '@name' => $user->name,
    )),
  );
  $form['body']['content'] = array(
    '#type' => 'textarea',
    '#title' => t('Content'),
    '#default_value' => t("Sample message content.\nOne line\nTwo lines."),
  );
  $form['body']['footer'] = array(
    '#type' => 'textarea',
    '#title' => t('Footer'),
    '#default_value' => t("This is a test message from !site_name.", array(
      '!site_name' => variable_get('site_name', 'Drupal'),
    )),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Send'),
  );
  return $form;
}