diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2005-01-18 00:01:05 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2005-01-18 00:01:05 +0000 |
commit | 2cf712c4495b722086401f4be034cfef2e33a5a1 (patch) | |
tree | d3a2e5f9f90dd38fd5c7994fb7f40e0d4d248a12 /usr/local/www/pkg.php | |
parent | 03dce3bd1ac8897f4bc7f71c934e43d2ee6199e9 (diff) | |
download | pfsense-2cf712c4495b722086401f4be034cfef2e33a5a1.zip pfsense-2cf712c4495b722086401f4be034cfef2e33a5a1.tar.gz |
Add type column to adddeleteeditpagefields allowing for the script to answer yes and no for checkbox items.
Diffstat (limited to 'usr/local/www/pkg.php')
-rwxr-xr-x | usr/local/www/pkg.php | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/usr/local/www/pkg.php b/usr/local/www/pkg.php index a1c4c56..25b18a7 100755 --- a/usr/local/www/pkg.php +++ b/usr/local/www/pkg.php @@ -114,35 +114,43 @@ include("fbegin.inc"); <?php $cols = 0; foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { - echo "<td class=\"listhdrr\">" . $column['fielddescr'] . "</td>"; - $cols++; + echo "<td class=\"listhdrr\">" . $column['fielddescr'] . "</td>"; + $cols++; } echo "</tr>"; - $i=0; - if($evaledvar) - foreach ($evaledvar as $ip) { - echo "<tr valign=\"top\">\n"; - foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { - ?> - <td class="listlr"> - <?php - $toeval="echo \$ip['" . xml_safe_fieldname($column['fieldname']) . "'];"; - eval($toeval); - ?> - </td> - <?php - } - ?> - <td valign="middle" class="list" nowrap> - <a href="pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>"><img src="e.gif" width="17" height="17" border="0"></a> - <a href="pkg.php?xml=<?=$xml?>&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this item?')"><img src="x.gif" width="17" height="17" border="0"></a> - </td> - <?php - echo "</tr>\n"; - $i++; + $i=0; + if($evaledvar) + foreach ($evaledvar as $ip) { + echo "<tr valign=\"top\">\n"; + foreach ($pkg['adddeleteeditpagefields']['columnitem'] as $column) { + ?> + <td class="listlr"> + <?php + $toeval="\$fieldname = \$ip['" . xml_safe_fieldname($column['fieldname']) . "'];"; + eval($toeval); + if($column['type'] == "checkbox") { + if($fieldname == "") { + echo "No"; + } else { + echo "Yes"; + } + } else { + echo $fieldname; + } + ?> + </td> + <?php } - ?> - + ?> + <td valign="middle" class="list" nowrap> + <a href="pkg_edit.php?xml=<?=$xml?>&act=edit&id=<?=$i;?>"><img src="e.gif" width="17" height="17" border="0"></a> + <a href="pkg.php?xml=<?=$xml?>&act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this item?')"><img src="x.gif" width="17" height="17" border="0"></a> + </td> + <?php + echo "</tr>\n"; + $i++; + } + ?> <tr><td colspan="<?=$cols?>"></td><td><a href="pkg_edit.php?xml=<?=$xml?>"><img src="plus.gif" width="17" height="17" border="0"></a></td></tr> </table> </td> |