X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fmain.inc;h=19279f04d74a68c5b85524907024de65f9ad8af8;hb=63d844bf6eeb980092224af6b613ee9da31a31cc;hp=b63a86cc173244ada06d060329054d49822ab29b;hpb=bcbf5c697db09a36994f391b5fe568d269145c68;p=fa-stable.git diff --git a/includes/main.inc b/includes/main.inc index b63a86cc..19279f04 100644 --- a/includes/main.inc +++ b/includes/main.inc @@ -13,29 +13,27 @@ include_once($path_to_root . "/admin/db/users_db.inc"); include_once($path_to_root . "/includes/ui/ui_view.inc"); + include_once($path_to_root . "/includes/ui/ui_controls.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="") + function page($title, $no_menu=false, $is_index=false, $onload="", $js="", $script_only=false) { 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"); page_header($title, $no_menu, $is_index, $onload, $js); error_box(); + if($script_only) { + echo ''; + div_start('_page_body', null, true); + } else { + div_start('_page_body'); // whole page content for ajax reloading + } } function end_page($no_menu=false, $is_index=false) @@ -44,9 +42,9 @@ $hide_menu = $no_menu; + div_end(); // _page_body section include($path_to_root . "/includes/page/footer.inc"); - $Ajax->run(); page_footer($no_menu, $is_index); }