diff options
author | NOYB <Al_Stu@Frontier.com> | 2016-01-14 00:26:55 -0800 |
---|---|---|
committer | NOYB <Al_Stu@Frontier.com> | 2016-01-14 00:26:55 -0800 |
commit | a7b4a1498dc101f918e5c2d278dbd29c9b3b0e41 (patch) | |
tree | 914f15ec28ca98488c33f9b2d9da9720ee7de593 /src/usr/local/www/widgets | |
parent | cd656b85255feee8313e6081325f05db7a6c2642 (diff) | |
download | pfsense-a7b4a1498dc101f918e5c2d278dbd29c9b3b0e41.zip pfsense-a7b4a1498dc101f918e5c2d278dbd29c9b3b0e41.tar.gz |
Return string and print
Diffstat (limited to 'src/usr/local/www/widgets')
-rw-r--r-- | src/usr/local/www/widgets/widgets/gateways.widget.php | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/src/usr/local/www/widgets/widgets/gateways.widget.php b/src/usr/local/www/widgets/widgets/gateways.widget.php index 399a85e..2b9958e 100644 --- a/src/usr/local/www/widgets/widgets/gateways.widget.php +++ b/src/usr/local/www/widgets/widgets/gateways.widget.php @@ -66,7 +66,7 @@ require_once("/usr/local/www/widgets/include/gateways.inc"); // Compose the table contents and pass it back to the ajax caller if ($_REQUEST && $_REQUEST['ajax']) { - compose_table_body_contents(); + print(compose_table_body_contents()); exit; } @@ -94,7 +94,7 @@ if ($_POST) { </thead> <tbody id="gwtblbody"> <?PHP - compose_table_body_contents(); + print(compose_table_body_contents()); ?> </tbody> </table> @@ -167,6 +167,8 @@ if ($_POST) { function compose_table_body_contents() { global $config; + $rtnstr = ''; + $a_gateways = return_gateways_array(); $gateways_status = array(); $gateways_status = return_gateways_status(true); @@ -178,10 +180,10 @@ function compose_table_body_contents() { } foreach ($a_gateways as $gname => $gateway) { - print("<tr>\n"); - print( "<td>\n"); - print(htmlspecialchars($gateway['name']) . "<br />"); - print('<div id="gateway' . $counter . '" style="display:inline"><b>'); + $rtnstr .= "<tr>\n"; + $rtnstr .= "<td>\n"; + $rtnstr .= htmlspecialchars($gateway['name']) . "<br />"; + $rtnstr .= '<div id="gateway' . $counter . '" style="display:inline"><b>'; $monitor_address = ""; $monitor_address_disp = ""; @@ -217,15 +219,15 @@ function compose_table_body_contents() { $monitor_address_disp = ""; } - print($if_gw . $monitor_address_disp); + $rtnstr .= $if_gw . $monitor_address_disp; unset ($if_gw); unset ($monitor_address); unset ($monitor_address_disp); $counter++; - print( "</b>"); - print( "</div>\n"); - print( "</td>\n"); + $rtnstr .= "</b>"; + $rtnstr .= "</div>\n"; + $rtnstr .= "</td>\n"; if ($gateways_status[$gname]) { if (stristr($gateways_status[$gname]['status'], "force_down")) { @@ -252,10 +254,11 @@ function compose_table_body_contents() { $bgcolor = "info"; // lightblue } - print( "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['delay']) : gettext("Pending")) . "</td>\n"); - print( "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['loss']) : gettext("Pending")) . "</td>\n"); - print('<td class="bg-' . $bgcolor . '">' . $online . "</td>\n"); - print("</tr>\n"); + $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['delay']) : gettext("Pending")) . "</td>\n"; + $rtnstr .= "<td>" . ($gateways_status[$gname] ? htmlspecialchars($gateways_status[$gname]['loss']) : gettext("Pending")) . "</td>\n"; + $rtnstr .= '<td class="bg-' . $bgcolor . '">' . $online . "</td>\n"; + $rtnstr .= "</tr>\n"; } + return($rtnstr); } ?>
\ No newline at end of file |