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 page_header($title, $no_menu=false, $is_index=false, $onload="", $js="")
32 // titles and screen header
33 global $db_connections, $path_to_root, $def_app, $applications,
34 $help_base_url, $help_page_url, $use_popup_windows;
35 $theme = user_theme();
36 $local_path_to_root = $path_to_root;
38 if ($help_base_url != null && $use_popup_windows && $js == '')
40 if (!function_exists('get_js_open_window'))
42 include_once($path_to_root.'/includes/ui/ui_view.inc');
44 $js = get_js_open_window(900, 500);
51 if (!isset($_SESSION["sel_app"]))
52 session_register("sel_app");
53 if (isset($_SESSION["App"]) && is_object($_SESSION["App"]) && isset($_SESSION["App"]->selected_application) &&
54 $_SESSION["App"]->selected_application != "")
55 $sel_app = $_SESSION["App"]->selected_application;
56 elseif (isset($_SESSION["sel_app"]) && $_SESSION["sel_app"] != "")
57 $sel_app = $_SESSION["sel_app"];
60 $_SESSION["sel_app"] = $sel_app;
62 echo "<html dir='" . $_SESSION['language']->dir . "' >";
63 echo "<head><title>$title</title>";
64 $encoding = $_SESSION['language']->encoding;
65 $local_stylesheet = $_SESSION['language']->get_stylesheet();
66 echo "<meta http-equiv='Content-type' content='text/html'; charset='$encoding'>";
67 echo "<link href='$local_path_to_root/themes/$theme/default.css' rel='stylesheet' type='text/css' /> \n";
68 if (file_exists($local_path_to_root. "/".$local_stylesheet))
69 echo "<link href='$local_path_to_root/$local_stylesheet' rel='stylesheet' type='text/css' /> \n";
76 echo "<body onload=\"$onload\">";
77 echo "<table class='callout_main' border='0' cellpadding='0' cellspacing='0'>\n";
79 echo "<td colspan='2' rowspan='2'>\n";
81 echo "<table class='main_page' border='0' cellpadding='0' cellspacing='0'>\n";
84 echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
86 echo "<td class='quick_menu'>\n";
89 echo "<table cellpadding=0 cellspacing=0 width='100%'><tr><td>";
90 echo "<div class=tabs>";
91 foreach($applications as $app => $name)
93 echo "<a ".($sel_app == $app ? "class='selected' " : "").
94 "href='$local_path_to_root/index.php?application=".$app.
95 SID ."'>" .$name . "</a>";
99 echo "</td></tr></table>";
101 echo "<table class=logoutBar>";
102 echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
103 if ($help_base_url != null)
106 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>";
108 echo "<td class=logoutBarRight><a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a>";
109 echo "</td></tr></table>";
112 echo "</td></tr></table>";
114 if ($title && !$no_menu && !$is_index)
116 echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td></tr></table></center>";