Icons, themes, removed instance proxy and more

This commit is contained in:
Pablo Ferreiro 2022-03-29 19:30:31 +02:00
parent 9a35c61023
commit 44ee065ec6
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
52 changed files with 476 additions and 511 deletions

View file

@ -2,13 +2,21 @@
namespace App\Helpers;
class Cookies {
const PROXY = ['host', 'port', 'user', 'password'];
const ALLOWED_THEMES = ['default', 'card'];
static public function get(string $name): ?string {
static public function get(string $name, string $default_value = ''): string {
if (isset($_COOKIE[$name]) && !empty($_COOKIE[$name])) {
return $_COOKIE[$name];
}
return null;
return $default_value;
}
static public function theme(): string {
$theme = self::get('theme');
if ($theme && in_array($theme, self::ALLOWED_THEMES)) {
return $theme;
}
return 'default';
}
static public function exists(string $name): bool {