Project

General

Profile

Download (16.3 KB) Statistics
| Branch: | Tag: | Revision:
1 c6c150e9 Scott Ullrich
<?php
2 7ac5a4cb Scott Ullrich
/*
3
	pfSense_MODULE:	header
4
*/
5 f0394bbb Scott Ullrich
6 705a4137 Ermal Luçi
require_once("globals.inc");
7 b8f82cd7 Scott Ullrich
require_once("functions.inc");
8 76692ad2 jim-p
require_once("shortcuts.inc");
9
require_once("service-utils.inc");
10 7ac5a4cb Scott Ullrich
11 b46bfcf5 Bill Marquette
/* $Id$ */
12 e86a8e57 Scott Ullrich
13 0a3eaf4d jim-p
14
/* Determine automated help URL. Should output the page name and
15
   parameters separately */
16
$uri_split = "";
17
preg_match("/\/(.*)\?(.*)/", $_SERVER["REQUEST_URI"], $uri_split);
18
19
/* If there was no match, there were no parameters, just grab the filename
20
   Otherwise, use the matched filename from above. */
21
if (empty($uri_split[0])) {
22
	$pagename = ltrim($_SERVER["REQUEST_URI"], '/');
23
} else {
24
	$pagename = $uri_split[1];
25
}
26
/* If the page name is still empty, the user must have requested / (index.php) */
27
if (empty($pagename)) {
28
	$pagename = "index.php";
29
}
30
31
/* If the filename is pkg_edit.php or wizard.php, reparse looking
32
	for the .xml filename */
33 b873ded5 jim-p
if (($pagename == "pkg.php") || ($pagename == "pkg_edit.php") || ($pagename == "wizard.php")) {
34 0a3eaf4d jim-p
	$param_split = explode('&', $uri_split[2]);
35
	foreach ($param_split as $param) {
36
		if (substr($param, 0, 4) == "xml=") {
37
			$xmlfile = explode('=', $param);
38
			$pagename = $xmlfile[1];
39
		}
40
	}
41
}
42
43
/* Build the full help URL. */
44
$helpurl .= "{$g['help_base_url']}?page={$pagename}";
45
46 e93441e0 Scott Ullrich
function return_ext_menu($section) {
47
	global $config;
48
	$htmltext = "";
49 5e3249f0 Scott Ullrich
	$extarray = array();
50 e93441e0 Scott Ullrich
	if($config['installedpackages']['menu'] <> "") {
51
		foreach($config['installedpackages']['menu'] as $menuitem) {
52
			if($menuitem['section'] != $section) continue;
53
			if($menuitem['url'] <> "") {
54 14f5f705 marcelloc
				$test_url=$menuitem['url'];
55 e93441e0 Scott Ullrich
			 	$addresswithport = getenv("HTTP_HOST");
56
				$colonpos = strpos($addresswithport, ":");
57
				if ($colonpos !== False){
58
					//my url is actually just the IP address of the pfsense box
59
					$myurl = substr($addresswithport, 0, $colonpos);
60 c987ed88 Scott Ullrich
				} else {
61 e93441e0 Scott Ullrich
					$myurl = $addresswithport;
62 90e3bbc0 Colin Smith
				}
63 2c7bc9d0 jim-p
				$description = str_replace('$myurl', $myurl, $menuitem['url']);
64 e93441e0 Scott Ullrich
			} else {
65
				$description = '/pkg.php?xml=' . $menuitem['configfile'];
66 14f5f705 marcelloc
				$test_url=$description;
67 c6c150e9 Scott Ullrich
			}
68 14f5f705 marcelloc
			 if(isAllowedPage($test_url)){
69
				$extarray[] = array($menuitem['name'], $description);
70
			 }
71 c6c150e9 Scott Ullrich
		}
72
	}
73 5e3249f0 Scott Ullrich
	return $extarray;
74 e93441e0 Scott Ullrich
}
75 65384707 Erik Kristensen
76 976d0213 Darren Embry
function output_menu($arrayitem, $target = null) {
77
	foreach ($arrayitem as $item) {
78 14f5f705 marcelloc
		if (isAllowedPage($item[1]) || $item[1]=="/index.php?logout"){
79
			$attr = sprintf("href=\"%s\"", htmlentities($item[1]));
80
			if ($target) {
81
				$attr .= sprintf(" target=\"%s\"", htmlentities($target));
82
			}
83
			$class = "navlnk";
84
			if ($item['class']) {
85
				$class .= " {$item['class']}";
86
			}
87
			$attr .= sprintf(" class=\"%s\"", htmlentities($class));
88
			if ($item['style']) {
89
				$attr .= sprintf(" style=\"%s\"", htmlentities($item['style']));
90
			}
91
			echo "<li>\n";
92
			printf("<a %s>%s</a>\n", $attr, $item[0]);
93
			echo "</li>\n";
94 976d0213 Darren Embry
		}
95 5e3249f0 Scott Ullrich
	}
96
}
97
98
// System
99 5ba2df71 Scott Ullrich
$system_menu = array();
100 94044c40 Carlos Eduardo Ramos
$system_menu[] = array(gettext("Advanced"), "/system_advanced_admin.php");
101
$system_menu[] = array(gettext("Firmware"), "/system_firmware.php");
102
$system_menu[] = array(gettext("General Setup"), "/system.php");
103 f97a5b04 Darren Embry
$system_menu[] = array(gettext("High Avail. Sync"), "/system_hasync.php");
104 94044c40 Carlos Eduardo Ramos
$system_menu[] = array(gettext("Logout"), "/index.php?logout");
105 5e3249f0 Scott Ullrich
if ($g['platform'] == "pfSense" or $g['platform'] == "nanobsd")
106 94044c40 Carlos Eduardo Ramos
	$system_menu[] = array(gettext("Packages"), "/pkg_mgr_installed.php");
