-
Notifications
You must be signed in to change notification settings - Fork 2
/
preferences.php
39 lines (34 loc) · 930 Bytes
/
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
<?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 != "." && $file != ".." && 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;
$html.='"';
if($t == $_SESSION['theme']) $html.=" SELECTED ";
$html.='>'.$t;
$html.="</option>";
$html.="\n";
}
// PAGE DISPLAY CODE
echo "<h2>Theme</h2>\n";
echo '<form action="updatePreferences.php" method="post">';
echo '<select name="theme">';
echo "\n";
echo $html;
echo "</select>\n"; echo '<input type="submit" class="button" value="Apply" name="submit">'."\n";
echo "</form>\n";
echo "</div>\n";
include_once('footer.php');
?>