File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,21 @@ protected static function genMenu($pos, $parent =0) {
27
27
28
28
$ db = self ::getDatabase ();
29
29
foreach ($ db ->select ("entries " , array ("menu " => $ pos , "parent " => $ parent )) as $ entry ) {
30
- array_push ($ menu , array ("text " => interpolate ($ entry ['display ' ]), "url " => $ entry ['target ' ],
30
+ if ($ entry ['condition ' ] && !eval ("return $ entry [condition]; " ))
31
+ continue ;
32
+
33
+ if (startsWith ($ entry ['target ' ], "/ " )) {
34
+ if ($ entry ['check-page ' ]*1 ) {
35
+ $ mod = new PageModule ($ entry ['target ' ]);
36
+ $ mod ->initialize (false );
37
+ if ($ mod ->hasError ())
38
+ continue ;
39
+ }
40
+ $ entry ['target ' ] = cleanpath (BASE_URI . $ entry ['target ' ]);
41
+ }
42
+
43
+ array_push ($ menu , array ("text " => interpolate ($ entry ['display ' ]),
44
+ "url " => $ entry ['target ' ],
31
45
"submenu " => self ::genMenu ($ pos , $ entry ['rowid ' ])));
32
46
}
33
47
You can’t perform that action at this time.
0 commit comments