diff --git a/index.php b/index.php index c28af72..ba2fca0 100644 --- a/index.php +++ b/index.php @@ -257,6 +257,32 @@ if (function_exists('getSiteConfig')) { +// Editierbare Textbausteine (Admin-Panel) +$heroWelcomeText = $settingsManager->get('content.hero_welcome_de'); +if ($heroWelcomeText === null || $heroWelcomeText === '') { + $heroWelcomeText = $siteConfig['welcomeDe']; +} + +$heroRegionText = $settingsManager->get('content.hero_region_text_de'); +if ($heroRegionText === null || $heroRegionText === '') { + $heroRegionText = 'Erleben Sie faszinierende Ausblicke der Züricher Region - in Echtzeit!'; +} + +$localFlagAltText = $settingsManager->get('content.local_flag_alt_de'); +if ($localFlagAltText === null || $localFlagAltText === '') { + $localFlagAltText = 'Ortsflagge'; +} + +$donationCalloutText = $settingsManager->get('content.donation_callout_de'); +if ($donationCalloutText === null || $donationCalloutText === '') { + $donationCalloutText = "Gefällt dir die Livecam? Unterstütze das Projekt –\njeder Franken zählt und hilft die Betriebskosten\nzu decken. So kannst du auch weiterhin\nFotos und Videos kostenlos nutzen."; +} + +$twintSupportText = $settingsManager->get('content.twint_support_text_de'); +if ($twintSupportText === null || $twintSupportText === '') { + $twintSupportText = 'Unterstütze die Aurora Livecam mit deiner Spende. Du hilfst dabei, Kamera, Server, Starlink-Verbindung und die 100 % autarke Stromversorgung mit Solarenergie und EcoFlow-Speichern zu finanzieren. So bleibt das Projekt nachhaltig, unabhängig und für alle frei zugänglich.'; +} + session_start(); error_reporting(E_ALL); ini_set('display_errors', 1); @@ -1368,6 +1394,41 @@ class AdminManager { $output .= ''; $output .= ''; $output .= ''; + + $output .= '
'; + $output .= 'Hero-Titel (DE)'; + $output .= '
'; + $output .= ''; + $output .= '
'; + $output .= '
'; + + $output .= '
'; + $output .= 'Hero-Untertitel (DE)'; + $output .= '
'; + $output .= ''; + $output .= '
'; + $output .= '
'; + + $output .= '
'; + $output .= 'Ortsflagge ALT-Text (DE)'; + $output .= '
'; + $output .= ''; + $output .= '
'; + $output .= '
'; + + $output .= '
'; + $output .= 'Spenden-Text (DE)'; + $output .= '
'; + $output .= ''; + $output .= '
'; + $output .= '
'; + + $output .= '
'; + $output .= 'TWINT-Infotext (DE)'; + $output .= '
'; + $output .= ''; + $output .= '
'; + $output .= '
'; $output .= ''; // settings-group // Technical Settings (Punkt 6) @@ -2952,17 +3013,18 @@ body.theme-neo footer {
Schweizer Flagge -

- +

+

- Ortsflagge + <?php echo htmlspecialchars($localFlagAltText); ?>
-

- Erleben Sie faszinierende Ausblicke der Züricher Region - in Echtzeit! +

@@ -3144,8 +3206,8 @@ body.theme-neo footer { Buy me a coffee -

- Gefällt dir die Livecam? Unterstütze das Projekt –
jeder Franken zählt und hilft die Betriebskosten
zu decken. So kannst du auch weiterhin
Fotos und Videos kostenlos nutzen. +

+

@@ -3155,13 +3217,14 @@ body.theme-neo footer {

- Unterstütze die Aurora Livecam mit deiner Spende. Du hilfst dabei, Kamera, Server, Starlink-Verbindung und die 100 % autarke Stromversorgung mit Solarenergie und EcoFlow-Speichern zu finanzieren. So bleibt das Projekt nachhaltig, unabhängig und für alle frei zugänglich. +

@@ -3525,8 +3588,8 @@ body.theme-neo footer { Buy me a coffee -

- Gefällt dir die Livecam? Unterstütze das Projekt –
jeder Franken zählt und hilft die Betriebskosten
zu decken. So kannst du auch weiterhin
Fotos und Videos kostenlos nutzen. +

+

@@ -4202,6 +4265,47 @@ const AdminSettings = { case 'content.max_guestbook_entries': this.showNotification('Max Einträge: ' + value + ' (Reload empfohlen)', 'success'); break; + case 'content.hero_welcome_de': + const heroWelcome = document.getElementById('hero-welcome-text'); + if (heroWelcome) { + const nextValue = value && String(value).trim() !== '' ? value : ''; + heroWelcome.textContent = nextValue; + heroWelcome.setAttribute('data-de', nextValue); + } + break; + case 'content.hero_region_text_de': + const heroRegionText = document.getElementById('hero-region-text'); + if (heroRegionText) { + const fallbackRegion = 'Erleben Sie faszinierende Ausblicke der Züricher Region - in Echtzeit!'; + const nextValue = value && String(value).trim() !== '' ? value : fallbackRegion; + heroRegionText.textContent = nextValue; + heroRegionText.setAttribute('data-de', nextValue); + } + break; + case 'content.local_flag_alt_de': + const localFlagImage = document.getElementById('local-flag-image'); + if (localFlagImage) { + const nextValue = value && String(value).trim() !== '' ? value : 'Ortsflagge'; + localFlagImage.setAttribute('alt', nextValue); + } + break; + case 'content.donation_callout_de': + const donationEls = document.querySelectorAll('.donation-callout-text'); + const donationFallback = 'Gefällt dir die Livecam? Unterstütze das Projekt –\njeder Franken zählt und hilft die Betriebskosten\nzu decken. So kannst du auch weiterhin\nFotos und Videos kostenlos nutzen.'; + const donationText = value && String(value).trim() !== '' ? value : donationFallback; + donationEls.forEach(el => { + el.innerHTML = donationText.replace(/\n/g, '
'); + }); + break; + case 'content.twint_support_text_de': + const twintTextEl = document.querySelector('.twint-support-text'); + if (twintTextEl) { + const fallbackTwint = 'Unterstütze die Aurora Livecam mit deiner Spende. Du hilfst dabei, Kamera, Server, Starlink-Verbindung und die 100 % autarke Stromversorgung mit Solarenergie und EcoFlow-Speichern zu finanzieren. So bleibt das Projekt nachhaltig, unabhängig und für alle frei zugänglich.'; + const nextValue = value && String(value).trim() !== '' ? value : fallbackTwint; + twintTextEl.textContent = nextValue; + twintTextEl.setAttribute('data-de', nextValue); + } + break; // Technical (Punkt 6) case 'technical.viewer_update_interval': @@ -4316,6 +4420,26 @@ const AdminSettings = { this.updateSetting('content.max_guestbook_entries', parseInt(e.target.value)); }); + document.getElementById('setting-hero-welcome')?.addEventListener('change', (e) => { + this.updateSetting('content.hero_welcome_de', e.target.value); + }); + + document.getElementById('setting-hero-region-text')?.addEventListener('change', (e) => { + this.updateSetting('content.hero_region_text_de', e.target.value); + }); + + document.getElementById('setting-local-flag-alt')?.addEventListener('change', (e) => { + this.updateSetting('content.local_flag_alt_de', e.target.value); + }); + + document.getElementById('setting-donation-callout')?.addEventListener('change', (e) => { + this.updateSetting('content.donation_callout_de', e.target.value); + }); + + document.getElementById('setting-twint-support-text')?.addEventListener('change', (e) => { + this.updateSetting('content.twint_support_text_de', e.target.value); + }); + // Technical Settings (Punkt 6) document.getElementById('setting-viewer-interval')?.addEventListener('change', (e) => { this.updateSetting('technical.viewer_update_interval', parseInt(e.target.value));