From ca36dcc51650f95aa35a1e626bf3f0a2781726d4 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 29 Jul 2019 20:56:30 +0200 Subject: [PATCH] for https://github.com/opnsense/core/issues/3594 align overview icons in firewall_rules.php --- src/www/firewall_rules.php | 42 +++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 17 deletions(-) diff --git a/src/www/firewall_rules.php b/src/www/firewall_rules.php index a772d1c015a..aa598986483 100644 --- a/src/www/firewall_rules.php +++ b/src/www/firewall_rules.php @@ -140,7 +140,7 @@ function firewall_rule_item_proto($filterent) function firewall_rule_item_icons($filterent) { $result = ""; - if (!empty($filterent['direction']) && $filterent['direction'] == "in") { + if (empty($filterent['direction']) || $filterent['direction'] == "in") { $result .= sprintf( "", gettext("in") @@ -150,20 +150,32 @@ function firewall_rule_item_icons($filterent) "", gettext("out") ); + } else { + $result .= sprintf( + "", + gettext("any") + ); } - if (!empty($filterent['floating'])) { - if (isset($filterent['quick']) && $filterent['quick'] === 'yes') { - $result .= sprintf( - "", - gettext('first match') - ); - } else { - $result .= sprintf( - "", - gettext('last match') - ); - } + if (empty($filterent['floating']) && $filterent['quick'] == null){ + $is_quick = true; + } elseif (!empty($filterent['floating']) && $filterent['quick'] == null) { + $is_quick = false; + } else { + $is_quick = $filterent['quick']; + } + + if ($is_quick) { + $result .= sprintf( + "", + gettext('first match') + ); + } else { + $result .= sprintf( + "", + gettext('last match') + ); } + if (isset($filterent['log'])) { $result .= sprintf( "", @@ -882,10 +894,8 @@ function firewall_rule_item_action($filterent) - - @@ -901,10 +911,8 @@ function firewall_rule_item_action($filterent) - -