]> git.wh0rd.org - tt-rss.git/blobdiff - errors.php
reduce the number of always included libraries
[tt-rss.git] / errors.php
index b2e0841a3a7577e48979f92faaa3fe0926ced9c8..12aeffe751943c219d9c65eed4442573f73bf7f0 100644 (file)
@@ -1,6 +1,7 @@
 <?php
+       require_once "functions.php";
 
-       $ERRORS[0] = __("Unknown error");
+       $ERRORS[0] = "";
 
        $ERRORS[1] = __("This program requires XmlHttpRequest " .
                        "to function properly. Your browser doesn't seem to support it.");
 
        $ERRORS[9] = __("Configuration check failed");
 
-       $ERRORS[10] = __("Your version of MySQL is not currently supported. Please see 
+       $ERRORS[10] = __("Your version of MySQL is not currently supported. Please see
                official site for more information.");
 
        $ERRORS[11] = "[This error is not returned by server]";
 
        $ERRORS[12] = __("SQL escaping test failed, check your database and PHP configuration");
+
+       if ($_REQUEST['mode'] == 'js') {
+               header("Content-Type: text/plain; charset=UTF-8");
+
+               print "var ERRORS = [];\n";
+
+               foreach ($ERRORS as $id => $error) {
+
+                       $error = preg_replace("/\n/", "", $error);
+                       $error = preg_replace("/\"/", "\\\"", $error);
+
+                       print "ERRORS[$id] = \"$error\";\n";
+               }
+       }
 ?>