diff options
-rwxr-xr-x | usr/local/www/javascript/row_helper.js | 2 | ||||
-rwxr-xr-x | usr/local/www/javascript/row_helper_dynamic.js | 2 | ||||
-rwxr-xr-x | usr/local/www/pkg_edit.php | 24 |
3 files changed, 27 insertions, 1 deletions
diff --git a/usr/local/www/javascript/row_helper.js b/usr/local/www/javascript/row_helper.js index 8193043..476602b 100755 --- a/usr/local/www/javascript/row_helper.js +++ b/usr/local/www/javascript/row_helper.js @@ -28,6 +28,8 @@ var addRowTo = (function() { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + rowsize[i] + "' class='formfld unknown' 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 size='1' name='" + rowname[i] + totalrows + "'><option value=\"32\" selected>32</option><option value=\"31\" >31</option><option value=\"30\" >30</option><option value=\"29\" >29</option><option value=\"28\" >28</option><option value=\"27\" >27</option><option value=\"26\" >26</option><option value=\"25\" >25</option><option value=\"24\" >24</option><option value=\"23\" >23</option><option value=\"22\" >22</option><option value=\"21\" >21</option><option value=\"20\" >20</option><option value=\"19\" >19</option><option value=\"18\" >18</option><option value=\"17\" >17</option><option value=\"16\" >16</option><option value=\"15\" >15</option><option value=\"14\" >14</option><option value=\"13\" >13</option><option value=\"12\" >12</option><option value=\"11\" >11</option><option value=\"10\" >10</option><option value=\"9\" >9</option><option value=\"8\" >8</option><option value=\"7\" >7</option><option value=\"6\" >6</option><option value=\"5\" >5</option><option value=\"4\" >4</option><option value=\"3\" >3</option><option value=\"2\" >2</option><option value=\"1\" >1</option></select> "; + } else if(rowtype[i] == 'select_source') { + td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><select size='1' name='" + rowname[i] + totalrows + "'><option value=\"32\" selected>32</option><option value=\"31\" >31</option><option value=\"30\" >30</option><option value=\"29\" >29</option><option value=\"28\" >28</option><option value=\"27\" >27</option><option value=\"26\" >26</option><option value=\"25\" >25</option><option value=\"24\" >24</option><option value=\"23\" >23</option><option value=\"22\" >22</option><option value=\"21\" >21</option><option value=\"20\" >20</option><option value=\"19\" >19</option><option value=\"18\" >18</option><option value=\"17\" >17</option><option value=\"16\" >16</option><option value=\"15\" >15</option><option value=\"14\" >14</option><option value=\"13\" >13</option><option value=\"12\" >12</option><option value=\"11\" >11</option><option value=\"10\" >10</option><option value=\"9\" >9</option><option value=\"8\" >8</option><option value=\"7\" >7</option><option value=\"6\" >6</option><option value=\"5\" >5</option><option value=\"4\" >4</option><option value=\"3\" >3</option><option value=\"2\" >2</option><option value=\"1\" >1</option></select> "; } else { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input type='checkbox' name='" + rowname[i] + totalrows + "'></input> "; } diff --git a/usr/local/www/javascript/row_helper_dynamic.js b/usr/local/www/javascript/row_helper_dynamic.js index 778f182..032874c 100755 --- a/usr/local/www/javascript/row_helper_dynamic.js +++ b/usr/local/www/javascript/row_helper_dynamic.js @@ -31,6 +31,8 @@ var addRowTo = (function() { td.innerHTML="<INPUT type='hidden' value='" + totalrows +"' name='" + rowname[i] + "_row-" + totalrows + "'></input><input size='" + objectSize + "' 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 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 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 type='checkbox'name='" + rowname[i] + totalrows + "' id='" + rowname[i] + totalrows + "'></input> "; } else if(rowtype[i] == 'input') { diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index 054ec97..5ac3776 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -690,7 +690,7 @@ if($pkg['note'] != "") * ROW Helpers function */ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) { - global $text; + global $text, $config; echo "<td>\n"; if($type == "input") { echo "<input size='" . $size . "' name='" . $fieldname . $trc . "' id='" . $fieldname . $trc . "' value='" . $value . "'>\n"; @@ -712,6 +712,28 @@ function display_row($trc, $value, $fieldname, $type, $rowhelper, $size) { echo "<option value='" . $rowopt['value'] . "'" . $selected . ">" . $rowopt['name'] . "</option>\n"; } echo "</select>\n"; + } else if($type == "select_source") { + echo "<select id='" . $fieldname . $trc . "' name='" . $fieldname . $trc . "'>\n"; + $source_url = $rowhelper['source']; + eval("\$pkg_source_txt = &$source_url;"); + foreach($pkg_source_txt as $opt) { + $selected = ""; + if($rowhelper['source_name']) { + $source_name = $opt[$rowhelper['source_name']]; + } else { + $source_name = $opt[$rowhelper['name']]; + } + if($rowhelper['source_value']) { + $source_value = $opt[$rowhelper['source_value']]; + } else { + $source_value = $opt[$rowhelper['value']]; + } + if($opt['value'] == $value) + $selected = " SELECTED"; + $text .= "<option value='" . $source_value . "'" . $selected . ">" . $source_name . "</option>"; + echo "<option value='" . $source_value . "'" . $selected . ">" . $source_name . "</option>\n"; + } + echo "</select>\n"; } } |