Earlier error handler binding.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 22 May 2008 09:34:56 +0000 (09:34 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Thu, 22 May 2008 09:34:56 +0000 (09:34 +0000)
CHANGELOG.txt
includes/main.inc
includes/session.inc
js/utils.js

index 1ac3eb177242ce4dbe4f6caee1fe0740d09ba3f9..d1d86dbdb7178771c7dc98311682c03865baf639 100644 (file)
@@ -19,6 +19,13 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+22-May-2008 Janusz Dobrowolski
+! Error handler switching moved to session.inc for early error catching
+$ /includes/main.inc
+  /includes/session.inc
+! Cosmetic cleanup
+  /js/utils.js
+  
 18-May-2008 Janusz Dobrowolski
 # Added explicit ob_end_flush() on shutdown needed for php5
 $ /includes/main.inc
index b63a86cc173244ada06d060329054d49822ab29b..be80677f5389f9b9948cca7ceae69a8bbcb1ddcb 100644 (file)
     include_once($path_to_root . "/admin/db/users_db.inc");
     include_once($path_to_root . "/includes/ui/ui_view.inc");
        
-       function output_html($text) 
-       {
-         global $before_box;
-         return  in_ajax() ? fmt_errors() : ($before_box.fmt_errors().$text);
-       }
-
     function page($title, $no_menu=false, $is_index=false, $onload="", $js="")
     {
 
        global $path_to_root;
 
        $hide_menu = $no_menu;
-               // intercept all output to destroy it in case of ajax call
-               register_shutdown_function('ob_end_flush');
-               ob_start('output_html',0);
-               // colect all error msgs
-               set_error_handler('error_handler' /*, errtypes */);
 
        include($path_to_root . "/includes/page/header.inc");
 
index ee1ac295e2714f1b8cffd99401b5c5d0af089b82..b7efb1899c524d1e4f15562dd4ca851c5efb891e 100644 (file)
@@ -9,6 +9,12 @@
     | by Joe Hunt Consulting         |
        \--------------------------------------------------*/
 
+       function output_html($text) 
+       {
+         global $before_box;
+         return  in_ajax() ? fmt_errors() : ($before_box.fmt_errors().$text);
+       }
+
        if (!isset($path_to_root)) 
        {
                $path_to_root = ".";
             exit;
         }
        }
+       include_once("ajax.inc");
+       $Ajax =& new Ajax();
+       // intercept all output to destroy it in case of ajax call
+       register_shutdown_function('ob_end_flush');
+       ob_start('output_html',0);
+       // colect all error msgs
+       set_error_handler('error_handler' /*, errtypes */);
 
        if (isset($_POST["user_name_entry_field"])) 
        {
     }*/
 
        //----------------------------------------------------------------------------------------
-       include_once("ajax.inc");
-
-       $Ajax =& new Ajax();
     
        check_page_security($page_security);
 
index 7c071c33dbaa13e8c94583af35fda61ffadc74bb..746fb77bac676f83a17c1d9a306d349ef72b74a5 100644 (file)
             false  // do not disable caching
         );
     }
-/*     //      calls form validation function
-       //
-    JsHttpRequest.validate= function(submit) {
-        JsHttpRequest.query(
-          'POST '+window.location.toString(), // backend
-           this.formValues('_validate_form'),
-            // Function is called when an answer arrives. 
-           function(result, errors) {
-                 if (result) {   
-                   window.location = result;
-                 } else
-                       return false;
-               return true;
-           },
-           false
-       );
-    }
-*/     // returns input field values submitted when form button 'name' is pressed
+       // returns input field values submitted when form button 'name' is pressed
        //
        JsHttpRequest.formValues = function(inp)
        {
@@ -162,4 +145,3 @@ function goBack() {
        else
         window.history.go(-1);
 }
-       
\ No newline at end of file