You are here

function yandex_metrics_main_settings_submit in Yandex.Metrics 7

Same name and namespace in other branches
  1. 6.2 yandex_metrics.module \yandex_metrics_main_settings_submit()
  2. 6 yandex_metrics.module \yandex_metrics_main_settings_submit()
  3. 7.3 yandex_metrics.module \yandex_metrics_main_settings_submit()
  4. 7.2 yandex_metrics.module \yandex_metrics_main_settings_submit()

Implementation of hook_submit for yandex_metrics_main_settings form.

_state

Parameters

array $form:

File

./yandex_metrics.module, line 682
The main code of Yandex.Metrics module.

Code

function yandex_metrics_main_settings_submit($form, &$form_state) {
  $counter_code = $form_state['values']['yandex_metrics_counter_code'];
  $visibility = $form_state['values']['yandex_metrics_visibility'];
  $pages = $form_state['values']['yandex_metrics_pages'];
  $visibility_roles = $form_state['values']['yandex_metrics_visibility_roles'];
  $roles = $form_state['values']['yandex_metrics_roles'];
  variable_set('yandex_metrics_counter_code', $counter_code);
  variable_set('yandex_metrics_visibility', $visibility);
  variable_set('yandex_metrics_pages', $pages);
  variable_set('yandex_metrics_visibility_roles', $visibility_roles);
  variable_set('yandex_metrics_roles', $roles);
  drupal_set_message(t("The Counter Code settings has been saved successfully."));
}