statistics_settings_form
function statistics_settings_form
statistics_settings_form()
Form constructor for the statistics administration form.
See also
Related topics
File
- modules/statistics/statistics.admin.inc, line 276
- Admin page callbacks for the Statistics module.
Code
function statistics_settings_form() { // Access log settings. $form['access'] = array( '#type' => 'fieldset', '#title' => t('Access log settings'), ); $form['access']['statistics_enable_access_log'] = array( '#type' => 'checkbox', '#title' => t('Enable access log'), '#default_value' => variable_get('statistics_enable_access_log', 0), '#description' => t('Log each page access. Required for referrer statistics.'), ); $form['access']['statistics_flush_accesslog_timer'] = array( '#type' => 'select', '#title' => t('Discard access logs older than'), '#default_value' => variable_get('statistics_flush_accesslog_timer', 259200), '#options' => array(0 => t('Never')) + drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval'), '#description' => t('Older access log entries (including referrer statistics) will be automatically discarded. (Requires a correctly configured <a href="drupal_7-modules-statistics-statistics-admin-inc-function-statistics_settings_form-@cron">cron maintenance task<-a>-)', array('@cron' => url('admin-reports-status'))), ); -- Content counter settings- $form['content'] = array( '.html?lang=en#type' => 'fieldset', '.html?lang=en#title' => t('Content viewing counter settings'), ); $form['content']['statistics_count_content_views'] = array( '.html?lang=en#type' => 'checkbox', '.html?lang=en#title' => t('Count content views'), '.html?lang=en#default_value' => variable_get('statistics_count_content_views', 0), '.html?lang=en#description' => t('Increment a counter each time content is viewed.'), ); $form['content']['statistics_count_content_views_ajax'] = array( '.html?lang=en#type' => 'checkbox', '.html?lang=en#title' => t('Use Ajax to increment the counter'), '.html?lang=en#default_value' => variable_get('statistics_count_content_views_ajax', 0), '.html?lang=en#description' => t('Perform the count asynchronously after page load rather than during page generation.'), '.html?lang=en#states' => array( 'disabled' => array( ':input[name="statistics_count_content_views"]' => array('checked' => FALSE), ), ), ); return system_settings_form($form); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!statistics!statistics.admin.inc/function/statistics_settings_form/7.x