1 | <?php namespace Modules\Core\Foundation\Theme; |
||
6 | class ThemeManager implements \Countable |
||
7 | { |
||
8 | /** |
||
9 | * @var Application |
||
10 | */ |
||
11 | private $app; |
||
12 | /** |
||
13 | * @var string Path to scan for themes |
||
14 | */ |
||
15 | private $path; |
||
16 | |||
17 | /** |
||
18 | * @param Application $app |
||
19 | * @param $path |
||
20 | */ |
||
21 | public function __construct(Application $app, $path) |
||
26 | |||
27 | /** |
||
28 | * @param string $name |
||
29 | * @return Theme|null |
||
30 | */ |
||
31 | public function find($name) |
||
41 | |||
42 | /** |
||
43 | * Return all available themes |
||
44 | * @return array |
||
45 | */ |
||
46 | public function all() |
||
64 | |||
65 | /** |
||
66 | * Get only the public themes |
||
67 | * @return array |
||
68 | */ |
||
69 | public function allPublicThemes() |
||
90 | |||
91 | /** |
||
92 | * Get the theme directories |
||
93 | * @return array |
||
94 | */ |
||
95 | private function getDirectories() |
||
99 | |||
100 | /** |
||
101 | * Return the theme assets path |
||
102 | * @param string $theme |
||
103 | * @return string |
||
104 | */ |
||
105 | public function getAssetPath($theme) |
||
109 | |||
110 | /** |
||
111 | * @return \Illuminate\Filesystem\Filesystem |
||
112 | */ |
||
113 | protected function getFinder() |
||
117 | |||
118 | /** |
||
119 | * @return \Illuminate\Config\Repository |
||
120 | */ |
||
121 | protected function getConfig() |
||
125 | |||
126 | /** |
||
127 | * Counts all themes |
||
128 | */ |
||
129 | public function count() |
||
133 | |||
134 | /** |
||
135 | * Returns the theme json file |
||
136 | * @param $theme |
||
137 | * @return string |
||
138 | * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException |
||
139 | */ |
||
140 | private function getThemeJsonFile($theme) |
||
144 | |||
145 | /** |
||
146 | * @param $themeJson |
||
147 | * @return bool |
||
148 | */ |
||
149 | private function isFrontendTheme($themeJson) |
||
153 | } |
||
154 |