mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
formulaire: default interne, unpublished, contact toggle, settings section
This commit is contained in:
@@ -149,18 +149,42 @@ extract($ctrl->handle());
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($data['baiu_link'])): ?>
|
||||
<?php
|
||||
$_contactHref = htmlspecialchars($data['baiu_link']);
|
||||
$_contactLabel = preg_replace('#^https?://#i', '', rtrim($data['baiu_link'], '/'));
|
||||
?>
|
||||
<?php if (!empty($data['author_email']) && !empty($data['author_show_contact'])): ?>
|
||||
<div>
|
||||
<dt>Contact :</dt>
|
||||
<dd>
|
||||
<a href="<?= $_contactHref ?>" target="_blank" rel="noopener">
|
||||
<?= htmlspecialchars($_contactLabel) ?>
|
||||
<?php
|
||||
$_contact = $data['author_email'];
|
||||
$_isUrl = filter_var($_contact, FILTER_VALIDATE_URL) !== false;
|
||||
$_isEmail = !$_isUrl && str_contains($_contact, '@');
|
||||
if ($_isUrl):
|
||||
?>
|
||||
<a href="<?= htmlspecialchars($_contact) ?>" target="_blank" rel="noopener">
|
||||
<?= htmlspecialchars(preg_replace('#^https?://#i', '', rtrim($_contact, '/'))) ?>
|
||||
<span class="sr-only">(ouvre dans un nouvel onglet)</span>
|
||||
</a>
|
||||
<?php elseif ($_isEmail): ?>
|
||||
<a href="mailto:<?= htmlspecialchars($_contact) ?>"><?= htmlspecialchars($_contact) ?></a>
|
||||
<?php else: ?>
|
||||
<?= htmlspecialchars($_contact) ?>
|
||||
<?php endif; ?>
|
||||
</dd>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($data['baiu_link'])): ?>
|
||||
<?php
|
||||
$_baiuHref = htmlspecialchars($data['baiu_link']);
|
||||
$_baiuLabel = preg_replace('#^https?://#i', '', rtrim($data['baiu_link'], '/'));
|
||||
?>
|
||||
<div>
|
||||
<dt>Lien :</dt>
|
||||
<dd>
|
||||
<a href="<?= $_baiuHref ?>" target="_blank" rel="noopener">
|
||||
<?= htmlspecialchars($_baiuLabel) ?>
|
||||
<span class="sr-only">(ouvre dans un nouvel onglet)</span>
|
||||
</a>
|
||||
|
||||
</dd>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user