Fix and elseif statement, the domain time_zone, and indentation on a few lines.

This commit is contained in:
Mark Crane 2013-08-20 07:37:39 +00:00
parent 6845e9ddb6
commit 0d35003dca
2 changed files with 38 additions and 25 deletions

View File

@ -177,7 +177,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
if ($action == "update") {
$page["title"] = $text['title-domain_setting-edit'];
}
if ($action == "add") {
elseif ($action == "add") {
$page["title"] = $text['title-domain_setting-add'];
}
@ -295,7 +295,7 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
closedir($handle);
}
echo " </select>\n";
} elseif ($category == "domain" && $subcategory == "time" && $name == "zone" ) {
} elseif ($category == "domain" && $subcategory == "time_zone" && $name == "name" ) {
echo " <select id='domain_setting_value' name='domain_setting_value' class='formfld' style=''>\n";
echo " <option value=''></option>\n";
//$list = DateTimeZone::listAbbreviations();
@ -311,17 +311,30 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
}
echo " <optgroup label='".$category."'>\n";
}
if ($val == $row['domain_setting_value']) {
echo " <option value='".$val."' selected='selected'>".$val."</option>\n";
if (strlen($val) > 0) {
$time_zone_offset = get_time_zone_offset($val)/3600;
$time_zone_offset_hours = floor($time_zone_offset);
$time_zone_offset_minutes = ($time_zone_offset - $time_zone_offset_hours) * 60;
$time_zone_offset_minutes = number_pad($time_zone_offset_minutes, 2);
if ($time_zone_offset > 0) {
$time_zone_offset_hours = number_pad($time_zone_offset_hours, 2);
$time_zone_offset_hours = "+".$time_zone_offset_hours;
}
else {
echo " <option value='".$val."'>".$val."</option>\n";
$time_zone_offset_hours = str_replace("-", "", $time_zone_offset_hours);
$time_zone_offset_hours = "-".number_pad($time_zone_offset_hours, 2);
}
}
if ($val == $row['default_setting_value']) {
echo " <option value='".$val."' selected='selected'>(UTC ".$time_zone_offset_hours.":".$time_zone_offset_minutes.") ".$val."</option>\n";
}
else {
echo " <option value='".$val."'>(UTC ".$time_zone_offset_hours.":".$time_zone_offset_minutes.") ".$val."</option>\n";
}
$previous_category = $category;
$x++;
}
echo " </select>\n";
break;
}
elseif ($category == "email" && $subcategory == "smtp_password" && $name == "var" ) {
echo " <input class='formfld' type='password' name='default_setting_value' maxlength='255' value=\"".$row['default_setting_value']."\">\n";