philippurbschat.de/plants/lexikon.php
Philipp Urbschat f393beb7ff
feat: inkubator-standard & modul-autodiscovery
- Dynamische Modulerkennung via module.json in ModuleService.php
- Kaskadierender Env-Loader fuer zentrale API-Keys (GEMINI_API_KEY)
- Graceful Auth fuer alle Subprojekte (dinos, plants, storymachine, test)
- Wiederverwendbares Starter-Template in _template/
- test-Modul auf philippurbschat.de Dark-Design modernisiert
2026-09-13 00:23:16 +02:00

118 lines
4.3 KiB
PHP

<?php
// Version: 01.10.2025 12:15 (Layout restored)
$authFile = __DIR__ . '/../auth.php';
if (file_exists($authFile)) {
$current_project = basename(__DIR__);
require_once $authFile;
}
session_start();
$is_logged_in = isset($_SESSION['user_id']);
$username = $_SESSION['username'] ?? '';
$user_theme = 'light';
if ($is_logged_in) {
require_once 'db.php';
try {
$stmt = $pdo->prepare("SELECT theme FROM users WHERE id = ?");
$stmt->execute([$_SESSION['user_id']]);
$result = $stmt->fetch();
if ($result && !empty($result['theme'])) {
$user_theme = $result['theme'];
}
} catch (PDOException $e) {
// Fehler ignorieren
}
} else {
// Wenn nicht eingeloggt, zur Hauptseite weiterleiten
header('Location: index.php');
exit;
}
?>
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Pflanzen-Lexikon</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Alan+Sans:wght@300;400;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="components.css">
</head>
<body data-theme="<?php echo htmlspecialchars($user_theme); ?>">
<div class="main-header">
<div class="container">
<div class="logo-title-container">
<a href="index.php" style="display: flex; align-items: center; text-decoration: none; color: inherit;">
<img src="img/logo.webp" alt="Plants App Logo" class="header-logo">
<h1>Plants</h1>
</a>
</div>
<div class="header-controls">
<a href="index.php" class="btn btn-secondary">Mein Dashboard</a>
</div>
</div>
</div>
<div class="container">
<div class="lexicon-intro">
<h2>Pflanzen-Lexikon</h2>
<p>Durchsuche die von der Community geteilten Pflanzen und lerne mehr über sie.</p>
</div>
<div class="search-bar-container">
<input type="search" id="lexiconSearch" placeholder="Suche nach Name oder botanischem Namen...">
</div>
<div id="lexicon-grid" class="plant-grid">
<!-- Inhalt wird von lexikon.js geladen -->
</div>
</div>
<!-- =========== MODAL für LEXIKON-DETAILS =========== -->
<div id="lexiconDetailModal" class="modal">
<div class="modal-content lexicon-detail-modal-content">
<div class="modal-header">
<h2 id="lexiconModalPlantName">Pflanzen-Detail</h2>
<button class="close-btn">&times;</button>
</div>
<div class="modal-body">
<div class="lexicon-modal-layout">
<div class="lexicon-modal-image-gallery">
<div class="lexicon-modal-image-container">
<img id="lexiconModalImage" src="" alt="Pflanzenbild">
</div>
<div class="lexicon-modal-thumbnails">
<!-- Thumbnails werden hier von lexikon.js eingefügt -->
</div>
</div>
<div class="lexicon-modal-info">
<span id="lexiconModalLatinName" class="lexicon-modal-latin"></span>
<div class="lexicon-modal-meta">
<div>
<strong>Familie:</strong>
<span id="lexiconModalFamily"></span>
</div>
<div>
<strong>Gattung:</strong>
<span id="lexiconModalGenus"></span>
</div>
</div>
<div class="lexicon-modal-description">
<!-- Beschreibung wird hier von lexikon.js eingefügt -->
</div>
</div>
</div>
</div>
</div>
</div>
<script type="module" src="lexikon.js"></script>
</body>
</html>