← All changes
|
src/Controller/Backend/ControllerTabNavigationTrait.php
+3
-7
trunk
→
2.3.18
View file →
| @@ -19,12 +19,10 @@ | ||
| 19 | 19 | public function getCurrentTabGroup(): string |
| 20 | 20 | { |
| 21 | 21 | $groups = $this->getTabGroups(); |
| 22 | 22 | $keys = array_keys($groups); |
| 23 | - $default = (string) reset($keys); | |
| 24 | - $group = (string) $this->getRequestParameter('tab_group', $default); | |
| 25 | 23 | |
| 26 | - return isset($groups[$group]) === true ? $group : $default; | |
| 24 | + return (string) $this->getRequestParameter('tab_group', reset($keys)); | |
| 27 | 25 | } |
| 28 | 26 | |
| 29 | 27 | public function getSections(): array |
| 30 | 28 | { |
| @@ -35,13 +33,11 @@ | ||
| 35 | 33 | |
| 36 | 34 | public function getCurrentTabGroupSection(): string |
| 37 | 35 | { |
| 38 | 36 | $groups = $this->getTabGroups(); |
| 39 | - $sections = (array) ($groups[$this->getCurrentTabGroup()] ?? reset($groups)); | |
| 40 | - $default = (string) reset($sections); | |
| 41 | - $section = (string) $this->getRequestParameter('tab_group_section', $default); | |
| 37 | + $sections = $groups[$this->getCurrentTabGroup()] ?? reset($groups); | |
| 42 | 38 | |
| 43 | - return in_array($section, $sections, true) === true ? $section : $default; | |
| 39 | + return (string) $this->getRequestParameter('tab_group_section', reset($sections)); | |
| 44 | 40 | } |
| 45 | 41 | |
| 46 | 42 | public function getTabGroupLink(string $groupKey): string |
| 47 | 43 | { |