[Mapbender-commits] r6584 - trunk/mapbender/lib
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Jul 8 05:53:27 EDT 2010
Author: christoph
Date: 2010-07-08 09:53:27 +0000 (Thu, 08 Jul 2010)
New Revision: 6584
Modified:
trunk/mapbender/lib/ajax.php
Log:
added second parameter to setSuccess for error code
Modified: trunk/mapbender/lib/ajax.php
===================================================================
--- trunk/mapbender/lib/ajax.php 2010-07-08 09:29:54 UTC (rev 6583)
+++ trunk/mapbender/lib/ajax.php 2010-07-08 09:53:27 UTC (rev 6584)
@@ -160,8 +160,14 @@
*
* @param $trueOrFalse Boolean
*/
- public function setSuccess ($trueOrFalse) {
+ public function setSuccess ($trueOrFalse, $code) {
$this->success = $trueOrFalse;
+
+ if (!$this->success && is_numeric($code)) {
+ $this->error = array(
+ "code" => intval($code)
+ );
+ }
}
/**
@@ -202,6 +208,12 @@
"message" => $this->message
);
}
+ else if (is_array($this->error)
+ && is_numeric($this->error["code"])
+ && !$this->error["message"]
+ ) {
+ $this->error["message"] = $this->message;
+ }
}
$obj = array(
"result" => $dataObject,
More information about the Mapbender_commits
mailing list