From e9eb81a87f38edf508d8c0c82f0ec2d086b448fc Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 20 Apr 2020 08:54:38 +0200 Subject: [PATCH] menu: change as discussed in 7749c098381 PR: https://github.com/opnsense/core/issues/4016 --- .../mvc/app/models/OPNsense/Base/Menu/MenuSystem.php | 10 +++++++++- src/www/interfaces.php | 6 +++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuSystem.php b/src/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuSystem.php index b36c67ec4..31056e70b 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuSystem.php +++ b/src/opnsense/mvc/app/models/OPNsense/Base/Menu/MenuSystem.php @@ -267,11 +267,19 @@ class MenuSystem } foreach ($ifgroups as $key => $groupings) { + $first = true; foreach ($groupings as $grouping) { $this->appendItem('Interfaces.' . $grouping, $key, array( - 'url' => '/interfaces.php?group=' . $grouping . '&if=' . $key, + 'url' => '/interfaces.php?if=' . $key . '&group=' . $grouping, 'visiblename' => '[' . $iftargets['if'][$key] . ']', )); + if ($first) { + $this->appendItem('Interfaces.' . $grouping . '.' . $key, 'Origin', array( + 'url' => '/interfaces.php?if=' . $key, + 'visibility' => 'hidden', + )); + $first = false; + } } } diff --git a/src/www/interfaces.php b/src/www/interfaces.php index 0d1674ee2..dfd61d182 100644 --- a/src/www/interfaces.php +++ b/src/www/interfaces.php @@ -612,7 +612,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { } @unlink('/tmp/.interfaces.apply'); if (!empty($ifgroup)) { - header(url_safe('Location: /interfaces.php?group=%s&if=%s', array($ifgroup, $if))); + header(url_safe('Location: /interfaces.php?if=%s&group=%s', array($if, $ifgroup))); } else { header(url_safe('Location: /interfaces.php?if=%s', array($if))); } @@ -647,7 +647,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { file_put_contents('/tmp/.interfaces.apply', serialize($toapplylist)); } if (!empty($ifgroup)) { - header(url_safe('Location: /interfaces.php?group=%s&if=%s', array($ifgroup, $if))); + header(url_safe('Location: /interfaces.php?if=%s&group=%s', array($if, $ifgroup))); } else { header(url_safe('Location: /interfaces.php?if=%s', array($if))); } @@ -1410,7 +1410,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { mark_subsystem_dirty('interfaces'); if (!empty($ifgroup)) { - header(url_safe('Location: /interfaces.php?group=%s&if=%s', array($ifgroup, $if))); + header(url_safe('Location: /interfaces.php?if=%s&group=%s', array($if, $ifgroup))); } else { header(url_safe('Location: /interfaces.php?if=%s', array($if))); }