107
$system_menu[] = array(gettext("Setup Wizard"), "/wizard.php?xml=setup_wizard.xml");
108
$system_menu[] = array(gettext("Routing"), "/system_gateways.php");
109
$system_menu[] = array(gettext("Cert Manager"), "/system_camanager.php");
110 43f26ab1 Ermal
if (!isAllowedPage("system_usermanager.php*"))
111 d8012adb Vinicius Coque
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager_passwordmg.php");
112 43f26ab1 Ermal
else
113 d8012adb Vinicius Coque
	$system_menu[] = array(gettext("User Manager"), "/system_usermanager.php");
114 5ba2df71 Scott Ullrich
$system_menu = msort(array_merge($system_menu, return_ext_menu("System")),0);
115 5e3249f0 Scott Ullrich
116
// Interfaces
117 5ba2df71 Scott Ullrich
$interfaces_menu = array();
118 5e3249f0 Scott Ullrich
if (!isset($config['system']['webgui']['noassigninterfaces']))
119 15e47776 Luiz Gustavo Costa
	$interfaces_menu[] = array(gettext("(assign)"), "/interfaces_assign.php");
120 5e3249f0 Scott Ullrich
$opts = get_configured_interface_with_descr(false, true);
121
foreach ($opts as $oif => $odescr)
122
	if (!isset($config['interfaces'][$oif]['ovpn']))
123 5ba2df71 Scott Ullrich
		$interfaces_menu[] = array(htmlspecialchars($odescr), "/interfaces.php?if={$oif}");
