Inserted a pl_error field in the json responses
authorRiton <henri.jouhaud@polytechnique.org>
Sat, 4 Sep 2010 14:54:49 +0000 (16:54 +0200)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 4 Sep 2010 16:14:15 +0000 (18:14 +0200)
Signed-off-by: Riton <henri.jouhaud@polytechnique.org>
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/plpage.php

index a38a076..63ece95 100644 (file)
@@ -370,6 +370,10 @@ abstract class PlPage extends Smarty
     protected function jsonDisplay()
     {
         pl_content_headers("text/javascript");
+        if (!empty($GLOBALS['pl_errors'])) {
+            $this->jsonAssign('pl_errors', join("\n", $GLOBALS['pl_errors']));
+            $GLOBALS['pl_errors'] = array();
+        }
         array_walk_recursive($this->_jsonVars, "escape_xorgDB");
         $jsonbegin = Env::v('jsonBegin');
         $jsonend = Env::v('jsonEnd');