]> git.wh0rd.org - tt-rss.git/blobdiff - errors.php
pngcrush.sh
[tt-rss.git] / errors.php
index 2963beb8d973cb35a27dab9bdc68d3033ba3f313..d9185307a7bb8430b352b81bb35617141402c4b4 100644 (file)
@@ -1,28 +1,54 @@
 <?php
-       $ERRORS[0] = "Unknown error";
+       set_include_path(dirname(__FILE__) ."/include" . PATH_SEPARATOR .
+               get_include_path());
 
-       $ERRORS[1] = "This program requires XmlHttpRequest " .
-                       "to function properly. Your browser doesn't seem to support it.";
+       require_once "functions.php";
 
-       $ERRORS[2] = "This program requires cookies " .
-                       "to function properly. Your browser doesn't seem to support them.";
+       $ERRORS[0] = "";
 
-       $ERRORS[3] = "Backend sanity check failed";
+       $ERRORS[1] = __("This program requires XmlHttpRequest " .
+                       "to function properly. Your browser doesn't seem to support it.");
 
-       $ERRORS[4] = "Frontend sanity check failed.";
+       $ERRORS[2] = __("This program requires cookies " .
+                       "to function properly. Your browser doesn't seem to support them.");
 
-       $ERRORS[5] = "Incorrect database schema version.";
+       $ERRORS[3] = __("Backend sanity check failed.");
 
-       $ERRORS[6] = "Request not authorized.";
+       $ERRORS[4] = __("Frontend sanity check failed.");
 
-       $ERRORS[7] = "No operation to perform.";
+       $ERRORS[5] = __("Incorrect database schema version. &lt;a href='db-updater.php'&gt;Please update&lt;/a&gt;.");
 
-       $ERRORS[8] = "Could not display feed: query failed. Please check label match syntax or local configuration.";
+       $ERRORS[6] = __("Request not authorized.");
 
-       $ERRORS[8] = "Denied. Your access level is insufficient to access this page.";
+       $ERRORS[7] = __("No operation to perform.");
 
-       $ERRORS[9] = "Configuration check failed";
+       $ERRORS[8] = __("Could not display feed: query failed. Please check label match syntax or local configuration.");
 
-       $ERRORS[10] = "Your version of MySQL is not currently supported. Please see 
-               official site for more information.";
+       $ERRORS[8] = __("Denied. Your access level is insufficient to access this page.");
+
+       $ERRORS[9] = __("Configuration check failed");
+
+       $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");
+
+       $ERRORS[13] = __("Method not found");
+
+       $ERRORS[14] = __("Plugin not found");
+
+       if ($_REQUEST['mode'] == 'js') {
+               header("Content-Type: text/javascript; 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";
+               }
+       }
 ?>