460a366748134f8e3a6757865f1deba0a8fc9df8
[fa-stable.git] / themes / default / renderer.php
1 <?php
2
3         class renderer
4         {
5                 function wa_header()
6                 {
7                         page(_("Main Menu"), false, true);
8                 }
9
10                 function wa_footer()
11                 {
12                         end_page(false, true);
13                 }
14
15                 function menu_header($title, $no_menu, $is_index)
16                 {
17                         global $path_to_root, $applications, $help_base_url, $db_connections;
18                         // you can owerride the table styles from config.php here, if you want.
19                         //global $table_style, $table_style2;
20                         //$table_style  = "cellpadding=3 border=1 bordercolor='#8cacbb' style='border-collapse: collapse'";
21                         //$table_style2 = "cellpadding=3 border=1 bordercolor='#cccccc' style='border-collapse: collapse'";
22                         echo "<table class='callout_main' border='0' cellpadding='0' cellspacing='0'>\n";
23                         echo "<tr>\n";
24                         echo "<td colspan='2' rowspan='2'>\n";
25
26                         echo "<table class='main_page' border='0' cellpadding='0' cellspacing='0'>\n";
27                         echo "<tr>\n";
28                         echo "<td>\n";
29                         echo "<table width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
30                         echo "<tr>\n";
31                         echo "<td class='quick_menu'>\n";
32                         if (!$no_menu)
33                         {
34                                 $local_path_to_root = $path_to_root;
35                                 $sel_app = $_SESSION['sel_app'];
36                                 echo "<table cellpadding=0 cellspacing=0 width='100%'><tr><td>";
37                                 echo "<div class=tabs>";
38                                 foreach($applications as $app => $name)
39                                 {
40                                         $acc = access_string($name);
41                                         echo "<a ".($sel_app == $app ? "class='selected' " : "").
42                                         "href='$local_path_to_root/index.php?application=".$app.
43                                                 SID ."'$acc[1]>" .$acc[0] . "</a>";
44                                 }
45                                 echo "</div>";
46                                 echo "</td></tr></table>";
47
48                                 echo "<table class=logoutBar>";
49                                 echo "<tr><td class=headingtext3>" . $db_connections[$_SESSION["wa_current_user"]->company]["name"] . " | " . $_SERVER['SERVER_NAME'] . " | " . $_SESSION["wa_current_user"]->name . "</td>";
50                                 $indicator = "$path_to_root/themes/".user_theme(). "/images/ajax-loader.gif";
51                                 echo "<td class='logoutBarRight'><img id='ajaxmark' src='$indicator' align='center' style='visibility:hidden;'></td>";
52                                 echo "  <td class='logoutBarRight'><a href='$path_to_root/admin/display_prefs.php?'>" . _("Preferences") . "</a>&nbsp;&nbsp;&nbsp;\n";
53                                 echo "  <a href='$path_to_root/admin/change_current_user_password.php?selected_id=" . $_SESSION["wa_current_user"]->username . "'>" . _("Change password") . "</a>&nbsp;&nbsp;&nbsp;\n";
54
55                                 if ($help_base_url != null)
56                                 {
57                                         echo "<a target = '_blank' onclick=" .'"'."javascript:openWindow(this.href,this.target); return false;".'" '. "href='". help_url($title, $sel_app)."'>" . _("Help") . "</a>&nbsp;&nbsp;&nbsp;";
58                                 }
59                                 echo "<a href='$local_path_to_root/access/logout.php?'>" . _("Logout") . "</a>&nbsp;&nbsp;&nbsp;";
60                                 echo "</td></tr></table>";
61                         }
62                         echo "</td></tr></table>";
63
64                         if ($title && !$no_menu && !$is_index)
65                         {
66                                 echo "<center><table width='100%'><tr><td width='100%' class='titletext'>$title</td>"
67                                 ."<td align=right>"
68                                 .(user_hints() ? "<span id='hints'></span>" : '')
69                                 ."</td>"
70                                 ."</tr></table></center>";
71                         }
72
73                         if (!$is_index)
74                                 echo "<br>";
75
76                 }
77
78                 function menu_footer($no_menu, $is_index)
79                 {
80                         global $version, $allow_demo_mode, $app_title, $power_url, $power_by, $path_to_root;
81                         include_once($path_to_root . "/includes/date_functions.inc");
82
83                         if ($no_menu == false)
84                         {
85                                 if ($is_index)
86                                         echo "<table class=bottomBar>\n";
87                                 else
88                                         echo "<table class=bottomBar2>\n";
89                                 echo "<tr>";
90                                 if (isset($_SESSION['wa_current_user']))
91                                         echo "<td class=bottomBarCell>" . Today() . " | " . Now() . "</td>\n";
92                                 echo "</tr></table>\n";
93                         }
94                         echo "</td></tr></table></td>\n";
95                         echo "</table>\n";
96                         if ($no_menu == false)
97                         {
98                                 echo "<table align='center' id='footer'>\n";
99                                 echo "<tr>\n";
100                                 echo "<td align='center' class='footer'><a target='_blank' href='$power_url' tabindex='-1'><font color='#ffffff'>$app_title $version - " . _("Theme:") . " " . user_theme() . "</font></a></td>\n";
101                                 echo "</tr>\n";
102                                 echo "<tr>\n";
103                                 echo "<td align='center' class='footer'><a target='_blank' href='$power_url' tabindex='-1'><font color='#ffff00'>$power_by</font></a></td>\n";
104                                 echo "</tr>\n";
105                                 if ($allow_demo_mode==true)
106                                 {
107                                         echo "<tr>\n";
108                                         //echo "<td><br><div align='center'><a href='http://sourceforge.net'><img src='http://sourceforge.net/sflogo.php?group_id=89967&amp;type=5' alt='SourceForge.net Logo' width='210' height='62' border='0' align='middle' /></a></div></td>\n";
109                                         echo "</tr>\n";
110                                 }
111                                 echo "</table><br><br>\n";
112                         }
113                 }
114
115                 function display_applications(&$waapp)
116                 {
117
118                         $selected_app = $waapp->get_selected_application();
119
120                         foreach ($selected_app->modules as $module)
121                         {
122                                 // image
123                                 echo "<tr>";
124                                 // values
125                                 echo "<td valign='top' class='menu_group'>";
126                                 echo "<table border=0 width='100%'>";
127                                 echo "<tr><td class='menu_group'>";
128                                 echo $module->name;
129                                 echo "</td></tr><tr>";
130                                 echo "<td class='menu_group_items'>";
131
132                                 foreach ($module->lappfunctions as $appfunction)
133                                 {
134                                         if ($_SESSION["wa_current_user"]->can_access_page($appfunction->access)) 
135                                         {
136                                                 $lnk = access_string($appfunction->label);
137                                                 echo "<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
138                                         }
139                                 }
140                                 echo "</td>";
141                                 if (sizeof($module->rappfunctions) > 0)
142                                 {
143                                         echo "<td width='50%' class='menu_group_items'>";
144                                         foreach ($module->rappfunctions as $appfunction)
145                                         {
146                                                 if ($_SESSION["wa_current_user"]->can_access_page($appfunction->access)) 
147                                                 {
148                                                         $lnk = access_string($appfunction->label);
149                                                         echo "<a href='$appfunction->link'$lnk[1]>$lnk[0]</a><br>";
150                                                 }
151                                         }
152                                         echo "</td>";
153                                 }
154
155                                 echo "</tr></table></td></tr>";
156                         }
157
158                         echo "</table>";
159                 }
160         }
161
162 ?>