|
8 | 8 | * License: GNU/GPLv2 |
9 | 9 | * @see LICENSE.txt |
10 | 10 | * |
11 | | - * This file: Front-end handler (last modified: 2020.10.26). |
| 11 | + * This file: Front-end handler (last modified: 2020.10.30). |
12 | 12 | */ |
13 | 13 |
|
14 | 14 | namespace phpMussel\FrontEnd; |
@@ -36,6 +36,11 @@ class FrontEnd |
36 | 36 | */ |
37 | 37 | private $AssetsPath = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'assets' . DIRECTORY_SEPARATOR; |
38 | 38 |
|
| 39 | + /** |
| 40 | + * @var string A path for any custom front-end asset files. |
| 41 | + */ |
| 42 | + public $CustomAssetsPath = ''; |
| 43 | + |
39 | 44 | /** |
40 | 45 | * @var string The path to the front-end L10N files. |
41 | 46 | */ |
@@ -131,6 +136,7 @@ class FrontEnd |
131 | 136 | * Construct the loader. |
132 | 137 | * |
133 | 138 | * @param \phpMussel\Core\Loader $Loader The instantiated loader object, passed by reference. |
| 139 | + * @param \phpMussel\Core\Scanner $Scanner The instantiated scanner object, passed by reference. |
134 | 140 | */ |
135 | 141 | public function __construct(\phpMussel\Core\Loader &$Loader, \phpMussel\Core\Scanner &$Scanner) |
136 | 142 | { |
@@ -1680,7 +1686,7 @@ public function view(string $Page = '') |
1680 | 1686 | ); |
1681 | 1687 |
|
1682 | 1688 | /** Initialise array for fetching logs data. */ |
1683 | | - $FE['LogFiles'] = ['Files' => $this->logsRecursiveList($this->AssetsPath), 'Out' => '']; |
| 1689 | + $FE['LogFiles'] = ['Files' => $this->logsRecursiveList(), 'Out' => '']; |
1684 | 1690 |
|
1685 | 1691 | /** Text mode switch link base. */ |
1686 | 1692 | $FE['TextModeSwitchLink'] = ''; |
@@ -1848,6 +1854,14 @@ private function getAssetPath(string $Asset, bool $CanFail = false): string |
1848 | 1854 | return ''; |
1849 | 1855 | } |
1850 | 1856 |
|
| 1857 | + /** Custom assets. */ |
| 1858 | + if ($this->CustomAssetsPath) { |
| 1859 | + $Try = $this->Loader->buildPath($this->CustomAssetsPath . DIRECTORY_SEPARATOR . $Asset); |
| 1860 | + if (is_readable($Try)) { |
| 1861 | + return $Try; |
| 1862 | + } |
| 1863 | + } |
| 1864 | + |
1851 | 1865 | /** Non-default assets. */ |
1852 | 1866 | if ( |
1853 | 1867 | $this->Loader->Configuration['frontend']['theme'] !== 'default' && |
|
0 commit comments