MDL-16036: make the default value in popup_form "selected"

This commit is contained in:
scyrma
2008-08-18 06:40:41 +00:00
parent f8c81c01f0
commit ffadf71ba8
+10 -1
View File
@@ -1101,7 +1101,16 @@ $targetwindow='self', $selectlabel='', $optionsextra=NULL) {
}
if ($nothing != '') {
$output .= " <option value=\"javascript:void(0)\">$nothing</option>\n";
$selectlabeloption = '';
if ($selected=='') {
$selectlabeloption = ' selected="selected"';
}
foreach ($options as $value => $label) { //if one of the options is the empty value, don't make this the default
if ($value == '') {
$selected = '';
}
}
$output .= " <option value=\"javascript:void(0)\"$selectlabeloption>$nothing</option>\n";
}
$inoptgroup = false;