124
$interfaces_menu = msort(array_merge($interfaces_menu, return_ext_menu("Interfaces")),0);
125 5e3249f0 Scott Ullrich
126
// Firewall
127 5ba2df71 Scott Ullrich
$firewall_menu = array();
128 94044c40 Carlos Eduardo Ramos
$firewall_menu[] = array(gettext("Aliases"), "/firewall_aliases.php");
129
$firewall_menu[] = array(gettext("NAT"), "/firewall_nat.php");
130
$firewall_menu[] = array(gettext("Rules"), "/firewall_rules.php");
131
$firewall_menu[] = array(gettext("Schedules"), "/firewall_schedule.php");
132
$firewall_menu[] = array(gettext("Traffic Shaper"), "/firewall_shaper.php");
133
$firewall_menu[] = array(gettext("Virtual IPs"), "/firewall_virtual_ip.php");
134 5ba2df71 Scott Ullrich
$firewall_menu = msort(array_merge($firewall_menu, return_ext_menu("Firewall")),0);
135 5e3249f0 Scott Ullrich
136
// Services
137 5ba2df71 Scott Ullrich
$services_menu = array();
138 94044c40 Carlos Eduardo Ramos
$services_menu[] = array(gettext("Captive Portal"), "/services_captiveportal.php");
139
$services_menu[] = array(gettext("DNS Forwarder"), "/services_dnsmasq.php");
140 be9f7794 Warren Baker
$services_menu[] = array(gettext("DNS Resolver"), "/services_unbound.php");
141 94044c40 Carlos Eduardo Ramos
$services_menu[] = array(gettext("DHCP Relay"), "/services_dhcp_relay.php");
142 1eca1a2f Seth Mos
$services_menu[] = array(gettext("DHCPv6 Relay"), "/services_dhcpv6_relay.php");
143 8b6313a4 jim-p
if($g['services_dhcp_server_enable']) {
144 94044c40 Carlos Eduardo Ramos
	$services_menu[] = array(gettext("DHCP Server"), "/services_dhcp.php");
145 93458cb1 Darren Embry
	$services_menu[] = array(gettext("DHCPv6 Server/RA"), "/services_dhcpv6.php");
146 8b6313a4 jim-p
}
147 94044c40 Carlos Eduardo Ramos
$services_menu[] = array(gettext("Dynamic DNS"), "/services_dyndns.php");
148
$services_menu[] = array(gettext("IGMP proxy"), "/services_igmpproxy.php");
149
$services_menu[] = array(gettext("Load Balancer"), "/load_balancer_pool.php");
150 cf180ccc jim-p
$services_menu[] = array(gettext("NTP"), "/services_ntpd.php");
151 94044c40 Carlos Eduardo Ramos
$services_menu[] = array(gettext("PPPoE Server"), "/vpn_pppoe.php");
152
$services_menu[] = array(gettext("SNMP"), "/services_snmp.php");
153 38b357bd Ermal
if(count($config['interfaces']) > 1) {
154 5e3249f0 Scott Ullrich
	/* no use for UPnP in single-interface deployments
155
	remove to reduce user confusion
156
	*/
157 52593da5 Colin Fleming
	$services_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/pkg_edit.php?xml=miniupnpd.xml&amp;id=0");
158 5e3249f0 Scott Ullrich
}
159 94044c40 Carlos Eduardo Ramos
$services_menu[] = array(gettext("Wake on LAN"), "/services_wol.php");
160 5ba2df71 Scott Ullrich
$services_menu = msort(array_merge($services_menu, return_ext_menu("Services")),0);
161 5e3249f0 Scott Ullrich
162
// VPN
163 5ba2df71 Scott Ullrich
$vpn_menu = array();
164 94044c40 Carlos Eduardo Ramos
$vpn_menu[] = array(gettext("IPsec"), "/vpn_ipsec.php");
165
$vpn_menu[] = array(gettext("OpenVPN"), "/vpn_openvpn_server.php");
166
$vpn_menu[] = array(gettext("PPTP"), "/vpn_pptp.php");
167
$vpn_menu[] = array(gettext("L2TP"), "/vpn_l2tp.php");
168 5ba2df71 Scott Ullrich
$vpn_menu = msort(array_merge($vpn_menu, return_ext_menu("VPN")),0);
169 5e3249f0 Scott Ullrich
170
// Status
171
$status_menu = array();
172 21b8289e Ermal
if (count($config['captiveportal']) > 0)
173 94044c40 Carlos Eduardo Ramos
	$status_menu[] = array(gettext("Captive Portal"), "/status_captiveportal.php");
174
$status_menu[] = array(gettext("CARP (failover)"), "/carp_status.php");
175
$status_menu[] = array(gettext("Dashboard"), "/index.php");
176
$status_menu[] = array(gettext("Gateways"), "/status_gateways.php");
177
$status_menu[] = array(gettext("DHCP Leases"), "/status_dhcp_leases.php");
178 8b6313a4 jim-p
$status_menu[] = array(gettext("DHCPv6 Leases"), "/status_dhcpv6_leases.php");
179 94044c40 Carlos Eduardo Ramos
$status_menu[] = array(gettext("Filter Reload"), "/status_filter_reload.php");
180
$status_menu[] = array(gettext("Interfaces"), "/status_interfaces.php");
181
$status_menu[] = array(gettext("IPsec"), "/diag_ipsec.php");
182
$status_menu[] = array(gettext("Load Balancer"), "/status_lb_pool.php");
183 a8543b59 jim-p
$status_menu[] = array(gettext("NTP"), "/status_ntpd.php");
184 94044c40 Carlos Eduardo Ramos
$status_menu[] = array(gettext("OpenVPN"), "/status_openvpn.php");
185 5e3249f0 Scott Ullrich
if ($g['platform'] == "pfSense")
186 94044c40 Carlos Eduardo Ramos
	$status_menu[] = array(gettext("Package Logs"), "/diag_pkglogs.php");
