summaryrefslogtreecommitdiff
path: root/modules/statistics.module
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-10-07 06:11:12 +0000
committerDries Buytaert <dries@buytaert.net>2005-10-07 06:11:12 +0000
commit7e1527ee61bc10b3765b95b9af8faaa2254da5a8 (patch)
tree2225c7f571b4a3f635564f8281406a12b2a271a7 /modules/statistics.module
parent7b5b460534e5c54b07d28467c2aa2fc670c714e4 (diff)
downloadbrdo-7e1527ee61bc10b3765b95b9af8faaa2254da5a8.tar.gz
brdo-7e1527ee61bc10b3765b95b9af8faaa2254da5a8.tar.bz2
- Patch #29465: new form API by Adrian et al.
TODO: + The contact.module was broken; a new patch for contact.module is needed. + Documentation is needed. + The most important modules need to be updated ASAP.
Diffstat (limited to 'modules/statistics.module')
-rw-r--r--modules/statistics.module26
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/statistics.module b/modules/statistics.module
index 0080a057d..3227b7606 100644
--- a/modules/statistics.module
+++ b/modules/statistics.module
@@ -325,18 +325,18 @@ function statistics_top_referrers() {
*/
function statistics_settings() {
// access log settings:
- $group = form_radios(t('Enable access log'), 'statistics_enable_access_log', variable_get('statistics_enable_access_log', 0), array('1' => t('Enabled'), '0' => t('Disabled')), t('Log each page access. Required for referrer statistics.'));
-
+ $options = array('1' => t('Enabled'), '0' => t('Disabled'));
+ $form['access'] = array(type => 'fieldset', title => t('Access log settings'));
+ $form['access']['statistics_enable_access_log'] = array(type => 'radios', title => t('Enable access log'), default_value => variable_get('statistics_enable_access_log', 0), options => $options, description => t('Log each page access. Required for referrer statistics.'));
$period = drupal_map_assoc(array(3600, 10800, 21600, 32400, 43200, 86400, 172800, 259200, 604800, 1209600, 2419200, 4838400, 9676800), 'format_interval');
- $group .= form_select(t('Discard access logs older than'), 'statistics_flush_accesslog_timer', variable_get('statistics_flush_accesslog_timer', 259200), $period, t('Older access log entries (including referrer statistics) will be automatically discarded. Requires crontab.'));
- $output = form_group(t('Access log settings'), $group);
-
+ $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 => $period, description => t('Older access log entries (including referrer statistics) will be automatically discarded. Requires crontab.'));
+
// count content views settings
- $group = form_radios(t('Count content views'), 'statistics_count_content_views', variable_get('statistics_count_content_views', 0), array('1' => t('Enabled'), '0' => t('Disabled')), t('Increment a counter each time content is viewed.'));
- $group .= form_radios(t('Display counter values'), 'statistics_display_counter', variable_get('statistics_display_counter', 0), array('1' => t('Enabled'), '0' => t('Disabled')), t('Display how many times given content has been viewed.'));
- $output .= form_group(t('Content viewing counter settings'), $group);
+ $form['content'] = array(type => 'fieldset', title => t('Content viewing counter settings'));
+ $form['content']['statistics_count_content_views'] = array(type => 'radios', title => t('Count content views'), default_value => variable_get('statistics_count_content_views', 0), options => $options, description => t('Increment a counter each time content is viewed.'));
+ $form['content']['statistics_display_counter'] = array(type => 'radios', title => t('Display counter values'), default_value => variable_get('statistics_display_counter', 0), options => $options, description => t('Display how many times given content has been viewed.'));
- return $output;
+ return $form;
}
/**
@@ -413,10 +413,10 @@ function statistics_block($op = 'list', $delta = 0, $edit = array()) {
case 'configure':
// Popular content block settings
$numbers = array('0' => t('Disabled')) + drupal_map_assoc(array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 15, 20, 25, 30, 40));
- $output = form_select(t("Number of day's top views to display"), 'statistics_block_top_day_num', variable_get('statistics_block_top_day_num', 0), $numbers, t('How many content items to display in "day" list.'));
- $output .= form_select(t('Number of all time views to display'), 'statistics_block_top_all_num', variable_get('statistics_block_top_all_num', 0), $numbers, t('How many content items to display in "all time" list.'));
- $output .= form_select(t('Number of most recent views to display'), 'statistics_block_top_last_num', variable_get('statistics_block_top_last_num', 0), $numbers, t('How many content items to display in "recently viewed" list.'));
- return $output;
+ $form['statistics_block_top_day_num'] = array(type => 'select', title => t("Number of day's top views to display"), default_value => variable_get('statistics_block_top_day_num', 0), options => $numbers, description => t('How many content items to display in "day" list.'));
+ $form['statistics_block_top_all_num'] = array(type => 'select', title => t('Number of all time views to display'), default_value => variable_get('statistics_block_top_all_num', 0), options => $numbers, description => t('How many content items to display in "all time" list.'));
+ $form['statistics_block_top_last_num'] = array(type => 'select', title => t('Number of most recent views to display'), default_value => variable_get('statistics_block_top_last_num', 0), options => $numbers, description => t('How many content items to display in "recently viewed" list.'));
+ return $form;
case 'save':
variable_set('statistics_block_top_day_num', $edit['statistics_block_top_day_num']);