Upload via GUI (267 Dateien)
This commit is contained in:
@@ -22,7 +22,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
|
||||
// E-Mail-Duplikat prüfen (andere Mitarbeiter)
|
||||
if (!$errors) {
|
||||
$dup = $pdo->prepare('SELECT COUNT(*) FROM staff WHERE email = ? AND id != ?');
|
||||
$dup = $pdo->prepare('SELECT COUNT(*) FROM staff WHERE LOWER(email) = LOWER(?) AND id != ?');
|
||||
$dup->execute([$email, $staff['id']]);
|
||||
if ((int)$dup->fetchColumn()) $errors[] = 'Diese E-Mail-Adresse wird bereits von einem anderen Mitarbeiter verwendet.';
|
||||
}
|
||||
@@ -372,20 +372,11 @@ require __DIR__ . '/_header.php';
|
||||
<form method="post">
|
||||
<?= csrf_field() ?>
|
||||
<input type="hidden" name="action" value="save_signature">
|
||||
<div class="richtext-wrap">
|
||||
<div class="richtext-toolbar" id="sig-toolbar">
|
||||
<button type="button" onclick="document.execCommand('bold')" title="Fett"><strong>B</strong></button>
|
||||
<button type="button" onclick="document.execCommand('italic')" title="Kursiv"><em>I</em></button>
|
||||
<button type="button" onclick="document.execCommand('underline')" title="Unterstrichen"><u>U</u></button>
|
||||
<button type="button" onclick="document.execCommand('insertUnorderedList')" title="Liste">•</button>
|
||||
<button type="button" onclick="insertLink()" title="Link">🔗</button>
|
||||
</div>
|
||||
<div class="richtext-editable" id="sig-editor" contenteditable="true" style="min-height:180px"><?= $me['signature'] ?? '' ?></div>
|
||||
</div>
|
||||
<input type="hidden" name="signature" id="sig-hidden">
|
||||
<textarea id="signature" name="signature" data-richtext data-image-upload-url="/staff/upload_signature_image.php" style="min-height:180px"><?= e($me['signature'] ?? '') ?></textarea>
|
||||
<p class="muted" style="font-size:.8rem;margin-top:8px">Bilder einfügen mit 🖼️. Zum Verkleinern oder Vergrößern das Bild anklicken: Mit dem runden Anfasser ziehen oder 25 / 50 / 75 % / Original wählen.</p>
|
||||
<div class="btn-row">
|
||||
<button type="submit" class="btn" onclick="document.getElementById('sig-hidden').value=document.getElementById('sig-editor').innerHTML">Speichern</button>
|
||||
<button type="button" class="btn secondary" onclick="document.getElementById('sig-editor').innerHTML='';document.getElementById('sig-hidden').value=''">Löschen</button>
|
||||
<button type="submit" class="btn">Speichern</button>
|
||||
<button type="button" class="btn secondary" id="sig-clear">Löschen</button>
|
||||
</div>
|
||||
</form>
|
||||
<?php if ($me['signature']): ?>
|
||||
@@ -399,12 +390,11 @@ require __DIR__ . '/_header.php';
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function insertLink() {
|
||||
var url = prompt('URL eingeben:', 'https://');
|
||||
if (url) document.execCommand('createLink', false, url);
|
||||
}
|
||||
document.querySelector('form').addEventListener('submit', function() {
|
||||
document.getElementById('sig-hidden').value = document.getElementById('sig-editor').innerHTML;
|
||||
document.getElementById('sig-clear').addEventListener('click', function () {
|
||||
var ta = document.getElementById('signature');
|
||||
var ed = ta.previousElementSibling;
|
||||
if (ed && ed.classList.contains('richtext-editable')) ed.innerHTML = '';
|
||||
ta.value = '';
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user