[Mapbender-commits] r3398 - trunk/mapbender/lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Jan 2 10:25:42 EST 2009
Author: christoph
Date: 2009-01-02 10:25:42 -0500 (Fri, 02 Jan 2009)
New Revision: 3398
Modified:
trunk/mapbender/lib/ajax.js
trunk/mapbender/lib/ajax.php
Log:
http://trac.osgeo.org/mapbender/ticket/360
Modified: trunk/mapbender/lib/ajax.js
===================================================================
--- trunk/mapbender/lib/ajax.js 2009-01-02 15:24:40 UTC (rev 3397)
+++ trunk/mapbender/lib/ajax.js 2009-01-02 15:25:42 UTC (rev 3398)
@@ -131,12 +131,12 @@
/**
* The method to call on the server
*/
- var method = "";
+ var method = (typeof(options) == "object" && options.method) ? options.method : "";
/**
* The parameters to pass to the above method
*/
- var parameters = {};
+ var parameters = (typeof(options) == "object" && options.parameters) ? options.parameters : {};
/**
* A unique identifier for this Ajax request
@@ -256,7 +256,7 @@
var getParameters = function () {
return {
"method": method,
- "params": $.toJSON([parameters]),
+ "params": $.toJSON(parameters),
"id": id
};
}
Modified: trunk/mapbender/lib/ajax.php
===================================================================
--- trunk/mapbender/lib/ajax.php 2009-01-02 15:24:40 UTC (rev 3397)
+++ trunk/mapbender/lib/ajax.php 2009-01-02 15:25:42 UTC (rev 3398)
@@ -56,17 +56,19 @@
if ($requestArray["params"]) {
- $obj = $this->json->decode($requestArray["params"]);
- if (is_array($obj) && count($obj) == 1) {
- $this->paramObject = $obj[0];
- }
+ $obj = $this->json->decode(stripslashes($requestArray["params"]));
+ $this->paramObject = $obj;
}
}
}
+ public function getMethod () {
+ return $this->method;
+ }
+
public function getParameter ($key) {
- if (is_object($this->paramObject) && $this->paramObject[$key]) {
- return $this->paramObject[$key];
+ if (is_object($this->paramObject) && $this->paramObject->$key) {
+ return $this->paramObject->$key;
}
return null;
}
More information about the Mapbender_commits
mailing list