You are here

function ga_push_settings_form in GA Push 7

Same name and namespace in other branches
  1. 8 inc/ga_push.admin.inc \ga_push_settings_form()

Form: GA Push settings.

1 string reference to 'ga_push_settings_form'
ga_push_menu in ./ga_push.module
Implements hook_menu().

File

inc/ga_push.admin.inc, line 11
The administration functions and forms.

Code

function ga_push_settings_form($form, &$form_state) {
  $options = ga_push_get_methods_option_list(NULL, FALSE);
  $help = array(
    '#theme' => 'item_list',
    '#items' => array(
      t("Universal methods are compatible with google_analytics 2.x (recommended), Classic methods are compatible with google_analytics 1.x"),
      t("Client-side: the action will be sent on the next page load - Server-side: the action will be sent immediately."),
    ),
  );
  $form['help'] = array(
    '#markup' => render($help),
  );
  $form['ga_push_default_method'] = array(
    '#type' => 'radios',
    '#title' => t('Default method'),
    '#options' => $options,
    '#default_value' => variable_get('ga_push_default_method', GA_PUSH_METHOD_ANALYTICS_JS),
    '#description' => t("Select the default method, it could be overriden in function call or each configuration of rules."),
    '#required' => TRUE,
  );
  $form['ga_push_debug'] = array(
    '#type' => 'checkbox',
    '#title' => t('Debug mode'),
    '#default_value' => variable_get('ga_push_debug', FALSE),
    '#description' => t('Active the debug mode: log GA push requests.'),
  );
  return system_settings_form($form);
}