1 |
a980eec1
|
Scott Ullrich
|
<?php
|
2 |
7ac5a4cb
|
Scott Ullrich
|
/*
|
3 |
|
|
pfSense_MODULE: header
|
4 |
|
|
*/
|
5 |
|
|
|
6 |
a980eec1
|
Scott Ullrich
|
/*
|
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 |
45ee90ed
|
Matthew Grooms
|
|
15 |
e06f19fa
|
Scott Ullrich
|
/*
|
16 |
|
|
* If this device is an apple ipod/iphone
|
17 |
|
|
* switch the theme to one that works with it.
|
18 |
|
|
*/
|
19 |
af5d9af2
|
Scott Ullrich
|
$apple_ua = array("iPhone","iPod", "iPad");
|
20 |
e06f19fa
|
Scott Ullrich
|
foreach($apple_ua as $useragent)
|
21 |
|
|
if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
|
22 |
|
|
$g['theme'] = "pfsense";
|
23 |
|
|
|
24 |
bdd55010
|
Matthew Grooms
|
$pagetitle = gentitle( $pgtitle );
|
25 |
|
|
|
26 |
a980eec1
|
Scott Ullrich
|
?>
|
27 |
75b1adc0
|
Bill Marquette
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
28 |
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
29 |
329b5bb7
|
Scott Ullrich
|
<html>
|
30 |
7f1f5492
|
Scott Ullrich
|
<head>
|
31 |
7f9ad068
|
Chris Buechler
|
<title><?php echo($config['system']['hostname'] . "." . $config['system']['domain'] . " - " . $pagetitle); ?></title>
|
32 |
d772ac32
|
Erik Kristensen
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
33 |
ab94e136
|
jim-p
|
<link rel="apple-touch-icon" href="/themes/<?php echo $g['theme']; ?>/apple-touch-icon.png"/>
|
34 |
719b7f09
|
Scott Ullrich
|
<?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false &&
|
35 |
|
|
file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?>
|
36 |
2494295a
|
Scott Ullrich
|
<?php echo "<style type=\"text/css\" src=\"/themes/{$g['theme']}/wizard.css\"></style>"; ?>
|
37 |
719b7f09
|
Scott Ullrich
|
<?php else: ?>
|
38 |
a2a3b97a
|
Scott Ullrich
|
<link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css" media="all" />
|
39 |
719b7f09
|
Scott Ullrich
|
<?php endif; ?>
|
40 |
6b519cfe
|
Scott Ullrich
|
<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 |
76cd0d89
|
Scott Ullrich
|
<script type="text/javascript">
|
44 |
|
|
var theme = "<?php echo $g['theme']; ?>";
|
45 |
|
|
</script>
|
46 |
2494295a
|
Scott Ullrich
|
<?php echo "\t<script type=\"text/javascript\" src=\"/themes/{$g['theme']}/loader.js\"></script>\n"; ?>
|
47 |
cb144a6d
|
Scott Ullrich
|
<?php
|
48 |
|
|
if($_GET['enablefirebuglite']) {
|
49 |
2494295a
|
Scott Ullrich
|
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 |
cb144a6d
|
Scott Ullrich
|
}
|
52 |
2494295a
|
Scott Ullrich
|
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 |
625dcc40
|
Bill Marquette
|
if(file_exists("{$g['www_path']}/javascript/global.js"))
|
57 |
2494295a
|
Scott Ullrich
|
echo "\t<script type=\"text/javascript\" src=\"/javascript/global.js\"></script>\n";
|
58 |
8ab3e9ed
|
Erik Kristensen
|
/*
|
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 |
7dd44f7d
|
Bill Marquette
|
$dir = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php');
|
65 |
625dcc40
|
Bill Marquette
|
$path = "{$g['www_path']}/javascript/" . $dir . "/";
|
66 |
4ce8ac00
|
Erik Kristensen
|
if (is_dir($path)) {
|
67 |
|
|
if ($dh = opendir($path)) {
|
68 |
|
|
while (($file = readdir($dh)) !== false) {
|
69 |
f6f6947e
|
Scott Ullrich
|
if (is_dir($file))
|
70 |
|
|
continue;
|
71 |
2494295a
|
Scott Ullrich
|
echo "\t<script type=\"text/javascript\" src=\"/javascript/{$dir}/{$file}\"></script>\n";
|
72 |
4ce8ac00
|
Erik Kristensen
|
}
|
73 |
|
|
closedir($dh);
|
74 |
|
|
}
|
75 |
|
|
}
|
76 |
d772ac32
|
Erik Kristensen
|
|
77 |
01da41cf
|
Bill Marquette
|
if (!isset($closehead))
|
78 |
a2a3b97a
|
Scott Ullrich
|
echo "</head>";
|
79 |
7f9ad068
|
Chris Buechler
|
?>
|