diff options
author | jim-p <jimp@pfsense.org> | 2012-06-12 12:52:14 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-06-12 12:52:14 -0400 |
commit | 435b4eec3d7cfdbb70c90142d7c12cd2f0f2601d (patch) | |
tree | b08a0780938686ff00d628c20b6ee61baf5d917a /usr/local | |
parent | ef62f989b916adab5e9306f8bb7edefe3367a5fe (diff) | |
download | pfsense-435b4eec3d7cfdbb70c90142d7c12cd2f0f2601d.zip pfsense-435b4eec3d7cfdbb70c90142d7c12cd2f0f2601d.tar.gz |
This should have been 2.1 only, and it's just causing some odd package behavior on 2.0.2 (blank lines in squid's interface selection, for one). 2.1 has different code here anyhow. Revert "Added "interface_selection" type to enable interface selection in tinydns server"
This reverts commit 05d908db3ad62e46eb22bb73e397ba8bf61cb36c.
Diffstat (limited to 'usr/local')
-rwxr-xr-x | usr/local/www/javascript/row_helper_dynamic.js | 13 | ||||
-rwxr-xr-x | usr/local/www/pkg_edit.php | 41 |
2 files changed, 11 insertions, 43 deletions
diff --git a/usr/local/www/javascript/row_helper_dynamic.js b/usr/local/www/javascript/row_helper_dynamic.js index 07df2c1..30312ba 100755 --- a/usr/local/www/javascript/row_helper_dynamic.js +++ b/usr/local/www/javascript/row_helper_dynamic.js @@ -24,30 +24,27 @@ var temp_streaming_text = ""; var addRowTo = (function() { return (function (tableId, objectSize) { - var d, tbody, tr, td, bgc, i, ii, j, size; + var d, tbody, tr, td, bgc, i, ii, j; d = document; tbody = d.getElementById(tableId).getElementsByTagName("tbody").item(0); tr = d.createElement("tr"); totalrows++; - size = objectSize; + if (!objectSize) + objectSize = rowsize[i]; for (i = 0; i < field_counter_js; i++) { - if (!objectSize) - size = rowsize[i]; td = d.createElement("td"); if(typeof(rowtype[i]) == 'function') { - td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input>" + rowtype[i](rowname[i], size, totalrows) + " "; + td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input>" + rowtype[i](rowname[i], objectSize, totalrows) + " "; } else if(rowtype[i] == 'textbox') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " size='" + rowsize[i] + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'select') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select " + rowhelper_onChange + " name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; - } else if(rowtype[i] == 'interfaces_selection') { - td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select " + rowhelper_onChange + " name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; } else if(rowtype[i] == 'select_source') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select " + rowhelper_onChange + " name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'>" + newrow[i] + "</select> "; } else if(rowtype[i] == 'checkbox') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " type='checkbox'name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'input') { - td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " class='formfld unknown' size='" + size + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; + td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " class='formfld unknown' size='" + objectSize + "' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'password') { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input " + rowhelper_onChange + " class='formfld pwd' type='password' name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index a683522..99a6204 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -503,7 +503,7 @@ if ($pkg['tabs'] <> "") { } else if($pkga['type'] == "select") { $fieldname = $pkga['fieldname']; if (isset($pkga['multiple'])) { - $multiple = 'multiple="multiple"'; + $multiple = 'multiple="multiple"'; $items = explode(',', $value); $fieldname .= "[]"; } else { @@ -653,10 +653,6 @@ if ($pkg['tabs'] <> "") { else $values = explode(',', $value); $ifaces["lo0"] = "loopback"; - if(isset($pkga['advancedfield']) && $adv_enabled) - $advanced .="<option><name></name><value></value></option>/n"; - else - echo "<option><name></name><value></value></option>/n"; foreach($ifaces as $ifname => $iface) { $selected = (in_array($ifname, $values) ? 'selected' : ''); if(isset($pkga['advancedfield']) && $adv_enabled) @@ -685,7 +681,6 @@ if ($pkg['tabs'] <> "") { foreach($pkga['rowhelper']['rowhelperfield'] as $rowhelper) { echo "rowname[" . $fieldcounter . "] = \"" . $rowhelper['fieldname'] . "\";\n"; echo "rowtype[" . $fieldcounter . "] = \"" . $rowhelper['type'] . "\";\n"; - echo "rowsize[" . $fieldcounter . "] = \"" . $rowhelper['size'] . "\";\n"; $fieldcounter++; } ?> @@ -752,9 +747,9 @@ if ($pkg['tabs'] <> "") { if($trc == 0) { /* * no records loaded. - * just show a generic line non-populated with saved data - */ - foreach($pkga['rowhelper']['rowhelperfield'] as $rowhelper) { + * just show a generic line non-populated with saved data + */ + foreach($pkga['rowhelper']['rowhelperfield'] as $rowhelper) { if($rowhelper['value'] <> "") $value = $rowhelper['value']; $fieldname = $rowhelper['fieldname']; $options = ""; @@ -898,34 +893,10 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) { foreach($rowhelper['options']['option'] as $rowopt) { $selected = ""; if($rowopt['value'] == $value) $selected = " SELECTED"; - $text .= "<option value='" . $rowopt['value'] . ">" . $rowopt['name'] . "</option>"; + $text .= "<option value='" . $rowopt['value'] . "'" . $selected . ">" . $rowopt['name'] . "</option>"; echo "<option value='" . $rowopt['value'] . "'" . $selected . ">" . $rowopt['name'] . "</option>\n"; } echo "</select>\n"; - } else if($type == "interfaces_selection") { - $size = ($size ? "size=\"{$size}\"" : ''); - $multiple = ''; - if (isset($rowhelper['multiple'])) { - $fieldname .= '[]'; - $multiple = 'multiple'; - } - echo "<select id='" . $fieldname . $trc . "' name='" . $fieldname . $trc . "' $size $multiple>\n"; - $ifaces = get_configured_interface_with_descr(); - $additional_ifaces = $rowhelper['add_to_interfaces_selection']; - if (!empty($additional_ifaces)) - $ifaces = array_merge($ifaces, explode(',', $additional_ifaces)); - if(is_array($value)) - $values = $value; - else - $values = explode(',', $value); - $ifaces["lo0"] = "loopback"; - echo "<option><name></name><value></value></option>/n"; - foreach($ifaces as $ifname => $iface) { - $selected = (in_array($ifname, $values) ? 'selected' : ''); - $text .="<option value=\\\"$ifname\\\">$iface</option>"; - echo "<option value=\"$ifname\" $selected>$iface</option>\n"; - } - echo "</select>\n"; } else if($type == "select_source") { echo "<select id='" . $fieldname . $trc . "' name='" . $fieldname . $trc . "'>\n"; $source_url = $rowhelper['source']; @@ -944,7 +915,7 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) { } if($source_value == $value) $selected = " SELECTED"; - $text .= "<option value='" . $source_value . "'" . ">" . $source_name . "</option>"; + $text .= "<option value='" . $source_value . "'" . $selected . ">" . $source_name . "</option>"; echo "<option value='" . $source_value . "'" . $selected . ">" . $source_name . "</option>\n"; } echo "</select>\n"; |