49 lines
3.2 KiB
PHP
49 lines
3.2 KiB
PHP
<?php $lat = is_numeric($settings['association_latitude'] ?? null) ? (float)$settings['association_latitude'] : null;
|
|
$lng = is_numeric($settings['association_longitude'] ?? null) ? (float)$settings['association_longitude'] : null;
|
|
$obfuscate = static fn (string$value): string => implode('', array_reverse(mb_str_split($value))); ?>
|
|
<section class="section">
|
|
<div class="wrap">
|
|
<div class="content-card">
|
|
<h1 class="page-title"><?= h(t('public_site.contact')) ?></h1>
|
|
<p><?= nl2br(h($settings['public_site_contact_text'])) ?></p>
|
|
<div class="contact-list"><?php if ($fullAddress !== ''): ?><div class="contact-item">📍
|
|
<?= h($fullAddress) ?></div><?php endif; ?><?php if ($settings['association_phone']): ?><div
|
|
class="contact-item">☎ <span
|
|
class="contact-obfuscated"><?= h($obfuscate($settings['association_phone'])) ?></span></div>
|
|
<?php endif; ?><?php if ($settings['association_email']): ?><div class="contact-item">✉ <span
|
|
class="contact-obfuscated"><?= h($obfuscate($settings['association_email'])) ?></span></div>
|
|
<?php endif; ?></div>
|
|
<div class="chips" style="margin-top:25px"><?php if ($settings['public_site_facebook_url']): ?><a
|
|
class="button secondary" href="<?= h($settings['public_site_facebook_url']) ?>"
|
|
rel="noopener noreferrer">Facebook</a><?php endif; ?><?php if ($settings['public_site_instagram_url']): ?><a
|
|
class="button secondary" href="<?= h($settings['public_site_instagram_url']) ?>"
|
|
rel="noopener noreferrer">Instagram</a><?php endif; ?></div>
|
|
<?php if ($lat !== null && $lng !== null): ?><h2 style="margin-top:35px">
|
|
<?= h(t('public_site.map_title')) ?></h2>
|
|
<div id="association-map" class="contact-map" aria-label="<?= h(t('public_site.map_title')) ?>"></div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<div class="wrap" style="text-align:center"><a href="<?= h($siteUrl('legal')) ?>"><?= h(t('public_site.legal')) ?></a> ·
|
|
<a href="<?= h($siteUrl('privacy')) ?>"><?= h(t('public_site.privacy')) ?></a></div>
|
|
<?php if ($lat !== null && $lng !== null): ?><script src="/assets/vendor/leaflet/leaflet.js"></script>
|
|
<script>
|
|
(() => {
|
|
const map = L.map('association-map', {
|
|
scrollWheelZoom: false
|
|
}).setView([ < ? = json_encode($lat) ? > , < ? = json_encode($lng) ? > ], 15);
|
|
L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
|
maxZoom: 19,
|
|
attribution: '© OpenStreetMap'
|
|
}).addTo(map);
|
|
const popup = document.createElement('div');
|
|
const name = document.createElement('strong');
|
|
name.textContent = < ? = json_encode($association, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ? > ;
|
|
popup.append(name, document.createElement('br'), document.createTextNode( < ? = json_encode($fullAddress,
|
|
JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) ? > ));
|
|
L.marker([ < ? = json_encode($lat) ? > , < ? = json_encode($lng) ? > ]).addTo(map).bindPopup(popup)
|
|
.openPopup();
|
|
})();
|
|
|
|
</script><?php endif; ?>
|