You are here

function statcounter_admin_settings_form_validate in StatCounter 7.2

File

./statcounter.admin.inc, line 190
Administrative page callbacks for the statcounter module.

Code

function statcounter_admin_settings_form_validate($form, &$form_state) {

  // Trim some text area values.
  $form_state['values']['statcounter_pages'] = trim($form_state['values']['statcounter_pages']);
  if (!preg_match('/^\\d{1,}$/', $form_state['values']['statcounter_project_id'])) {
    form_set_error('statcounter_project_id', t('A valid Statcounter Project ID is an integer only.'));
  }

  // Delete obsolete local cache file.
  if (empty($form_state['values']['statcounter_cache']) && $form['advanced']['statcounter_cache']['#default_value']) {
    statcounter_clear_js_cache();
  }
}