Project

General

Profile

Download (2.98 KB) Statistics
| Branch: | Tag: | Revision:
1 a980eec1 Scott Ullrich
<?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 45ee90ed Matthew Grooms
11 e06f19fa Scott Ullrich
/*
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 bdd55010 Matthew Grooms
$pagetitle = gentitle( $pgtitle );
21
22 a980eec1 Scott Ullrich
?>
23 75b1adc0 Bill Marquette
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
24
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
25 329b5bb7 Scott Ullrich
<html>
26 7f1f5492 Scott Ullrich
<head>
27 bdd55010 Matthew Grooms
	<title><?=$pagetitle;?></title>
28 d772ac32 Erik Kristensen
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
29 719b7f09 Scott Ullrich
        <?php if (strpos($_SERVER["SCRIPT_FILENAME"], "wizard.php") !== false &&
30
                  file_exists("{$g['www_path']}/themes/{$g['theme']}/wizard.css")): ?>
31 625dcc40 Bill Marquette
					<?php outputCSSFileInline("{$g['www_path']}/themes/{$g['theme']}/wizard.css"); ?>
32 719b7f09 Scott Ullrich
        <?php else: ?>
33 a2a3b97a Scott Ullrich
        	<link rel="stylesheet" href="/themes/<?php echo $g['theme']; ?>/all.css" media="all" />
34 719b7f09 Scott Ullrich
        <?php endif; ?>
35 8d236bfb Scott Ullrich
		<?php 
36 625dcc40 Bill Marquette
			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 8d236bfb Scott Ullrich
		?>
43 76cd0d89 Scott Ullrich
		<script type="text/javascript">
44
			var theme = "<?php echo $g['theme']; ?>";
45
		</script>
46 625dcc40 Bill Marquette
		<?php outputJavaScriptFileInline("{$g['www_path']}/themes/{$g['theme']}/loader.js"); ?>
47 cb144a6d Scott Ullrich
<?php
48
		if($_GET['enablefirebuglite']) {
49 625dcc40 Bill Marquette
			outputJavaScriptFileInline("{$g['www_path']}/javascript/pi.js");
50
			outputJavaScriptFileInline("{$g['www_path']}/javascript/firebug-lite.js");
51 cb144a6d Scott Ullrich
		}
52 625dcc40 Bill Marquette
		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 ef1d930a Scott Ullrich
59 8ab3e9ed Erik Kristensen
	/*
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 7dd44f7d Bill Marquette
	$dir  = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php');
66 625dcc40 Bill Marquette
	$path = "{$g['www_path']}/javascript/" . $dir . "/";
67 4ce8ac00 Erik Kristensen
	if (is_dir($path)) {
68
		if ($dh = opendir($path)) {
69
			while (($file = readdir($dh)) !== false) {
70
		   		if (is_dir($file)) continue;
71 9e622280 Scott Ullrich
				//echo "\t".'<script type="text/javascript" src="/javascript/'.$dir.'/'.$file.'"></script>'."\n";
72 625dcc40 Bill Marquette
				outputJavaScriptFileInline("{$g['www_path']}/javascript/{$dir}/{$file}"); 
73 4ce8ac00 Erik Kristensen
			}
74
			closedir($dh);
75
		}
76
	}
77 d772ac32 Erik Kristensen
78 01da41cf Bill Marquette
if (!isset($closehead))
79 a2a3b97a Scott Ullrich
	echo "</head>";
80
?>