|
@@ -49,7 +49,7 @@ function renderField(array $field, string $addressDisclaimerText): void
|
|
|
if ($requiredAlways) {
|
|
if ($requiredAlways) {
|
|
|
$requiredLabel = ' <span class="required-mark required-mark-field" aria-hidden="true">* Pflichtfeld</span>';
|
|
$requiredLabel = ' <span class="required-mark required-mark-field" aria-hidden="true">* Pflichtfeld</span>';
|
|
|
} elseif ($requiredConditional) {
|
|
} elseif ($requiredConditional) {
|
|
|
- $requiredLabel = ' <span class="required-mark required-mark-field required-mark-conditional" aria-hidden="true">* Bedingt Pflicht</span>';
|
|
|
|
|
|
|
+ $requiredLabel = ' <span class="required-mark required-mark-field" aria-hidden="true">* Pflichtfeld</span>';
|
|
|
}
|
|
}
|
|
|
$fieldClass = 'field';
|
|
$fieldClass = 'field';
|
|
|
if ($requiredAlways || $requiredConditional) {
|
|
if ($requiredAlways || $requiredConditional) {
|
|
@@ -82,6 +82,7 @@ function renderField(array $field, string $addressDisclaimerText): void
|
|
|
echo '</select>';
|
|
echo '</select>';
|
|
|
} elseif ($type === 'file') {
|
|
} elseif ($type === 'file') {
|
|
|
$accept = htmlspecialchars((string) ($field['accept'] ?? ''));
|
|
$accept = htmlspecialchars((string) ($field['accept'] ?? ''));
|
|
|
|
|
+ $description = trim((string) ($field['description'] ?? ''));
|
|
|
$fileInputId = $key . '_file';
|
|
$fileInputId = $key . '_file';
|
|
|
$cameraInputId = $key . '_camera';
|
|
$cameraInputId = $key . '_camera';
|
|
|
echo '<div class="upload-control" data-upload-key="' . $key . '">';
|
|
echo '<div class="upload-control" data-upload-key="' . $key . '">';
|
|
@@ -89,6 +90,9 @@ function renderField(array $field, string $addressDisclaimerText): void
|
|
|
echo '<label class="upload-action-btn" for="' . $fileInputId . '">Datei auswählen</label>';
|
|
echo '<label class="upload-action-btn" for="' . $fileInputId . '">Datei auswählen</label>';
|
|
|
echo '<label class="upload-action-btn upload-action-btn-camera" for="' . $cameraInputId . '">Foto aufnehmen</label>';
|
|
echo '<label class="upload-action-btn upload-action-btn-camera" for="' . $cameraInputId . '">Foto aufnehmen</label>';
|
|
|
echo '</div>';
|
|
echo '</div>';
|
|
|
|
|
+ if ($description !== '') {
|
|
|
|
|
+ echo '<small class="hint">' . nl2br(htmlspecialchars($description)) . '</small>';
|
|
|
|
|
+ }
|
|
|
echo '<input id="' . $fileInputId . '" class="upload-native-input" type="file" name="' . $key . '" accept="' . $accept . '">';
|
|
echo '<input id="' . $fileInputId . '" class="upload-native-input" type="file" name="' . $key . '" accept="' . $accept . '">';
|
|
|
echo '<input id="' . $cameraInputId . '" class="upload-native-input" type="file" name="' . $key . '__camera" accept="image/*" capture="environment">';
|
|
echo '<input id="' . $cameraInputId . '" class="upload-native-input" type="file" name="' . $key . '__camera" accept="image/*" capture="environment">';
|
|
|
echo '<p class="upload-selected" data-upload-selected="' . $key . '">Keine Datei gewählt</p>';
|
|
echo '<p class="upload-selected" data-upload-selected="' . $key . '">Keine Datei gewählt</p>';
|
|
@@ -110,7 +114,7 @@ function renderField(array $field, string $addressDisclaimerText): void
|
|
|
if (isset($field['required_if']) && is_array($field['required_if'])) {
|
|
if (isset($field['required_if']) && is_array($field['required_if'])) {
|
|
|
$depField = htmlspecialchars((string) ($field['required_if']['field'] ?? ''));
|
|
$depField = htmlspecialchars((string) ($field['required_if']['field'] ?? ''));
|
|
|
$depValue = htmlspecialchars((string) ($field['required_if']['equals'] ?? ''));
|
|
$depValue = htmlspecialchars((string) ($field['required_if']['equals'] ?? ''));
|
|
|
- echo '<small class="hint">Bedingtes Pflichtfeld, wenn ' . $depField . ' = ' . $depValue . '.</small>';
|
|
|
|
|
|
|
+ echo '<small class="hint">Pflichtfeld, wenn ' . $depField . ' = ' . $depValue . '.</small>';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
echo '<div class="error" data-error-for="' . $key . '"></div>';
|
|
echo '<div class="error" data-error-for="' . $key . '"></div>';
|
|
@@ -188,11 +192,12 @@ function renderField(array $field, string $addressDisclaimerText): void
|
|
|
<span id="submitSpinner" class="btn-spinner hidden" aria-hidden="true"></span>
|
|
<span id="submitSpinner" class="btn-spinner hidden" aria-hidden="true"></span>
|
|
|
</button>
|
|
</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <p id="feedbackMessage" class="status-text" role="status" aria-live="polite"></p>
|
|
|
</form>
|
|
</form>
|
|
|
</section>
|
|
</section>
|
|
|
|
|
|
|
|
<section id="startSection" class="card hidden">
|
|
<section id="startSection" class="card hidden">
|
|
|
- <h2>Start</h2>
|
|
|
|
|
|
|
+ <h2>Status</h2>
|
|
|
<p id="startIntroText">Bitte E-Mail eingeben. Bestehende Entwürfe werden automatisch geladen.</p>
|
|
<p id="startIntroText">Bitte E-Mail eingeben. Bestehende Entwürfe werden automatisch geladen.</p>
|
|
|
<form id="startForm" novalidate>
|
|
<form id="startForm" novalidate>
|
|
|
<input type="hidden" name="csrf" value="<?= htmlspecialchars($csrf) ?>">
|
|
<input type="hidden" name="csrf" value="<?= htmlspecialchars($csrf) ?>">
|
|
@@ -213,7 +218,7 @@ function renderField(array $field, string $addressDisclaimerText): void
|
|
|
<p><strong>Speicherstatus:</strong> <span id="draftStatusValue">Noch nicht gespeichert</span></p>
|
|
<p><strong>Speicherstatus:</strong> <span id="draftStatusValue">Noch nicht gespeichert</span></p>
|
|
|
<button id="resetDataBtn" type="button" class="btn btn-small">Gespeicherte Daten löschen und neu starten</button>
|
|
<button id="resetDataBtn" type="button" class="btn btn-small">Gespeicherte Daten löschen und neu starten</button>
|
|
|
</div>
|
|
</div>
|
|
|
- <p id="feedbackMessage" class="status-text" role="status" aria-live="polite"></p>
|
|
|
|
|
|
|
+ <p id="startFeedbackMessage" class="status-text" role="status" aria-live="polite"></p>
|
|
|
</form>
|
|
</form>
|
|
|
</section>
|
|
</section>
|
|
|
</main>
|
|
</main>
|