Commit 77a2c1c 1 parent e918591 commit 77a2c1c Copy full SHA for 77a2c1c
File tree 1 file changed +20
-5
lines changed
1 file changed +20
-5
lines changed Original file line number Diff line number Diff line change 10
10
11
11
use MyAAC \Cache \Cache ;
12
12
use MyAAC \Models \Menu ;
13
+ use MyAAC \Plugins ;
13
14
14
15
defined ('MYAAC ' ) or die ('Direct access not allowed! ' );
15
16
$ title = 'Menus ' ;
21
22
return ;
22
23
}
23
24
25
+ $ pluginThemes = Plugins::getThemes ();
26
+
24
27
if (isset ($ _POST ['template ' ])) {
25
28
$ template = $ _POST ['template ' ];
26
29
64
67
success ('Saved at ' . date ('H:i ' ));
65
68
}
66
69
67
- $ file = TEMPLATES . $ template . '/config.php ' ;
68
- if (file_exists ($ file )) {
69
- require_once $ file ;
70
+ $ path = TEMPLATES . $ template ;
71
+
72
+ if (isset ($ pluginThemes [$ template ])) {
73
+ $ path = BASE . $ pluginThemes [$ template ];
74
+ }
75
+
76
+ $ path .= '/config.php ' ;
77
+
78
+ if (file_exists ($ path )) {
79
+ require_once $ path ;
70
80
} else {
71
81
echo 'Cannot find template config.php file. ' ;
72
82
return ;
169
179
} else {
170
180
$ templates = Menu::select ('template ' )->distinct ()->get ()->toArray ();
171
181
foreach ($ templates as $ key => $ value ) {
172
- $ file = TEMPLATES . $ value ['template ' ] . '/config.php ' ;
173
- if (!file_exists ($ file )) {
182
+ $ path = TEMPLATES . $ value ['template ' ];
183
+
184
+ if (isset ($ pluginThemes [$ value ['template ' ]])) {
185
+ $ path = BASE . $ pluginThemes [$ value ['template ' ]];
186
+ }
187
+
188
+ if (!file_exists ($ path . '/config.php ' )) {
174
189
unset($ templates [$ key ]);
175
190
}
176
191
}
You can’t perform that action at this time.
0 commit comments