Project

General

Profile

Download (3.06 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
$apple_ua = array("iPhone","iPod");
20
foreach($apple_ua as $useragent)
21
	if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
22
		$g['theme'] = "pfsense";
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
		<script type="text/javascript" src="/javascript/niftyjsCode.js"></script>
43
		<script type="text/javascript">
44
			var theme = "<?php echo $g['theme']; ?>";
45
		</script>
46
		<?php echo "\t<script type=\"text/javascript\" src=\"/themes/{$g['theme']}/loader.js\"></script>\n"; ?>
47
<?php
48
		if($_GET['enablefirebuglite']) {
49
			echo "\t<script type=\"text/javascript\" src=\"/javascript/pi.js\"></script>\n";
50
			echo "\t<script type=\"text/javascript\" src=\"/javascript/firebug-lite.js\"></script>\n";
51
		}
52
		echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/prototype.js\"></script>\n";
53
		echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/scriptaculous.js\"></script>\n";
54
		echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/effects.js\"></script>\n";
55
		echo "\t<script type=\"text/javascript\" src=\"/javascript/scriptaculous/dragdrop.js\"></script>\n";
56
		if(file_exists("{$g['www_path']}/javascript/global.js"))
57
			echo "\t<script type=\"text/javascript\" src=\"/javascript/global.js\"></script>\n";
58
	/*
59
	 *	Find all javascript files that need to be included
60
	 *	for this page ... from the arrays ... :)
61
	 *	Coded by: Erik Kristensen
62
	 */
63

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

    
77
if (!isset($closehead))
78
	echo "</head>";
79
?>
(75-75/218)