diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-04-04 23:11:01 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-04-04 23:11:01 +0000 |
commit | bd31336e1e52cb9a943bae72c8b12ce6e476c1f7 (patch) | |
tree | 09638214617d1882b2282bdc80e04f8d6aef38e5 /usr/local/www/wizard.php | |
parent | dec899f823c4b34f014a8e64cfd2373389d72d94 (diff) | |
download | pfsense-bd31336e1e52cb9a943bae72c8b12ce6e476c1f7.zip pfsense-bd31336e1e52cb9a943bae72c8b12ce6e476c1f7.tar.gz |
* Move indvidual xml subnet items to its own widget
* Move indvidual xml time zones items to its own widget
Diffstat (limited to 'usr/local/www/wizard.php')
-rwxr-xr-x | usr/local/www/wizard.php | 44 |
1 files changed, 42 insertions, 2 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index 2700c90..4371eb4 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -50,7 +50,7 @@ if($xml == "") { print_info_box_np("ERROR: Could not open " . $xml . "."); die; } else { - if (file_exists("{$g['www_path']}/wizards/{$xml}")) + if (file_exists("{$g['www_path']}/wizards/{$xml}")) $pkg = parse_xml_config_pkg("{$g['www_path']}/wizards/" . $xml, "pfsensewizard"); else { print_info_box_np("ERROR: Could not open " . $xml . "."); @@ -62,6 +62,10 @@ $title = $pkg['step'][$stepid]['title']; $description = $pkg['step'][$stepid]['description']; $totalsteps = $pkg['totalsteps']; +exec('/usr/bin/tar -tzf /usr/share/zoneinfo.tgz', $timezonelist); +$timezonelist = array_filter($timezonelist, 'is_timezone'); +sort($timezonelist); + if($pkg['step'][$stepid]['stepsubmitbeforesave']) { eval($pkg['step'][$stepid]['stepsubmitbeforesave']); } @@ -252,6 +256,39 @@ function FieldValidate(userinput, regexp, message) } else if ($field['type'] == "listtopic") { echo "<td> </td><tr>"; echo "<tr><td colspan=\"2\" class=\"listtopic\">" . $field['name'] . "<br></td>\n"; + } else if ($field['type'] == "subnet_select") { + if(!$field['dontdisplayname']) { + echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n"; + echo fixup_string($field['name']); + echo ":</td>"; + } + if(!$field['dontcombinecells']) + echo "<td class=\"vtable\">"; + echo "<select name='{$name}'>\n"; + for($x=1; $x<33; $x++) { + $CHECKED = ""; + if($value == $x) $CHECKED = " SELECTED"; + if($x <> 31) + echo "<option value='{$x}' {$CHECKED}>{$x}</option>\n"; + } + echo "</select>\n"; + } else if ($field['type'] == "timezone_select") { + if(!$field['dontdisplayname']) { + echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n"; + echo fixup_string($field['name']); + echo ":</td>"; + } + if(!$field['dontcombinecells']) + echo "<td class=\"vtable\">"; + echo "<select name='{$name}'>\n"; + foreach ($timezonelist as $tz) { + $SELECTED = ""; + if ($value == $tz) $SELECTED = " SELECTED"; + echo "<option value='" . htmlspecialchars($tz) . "' {$SELECTED}>"; + echo htmlspecialchars($tz); + echo "</option>\n"; + } + echo "</select>\n"; } else if ($field['type'] == "checkbox") { if(!$field['dontdisplayname']) { echo "<td width=\"22%\" align=\"right\" class=\"vncellreq\">\n"; @@ -376,5 +413,8 @@ function fixup_string($string) { return $newstring; } -?> +function is_timezone($elt) { + return !preg_match("/\/$/", $elt); +} +?>
\ No newline at end of file |