added theme support
This commit is contained in:
@@ -4,7 +4,7 @@ namespace Modules\Stylist\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Routing\Controller;
|
||||
use Modules\Settings\Services\SettingsRepository;
|
||||
use Modules\Stylist\Services\SiteSettingsRepository;
|
||||
use Modules\Stylist\Services\ThemeAccessibilityValidator;
|
||||
use Modules\Stylist\Services\ThemeOptimizer;
|
||||
use Modules\Stylist\Services\ThemePackageManager;
|
||||
@@ -14,7 +14,7 @@ use Modules\Stylist\View\ThemeViewResolver;
|
||||
|
||||
final class ThemeManagementController extends Controller
|
||||
{
|
||||
public function activate(string $theme, Loader $loader, SettingsRepository $settings)
|
||||
public function activate(string $theme, Loader $loader, SiteSettingsRepository $settings)
|
||||
{
|
||||
$item = $loader->find($theme);
|
||||
abort_unless(in_array($item->type(), ['frontend', 'backend'], true), 422, 'Only frontend and backend themes can be activated.');
|
||||
@@ -60,7 +60,7 @@ final class ThemeManagementController extends Controller
|
||||
{
|
||||
$item = $loader->find($theme);
|
||||
abort_if(in_array($item->key(), ['sonardesk', 'sonardesk-admin'], true), 403, 'Bundled themes cannot be removed.');
|
||||
$settings = app(SettingsRepository::class);
|
||||
$settings = app(SiteSettingsRepository::class);
|
||||
abort_if($settings->get($item->type().'_theme', null, 'site') === $item->key(), 409, 'Deactivate this theme before uninstalling.');
|
||||
$packages->uninstall($item);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user