function counter_admin_settings in Counter 6.2
Same name and namespace in other branches
- 5 counter.module \counter_admin_settings()
- 6 counter.module \counter_admin_settings()
- 7 counter.settings.inc \counter_admin_settings()
Menu callback;
File
- ./
counter.settings.inc, line 11 - Settings page callback file for the counter module.
Code
function counter_admin_settings() {
$form = array();
// only administrators can access this function
// Generate the form - settings applying to all patterns first
$form['counter_settings'] = array(
'#type' => 'fieldset',
'#weight' => -30,
'#title' => t('Basic settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['counter_settings']['counter_save_details'] = array(
'#type' => 'checkbox',
'#title' => t('Save details'),
'#default_value' => variable_get('counter_save_details', 0),
'#description' => t('Enable this option to save visitor details, including: IP, Data dan Page. Caution: This will your counter table size very big if your website has huge traffic.'),
);
$form['counter_settings']['counter_show_site_counter'] = array(
'#type' => 'checkbox',
'#title' => t('Show Site Counter'),
'#default_value' => variable_get('counter_show_site_counter', 1),
);
$form['counter_settings']['counter_show_unique_visitor'] = array(
'#type' => 'checkbox',
'#title' => t('Show Unique Visitors'),
'#default_value' => variable_get('counter_show_unique_visitor', 1),
'#description' => t('Show Unique Visitors based on their IP'),
);
$form['counter_settings']['counter_registered_user'] = array(
'#type' => 'checkbox',
'#title' => t('Show Registered Users'),
'#default_value' => variable_get('counter_registered_user', 1),
);
$form['counter_settings']['counter_unregistered_user'] = array(
'#type' => 'checkbox',
'#title' => t('Show Unregistered Users'),
'#default_value' => variable_get('counter_unregistered_user', 1),
);
$form['counter_settings']['counter_blocked_user'] = array(
'#type' => 'checkbox',
'#title' => t('Show Blocked Users'),
'#default_value' => variable_get('counter_blocked_user', 1),
);
$form['counter_settings']['counter_published_node'] = array(
'#type' => 'checkbox',
'#title' => t('Show Published Nodes'),
'#default_value' => variable_get('counter_published_node', 1),
);
$form['counter_settings']['counter_unpublished_node'] = array(
'#type' => 'checkbox',
'#title' => t('Show Unpublished Nodes'),
'#default_value' => variable_get('counter_unpublished_node', 1),
);
$form['counter_settings']['counter_show_server_ip'] = array(
'#type' => 'checkbox',
'#title' => t('Show Web Server IP'),
'#default_value' => variable_get('counter_show_server_ip', 1),
);
$form['counter_settings']['counter_show_ip'] = array(
'#type' => 'checkbox',
'#title' => t('Show Client IP'),
'#default_value' => variable_get('counter_show_ip', 1),
);
$form['counter_settings']['counter_show_counter_since'] = array(
'#type' => 'checkbox',
'#title' => t('Show Site Counter Since'),
'#default_value' => variable_get('counter_show_counter_since', 1),
'#description' => t('Show the first entry date in the Site Counter'),
);
$form['counter_statistic'] = array(
'#type' => 'fieldset',
'#weight' => -20,
'#title' => t('Statistic settings'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
);
$form['counter_statistic']['counter_statistic_today'] = array(
'#type' => 'checkbox',
'#title' => t('Visitors Today'),
'#default_value' => variable_get('counter_statistic_today', 1),
);
$form['counter_statistic']['counter_statistic_week'] = array(
'#type' => 'checkbox',
'#title' => t('Visitors This Week'),
'#default_value' => variable_get('counter_statistic_week', 1),
);
$form['counter_statistic']['counter_statistic_month'] = array(
'#type' => 'checkbox',
'#title' => t('Visitors This Month'),
'#default_value' => variable_get('counter_statistic_month', 1),
);
$form['counter_statistic']['counter_statistic_year'] = array(
'#type' => 'checkbox',
'#title' => t('Visitors This Year'),
'#default_value' => variable_get('counter_statistic_year', 1),
);
return system_settings_form($form);
}