feat: add themes and custom color options

feat: add italian translation
This commit is contained in:
Miguel Ribeiro
2024-04-19 14:22:07 +02:00
committed by GitHub
parent 2c186b4818
commit 70e42349ca
91 changed files with 751 additions and 98 deletions
+25
View File
@@ -0,0 +1,25 @@
<?php
// This migration adds a "color_theme" column to the settings table and sets it to blue as default.
/** @noinspection PhpUndefinedVariableInspection */
$columnQuery = $db->query("SELECT * FROM pragma_table_info('settings') where name='color_theme'");
$columnRequired = $columnQuery->fetchArray(SQLITE3_ASSOC) === false;
if ($columnRequired) {
$db->exec("ALTER TABLE settings ADD COLUMN color_theme TEXT DEFAULT 'blue'");
$db->exec('UPDATE settings SET `color_theme` = "blue"');
}
// This migrations adds custom_colors table to the database, so the user can set custom accent colors to the application
$customColorsTableQuery = $db->query("SELECT * FROM sqlite_master WHERE type='table' AND name='custom_colors'");
$customColorsTableRequired = $customColorsTableQuery->fetchArray(SQLITE3_ASSOC) === false;
if ($customColorsTableRequired) {
$db->exec("CREATE TABLE custom_colors (
main_color TEXT NOT NULL,
accent_color TEXT NOT NULL,
hover_color TEXT NOT NULL
)");
}