You are here

function agreement_page in Agreement 7.2

Same name and namespace in other branches
  1. 6.2 agreement.module \agreement_page()
  2. 6 agreement.module \agreement_page()

Callback for agreement URL.

Parameters

string $agreement_type: The agreement type name.

Return value

string HTML output.

Throws

\Exception Wrapped exception from theme().

1 string reference to 'agreement_page'
agreement_menu in ./agreement.module
Implements hook_menu().

File

./agreement.pages.inc, line 20
Agreement page callbacks.

Code

function agreement_page($agreement_type) {
  global $user;

  // Redirect anonymous users to the home page.
  if (!$user->uid) {
    drupal_goto('<front>');
  }
  $info = agreement_type_load($agreement_type);
  $status = agreement_has_agreed($user, $info);
  $form = drupal_get_form('agreement_form', $status, $info, $user);
  $output = theme('agreement_page', array(
    'form' => $form,
  ));
  return $output;
}