First pass of features
This commit is contained in:
@@ -2,26 +2,54 @@
|
||||
require_once 'config/config.php';
|
||||
require_once 'includes/db.php';
|
||||
require_once 'includes/utils.php';
|
||||
require_once 'includes/persona.php';
|
||||
require_once 'includes/family_settings.php';
|
||||
|
||||
// Determine which tab is active
|
||||
$activeTab = isset($_GET['tab']) ? $_GET['tab'] : 'chores';
|
||||
startFamilyHubSession();
|
||||
|
||||
$people = normalizePeopleList(readJsonFile('people.json'));
|
||||
if (getActivePersonId() !== null && getActivePerson($people) === null) {
|
||||
clearPersonaSession();
|
||||
}
|
||||
|
||||
$activePerson = getActivePerson($people);
|
||||
$familySettings = loadFamilySettings();
|
||||
|
||||
if (isset($TABS['currency'])) {
|
||||
$TABS['currency']['title'] = currencyTabLabel($familySettings);
|
||||
}
|
||||
|
||||
$activeTab = isset($_GET['tab']) ? (string) $_GET['tab'] : 'chores';
|
||||
if (!isset($TABS[$activeTab])) {
|
||||
$activeTab = 'chores';
|
||||
}
|
||||
|
||||
$familyHubApiBase = familyHubWebApiBase();
|
||||
|
||||
$favoriteColor = '#4a90e2';
|
||||
if (
|
||||
$activePerson !== null
|
||||
&& !empty($activePerson['favoriteColor'])
|
||||
&& preg_match('/^#[0-9A-Fa-f]{6}$/', (string) $activePerson['favoriteColor'])
|
||||
) {
|
||||
$favoriteColor = (string) $activePerson['favoriteColor'];
|
||||
}
|
||||
|
||||
// Include header
|
||||
include 'includes/header.php';
|
||||
?>
|
||||
|
||||
<div class="container">
|
||||
<div class="tabs">
|
||||
<?php foreach ($TABS as $tabId => $tab): ?>
|
||||
<a href="?tab=<?= $tabId ?>" class="tab <?= $activeTab === $tabId ? 'active' : '' ?>">
|
||||
<i class="fa fa-<?= $tab['icon'] ?>"></i> <?= $tab['title'] ?>
|
||||
<a href="?tab=<?= htmlspecialchars($tabId, ENT_QUOTES, 'UTF-8') ?>" class="tab <?= $activeTab === $tabId ? 'active' : '' ?>">
|
||||
<i class="fa fa-<?= htmlspecialchars($tab['icon'], ENT_QUOTES, 'UTF-8') ?>"></i> <?= htmlspecialchars($tab['title'], ENT_QUOTES, 'UTF-8') ?>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-content">
|
||||
<?php include "tabs/$activeTab.php"; ?>
|
||||
<?php include 'tabs/' . $activeTab . '.php'; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php include 'includes/footer.php'; ?>
|
||||
<?php include 'includes/footer.php'; ?>
|
||||
|
||||
Reference in New Issue
Block a user