Project

General

Profile

Download (2.45 KB) Statistics
| Branch: | Tag: | Revision:
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("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("niftycssCode.css")) 
37
				outputCSSFileInline("niftycssCode.css"); 
38
			if(file_exists("niftycssprintCode.css")) 
39
				outputCSSPrintFileInline("niftycssprintCode.css");
40
			if(file_exists("niftyjsCode.js")) 
41
				outputJavaScriptFileInline("niftyjsCode.js"); 
42
		?>
43
		<script type="text/javascript">
44
			var theme = "<?php echo $g['theme']; ?>";
45
		</script>
46
		<?php outputJavaScriptFileInline("themes/{$g['theme']}/loader.js"); ?>
47
<?php
48
		if($_GET['enablefirebuglite']) {
49
			outputJavaScriptFileInline("javascript/pi.js");
50
			outputJavaScriptFileInline("javascript/firebug-lite.js");
51
		}
52

    
53
	/*
54
	 *	Find all javascript files that need to be included
55
	 *	for this page ... from the arrays ... :)
56
	 *	Coded by: Erik Kristensen
57
	 */
58

    
59
	$dir  = trim(basename($_SERVER["SCRIPT_FILENAME"]), '.php');
60
	$path = "/usr/local/www/javascript/" . $dir . "/";
61
	if (is_dir($path)) {
62
		if ($dh = opendir($path)) {
63
			while (($file = readdir($dh)) !== false) {
64
		   		if (is_dir($file)) continue;
65
				//echo "\t".'<script type="text/javascript" src="/javascript/'.$dir.'/'.$file.'"></script>'."\n";
66
				outputJavaScriptFileInline("javascript/{$dir}/{$file}"); 
67
			}
68
			closedir($dh);
69
		}
70
	}
71

    
72
	if ($oSajax):
73
?>
74
	<script language="javascript" type="text/javascript">
75
		<?php $oSajax->sajax_show_javascript(); ?>
76
	</script>
77

    
78
<?	endif; ?>
79

    
80
<?php if (!isset($closehead))
81
	echo "</head>";
82
?>
(70-70/211)