X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fpage%2Fheader.inc;h=f77de073cb9760b0b9ed161fb4f870aaa95979ee;hb=c76c9607be58ce1d344f117556ac97da0dfcf218;hp=12b99eba88621902e141fb4f04fc4a4d03641b55;hpb=e3f700d1e11788f176bf02c7b9969780e66dc167;p=fa-stable.git
diff --git a/includes/page/header.inc b/includes/page/header.inc
index 12b99eba..f77de073 100644
--- a/includes/page/header.inc
+++ b/includes/page/header.inc
@@ -27,11 +27,45 @@ 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;
+ global $path_to_root, $def_app, $use_popup_windows, $help_base_url;
+
+ if (in_ajax())
+ return; // just for speed up
+
$theme = user_theme();
$local_path_to_root = $path_to_root;
@@ -41,8 +75,10 @@ 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);
if (!isset($no_menu))
{
@@ -58,66 +94,29 @@ function page_header($title, $no_menu=false, $is_index=false, $onload="", $js=""
else
$sel_app = $def_app;
$_SESSION["sel_app"] = $sel_app;
+ $encoding = $_SESSION['language']->encoding;
- echo "dir . "' >";
+ if (!headers_sent()){
+ header("Content-type: text/html; charset='$encoding'");
+ }
+ echo "\n";
+ echo "dir . "' >\n";
echo "
$title";
- $encoding = $_SESSION['language']->encoding;
$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 " ";
-
- if ($title && !$no_menu && !$is_index)
- {
- echo "";
- }
-
- 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
| |