187
$status_menu[] = array(gettext("Queues"), "/status_queues.php");
188
$status_menu[] = array(gettext("RRD Graphs"), "/status_rrd_graph.php");
189
$status_menu[] = array(gettext("Services"), "/status_services.php");
190
$status_menu[] = array(gettext("System Logs"), "/diag_logs.php");
191
$status_menu[] = array(gettext("Traffic Graph"), "/status_graph.php?if=wan");
192 15e47776 Luiz Gustavo Costa
if(count($config['interfaces']) > 1)
193 94044c40 Carlos Eduardo Ramos
	$status_menu[] = array(gettext("UPnP &amp; NAT-PMP"), "/status_upnp.php");
194 5e3249f0 Scott Ullrich
$ifentries = get_configured_interface_with_descr();
195
foreach ($ifentries as $ent => $entdesc) {
196
	if (is_array($config['interfaces'][$ent]['wireless']) &&
197
		preg_match($g['wireless_regex'], $config['interfaces'][$ent]['if']))
198 273e9bf7 jim-p
		$wifdescrs[$ent] = $entdesc;
199 5e3249f0 Scott Ullrich
}
200 273e9bf7 jim-p
if (count($wifdescrs) > 0)
201 94044c40 Carlos Eduardo Ramos
	$status_menu[] = array(gettext("Wireless"), "/status_wireless.php");
202 5e3249f0 Scott Ullrich
$status_menu = msort(array_merge($status_menu, return_ext_menu("Status")),0);
203
204
// Diagnostics
205 5ba2df71 Scott Ullrich
$diagnostics_menu = array();
206 1d50d8d9 Chris Buechler
$diagnostics_menu[] = array(gettext("ARP Table"), "/diag_arp.php");
207 94044c40 Carlos Eduardo Ramos
$diagnostics_menu[] = array(gettext("Authentication"), "/diag_authentication.php");
208
$diagnostics_menu[] = array(gettext("Backup/Restore"), "/diag_backup.php");
209
$diagnostics_menu[] = array(gettext("Command Prompt"), "/exec.php");
210
$diagnostics_menu[] = array(gettext("DNS Lookup"), "/diag_dns.php");
211
$diagnostics_menu[] = array(gettext("Edit File"), "/edit.php");
212
$diagnostics_menu[] = array(gettext("Factory Defaults"), "/diag_defaults.php");
213
$diagnostics_menu[] = array(gettext("Halt System"), "/halt.php" );
214 ca98b042 Vinicius Coque
$diagnostics_menu[] = array(gettext("Limiter Info"), "/diag_limiter_info.php" );
215 8b6313a4 jim-p
$diagnostics_menu[] = array(gettext("NDP Table"), "/diag_ndp.php" );
216 ca98b042 Vinicius Coque
217 94044c40 Carlos Eduardo Ramos
$diagnostics_menu[] = array(gettext("Tables"), "/diag_tables.php");
218
$diagnostics_menu[] = array(gettext("Ping"), "/diag_ping.php");
219 c73fec1f jim-p
$diagnostics_menu[] = array(gettext("Test Port"), "/diag_testport.php");
220 ca98b042 Vinicius Coque
$diagnostics_menu[] = array(gettext("pfInfo"), "/diag_pf_info.php");
221
$diagnostics_menu[] = array(gettext("pfTop"), "/diag_system_pftop.php");
222 94044c40 Carlos Eduardo Ramos
$diagnostics_menu[] = array(gettext("Reboot"), "/reboot.php");
223
$diagnostics_menu[] = array(gettext("Routes"), "/diag_routes.php");
224
$diagnostics_menu[] = array(gettext("SMART Status"), "/diag_smart.php");
225 c75fd3db PiBa-NL
$diagnostics_menu[] = array(gettext("Sockets"), "/diag_sockets.php" );
226 94044c40 Carlos Eduardo Ramos
$diagnostics_menu[] = array(gettext("States"), "/diag_dump_states.php");
227
$diagnostics_menu[] = array(gettext("States Summary"), "/diag_states_summary.php");
228
$diagnostics_menu[] = array(gettext("System Activity"), "/diag_system_activity.php");
229
$diagnostics_menu[] = array(gettext("Traceroute"), "/diag_traceroute.php");
230
$diagnostics_menu[] = array(gettext("Packet Capture"), "/diag_packet_capture.php");
231 5e3249f0 Scott Ullrich
if($g['platform'] == "nanobsd")
232 94044c40 Carlos Eduardo Ramos
	$diagnostics_menu[] = array(gettext("NanoBSD"), "/diag_nanobsd.php");
