diff options
author | Igor Scheller <igor.scheller@igorshp.de> | 2019-11-26 20:12:43 +0100 |
---|---|---|
committer | Igor Scheller <igor.scheller@igorshp.de> | 2019-11-28 14:30:41 +0100 |
commit | 0e386d2c7fd46832fa67ce574637d30a15e88641 (patch) | |
tree | 44f9edd47376d05773cca3e0065da6d97f102604 /includes/sys_menu.php | |
parent | a2f4426058794673c4a880e9544635b71a95690a (diff) |
Removed global $page
Diffstat (limited to 'includes/sys_menu.php')
-rw-r--r-- | includes/sys_menu.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/includes/sys_menu.php b/includes/sys_menu.php index 4dabc857..3bb061ce 100644 --- a/includes/sys_menu.php +++ b/includes/sys_menu.php @@ -41,12 +41,21 @@ function header_render_hints() } /** + * Returns the path of the current path with underscores instead of hyphens + * + * @return string + */ +function current_page() +{ + return request()->query->get('p') ?: str_replace('-', '_', request()->path()); +} + +/** * @return array */ function make_user_submenu() { - global $page; - + $page = current_page(); $user_submenu = make_language_select(); if (auth()->can('user_settings') || auth()->can('logout')) { @@ -79,8 +88,7 @@ function make_user_submenu() */ function make_navigation() { - global $page; - + $page = current_page(); $menu = []; $pages = [ 'news' => __('News'), |