summaryrefslogtreecommitdiffstats
path: root/usr/local/www/pkg_edit.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@inf.org>2015-05-22 01:58:17 +0545
committerPhil Davis <phil.davis@inf.org>2015-05-22 01:58:17 +0545
commitbec3f9253fa3e2c8f6004aebb8630e0b78bbfbcb (patch)
tree7be6af49c4db30b40ffecb61aa8e4ce446865dc3 /usr/local/www/pkg_edit.php
parent8a736faeae8113daa85c6ad8da3dd3dc9e789a87 (diff)
downloadpfsense-bec3f9253fa3e2c8f6004aebb8630e0b78bbfbcb.zip
pfsense-bec3f9253fa3e2c8f6004aebb8630e0b78bbfbcb.tar.gz
Update pkg_edit.php
a) When we are doing combined fields and usecolspan2 is in effect, then usecolspan2 is also a signal that we want to spread the combined fields horizontally in a single row. In that case we want the combined fields to all be in a single "tr" tag enclosing them all. That was already working in that way. b) But if usecolspan2 is NOT in effect, then we want the combined fields to still run "together" but vertically under each other. In this case we want each field to be in its own "tr" tag. This change makes (b) happen. If combinedfields is not set, then each of the "if" tests here still follows the same path it did previously, so there should be no effect on the HTML output for any ordinary package fields.
Diffstat (limited to 'usr/local/www/pkg_edit.php')
-rw-r--r--usr/local/www/pkg_edit.php33
1 files changed, 23 insertions, 10 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php
index 0d7c3cd..ad56f5a 100644
--- a/usr/local/www/pkg_edit.php
+++ b/usr/local/www/pkg_edit.php
@@ -472,10 +472,14 @@ if ($pkg['tabs'] <> "") {
$colspan="";
if (isset($pkga['dontdisplayname'])){
$input="";
- // We do not want a separate tr tag pair for each field in a set of combined fields.
- // The case of putting the first tr tag at the beginning of a combine-fields set is already handled above.
- if (!isset($pkga['combinefields']))
+ // If this is in a set of combined fields and;
+ // - it is a "begin" (case already handled above) or
+ // - usecolspan2 is in effect (so we want to spread all the combined fields horizontally)
+ // then we do not want this "tr" to be inserted.
+ // Thus only insert the "tr" if the not (!) of the above condition.
+ if (!((isset($pkga['combinefields'])) && (($pkga['combinefields'] == "begin") || (isset($pkga['usecolspan2']))))) {
$input .= "<tr valign='top' id='tr_{$pkga['fieldname']}'>";
+ }
if(isset($pkga['usecolspan2']))
$colspan="colspan='2'";
else
@@ -492,9 +496,12 @@ if ($pkg['tabs'] <> "") {
if (isset($pkga['required']))
$req = 'req';
$input="";
- // We do not want a separate tr tag pair for each field in a set of combined fields.
- // The case of putting the first tr tag at the beginning of a combine-fields set is already handled above.
- if (!isset($pkga['combinefields'])) {
+ // If this is in a set of combined fields and;
+ // - it is a "begin" (case already handled above) or
+ // - usecolspan2 is in effect (so we want to spread all the combined fields horizontally)
+ // then we do not want this "tr" to be inserted.
+ // Thus only insert the "tr" if the not (!) of the above condition.
+ if (!((isset($pkga['combinefields'])) && (($pkga['combinefields'] == "begin") || (isset($pkga['usecolspan2']))))) {
$input .= "<tr>";
}
$input .= "<td valign='top' width=\"22%\" class=\"vncell{$req}\">";
@@ -910,11 +917,17 @@ if ($pkg['tabs'] <> "") {
echo " " . $pkga['typehint'];
#check combinefields options
if (isset($pkga['combinefields'])){
- // At the end of each combined-fields field we just want to end a td tag.
+ // At the end of each combined-fields field we always want to end a td tag.
$input = "</td>";
- // The tr tag and... ends are only used to end the whole set of combined fields.
- if ($pkga['combinefields']=="end")
- $input.="</tr></table></td></tr>";
+ // The tr tag end is used to end the whole set of combined fields,
+ // but also if usecolspan2 is not in effect then we also put each combined field in its own tr.
+ if (($pkga['combinefields'] == "end") || (!isset($pkga['usecolspan2']))) {
+ $input.="</tr>";
+ }
+ // At the end of the combined fields we finish up the table that encloses the combined fields...
+ if ($pkga['combinefields'] == "end") {
+ $input.="</table></td></tr>";
+ }
}
else{
$input = "</td></tr>";
OpenPOWER on IntegriCloud