233 5e3249f0 Scott Ullrich
234
if (isset($config['system']['developer'])) {
235 976d0213 Darren Embry
	$diagnostics_menu[] = array(gettext("Restart HTTPD"), "/restart_httpd.php", "style" => "font-weight: bold; color: yellow;");
236 15e47776 Luiz Gustavo Costa
237 5e3249f0 Scott Ullrich
}
238 5ba2df71 Scott Ullrich
$diagnostics_menu = msort(array_merge($diagnostics_menu, return_ext_menu("Diagnostics")),0);
239 5e3249f0 Scott Ullrich
240 3b29612f Chris Buechler
if(! $g['disablehelpmenu']) {
241
	$help_menu = array();
242 94044c40 Carlos Eduardo Ramos
	$help_menu[] = array(gettext("About this Page"), $helpurl);
243 15e47776 Luiz Gustavo Costa
	if($g['product_name'] == "pfSense")
244 c7281770 Chris Buechler
	$help_menu[] = array(gettext("Bug Database"), "https://www.pfsense.org/j.php?jumpto=redmine");
245
	$help_menu[] = array(gettext("User Forum"), "https://www.pfsense.org/j.php?jumpto=forum");
246
	$help_menu[] = array(gettext("Documentation"), "https://www.pfsense.org/j.php?jumpto=doc");
247
	$help_menu[] = array(gettext("Developers Wiki"), "https://www.pfsense.org/j.php?jumpto=devwiki");
248
	$help_menu[] = array(gettext("Paid Support"), "https://www.pfsense.org/j.php?jumpto=portal");
249
	$help_menu[] = array(gettext("pfSense Book"), "https://www.pfsense.org/j.php?jumpto=book");
250
	$help_menu[] = array(gettext("Search portal"), "https://www.pfsense.org/j.php?jumpto=searchportal");
251
	$help_menu[] = array(gettext("FreeBSD Handbook"), "https://www.pfsense.org/j.php?jumpto=fbsdhandbook");
252 15e47776 Luiz Gustavo Costa
	$help_menu = msort(array_merge($help_menu, return_ext_menu("Help")),0);
253 3b29612f Chris Buechler
}
254 669716df Scott Ullrich
255 c6c150e9 Scott Ullrich
?>
256 12a00813 Erik Kristensen
257 9f53d3a8 Scott Ullrich
<div id="wrapper">
258 97f30a08 Marcello Coutinho
	<div id="header">
259 52593da5 Colin Fleming
		<div id="header-left"><a href="/index.php" id="status-link"><img src="/themes/<?= $g['theme']; ?>/images/transparent.gif" border="0" alt="transparent" /></a></div>
260 97f30a08 Marcello Coutinho
		<div id="header-right">
261 1df0159c Erik Kristensen
			<div class="container">
262
				<div class="left">webConfigurator</div>
263 005ac3ca Marcello Coutinho
				<div class="right" id="menu_messages">
264 52593da5 Colin Fleming
<?php
265 005ac3ca Marcello Coutinho
				echo get_menu_messages();
266 612832ec Erik Kristensen
?>
267 005ac3ca Marcello Coutinho
	</div>
268 1df0159c Erik Kristensen
			</div>
269 9f53d3a8 Scott Ullrich
		</div>
270
	</div> <!-- Header DIV -->
271
	<div id="content">
272
		<div id="left">
273 97f30a08 Marcello Coutinho
			<div id="navigation" style="z-index:1000;">
274 41058a8c Erik Kristensen
				<ul id="menu">
275 d86286ed Erik Kristensen
					<li class="firstdrop">
276 7de4284c Vinicius Coque
						<div><?php echo gettext("System"); ?></div>
277 d86286ed Erik Kristensen
						<ul class="subdrop">
278 7cf210f1 Ermal Lu?i
						<?php
279 5ba2df71 Scott Ullrich
							output_menu($system_menu);
280 7cf210f1 Ermal Lu?i
						?>
281 9f53d3a8 Scott Ullrich
						</ul>
282
					</li>
283 d86286ed Erik Kristensen
					<li class="drop">
