summaryrefslogtreecommitdiff
path: root/includes/sys_menu.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-11-26 20:12:43 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-11-28 14:30:41 +0100
commit0e386d2c7fd46832fa67ce574637d30a15e88641 (patch)
tree44f9edd47376d05773cca3e0065da6d97f102604 /includes/sys_menu.php
parenta2f4426058794673c4a880e9544635b71a95690a (diff)
Removed global $page
Diffstat (limited to 'includes/sys_menu.php')
-rw-r--r--includes/sys_menu.php16
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'),