X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fpage%2Fheader.inc;h=f77de073cb9760b0b9ed161fb4f870aaa95979ee;hb=570a9b11ac5a56bf97aeef669838ef45abaf65a4;hp=bf93e2d5e1bf15301a9c4bea8bc5a0bc3b1545a2;hpb=3a1f2b3032483a04ffca4bb037ddb5c73d4730a7;p=fa-stable.git diff --git a/includes/page/header.inc b/includes/page/header.inc index bf93e2d5..f77de073 100644 --- a/includes/page/header.inc +++ b/includes/page/header.inc @@ -27,14 +27,44 @@ function help_url($title, $app) return $help_base_url.urlencode(str_replace(' ', '', ucwords($help_page_url))); } +function send_scripts() +{ + global $js_lib, $js_static, $js_path, $js_userlib, $comp_path, + $path_to_root, $go_debug; + + add_user_js_data(); + + $js =''; + foreach($js_static as $jsfile) + { + $fpath = $comp_path.'/'.user_company().'/js_cache/'.$jsfile; + // compress also static files + if (!file_exists($fpath) || $go_debug) + cache_js_file($fpath, file_get_contents($js_path.$jsfile)); + + $js .= ''; + } + foreach($js_userlib as $jsfile) + { + $js .= ''; + } + + foreach($js_lib as $text) + { + $js .= $text; + } + echo $js; +} + function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="") { // titles and screen header - global $db_connections, $path_to_root, $def_app, $applications, - $help_base_url, $help_page_url, $use_popup_windows, - $js_lib, $js_static, $js_path, $js_userlib, $comp_path; + global $path_to_root, $def_app, $use_popup_windows, $help_base_url; - if (isset($_GET['ajax'])) return; + if (in_ajax()) + return; // just for speed up $theme = user_theme(); $local_path_to_root = $path_to_root; @@ -45,24 +75,11 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="" { include_once($path_to_root.'/includes/ui/ui_view.inc'); } - $js = get_js_open_window(900, 500); + add_js_source(get_js_open_window(900, 500)); } + if ($js!='') + add_js_source($js); - add_js_user_num(); // add user native numeric input functions - // javascript includes collect - add_js_source($js); - $js =''; - foreach($js_static as $jsfile) { - $js .= ''; - } - foreach($js_userlib as $jsfile) { - $js .= ''; - } - foreach($js_lib as $text) { - $js .= $text; - } if (!isset($no_menu)) { $no_menu = false; @@ -82,66 +99,24 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="" if (!headers_sent()){ header("Content-type: text/html; charset='$encoding'"); } + echo "\n"; echo "dir . "' >\n"; echo "$title"; $local_stylesheet = $_SESSION['language']->get_stylesheet(); - echo ""; - echo " \n"; + echo ""; + echo " \n"; if (file_exists($local_path_to_root. "/".$local_stylesheet)) - echo " \n"; - if ($js != "") - echo $js; + echo " \n"; + send_scripts($js); + echo " \n"; if ($onload == "") echo ""; else echo ""; - echo "\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - - echo "\n"; - echo "\n"; - echo "
\n"; - echo "\n"; - echo "\n"; - echo "
\n"; - if (!$no_menu) - { - echo "
"; - echo "
"; - foreach($applications as $app => $name) - { - echo "" .$name . ""; - } - echo "
"; - - echo "
"; - - echo ""; - echo ""; - if ($help_base_url != null) - { - - echo ""; - } - echo "
" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "" . _("Help") . "" . _("Logout") . ""; - echo "
"; - } - - echo "
"; - - if ($title && !$no_menu && !$is_index) - { - echo "
$title
"; - } - - if (!$is_index) - echo "
"; + include_once($local_path_to_root."/themes/".user_theme()."/renderer.php"); + $rend = new renderer(); + $rend->menu_header($title, $no_menu, $is_index); } ?> \ No newline at end of file