Index: statistics_filter.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/statistics_filter/statistics_filter.module,v
retrieving revision 1.9
diff -u -F^f -r1.9 statistics_filter.module
--- statistics_filter.module	9 Apr 2006 08:19:54 -0000	1.9
+++ statistics_filter.module	21 Jan 2007 20:02:56 -0000
@@ -28,7 +28,7 @@ function statistics_filter_exit() {
   global $user;
 
   // No point if statistics aren't enabled
-  if (!module_exist('statistics')) {
+  if (!module_exists('statistics')) {
     return;
   }
 
@@ -54,7 +54,7 @@ function statistics_filter_exit() {
   }
 
   // Ignore crawlers if requested
-  if (!$do_filtering && module_exist('browscap')) {
+  if (!$do_filtering && module_exists('browscap')) {
     $filter_crawlers = variable_get('statistics_filter_crawlers', FALSE);
     if ($filter_crawlers) {
       $browser = browscap_get_browser();
@@ -87,7 +87,7 @@ function statistics_filter_exit() {
         "AND url='%s' AND hostname='%s' AND uid=%d",
         drupal_get_title(), $_GET['q'], $referrer, $hostname, $user->uid);
     }
-    if (!$ignoring_because_crawler && module_exist('browscap')) {
+    if (!$ignoring_because_crawler && module_exists('browscap')) {
       // If we're ignoring based on role, we don't want to count
       // the browser stats
       browscap_unmonitor();
@@ -96,6 +96,25 @@ function statistics_filter_exit() {
 }
 
 /**
+ * Implementation of hook_menu().
+ */
+function statistics_filter_menu($may_cache) {
+  $items = array();
+
+  if ($may_cache) {
+    $items[] = array(
+      'path' => 'admin/logs/settings/statistics-filter',
+      'title' => t('Statistics filter settings'),
+      'description' => t("Set up which types of site access you don't want to get logged."),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('statistics_filter_admin_settings'),
+      'access' => user_access('administer statistics filter'),
+      'type' => MENU_NORMAL_ITEM);
+  }
+  return $items;
+}
+
+/**
  * Implementation of hook_perm().
  *
  * @return array
@@ -105,17 +124,17 @@ function statistics_filter_perm() {
 }
 
 /**
- * Implementation of hook_settings().
+ * Admin settings callback.
  */
-function statistics_filter_settings() {
+function statistics_filter_admin_settings() {
   $form = array();
 
   // Restrict administration of this module
-  if (user_access('administer statistics filter') === false) {
+  if (user_access('administer statistics filter') === FALSE) {
     return drupal_access_denied();
   }
 
-  if (!module_exist('statistics')) {
+  if (!module_exists('statistics')) {
     $output = array('statistics' => array(
                     '#value' => t('<p>The statistics_filter module is an extension of the <b>statistics</b> '.
                                   'module - you must enable <b>statistics</b> to use it.</p>')));
@@ -145,7 +164,7 @@ function statistics_filter_settings() {
     '#description' => t("Ignore accesses by users in any of the checked roles.")
   );
 
-  if (module_exist('browscap')) {
+  if (module_exists('browscap')) {
     $form['statistics_filter_crawlers'] = array(
       '#type' => 'checkbox',
       '#title' => t('Ignore crawlers'),
@@ -154,7 +173,5 @@ function statistics_filter_settings() {
     );
   }
 
-  return $form;
+  return system_settings_form($form);
 }
-
-?>
