You are here

function agreement_form in Agreement 6

Same name and namespace in other branches
  1. 6.2 agreement.module \agreement_form()
  2. 7.2 agreement.pages.inc \agreement_form()

FAPI definition for the agreement form.

See also

agreement_form_validate()

agreement_form_submit()

1 string reference to 'agreement_form'
agreement_page in ./agreement.module
Callback for agreement URL

File

./agreement.module, line 350
agreement.module - Agreement module code

Code

function agreement_form($form, $text, $status = 0, $uid = -1) {
  $form = array();
  $form['agreement_terms'] = array(
    '#value' => $text,
    '#type' => 'item',
    '#prefix' => '<div class="agreement-text">',
    '#suffix' => '</div>',
  );
  $form['uid'] = array(
    '#value' => $uid,
    '#type' => 'hidden',
  );
  if (!$status) {
    $form['agree'] = array(
      '#default_value' => $status,
      '#title' => check_plain(variable_get('agreement_checkbox_text', AGREEMENT_CHECKBOX_TEXT)),
      '#type' => 'checkbox',
    );
    $form['submit'] = array(
      '#type' => 'submit',
      '#value' => check_plain(variable_get('agreement_submit_text', AGREEMENT_SUBMIT_TEXT)),
    );
  }
  return $form;
}