Theme finder issue fixed (Shop changes was reflecting in admin)
This commit is contained in:
parent
4840b0361b
commit
6b247993e4
|
|
@ -15,13 +15,17 @@ class Theme
|
|||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$theme = app('themes');
|
||||
$themes = app('themes');
|
||||
$channel = core()->getCurrentChannel();
|
||||
|
||||
if ($channel && $channelThemeCode = $channel->theme) {
|
||||
if ($theme->exists($channelThemeCode)) {
|
||||
$theme->set($channelThemeCode);
|
||||
if ($themes->exists($channelThemeCode)) {
|
||||
$themes->set($channelThemeCode);
|
||||
} else {
|
||||
$themes->set(config('themes.default'));
|
||||
}
|
||||
} else {
|
||||
$themes->set(config('themes.default'));
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
|
|
|
|||
|
|
@ -53,12 +53,6 @@ class ShopServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function register()
|
||||
{
|
||||
$themes = $this->app->make('themes');
|
||||
|
||||
if (! $themes->current() && \Config::get('themes.default')) {
|
||||
$themes->set(\Config::get('themes.default'));
|
||||
}
|
||||
|
||||
$this->registerConfig();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,10 +19,14 @@ class ThemeViewFinder extends FileViewFinder
|
|||
// Extract the $view and the $namespace parts
|
||||
list($namespace, $view) = $this->parseNamespaceSegments($name);
|
||||
|
||||
$paths = $this->addThemeNamespacePaths($namespace);
|
||||
if ($namespace != 'admin') {
|
||||
$paths = $this->addThemeNamespacePaths($namespace);
|
||||
|
||||
// Find and return the view
|
||||
return $this->findInPaths($view, $paths);
|
||||
// Find and return the view
|
||||
return $this->findInPaths($view, $paths);
|
||||
} else {
|
||||
return $this->findInPaths($view, $this->hints[$namespace]);
|
||||
}
|
||||
}
|
||||
|
||||
public function addThemeNamespacePaths($namespace)
|
||||
|
|
|
|||
Loading…
Reference in New Issue