1
|
<?php
|
2
|
/*
|
3
|
* if user has selected a custom template, use it.
|
4
|
* otherwise default to pfsense tempalte
|
5
|
*/
|
6
|
if($config['theme'] <> "")
|
7
|
$g['theme'] = $config['theme'];
|
8
|
else
|
9
|
$g['theme'] = "pfsense";
|
10
|
|
11
|
/*
|
12
|
* If this device is an apple ipod/iphone
|
13
|
* switch the theme to one that works with it.
|
14
|
*/
|
15
|
$apple_ua = array("iPhone","iPod");
|
16
|
foreach($apple_ua as $useragent)
|
17
|
if(strstr($_SERVER['HTTP_USER_AGENT'], $useragent))
|
18
|
$g['theme'] = "pfsense";
|
19
|
|
20
|
$pagetitle = gentitle( $pgtitle );
|
21
|
|
22
|
?>
|
23
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
24
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
25
|
<html>
|
26
|
<head>
|
27
|
<title><?=$pagetitle;?></title>
|
28
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
29
|
<?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false &&
|
30
|
file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?>
|
31
|
<?php outputCSSFileInline("{$g['www_path']}/themes/{$g['theme']}/wizard.css"); ?>
|
32
|
<?php else: ?>
|
33
|
<link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css" media="all" />
|
34
|
<?php endif; ?>
|
35
|
<?php
|
36
|
if(file_exists("{$g['www_path']}/niftycssCode.css"))
|
37
|
outputCSSFileInline("{$g['www_path']}/niftycssCode.css");
|
38
|
if(file_exists("{$g['www_path']}/niftycssprintCode.css"))
|
39
|
outputCSSPrintFileInline("{$g['www_path']}/niftycssprintCode.css");
|
40
|
if(file_exists("{$g['www_path']}/javascript/niftyjsCode.js"))
|
41
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/niftyjsCode.js");
|
42
|
?>
|
43
|
<script type="text/javascript">
|
44
|
var theme = "<?php echo $g['theme']; ?>";
|
45
|
</script>
|
46
|
<?php outputJavaScriptFileInline("{$g['www_path']}/themes/{$g['theme']}/loader.js"); ?>
|
47
|
<?php
|
48
|
if($_GET['enablefirebuglite']) {
|
49
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/pi.js");
|
50
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/firebug-lite.js");
|
51
|
}
|
52
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/scriptaculous/prototype.js");
|
53
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/scriptaculous/scriptaculous.js");
|
54
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/scriptaculous/effects.js");
|
55
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/scriptaculous/dragdrop.js");
|
56
|
if(file_exists("{$g['www_path']}/javascript/global.js"))
|
57
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/global.js");
|
58
|
|
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)) continue;
|
71
|
//echo "\t".'<script type="text/javascript" src="/javascript/'.$dir.'/'.$file.'"></script>'."\n";
|
72
|
outputJavaScriptFileInline("{$g['www_path']}/javascript/{$dir}/{$file}");
|
73
|
}
|
74
|
closedir($dh);
|
75
|
}
|
76
|
}
|
77
|
|
78
|
if (!isset($closehead))
|
79
|
echo "</head>";
|
80
|
?>
|