You are here

function merci_printable_contract_admin_settings in MERCI (Manage Equipment Reservations, Checkout and Inventory) 7.3

Same name and namespace in other branches
  1. 8.2 modules/merci_printable_contract/merci_printable_contract.module \merci_printable_contract_admin_settings()
  2. 6.2 modules/merci_printable_contract/merci_printable_contract.module \merci_printable_contract_admin_settings()
  3. 7.2 modules/merci_printable_contract/merci_printable_contract.module \merci_printable_contract_admin_settings()

Builds the admininstration settings form.

1 string reference to 'merci_printable_contract_admin_settings'
merci_printable_contract_menu in merci_printable_contract/merci_printable_contract.module
Implements hook_menu().

File

merci_printable_contract/merci_printable_contract.module, line 73
merci_printable_contract functions

Code

function merci_printable_contract_admin_settings($form, &$form_state) {
  $form['merci_contract_header'] = array(
    '#type' => 'textarea',
    '#title' => t('Contract header'),
    '#rows' => 10,
    // TODO: this doesn't seem to work...
    '#cols' => 5,
    '#default_value' => variable_get('merci_contract_header', ''),
    '#description' => t('Header portion of printable contract.  Allows HTML.'),
  );
  $form['merci_contract_boilerplate'] = array(
    '#type' => 'textarea',
    '#title' => t('Contract boilerplate'),
    '#rows' => 10,
    // TODO: this doesn't seem to work...
    '#cols' => 5,
    '#default_value' => variable_get('merci_contract_boilerplate', ''),
    '#description' => t('Legalese that makes the contract legally binding.'),
  );
  $form['merci_contract_footer'] = array(
    '#type' => 'textarea',
    '#title' => t('Contract footer'),
    '#rows' => 10,
    // TODO: this doesn't seem to work...
    '#cols' => 5,
    '#default_value' => variable_get('merci_contract_footer', ''),
    '#description' => t('Footer portion of printable contract. Normally includes signature lines. HTML allowed.'),
  );
  if (module_exists('token')) {
    $form['token_help'] = array(
      '#title' => t('Replacement patterns'),
      '#type' => 'fieldset',
      '#collapsible' => TRUE,
      '#collapsed' => TRUE,
    );
    $output = '<div>';
    $output .= '<dt>' . t('List of the currently available tokens on this site') . '</dt>';
    $output .= '<dd>' . theme('token_tree', array(
      'token_types' => array(
        'merci_reservation',
      ),
      'click_insert' => TRUE,
      'show_restricted' => TRUE,
    )) . '</dd>';
    $output .= '</div>';

    // TODO Please change this theme call to use an associative array for the $variables parameter.
    $form['token_help']['help'] = array(
      //'#value' => theme('token_help', 'commerce_order'),
      '#type' => 'markup',
      '#markup' => $output,
    );
  }
  return system_settings_form($form);
}