X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=inline;f=includes%2Fpage%2Fheader.inc;h=f77de073cb9760b0b9ed161fb4f870aaa95979ee;hb=6918bb5a9e5505ebdeb1abd93127a68db5ece8b6;hp=d71f39fe29e55a12fa5d56e0c5c91264f2e6e5ea;hpb=d415c4b31baaa6379a0c360a93a1f78f983df4e7;p=fa-stable.git
diff --git a/includes/page/header.inc b/includes/page/header.inc
index d71f39fe..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;
+ 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,19 +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);
- // javascript includes collect
- add_js_source($js);
- $js ='';
- foreach($js_static as $jsfile) {
- $js .= '';
- }
- foreach($js_lib as $text) {
- $js .= $text;
- }
if (!isset($no_menu))
{
$no_menu = false;
@@ -72,68 +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 "\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
| |