You are here

function email_mail_page_form in Email Field 6

Same name and namespace in other branches
  1. 5 email.module \email_mail_page_form()
  2. 6.2 email.module \email_mail_page_form()
  3. 7 email.module \email_mail_page_form()

Contact form

1 string reference to 'email_mail_page_form'
email_mail_page in ./email.module
The contact form page.

File

./email.module, line 325

Code

function email_mail_page_form($form_state, $node, $field_name, $email) {
  global $user;
  $form['node'] = array(
    '#type' => 'value',
    '#value' => $node,
  );
  $form['field_name'] = array(
    '#type' => 'value',
    '#value' => $field_name,
  );
  $form['email'] = array(
    '#type' => 'value',
    '#value' => $email,
  );
  $form['name'] = array(
    '#type' => 'textfield',
    '#title' => t('Your name'),
    '#maxlength' => 255,
    '#default_value' => $user->uid ? $user->name : '',
    '#required' => TRUE,
  );
  $form['mail'] = array(
    '#type' => 'textfield',
    '#title' => t('Your e-mail address'),
    '#maxlength' => 255,
    '#default_value' => $user->uid ? $user->mail : '',
    '#required' => TRUE,
  );
  $form['subject'] = array(
    '#type' => 'textfield',
    '#title' => t('Subject'),
    '#maxlength' => 255,
    '#required' => TRUE,
  );
  $form['message'] = array(
    '#type' => 'textarea',
    '#title' => t('Message'),
    '#required' => TRUE,
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Send e-mail'),
    '#validate' => array(
      'email_mail_page_form_validate',
    ),
    '#submit' => array(
      'email_mail_page_form_submit',
    ),
  );
  return $form;
}