function uc_termsofservice_general_form in Ubercart Terms of Service 6
Same name and namespace in other branches
- 7 uc_termsofservice.module \uc_termsofservice_general_form()
 
General form for both checkout & cart modes.
See also
uc_termsofservice_general_form_submit()
2 calls to uc_termsofservice_general_form()
- uc_termsofservice_agreement_cart_callback in ./
uc_termsofservice.module  - Callback form for cart pane.
 - uc_termsofservice_checkout_pane_callback in ./
uc_termsofservice.module  - Callback form for checkout pane.
 
1 string reference to 'uc_termsofservice_general_form'
- uc_termsofservice_menu in ./
uc_termsofservice.module  - Implements hook_menu().
 
File
- ./
uc_termsofservice.module, line 122  - Ubercart Terms of Service.
 
Code
function uc_termsofservice_general_form($form_state, $type = NULL) {
  $form = array();
  if (!$type) {
    $type = arg(2);
  }
  $node = uc_termsofservice_get_node($type);
  if ($node) {
    $form['tos_text'] = array(
      '#value' => node_view($node, FALSE, TRUE, FALSE),
    );
    $form['tos_agree'] = array(
      '#type' => 'checkboxes',
      '#options' => array(
        'agreed' => t('I agree with the terms above'),
      ),
    );
    $form['#theme'] = 'uc_termsofservice_agreement_form';
    if (module_exists('modalframe') && variable_get('uc_termsofservice_' . $type . '_popup', 0)) {
      // Send the Modal Frame javascript for child windows to the page.
      modalframe_child_js();
      $form['submit'] = array(
        '#type' => 'submit',
        '#value' => t('Submit'),
      );
      $form['tos_agree']['#attributes'] = array(
        'onclick' => 'this.form.submit();',
      );
    }
    return $form;
  }
  return;
}