diff --git a/include/functions.php b/include/functions.php index 1ceb31da..83056b3c 100644 --- a/include/functions.php +++ b/include/functions.php @@ -466,8 +466,20 @@ function highlight($search,$subject,$hlstart='',$hlend function get_user_class() { - global $CURUSER; - return $CURUSER["class"] ?? ''; + if (IN_NEXUS) { + global $CURUSER; + return $CURUSER["class"] ?? ''; + } + return auth()->user()->class; +} + +function get_user_id() +{ + if (IN_NEXUS) { + global $CURUSER; + return $CURUSER["id"] ?? 0; + } + return auth()->user()->id ?? 0; } function get_user_class_name($class, $compact = false, $b_colored = false, $I18N = false) diff --git a/resources/lang/en/label.php b/resources/lang/en/label.php index 2efcf7b5..3cf6c593 100644 --- a/resources/lang/en/label.php +++ b/resources/lang/en/label.php @@ -206,5 +206,6 @@ return [ 'target' => 'Open type', 'style' => 'Style', 'parent_id' => 'Parent', + 'min_class' => 'Minimum visible class', ], ]; diff --git a/resources/lang/zh_CN/label.php b/resources/lang/zh_CN/label.php index d1d83452..d89cdd8b 100644 --- a/resources/lang/zh_CN/label.php +++ b/resources/lang/zh_CN/label.php @@ -209,5 +209,6 @@ return [ 'target' => '打开方式', 'style' => '样式', 'parent_id' => '父菜单', + 'min_class' => '最低可见等级', ], ]; diff --git a/resources/lang/zh_TW/label.php b/resources/lang/zh_TW/label.php index 1401255a..9dac0928 100644 --- a/resources/lang/zh_TW/label.php +++ b/resources/lang/zh_TW/label.php @@ -206,5 +206,6 @@ return [ 'target' => '打開方式', 'style' => '樣式', 'parent_id' => '父菜單', + 'min_class' => '最低可見等級', ], ];