First pass of features

This commit is contained in:
2026-03-30 14:53:13 -05:00
parent 1a65e69d25
commit 6353f9c9b4
54 changed files with 5409 additions and 128 deletions
+31
View File
@@ -0,0 +1,31 @@
<?php
require_once __DIR__ . '/db.php';
function defaultFamilySettings(): array {
return [
'currency_symbol' => '★',
'currency_name' => 'Stars',
'currency_permanence' => 'permanent',
'timezone' => 'UTC',
'week_starts_on' => 0,
];
}
function loadFamilySettings(): array {
$raw = readJsonFile('family_settings.json');
if (!is_array($raw)) {
return defaultFamilySettings();
}
return array_merge(defaultFamilySettings(), $raw);
}
/**
* Tab label: symbol + name (e.g. "★ Stars").
*/
function currencyTabLabel(array $familySettings): string {
$sym = trim((string) ($familySettings['currency_symbol'] ?? ''));
$name = trim((string) ($familySettings['currency_name'] ?? ''));
$label = trim($sym . ' ' . $name);
return $label !== '' ? $label : 'Currency';
}