savelocation ajax action is POST only
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 9 Nov 2009 18:48:23 +0000 (13:48 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 9 Nov 2009 18:48:23 +0000 (13:48 -0500)
ansel/js/googlemap.js
ansel/lib/Ajax/Imple/ImageSaveGeotag.php

index ec3d392..8aeb146 100644 (file)
@@ -250,9 +250,7 @@ Ansel_GMap.prototype = {
 
     /**
      * Custom getLocations method so we can check for our own locally cached
-     * geodata first. We can't implement our own GGeocodeCache becuase we want
-     * to allow a per-user override of an individual image, not a general cache
-     * of lat/lng => location text.
+     * geodata first.
      */
     getLocations: function(p) {
         if (p.image_data.image_location.length > 0) {
@@ -308,14 +306,10 @@ Ansel_GMap.prototype = {
 
                 // Cache the location locally?
                 if (update) {
-                    new Ajax.Request(this.options['updateEndpoint'],
+                    new Ajax.Request(this.options['updateEndpoint'] + "/action=location/post=values",
                                     {
                                         method: 'post',
-                                        parameters: {
-                                            type: 'location',
-                                            location: encodeURIComponent(place.address),
-                                            img: image_data.image_id
-                                        }
+                                        parameters: { "values": "location=" + encodeURIComponent(place.address) + "/img=" + image_data.image_id }
                                     }
                     );
                 }
index dd86d2e..ea85f9c 100644 (file)
@@ -26,10 +26,10 @@ class Ansel_Ajax_Imple_ImageSaveGeotag extends Horde_Ajax_Imple_Base
         include_once dirname(__FILE__) . '/../../base.php';
 
         $type = $args['action'];
-        $location = empty($post['location']) ? '' : $post['location'];
+        $location = empty($post['location']) ? null : $post['location'];
+        $lat = empty($post['lat']) ? null : $post['lat'];
+        $lng = empty($post['lng']) ? null : $post['lng'];
         $img = $post['img'];
-        $lat = $post['lat'];
-        $lng = $post['lng'];
 
         if (empty($img) ||
             ($type == 'location' && empty($location)) ||