-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpreferences.php
50 lines (44 loc) · 1.47 KB
/
preferences.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
//INCLUDES
include_once('header.php');
// query theme directory to build dropdown selector
$themedir = "./themes";
if ($handle = opendir($themedir)) {
while (false !== ($file = readdir($handle))) {
if ($file[0] !== "." && is_dir($themedir. "/" . $file)) {
$themes[] = $file;
}
}
closedir($handle);
}
$html="";
// ran into a strange PHP bug when using "foreach ($themes as $theme)", so just using $t
foreach ($themes as $t) {
$html.= "<option value='$t' ";
if($t === $config['theme']) $html.=" selected='selected' ";
$html.=">$t</option>\n";
}
if ($config['useLiveEnhancements']) {
$useLiveEnhancements="<div class='formrow'>"
."<label for='useLiveEnhancements'>Use Live Enhancements</label>"
."<input type='checkbox'name='useLiveEnhancements' id='useLiveEnhancements' "
.(($_SESSION['useLiveEnhancements'])?" checked='checked' ":'')
." />\n"
."<input type='hidden' name='checkboxes[]' value='useLiveEnhancements' />\n"
."</div>\n";
} else $useLiveEnhancements='';
?>
<h2>Preference</h2>
<form action="processPreferences.php" method="post">
<div class='formrow'>
<label for='theme'>Theme:</label>
<select id='theme' name="theme">
<?php echo $html; ?>
</select>
</div><?php
echo $useLiveEnhancements;
?><div class='formbuttons'>
<input type="submit" class="button" value="Apply" name="submit" id='submit' />
</div>
</form>
<?php include_once('footer.php'); ?>