You are here

function regcode_voucher_admin_form in Registration codes 7

Same name and namespace in other branches
  1. 7.2 regcode_voucher/regcode_voucher.module \regcode_voucher_admin_form()

Administration page.

1 string reference to 'regcode_voucher_admin_form'
regcode_voucher_menu in regcode_voucher/regcode_voucher.module
Implements hook_menu().

File

regcode_voucher/regcode_voucher.module, line 112
Main code and hooks for regcode voucher module.

Code

function regcode_voucher_admin_form($form, &$form_state) {
  $form = array();
  $form['regcode_voucher_fieldset_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Field set title'),
    '#description' => t('The title of the voucher code fieldset'),
    '#default_value' => variable_get('regcode_voucher_fieldset_title', variable_get('regcode_fieldset_title', '')),
  );
  $form['regcode_voucher_field_title'] = array(
    '#type' => 'textfield',
    '#title' => t('Field label'),
    '#description' => t('The label of the voucher code textfield.'),
    '#default_value' => variable_get('regcode_voucher_field_title', variable_get('regcode_field_title', '')),
  );
  $form['regcode_voucher_field_description'] = array(
    '#type' => 'textfield',
    '#title' => t('Field description'),
    '#description' => t('The description under the voucher code textfield.'),
    '#default_value' => variable_get('regcode_voucher_field_description', variable_get('regcode_field_description', '')),
  );
  $form['regcode_voucher_display'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Voucher form'),
    '#options' => array(
      'editform' => t('Display on user edit page'),
      'tab' => t('Create tab in user profile'),
    ),
    '#default_value' => variable_get('regcode_voucher_display', array()),
  );
  $form['regcode_voucher_introtext'] = array(
    '#type' => 'textarea',
    '#title' => t('Voucher page text'),
    '#description' => t('Text to be displayed on the voucher page'),
    '#default_value' => variable_get('regcode_voucher_introtext', ''),
  );
  $form['regcode_voucher_message'] = array(
    '#type' => 'textfield',
    '#title' => t('Voucher used message'),
    '#description' => t('Text to be displayed when the voucher was used successfully.'),
    '#default_value' => variable_get('regcode_voucher_message', t('Voucher code used successfully.')),
  );
  $form['regcode_voucher_allowed_roles'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Allow these roles'),
    '#description' => t('Select roles which can enter registration codes post registration.'),
    '#options' => user_roles(),
    '#default_value' => variable_get('regcode_voucher_allowed_roles', array()),
  );
  $form['regcode_voucher_disallowed_roles'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Disallow these roles'),
    '#description' => t('Select roles which can not enter registration codes post registration.'),
    '#options' => user_roles(),
    '#default_value' => variable_get('regcode_voucher_disallowed_roles', array()),
  );
  return system_settings_form($form);
}