284 7de4284c Vinicius Coque
						<div><?php echo gettext("Interfaces"); ?></div>
285 d86286ed Erik Kristensen
						<ul class="subdrop">
286 7cf210f1 Ermal Lu?i
						<?php
287 5ba2df71 Scott Ullrich
							output_menu($interfaces_menu);
288 7cf210f1 Ermal Lu?i
						?>
289 9f53d3a8 Scott Ullrich
						</ul>
290
					</li>
291 d86286ed Erik Kristensen
					<li class="drop">
292 7de4284c Vinicius Coque
						<div><?php echo gettext("Firewall"); ?></div>
293 d86286ed Erik Kristensen
						<ul class="subdrop">
294 7cf210f1 Ermal Lu?i
						<?php
295 5ba2df71 Scott Ullrich
							output_menu($firewall_menu);
296 7cf210f1 Ermal Lu?i
						?>
297 9f53d3a8 Scott Ullrich
						</ul>
298
					</li>
299 d86286ed Erik Kristensen
					<li class="drop">
300 7de4284c Vinicius Coque
						<div><?php echo gettext("Services"); ?></div>
301 d86286ed Erik Kristensen
						<ul class="subdrop">
302 52593da5 Colin Fleming
						<?php
303 5ba2df71 Scott Ullrich
							output_menu($services_menu);
304 7cf210f1 Ermal Lu?i
						?>
305 9f53d3a8 Scott Ullrich
						</ul>
306
					</li>
307 d86286ed Erik Kristensen
					<li class="drop">
308 7de4284c Vinicius Coque
						<div><?php echo gettext("VPN"); ?></div>
309 d86286ed Erik Kristensen
						<ul class="subdrop">
310 7cf210f1 Ermal Lu?i
						<?php
311 5ba2df71 Scott Ullrich
							output_menu($vpn_menu);
312 7cf210f1 Ermal Lu?i
						?>
313 9f53d3a8 Scott Ullrich
						</ul>
314
					</li>
315 d86286ed Erik Kristensen
					<li class="drop">
316 7de4284c Vinicius Coque
						<div><?php echo gettext("Status"); ?></div>
317 d86286ed Erik Kristensen
						<ul class="subdrop">
318 7cf210f1 Ermal Lu?i
						<?php
319 5e3249f0 Scott Ullrich
							output_menu($status_menu);
320 7cf210f1 Ermal Lu?i
						?>
321 9f53d3a8 Scott Ullrich
						</ul>
322
					</li>
323 669716df Scott Ullrich
					<li class="drop">
324 7de4284c Vinicius Coque
						<div><?php echo gettext("Diagnostics"); ?></div>
325 d86286ed Erik Kristensen
						<ul id="diag" class="subdrop">
326 52593da5 Colin Fleming
						<?php
327 5ba2df71 Scott Ullrich
							output_menu($diagnostics_menu);
328 7cf210f1 Ermal Lu?i
						?>
329 9f53d3a8 Scott Ullrich
						</ul>
330
					</li>
331 3b29612f Chris Buechler
					<?php if(! $g['disablehelpmenu']): ?>
332 669716df Scott Ullrich
					<li class="lastdrop">
333 7de4284c Vinicius Coque
						<div><?php echo gettext("Help"); ?></div>
334 669716df Scott Ullrich
						<ul id="help" class="subdrop">
335 52593da5 Colin Fleming
						<?php
336
							output_menu($help_menu, "_blank");
337 669716df Scott Ullrich
						?>
338
						</ul>
339
					</li>
340 3b29612f Chris Buechler
					<?php endif; ?>
341 9f53d3a8 Scott Ullrich
				</ul>
342
			</div>
343 dca32536 Scott Ullrich
344 9f53d3a8 Scott Ullrich
		</div> <!-- Left DIV -->
345 dca32536 Scott Ullrich
346 9f53d3a8 Scott Ullrich
		<div id="right">
347 dca32536 Scott Ullrich
348 5c9cc1de Scott Ullrich
<?php
349 005ac3ca Marcello Coutinho
echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domLib.js\"></script>\n";
350
echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/domTT.js\"></script>\n";
351
echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/behaviour.js\"></script>\n";
352
echo "\t<script type=\"text/javascript\" src=\"javascript/domTT/fadomatic.js\"></script>\n";
353 5c9cc1de Scott Ullrich
	/* display a top alert bar if need be */
354
	$need_alert_display = false;
355
	$found_notices = are_notices_pending();
