summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/firewall_nat.php
diff options
context:
space:
mode:
authorNOYB <Al_Stu@Frontier.com>2016-02-08 22:15:51 -0800
committerNOYB <Al_Stu@Frontier.com>2016-02-08 22:15:51 -0800
commitccc62f13b6f599b932238929e96f5d945be9d515 (patch)
tree4bbc7837387cc9051b5a26bcc2a572baa8d3368c /src/usr/local/www/firewall_nat.php
parente1c2947501d9eef131d7fe58e8be031ebfa4e9fb (diff)
downloadpfsense-ccc62f13b6f599b932238929e96f5d945be9d515.zip
pfsense-ccc62f13b6f599b932238929e96f5d945be9d515.tar.gz
Make display separators function generic and move to filter.inc.
Diffstat (limited to 'src/usr/local/www/firewall_nat.php')
-rw-r--r--src/usr/local/www/firewall_nat.php23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/usr/local/www/firewall_nat.php b/src/usr/local/www/firewall_nat.php
index 99e0914..80f603e 100644
--- a/src/usr/local/www/firewall_nat.php
+++ b/src/usr/local/www/firewall_nat.php
@@ -69,24 +69,6 @@ require_once("filter.inc");
require_once("shaper.inc");
require_once("itemid.inc");
-// This display separators function can be made generic and placed in filter.inc along with it's counter part of firewall rules.
-// Things that would need to be passed instead of global are the config and nnats/nrules count.
-function display_separator() {
- global $config, $if, $nnats, $columns_in_table;
-
- if (!empty($config['nat']['separator'])) {
- foreach ($config['nat']['separator'] as $sepn => $separator) {
- if ($separator['row'][0] == "fr" . $nnats) {
- $cellcolor = $separator['color'];
- print('<tr class="ui-sortable-handle separator">' .
- '<td class="' . $cellcolor . '" colspan="' . ($columns_in_table -1) . '">' . '<span class="' . $cellcolor . '">' . $separator['text'] . '</span></td>' .
- '<td class="' . $cellcolor . '"><a href="#"><i class="fa fa-trash no-confirm sepdel" title="delete this separator"></i></a></td>' .
- '</tr>' . "\n");
- }
- }
- }
-}
-
if (!is_array($config['nat']['rule'])) {
$config['nat']['rule'] = array();
}
@@ -276,9 +258,10 @@ $columns_in_table = 13;
<?php
$nnats = $i = 0;
+$separators = $config['nat']['separator'];
// There can be a separator before any rules are listed
-display_separator();
+display_separator($separators, $nnats, $columns_in_table);
foreach ($a_nat as $natent):
@@ -444,7 +427,7 @@ foreach ($a_nat as $natent):
$nnats++;
// There can be a separator before the next rule listed, or after the last rule listed
- display_separator();
+ display_separator($separators, $nnats, $columns_in_table);
endforeach;
?>
OpenPOWER on IntegriCloud