add superadmin dashboard. subscriptions

This commit is contained in:
root
2026-01-13 20:03:16 +03:00
parent 3c24c250e5
commit edb4df7e37
36 changed files with 3329 additions and 100 deletions
@@ -42,6 +42,11 @@ class TwigGlobalsExtension extends AbstractExtension
new TwigFunction('role_badge', [$this, 'roleBadge'], ['is_safe' => ['html']]),
new TwigFunction('status_badge', [$this, 'statusBadge'], ['is_safe' => ['html']]),
new TwigFunction('get_all_roles', [$this, 'getAllRoles'], ['is_safe' => ['html']]),
// System role functions (superadmin)
new TwigFunction('is_superadmin', [$this, 'isSuperadmin'], ['is_safe' => ['html']]),
new TwigFunction('is_system_admin', [$this, 'isSystemAdmin'], ['is_safe' => ['html']]),
new TwigFunction('get_system_role', [$this, 'getSystemRole'], ['is_safe' => ['html']]),
];
}
@@ -137,6 +142,26 @@ class TwigGlobalsExtension extends AbstractExtension
return '<span class="badge ' . esc($color) . '">' . esc($label) . '</span>';
}
// ========================================
// System Role Functions (superadmin)
// ========================================
public function isSuperadmin(): bool
{
return service('access')->isSuperadmin();
}
public function isSystemAdmin(): bool
{
return service('access')->isSystemAdmin();
}
public function getSystemRole(): ?string
{
return service('access')->getSystemRole();
}
public function statusBadge(string $status): string
{
$colors = [