summaryrefslogtreecommitdiffstats
path: root/src/usr
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
parente1c2947501d9eef131d7fe58e8be031ebfa4e9fb (diff)
downloadpfsense-ccc62f13b6f599b932238929e96f5d945be9d515.zip
pfsense-ccc62f13b6f599b932238929e96f5d945be9d515.tar.gz
Make display separators function generic and move to filter.inc.
Diffstat (limited to 'src/usr')
-rw-r--r--src/usr/local/www/firewall_nat.php23
-rw-r--r--src/usr/local/www/firewall_rules.php21
2 files changed, 6 insertions, 38 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;
?>
diff --git a/src/usr/local/www/firewall_rules.php b/src/usr/local/www/firewall_rules.php
index b64b506..365a081 100644
--- a/src/usr/local/www/firewall_rules.php
+++ b/src/usr/local/www/firewall_rules.php
@@ -133,22 +133,6 @@ function delete_nat_association($id) {
}
}
-function display_separator() {
- global $config, $if, $nrules, $columns_in_table;
-
- if (!empty($config['filter']['separator'][strtolower($if)])) {
- foreach ($config['filter']['separator'][strtolower($if)] as $sepn => $separator) {
- if ($separator['row'][0] == "fr" . $nrules) {
- $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['filter']['rule'])) {
$config['filter']['rule'] = array();
}
@@ -502,9 +486,10 @@ $columns_in_table = 13;
<tbody class="user-entries">
<?php
$nrules = 0;
+$separators = $config['filter']['separator'][strtolower($if)];
// There can be a separator before any rules are listed
-display_separator();
+display_separator($separators, $nrules, $columns_in_table);
for ($i = 0; isset($a_filter[$i]); $i++):
$filterent = $a_filter[$i];
@@ -812,7 +797,7 @@ for ($i = 0; isset($a_filter[$i]); $i++):
<?php
$nrules++;
// There can be a separator before the next rule listed, or after the last rule listed
- display_separator();
+ display_separator($separators, $nrules, $columns_in_table);
}
endfor;
?>
OpenPOWER on IntegriCloud