8
8
* License: GNU/GPLv2
9
9
* @see LICENSE.txt
10
10
*
11
- * This file: Upload handler (last modified: 2020.07.31 ).
11
+ * This file: Upload handler (last modified: 2020.10.30 ).
12
12
*/
13
13
14
14
namespace phpMussel \Web ;
@@ -30,6 +30,11 @@ class Web
30
30
*/
31
31
private $ AssetsPath = __DIR__ . DIRECTORY_SEPARATOR . '.. ' . DIRECTORY_SEPARATOR . 'assets ' . DIRECTORY_SEPARATOR ;
32
32
33
+ /**
34
+ * @var string A path for any custom front-end asset files.
35
+ */
36
+ public $ CustomAssetsPath = '' ;
37
+
33
38
/**
34
39
* @var string The path to the upload handler's L10N files.
35
40
*/
@@ -49,6 +54,7 @@ class Web
49
54
* Construct the loader.
50
55
*
51
56
* @param \phpMussel\Core\Loader $Loader The instantiated loader object, passed by reference.
57
+ * @param \phpMussel\Core\Scanner $Scanner The instantiated scanner object, passed by reference.
52
58
*/
53
59
public function __construct (\phpMussel \Core \Loader &$ Loader , \phpMussel \Core \Scanner &$ Scanner )
54
60
{
@@ -300,11 +306,20 @@ public function scan()
300
306
}
301
307
302
308
/** Determine which template file to use. */
303
- if (is_readable ($ this ->AssetsPath . 'template_ ' . $ this ->Loader ->Configuration ['web ' ]['theme ' ] . '.html ' )) {
304
- $ TemplateFile = $ this ->AssetsPath . 'template_ ' . $ this ->Loader ->Configuration ['web ' ]['theme ' ] . '.html ' ;
305
- } elseif (is_readable ($ this ->AssetsPath . 'template_default.html ' )) {
306
- $ TemplateFile = $ this ->AssetsPath . 'template_default.html ' ;
309
+ if ($ this ->CustomAssetsPath ) {
310
+ if (is_readable ($ this ->CustomAssetsPath . 'template_ ' . $ this ->Loader ->Configuration ['web ' ]['theme ' ] . '.html ' )) {
311
+ $ TemplateFile = $ this ->CustomAssetsPath . 'template_ ' . $ this ->Loader ->Configuration ['web ' ]['theme ' ] . '.html ' ;
312
+ } elseif (is_readable ($ this ->CustomAssetsPath . 'template_default.html ' )) {
313
+ $ TemplateFile = $ this ->CustomAssetsPath . 'template_default.html ' ;
314
+ }
307
315
} else {
316
+ if (is_readable ($ this ->AssetsPath . 'template_ ' . $ this ->Loader ->Configuration ['web ' ]['theme ' ] . '.html ' )) {
317
+ $ TemplateFile = $ this ->AssetsPath . 'template_ ' . $ this ->Loader ->Configuration ['web ' ]['theme ' ] . '.html ' ;
318
+ } elseif (is_readable ($ this ->AssetsPath . 'template_default.html ' )) {
319
+ $ TemplateFile = $ this ->AssetsPath . 'template_default.html ' ;
320
+ }
321
+ }
322
+ if (empty ($ TemplateFile )) {
308
323
$ TemplateFile = '' ;
309
324
}
310
325
0 commit comments