356
	if($found_notices == true) {
357
		$notices = get_notices();
358
		if(!$notices) {
359
			$need_alert_display = true;
360 52593da5 Colin Fleming
			$display_text = print_notices($notices) . "<br />";
361 dca32536 Scott Ullrich
		}
362 5c9cc1de Scott Ullrich
	}
363
	if($need_alert_display == true) {
364
                echo "<div style=\"background-color:#000000\" id=\"roundalert\">";
365 52593da5 Colin Fleming
                echo "<table summary=\"round alert\">";
366 5c9cc1de Scott Ullrich
		echo "<tr><td><font color=\"#ffffff\">";
367 52593da5 Colin Fleming
		echo "&nbsp;&nbsp;<img align=\"middle\" src=\"/top_notification.gif\" alt=\"notification\" />&nbsp;&nbsp;&nbsp;";
368 5c9cc1de Scott Ullrich
		echo $display_text;
369 52593da5 Colin Fleming
		echo "</font></td>";
370 5c9cc1de Scott Ullrich
		echo "</tr>";
371
		echo "</table>";
372
		echo "</div>";
373
	}
374 b8f82cd7 Scott Ullrich
375 5e3249f0 Scott Ullrich
function add_to_menu($url, $name) {
376 45ee90ed Matthew Grooms
	if (isAllowedPage($url))
377
		echo "<li><a href=\"{$url}\" class=\"navlnk\">{$name}</a></li>\n";
378 b8f82cd7 Scott Ullrich
}
379 76692ad2 jim-p
380 19b331c1 Scott Ullrich
?>
381 dca32536 Scott Ullrich
382 f7eae2bf jim-p
<div>
383 a1560c1b Colin Fleming
<span class="pgtitle"><a href="<?= htmlentities($_SERVER['REQUEST_URI']) ?>"><?=genhtmltitle($pgtitle);?></a></span>
384 76692ad2 jim-p
<span style="float:right; margin: 0 0 20px 20px">
385
<?php
386
if (!$hide_service_status && !empty($shortcuts[$shortcut_section]['service'])) {
387 9cb6bef1 jim-p
	$ssvc = array();
388 6d9b1074 jim-p
	switch ($shortcut_section) {
389
		case "openvpn":
390
			$ssvc = find_service_by_openvpn_vpnid($vpnid);
391
			break;
392
		case "captiveportal":
393
			$ssvc = find_service_by_cp_zone($cpzone);
394
			break;
395
		default:
396
			$ssvc = find_service_by_name($shortcuts[$shortcut_section]['service']);
397
398
	}
399
	if (!empty($ssvc)) {
400
		echo get_service_status_icon($ssvc, false);
401
		echo get_service_control_links($ssvc, true);
402
	}
403 391abfcf jim-p
}
404 7f4a7998 jim-p
405 391abfcf jim-p
echo get_shortcut_main_link($shortcut_section, true);
406
echo get_shortcut_status_link($shortcut_section, true);
407
echo get_shortcut_log_link($shortcut_section, true);
408 7f4a7998 jim-p
409 391abfcf jim-p
?>
410 28181237 Renato Botelho
<?php if(! $g['disablehelpicon']): ?>
411 7f4a7998 jim-p
412 52593da5 Colin Fleming
<a href="<?php echo $helpurl; ?>" title="<?php echo gettext("Help for items on this page"); ?>"><img style="vertical-align:middle" src="/themes/<?php echo $g['theme']; ?>/images/icons/icon_help.gif" border="0" alt="help" /></a>
413 28181237 Renato Botelho
<?php endif; ?>
414 c2e23f7b jim-p
</span>
415 f7eae2bf jim-p
</div>
416
<br />
417 b873ded5 jim-p
418 366e5d8c sullrich
<?php
419 261c7de8 jim-p
/* if upgrade in progress, alert user */
420
if(is_subsystem_dirty('packagelock')) {
421
	$pgtitle = array(gettext("System"),gettext("Package Manager"));
422 52593da5 Colin Fleming
	print_info_box(gettext("Packages are currently being reinstalled in the background.<p>Do not make changes in the GUI until this is complete.") . "<p><img src='/themes/{$g['theme']}/images/icons/icon_fw-update.gif' alt='firmware update' />");
423 261c7de8 jim-p
}
424 366e5d8c sullrich
	$pgtitle_output = true;
425 3f0357fc Ermal Lu?i
?>