added theme support

This commit is contained in:
Mark Gregory
2026-10-20 10:23:23 +01:00
parent 1d70a9c8cf
commit f0e31aad6b
5 changed files with 55 additions and 25 deletions
@@ -59,6 +59,9 @@ final class ThemeManagementController extends Controller
public function uninstall(string $theme, Loader $loader, ThemePackageManager $packages)
{
$item = $loader->find($theme);
abort_if(in_array($item->key(), ['sonardesk', 'sonardesk-admin'], true), 403, 'Bundled themes cannot be removed.');
$settings = app(SettingsRepository::class);
abort_if($settings->get($item->type().'_theme', null, 'site') === $item->key(), 409, 'Deactivate this theme before uninstalling.');
$packages->uninstall($item);
return back()->with('status', $item->name().' uninstalled.');