@@ -15,6 +15,7 @@ import { useI18n } from "vue-i18n"
15
15
import { useRouter } from " vue-router"
16
16
import { useLocale } from " ../../composables/locale"
17
17
import PlatformLogo from " ./PlatformLogo.vue"
18
+ import {usePlatformConfig } from " ../../store/platformConfig"
18
19
19
20
const { t } = useI18n ()
20
21
const router = useRouter ()
@@ -27,31 +28,42 @@ const languageItems = languageList.map((language) => ({
27
28
command : (event ) => reloadWithLocale (event .item .isoCode ),
28
29
}))
29
30
30
- const menuItems = computed (() => [
31
- {
32
- label: t (" Home" ),
33
- url: router .resolve ({ name: " Index" }).href ,
34
- },
35
- {
36
- label: t (" FAQ" ),
37
- url: router .resolve ({ name: " Faq" }).href ,
38
- },
39
- {
40
- label: t (" Registration" ),
41
- url: " /main/auth/inscription.php" ,
42
- },
43
- {
44
- label: t (" Demo" ),
45
- url: router .resolve ({ name: " Demo" }).href ,
46
- },
47
- {
48
- label: t (" Contact" ),
49
- url: " /contact" ,
50
- },
51
- {
52
- key: " language_selector" ,
53
- label: currentLanguageFromList .originalName ,
54
- items: languageItems,
55
- },
56
- ])
31
+ const platformConfigStore = usePlatformConfig ()
32
+ const allowRegistration = computed (() => " false" !== platformConfigStore .getSetting (" registration.allow_registration" ))
33
+
34
+ const menuItems = computed (() => {
35
+ const items = [
36
+ {
37
+ label: t (" Home" ),
38
+ url: router .resolve ({ name: " Index" }).href ,
39
+ },
40
+ {
41
+ label: t (" FAQ" ),
42
+ url: router .resolve ({ name: " Faq" }).href ,
43
+ },
44
+ {
45
+ label: t (" Demo" ),
46
+ url: router .resolve ({ name: " Demo" }).href ,
47
+ },
48
+ {
49
+ label: t (" Contact" ),
50
+ url: " /contact" ,
51
+ },
52
+ {
53
+ key: " language_selector" ,
54
+ label: currentLanguageFromList .originalName ,
55
+ items: languageItems,
56
+ },
57
+ ]
58
+
59
+ if (allowRegistration .value ) {
60
+ items .splice (2 , 0 , {
61
+ label: t (" Registration" ),
62
+ url: " /main/auth/inscription.php" ,
63
+ })
64
+ }
65
+
66
+ console .log (" Menu Items:" , items)
67
+ return items
68
+ })
57
69
</script >
0 commit comments