3 function help_url($title, $app)
6 global $help_page_url, $help_base_url, $applications, $help_page_title;
8 if (isset($help_page_url))
10 return $help_base_url.$help_page_url;
14 if (isset($help_page_title))
16 $help_page_url = $help_page_title;
18 elseif ($title==_("Main Menu"))
20 $help_page_url = $applications[$app];
24 $help_page_url = $title;
27 return $help_base_url.urlencode(str_replace(' ', '', ucwords($help_page_url)));
30 function send_scripts()
32 global $js_lib, $js_static, $js_path, $js_userlib, $comp_path,
33 $path_to_root, $go_debug;
38 foreach($js_static as $jsfile) {
39 $fpath = $comp_path.'/'.user_company().'/js_cache/'.$jsfile;
40 // compress also static files
41 if (!file_exists($fpath) || $go_debug)
42 cache_js_file($fpath, file_get_contents($js_path.$jsfile));
44 $js .= '<script language="javascript" type="text/javascript" src="'.
45 $fpath . '"></script>';
47 foreach($js_userlib as $jsfile) {
48 $js .= '<script language="javascript" type="text/javascript" src="'.
49 $jsfile . '"></script>';
52 foreach($js_lib as $text) {
58 function page_header($title, $no_menu=false, $is_index=false, $onload="", $js="")
60 // titles and screen header
61 global $db_connections, $path_to_root, $def_app, $applications,
62 $help_base_url, $help_page_url, $use_popup_windows;
64 if (in_ajax()) return; // just for speed up
66 $theme = user_theme();
67 $local_path_to_root = $path_to_root;
69 if ($help_base_url != null && $use_popup_windows && $js == '')
71 if (!function_exists('get_js_open_window'))
73 include_once($path_to_root.'/includes/ui/ui_view.inc');
75 add_js_source(get_js_open_window(900, 500));
84 if (!isset($_SESSION["sel_app"]))
85 session_register("sel_app");
86 if (isset($_SESSION["App"]) && is_object($_SESSION["App"]) && isset($_SESSION["App"]->selected_application) &&
87 $_SESSION["App"]->selected_application != "")
88 $sel_app = $_SESSION["App"]->selected_application;
89 elseif (isset($_SESSION["sel_app"]) && $_SESSION["sel_app"] != "")
90 $sel_app = $_SESSION["sel_app"];
93 $_SESSION["sel_app"] = $sel_app;
94 $encoding = $_SESSION['language']->encoding;
97 header("Content-type: text/html; charset='$encoding'");
99 echo "<html dir='" . $_SESSION['language']->dir . "' >\n";
100 echo "<head><title>$title</title>";
101 $local_stylesheet = $_SESSION['language']->get_stylesheet();
102 echo "<meta http-equiv='Content-type' content='text/html'; charset='$encoding'>";
103 echo "<link href='$local_path_to_root/themes/$theme/default.css' rel='stylesheet' type='text/css' /> \n";
104 if (file_exists($local_path_to_root. "/".$local_stylesheet))
105 echo "<link href='$local_path_to_root/$local_stylesheet' rel='stylesheet' type='text/css' /> \n";
112 echo "<body onload=\"$onload\">";
114 echo "<table class='callout_main' border='0' cellpadding='0' cellspacing='0'>\n";
116 echo "<td colspan='2' rowspan='2'>\n";
118 echo "<table class='main_page' border='0' cellpadding='0' cellspacing='0'>\n";
121 echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
123 echo "<td class='quick_menu'>\n";
126 echo "<table cellpadding=0 cellspacing=0 width='100%'><tr><td>";
127 echo "<div class=tabs>";
128 foreach($applications as $app => $name)
130 echo "<a ".($sel_app == $app ? "class='selected' " : "").
131 "href='$local_path_to_root/index.php?application=".$app.
132 SID ."'>" .$name . "</a>";
136 echo "</td></tr></table>";
138 echo "<table class=logoutBar>";
139 echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
140 if ($help_base_url != null)
143 echo "<td align=right ><a target = '_blank' onclick=" .'"'."javascript:openWindow(this.href,this.target); return false;".'" '. "href='". help_url($title, $sel_app)."'>" . _("Help") . "</a></td>";
145 echo "<td class=logoutBarRight><a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a>";
146 echo "</td></tr></table>";
149 echo "</td></tr></table>";
151 if ($title && !$no_menu && !$is_index)
153 echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td></tr></table></center>";