Add interface PlIteraface and the corresponding abstract class
[platal.git] / 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');