You are here

function ajax_register_admin_form in Ajax Login/Register 7.4

Administrative settings form.

1 string reference to 'ajax_register_admin_form'
ajax_register_menu in ./ajax_register.module
Implements hook_menu().

File

./ajax_register.admin.inc, line 11
Provides form with AJAX REGISTER module settings.

Code

function ajax_register_admin_form($form, $form_state) {
  $form['ajax_register_modal'] = array(
    '#type' => 'fieldset',
    '#title' => t('Modal window settings'),
  );
  $form['ajax_register_modal']['ajax_register_modal_width'] = array(
    '#type' => 'textfield',
    '#title' => t('Modal window width'),
    '#size' => 4,
    '#field_suffix' => 'px',
    '#default_value' => variable_get('ajax_register_modal_width', 550),
  );
  $form['ajax_register_modal']['ajax_register_modal_background_opacity'] = array(
    '#type' => 'select',
    '#title' => t('Background opacity'),
    '#options' => array(
      '0' => '0%',
      '0.1' => '10%',
      '0.2' => '20%',
      '0.3' => '30%',
      '0.4' => '40%',
      '0.5' => '50%',
      '0.6' => '60%',
      '0.7' => '70%',
      '0.8' => '80%',
      '0.9' => '90%',
      '1' => '100%',
    ),
    '#default_value' => variable_get('ajax_register_modal_background_opacity', '0.7'),
  );
  $form['ajax_register_modal']['ajax_register_modal_background_color'] = array(
    '#type' => 'textfield',
    '#title' => t('Background color'),
    '#size' => 6,
    '#maxlength' => 6,
    '#field_prefix' => '#',
    '#default_value' => variable_get('ajax_register_modal_background_color', '000000'),
  );
  $form['ajax_register_modal']['ajax_register_hide_captcha'] = array(
    '#type' => 'checkbox',
    '#title' => t('Hide captcha in modal dialog'),
    '#description' => t('Capctha protects your site from spambots.
      But they have no js enabled, so spambots will never see modal dialog and will be redirected to normal login/register form with captcha.'),
    '#default_value' => variable_get('ajax_register_hide_captcha', FALSE),
  );
  if (!module_exists('captcha')) {
    $form['ajax_register_modal']['ajax_register_hide_captcha']['#disabled'] = TRUE;
    $form['ajax_register_modal']['ajax_register_hide_captcha']['#title'] .= ' (' . t('requires CAPTCHA module') . ')';
  }
  $form['ajax_register_forms'] = array(
    '#type' => 'fieldset',
    '#title' => t('Form settings'),
  );
  $form['ajax_register_forms']['ajax_register_form_enable_modal_links'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable links in modal window'),
    '#description' => t('Check if links to another forms should appear in modal form'),
    '#default_value' => variable_get('ajax_register_form_enable_modal_links', TRUE),
  );
  $form['ajax_register_redirect'] = array(
    '#type' => 'fieldset',
    '#title' => t('Redirect behaviors'),
  );

  // Add redirect settings to the login form type.
  ajax_register_add_redirect_settings($form['ajax_register_redirect'], 'login');

  // Add redirect settings to the register form type.
  ajax_register_add_redirect_settings($form['ajax_register_redirect'], 'register');

  // Add redirect settings to the password form type.
  ajax_register_add_redirect_settings($form['ajax_register_redirect'], 'password');

  // Return the form.
  return system_settings_form($form);
}