2 /**********************************************************************
3 Copyright (C) FrontAccounting, LLC.
4 Released under the terms of the GNU General Public License, GPL,
5 as published by the Free Software Foundation, either version 3
6 of the License, or (at your option) any later version.
7 This program is distributed in the hope that it will be useful,
8 but WITHOUT ANY WARRANTY; without even the implied warranty of
9 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
11 ***********************************************************************/
16 page(_("Main Menu"), false, true);
21 end_page(false, true);
24 function menu_header($title, $no_menu, $is_index)
26 global $path_to_root, $help_base_url, $db_connections;
27 // you can owerride the table styles from config.php here, if you want.
28 //global $table_style, $table_style2;
29 //$table_style = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";
30 //$table_style2 = "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";
31 echo "<table class='callout_main' border='0' cellpadding='0' cellspacing='0'>\n";
33 echo "<td colspan='2' rowspan='2'>\n";
35 echo "<table class='main_page' border='0' cellpadding='0' cellspacing='0'>\n";
38 echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
40 echo "<td class='quick_menu'>\n";
43 $applications = $_SESSION['App']->applications;
44 $local_path_to_root = $path_to_root;
45 $sel_app = $_SESSION['sel_app'];
46 echo "<table cellpadding=0 cellspacing=0 width='100%'><tr><td>";
47 echo "<div class=tabs>";
48 foreach($applications as $app)
50 $acc = access_string($app->name);
51 echo "<a ".($sel_app == $app->id ? "class='selected' " : "").
52 "href='$local_path_to_root/index.php?application=".$app->id.
53 SID ."'$acc[1]>" .$acc[0] . "</a>";
57 echo "</td></tr></table>";
59 echo "<table class=logoutBar>";
60 echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
61 $indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif";
62 echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>";
63 echo " <td class='logoutBarRight'><a href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a> \n";
64 echo " <a href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a> \n";
66 if ($help_base_url != null)
68 echo "<a target = '_blank' onclick=" .'"'."javascript:openWindow(this.href,this.target); return false;".'" '. "href='". help_url($title, $sel_app)."'>" . _("Help") . "</a> ";
70 echo "<a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a> ";
71 echo "</td></tr></table>";
73 echo "</td></tr></table>";
75 if ($title && !$no_menu && !$is_index)
77 echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td>"
79 .(user_hints() ? "<span id='hints'></span>" : '')
81 ."</tr></table></center>";
89 function menu_footer($no_menu, $is_index)
91 global $version, $allow_demo_mode, $app_title, $power_url, $power_by, $path_to_root;
92 include_once($path_to_root . "/includes/date_functions.inc");
94 if ($no_menu == false)
97 echo "<table class=bottomBar>\n";
99 echo "<table class=bottomBar2>\n";
101 if (isset($_SESSION['wa_current_user']))
102 echo "<td class=bottomBarCell>" . Today() . " | " . Now() . "</td>\n";
103 echo "</tr></table>\n";
105 echo "</td></tr></table></td>\n";
107 if ($no_menu == false)
109 echo "<table align='center' id='footer'>\n";
111 echo "<td align='center' class='footer'><a target='_blank' href='$power_url'><font color='#ffffff'>$app_title $version - " . _("Theme:") . " " . user_theme() . "</font></a></td>\n";
114 echo "<td align='center' class='footer'><a target='_blank' href='$power_url'><font color='#ffff00'>$power_by</font></a></td>\n";
116 if ($allow_demo_mode==true)
119 //echo "<td><br><div align='center'><a href='http://sourceforge.net'><img src='http://sourceforge.net/sflogo.php?group_id=89967&type=5' alt='SourceForge.net Logo' width='210' height='62' border='0' align='middle' /></a></div></td>\n";
122 echo "</table><br><br>\n";
126 function display_applications(&$waapp)
129 $selected_app = $waapp->get_selected_application();
131 foreach ($selected_app->modules as $module)
136 echo "<td valign='top' class='menu_group'>";
137 echo "<table border=0 width='100%'>";
138 echo "<tr><td class='menu_group'>";
140 echo "</td></tr><tr>";
141 echo "<td class='menu_group_items'>";
143 foreach ($module->lappfunctions as $appfunction)
145 if ($_SESSION["wa_current_user"]->can_access_page($appfunction->access))
147 $lnk = access_string($appfunction->label);
148 echo "<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
152 if (sizeof($module->rappfunctions) > 0)
154 echo "<td width='50%' class='menu_group_items'>";
155 foreach ($module->rappfunctions as $appfunction)
157 if ($_SESSION["wa_current_user"]->can_access_page($appfunction->access))
159 $lnk = access_string($appfunction->label);
160 echo "<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
166 echo "</tr></table></td></tr>";