menu: change as discussed in 7749c098381

PR: https://github.com/opnsense/core/issues/4016
This commit is contained in:
Franco Fichtner 2020-04-20 08:54:38 +02:00
parent 2c3da19953
commit e9eb81a87f
2 changed files with 12 additions and 4 deletions

View File

@ -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;
}
}
}

View File

@ -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)));
}