Project

General

Profile

Download (3.61 KB) Statistics
| Branch: | Tag: | Revision:
1
<?php
2
/*
3
	pfSense_MODULE:	header
4
*/
5

    
6
/* 
7
 *   if user has selected a custom template, use it.
8
 *   otherwise default to pfsense tempalte
9
 */
10
if($config['theme'] <> "")
11
	$g['theme'] = $config['theme'];
12
else
13
	$g['theme'] = "pfsense";
14

    
15
/*
16
 *  If this device is an apple ipod/iphone
17
 *  switch the theme to one that works with it.
18
 */
19
$lowres_ua = array("iPhone","iPod", "iPad", "Android");
20
foreach($lowres_ua as $useragent)
21
	if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
22
		$g['theme'] = empty($g['theme_lowres']) ? "pfsense" : $g['theme_lowres'];
23

    
24
$pagetitle = gentitle( $pgtitle );
25

    
26
?>
27
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
28
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
29
<html>
30
<head>
31
	<title><?php echo($config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pagetitle); ?></title>
32
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
33
	<link rel="apple-touch-icon" href="/themes/<?php echo $g['theme']; ?>/apple-touch-icon.png"/>
34
        <?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false &&
35
                  file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?>
36
					<?php echo "<style type=\"text/css\" src=\"/themes/{$g['theme']}/wizard.css\"></style>"; ?>
37
        <?php else: ?>
38
        	<link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css" media="all" />
39
        <?php endif; ?>
40
		<link rel="stylesheet" type="text/css" href="/niftycssCode.css">
41
		<link rel="stylesheet" type="text/css" href="/niftycssprintCode.css" media="print">
42
		<link rel="stylesheet" type="text/css" href="/themes/<?=$g['theme']?>/new_tab_menu.css" media="all">
43
		<script type="text/javascript" src="/javascript/niftyjsCode.js"></script>
44
		<script type="text/javascript">
45
			var theme = "<?php echo $g['theme']; ?>";
46
		</script>
47
		<?php echo "\t<script type=\"text/javascript\" src=\"/themes/{$g['theme']}/loader.js\"></script>\n"; ?>
48
<?php
49
		if($_GET['enablefirebuglite']) {
50
			echo "\t<script type=\"text/javascript\" src=\"/javascript/pi.js\"></script>\n";
51
			echo "\t<script type=\"text/javascript\" src=\"/javascript/firebug-lite.js\"></script>\n";
52
		}
53
		echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/prototype.js\"></script>\n";
54
		echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/scriptaculous.js\"></script>\n";
55
		echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/effects.js\"></script>\n";
56
		echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/dragdrop.js\"></script>\n";
57
		if(file_exists("{$g['www_path']}/javascript/global.js"))
58
			echo "\t<script type=\"text/javascript\" src=\"/javascript/global.js\"></script>\n";
59
	/*
60
	 *	Find all javascript files that need to be included
61
	 *	for this page ... from the arrays ... :)
62
	 *	Coded by: Erik Kristensen
63
	 */
64

    
65
	$dir  = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php');
66
	$path = "{$g['www_path']}/javascript/" . $dir . "/";
67
	if (is_dir($path)) {
68
		if ($dh = opendir($path)) {
69
			while (($file = readdir($dh)) !== false) {
70
		   		if (is_dir($file)) 
71
					continue;
72
				echo "\t<script type=\"text/javascript\" src=\"/javascript/{$dir}/{$file}\"></script>\n";
73
			}
74
			closedir($dh);
75
		}
76
	}
77

    
78
if (!isset($closehead))
79
	echo "</head>";
80

    
81
/*  If this page is being remotely managed then do not allow the loading of the contents. */
82
if($config['remote_managed_pages']['item']) {
83
	foreach($config['remote_managed_pages']['item'] as $rmp) {
84
		if($rmp == $_SERVER['SCRIPT_NAME']) {
85
			include("fbegin.inc");
86
			print_info_box_np("This page is currently being managed by a remote machine.");
87
			include("fend.inc");
88
			exit;
89
		}
90
	}	
91
}
92

    
93
?>
(78-78/224)