Index: location.views.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/location/location.views.inc,v
retrieving revision 1.16
diff -u -r1.16 location.views.inc
--- location.views.inc	3 Dec 2008 22:51:23 -0000	1.16
+++ location.views.inc	14 Jan 2009 17:28:19 -0000
@@ -66,6 +66,9 @@
       'location_handler_sort_location_distance' => array(
         'parent' => 'views_handler_sort',
       ),
+      'location_handler_argument_location_distance' => array(
+        'parent' => 'views_handler_argument',
+      ),
 //      'location_handler_relationship_location_distance' => array(
 //        'parent' => 'views_handler_relationship',
 //      ),
@@ -306,6 +309,9 @@
     'filter' => array(
       'handler' => 'location_views_handler_filter_proximity',
     ),
+    'argument' => array(
+      'handler' => 'location_handler_argument_location_distance',
+    ),
 //    'relationship' => array(
 //      'handler' => 'location_handler_relationship_location_distance',
 //    ),
@@ -364,8 +370,66 @@
   );
 
 
+  $data['location_instance']['nid'] = array(
+    'title' => t('Nodes'),
+    'help' => t('Relate a location to the nodes it is associated with.'),
+    'relationship' => array(
+      'base' => 'node',
+      'field' => 'nid',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Location: User'), // @@@ Some sort of better name?
+      'extra' => array(
+        array(
+          'field' => 'nid',
+          'operator' => '!=',
+          'numeric' => TRUE,
+          'value' => 0,
+        ),
+      ),
+    ),
+  );
+
+  $data['location_instance']['vid'] = array(
+    'title' => t('Node Revisions'),
+    'help' => t('Relate a location to the node revisions it is associated with.'),
+    'relationship' => array(
+      'base' => 'node_revisions',
+      'field' => 'vid',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Location: User'), // @@@ Some sort of better name?
+      'extra' => array(
+        array(
+          'field' => 'vid',
+          'operator' => '!=',
+          'numeric' => TRUE,
+          'value' => 0,
+        ),
+      ),
+    ),
+  );
+
+  $data['location_instance']['uid'] = array(
+    'title' => t('Users'),
+    'help' => t('Relate a location to the users it is associated with.'),
+    'relationship' => array(
+      'base' => 'users',
+      'field' => 'uid',
+      'handler' => 'views_handler_relationship',
+      'label' => t('Location: User'), // @@@ Some sort of better name?
+      'extra' => array(
+        array(
+          'field' => 'uid',
+          'operator' => '!=',
+          'numeric' => TRUE,
+          'value' => 0,
+        ),
+      ),
+    ),
+  );
+
+
   // Tell the base tables about us.
-  $data['node']['table']['join']['location'] = array(
+/*  $data['node']['table']['join']['location'] = array(
     'left_table' => 'location_instance',
     'left_field' => 'vid',
     'field' => 'vid',
@@ -380,6 +444,22 @@
     'left_field' => 'uid',
     'field' => 'uid',
   );
+*/
 
   return $data;
 }
+
+/**
+ * Implementation of hook_views_plugins().
+ */
+function location_views_plugins() {
+  return array(
+    'argument validator' => array(
+      'location' => array(
+        'title' => t('Location'),
+        'handler' => 'location_plugin_argument_validate_location',
+        'path' => drupal_get_path('module', 'location') . '/plugins',
+      ),
+    ),
+  );
+}

