X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fpage%2Fheader.inc;h=cd454b6d50e7cf0172181a9bf090d47f3d2bb127;hb=56390edbd0d21b90f348200144d06c096483e59c;hp=bf93e2d5e1bf15301a9c4bea8bc5a0bc3b1545a2;hpb=3a1f2b3032483a04ffca4bb037ddb5c73d4730a7;p=fa-stable.git diff --git a/includes/page/header.inc b/includes/page/header.inc index bf93e2d5..cd454b6d 100644 --- a/includes/page/header.inc +++ b/includes/page/header.inc @@ -1,5 +1,14 @@ . +***********************************************************************/ function help_url($title, $app) { @@ -17,7 +26,7 @@ function help_url($title, $app) } elseif ($title==_("Main Menu")) { - $help_page_url = $applications[$app]; + $help_page_url = access_string($applications[$app], true); } else { @@ -27,14 +36,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 +84,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; @@ -77,71 +103,28 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="" else $sel_app = $def_app; $_SESSION["sel_app"] = $sel_app; + if (isset($_SESSION["App"]) && is_object($_SESSION["App"])) + $_SESSION["App"]->selected_application = $sel_app; $encoding = $_SESSION['language']->encoding; 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"; - if (file_exists($local_path_to_root. "/".$local_stylesheet)) - echo " \n"; - if ($js != "") - echo $js; + echo ""; + 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