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
+34
View File
@@ -0,0 +1,34 @@
<?php
require_once '../../includes/connect_endpoint.php';
session_start();
if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) {
die(json_encode([
"success" => false,
"message" => translate('session_expired', $i18n)
]));
}
if ($_SERVER["REQUEST_METHOD"] === "POST") {
$postData = file_get_contents("php://input");
$data = json_decode($postData, true);
$color = $data['color'];
$stmt = $db->prepare('UPDATE settings SET color_theme = :color');
$stmt->bindParam(':color', $color, SQLITE3_TEXT);
if ($stmt->execute()) {
die(json_encode([
"success" => true,
"message" => translate("success", $i18n)
]));
} else {
die(json_encode([
"success" => false,
"message" => translate("error", $i18n)
]));
}
}
?>