You are here

function abjs_settings_admin in A/B Test JS 7

Sets variables that will be used in the test JavaScript that is output.

1 string reference to 'abjs_settings_admin'
abjs_menu in ./abjs.module
Implements hook_menu().

File

./abjs.admin.inc, line 11
Admin forms to view/add/edit/delete tests, conditions, experiences.

Code

function abjs_settings_admin($form, &$form_state) {

  // Each applicable test will have one cookie. The cookie prefix will prefix
  // the name of all test cookies.
  $form['abjs_cookie_prefix'] = array(
    '#type' => 'textfield',
    '#title' => t('Cookie Prefix'),
    '#default_value' => variable_get('abjs_cookie_prefix'),
    '#description' => t('This string will prefix all A/B test cookie names'),
    '#size' => 10,
    '#maxlength' => 10,
  );
  $form['abjs_cookie_lifetime'] = array(
    '#type' => 'textfield',
    '#title' => t('Cookie Lifetime'),
    '#description' => t('Enter cookie lifetime in days'),
    '#default_value' => variable_get('abjs_cookie_lifetime'),
    '#size' => 4,
    '#maxlength' => 10,
  );
  $form['abjs_cookie_domain'] = array(
    '#type' => 'textfield',
    '#title' => t('Cookie Domain'),
    '#description' => t('Enter the domain to which the test cookies will be set, e.g. example.com. Leave blank to set the cookies to the domain of the page where the tests are occurring.'),
    '#default_value' => variable_get('abjs_cookie_domain'),
    '#size' => 50,
    '#maxlength' => 100,
  );
  $form['abjs_cookie_secure'] = array(
    '#type' => 'select',
    '#title' => t('Use Secure Cookies?'),
    '#description' => t('This sets the secure flag on A/B test cookies'),
    '#options' => array(
      0 => t('No'),
      1 => t('Yes'),
    ),
    '#default_value' => variable_get('abjs_cookie_secure'),
  );
  $form['abjs_ace'] = array(
    '#type' => 'select',
    '#title' => t('Use Ace Code Editor?'),
    '#description' => t('Use Ace Code Editor for entering Condition and Experience scripts. If chosen, it will be loaded via https://cdnjs.cloudflare.com.'),
    '#options' => array(
      0 => t('No'),
      1 => t('Yes'),
    ),
    '#default_value' => variable_get('abjs_ace'),
  );
  return system_settings_form($form);
}