$quizOptions * @var list $orderOptions Ordering slide: labels in the correct order * @var string $preparedText Q&A slide: questions entered beforehand, one per line * @var bool|null $hasResponses */ use App\Service\YouTubeService; $isNew = $slide->isNew(); $settings = $slide->getSettings(); $this->assign('title', $isNew ? __('Neue Folie') : __('Folie bearbeiten')); $this->assign('noindex', '1'); $formUrl = $isNew ? ['_name' => 'slides:add', 'token' => $adminToken, '?' => ['type' => $slide->type]] : ['_name' => 'slides:edit', 'token' => $adminToken, 'id' => $slide->id]; $optionsError = $slide->getError('options_text'); ?>

← title)) ?>

typeLabel()) ?>

Form->create($slide, ['url' => $formUrl, 'type' => 'file']) ?> Form->hidden('type') ?> isYouTube()) : $urlError = $slide->getError('youtube_url'); $startError = $slide->getError('youtube_start'); $linkStart = YouTubeService::parseUrl((string)$settings['url'])['start'] ?? null; // Leave the field empty when the start comes from the link, so a changed link wins. $startValue = $this->getRequest()->is(['post', 'put', 'patch']) ? (string)$this->getRequest()->getData('settings.start', '') : ((int)$settings['start'] > 0 && (int)$settings['start'] !== $linkStart ? YouTubeService::formatTime((int)$settings['start']) : ''); $previewUrl = $settings['video_id'] !== '' && !$urlError ? YouTubeService::embedUrl((string)$settings['video_id'], (int)$settings['start']) : null; ?>
value="" placeholder="https://www.youtube.com/watch?v=dQw4w9WgXcQ" aria-describedby="youtube-url-hint youtube-status" data-youtube-url>

>
data-youtube-start>

Form->control('settings.autoplay', [ 'type' => 'checkbox', 'label' => __('Automatisch abspielen, sobald die Folie in der Präsentation erscheint'), 'checked' => (bool)$settings['autoplay'], ]) ?>

Form->control('question', [ 'label' => match ($slide->type) { 'content' => __('Überschrift'), 'youtube' => __('Titel'), 'qa' => __('Überschrift'), default => __('Frage'), }, 'maxlength' => 500, 'required' => !$slide->isYouTube(), 'autofocus' => $isNew && !$slide->isYouTube(), 'placeholder' => match (true) { $slide->isYouTube() => __('Leer lassen, um den Titel des Videos zu übernehmen'), $slide->isQa() => __('z. B. Eure Fragen an den Vorstand'), default => null, }, 'data-youtube-title' => $slide->isYouTube() ? '' : null, ]) ?> Form->control('description', [ 'type' => 'textarea', 'rows' => $slide->type === 'content' ? 6 : 2, 'label' => $slide->type === 'content' ? __('Text') : __('Beschreibung (optional)'), 'aria-describedby' => 'description-format', ]) ?>

element('slide_image_fields', compact('slide', 'poll')) ?> type === 'choice') : ?>

Form->control('settings.multiple', [ 'type' => 'checkbox', 'label' => __('Mehrfachauswahl erlauben'), 'checked' => (bool)$settings['multiple'], ]) ?> Form->control('settings.comments', [ 'type' => 'checkbox', 'label' => __('Kommentarfeld anzeigen (Teilnehmende können ihre Auswahl optional begründen)'), 'checked' => (bool)$settings['comments'], ]) ?>

type === 'open') : ?> Form->control('settings.private', [ 'type' => 'checkbox', 'label' => __('Anonymes Feedback: Antworten nicht öffentlich anzeigen'), 'checked' => (bool)$settings['private'], ]) ?>

type === 'wordcloud') : ?> Form->control('settings.allow_upvotes', [ 'type' => 'checkbox', 'label' => __('Upvotes erlauben (Teilnehmende sehen die Wortwolke live und können Begriffe per Klick unterstützen)'), 'checked' => (bool)$settings['allow_upvotes'], ]) ?> Form->control('settings.allow_downvotes', [ 'type' => 'checkbox', 'label' => __('Downvotes erlauben (nur zusammen mit Upvotes: Teilnehmende können Begriffe anderer ablehnen)'), 'checked' => (bool)$settings['allow_downvotes'], ]) ?> type === 'scale') : ?>
Form->radio('settings.style', [ ['value' => \App\Model\Entity\Slide::SCALE_NUMBERS, 'text' => __('Zahlen (z. B. 1 bis 10)')], ['value' => \App\Model\Entity\Slide::SCALE_STARS, 'text' => __('Sterne (wie bei einer Produktbewertung)')], ], ['value' => $settings['style']]) ?>
Form->control('settings.scale_min', [ 'type' => 'select', 'options' => [0 => '0', 1 => '1'], 'label' => __('Von'), 'value' => $settings['scale_min'], 'templateVars' => ['attrs' => $stars ? ' hidden' : ''], 'templates' => ['inputContainer' => '
{{content}}
'], ]) ?> Form->control('settings.scale_max', [ 'type' => 'select', 'options' => array_combine(range(2, 10), range(2, 10)), 'label' => $stars ? __('Anzahl Sterne') : __('Bis'), 'value' => $settings['scale_max'], 'data-label-numbers' => __('Bis'), 'data-label-stars' => __('Anzahl Sterne'), ]) ?>
Form->control('settings.min_label', [ 'label' => __('Beschriftung links (optional)'), 'maxlength' => 60, 'placeholder' => __('z. B. gar nicht'), 'value' => $settings['min_label'], ]) ?> Form->control('settings.max_label', [ 'label' => __('Beschriftung rechts (optional)'), 'maxlength' => 60, 'placeholder' => __('z. B. sehr'), 'value' => $settings['max_label'], ]) ?>
Form->control('settings.scale_view', [ 'type' => 'select', 'label' => __('In der Präsentation zeigen'), 'options' => [ \App\Model\Entity\Slide::SCALE_VIEW_BOTH => __('Durchschnitt und Verteilung'), \App\Model\Entity\Slide::SCALE_VIEW_AVERAGE => __('Nur Durchschnitt'), \App\Model\Entity\Slide::SCALE_VIEW_CHART => __('Nur Verteilung (Diagramm)'), ], 'value' => $settings['scale_view'], ]) ?>

Form->control('settings.comments', [ 'type' => 'checkbox', 'label' => __('Kommentarfeld anzeigen (Teilnehmende können ihre Bewertung optional begründen)'), 'checked' => (bool)$settings['comments'], ]) ?>

Form->control('settings.comment_ratings', [ 'type' => 'checkbox', 'label' => __('Bewertung beim Kommentar in der Präsentation anzeigen'), 'checked' => (bool)$settings['comment_ratings'], ]) ?> Form->control('settings.private', [ 'type' => 'checkbox', 'label' => __('Internes Feedback: Ergebnis nicht öffentlich anzeigen'), 'checked' => (bool)$settings['private'], ]) ?>

type === 'quiz') : $quizError = $slide->getError('quiz_options'); $rows = $quizOptions; // Offer the two required rows (more via "Antwort hinzufügen" with JS), plus one spare when editing. $rowCount = min(\App\Model\Table\SlidesTable::MAX_QUIZ_OPTIONS, max(2, count($rows) + 1)); $rows = array_pad($rows, $rowCount, ['label' => '', 'correct' => false]); ?>
>

    $row) : ?>
  1. >

__('Kein Zeitlimit – ich beende das Quiz selbst'), $seconds < 60 => __('{0} Sekunden', $seconds), $seconds % 60 === 0 => __n('{0} Minute', '{0} Minuten', intdiv($seconds, 60), intdiv($seconds, 60)), default => __('{0} Minuten', number_format($seconds / 60, 1, ',', '')), }; } ?> Form->control('settings.time_limit', [ 'type' => 'select', 'options' => $limits, 'label' => __('Zeitlimit'), 'value' => $settings['time_limit'], ]) ?>

isOrder()) : $orderError = $slide->getError('order_options'); $max = \App\Model\Table\SlidesTable::MAX_ORDER_OPTIONS; $rows = array_pad($orderOptions, min($max, max(2, count($orderOptions) + 1)), ''); ?>

    $label) : ?>
  1. placeholder="">

Form->control('settings.ranking', [ 'type' => 'checkbox', 'label' => __('Keine richtige Reihenfolge – Teilnehmende sortieren nach eigener Einschätzung (z. B. nach Wichtigkeit)'), 'checked' => (bool)$settings['ranking'], ]) ?>

type === 'qa') : $upvoteOptions = []; foreach (range(1, \App\Model\Entity\Slide::QA_MAX_UPVOTES) as $n) { $upvoteOptions[$n] = __n('{0} Stimme', '{0} Stimmen', $n, $n); } ?> Form->control('settings.upvote_share', [ 'type' => 'select', 'options' => [0 => __('keine – ohne Abstimmung')] + $shareOptions, 'label' => __('Stimmen pro Person'), 'value' => $settings['upvote_share'], 'aria-describedby' => 'qa-upvotes-hint', ]) ?>

Form->control('settings.max_upvotes_per_question', [ 'type' => 'select', 'options' => [0 => __('unbegrenzt (bis alle Stimmen vergeben sind)')] + $upvoteOptions, 'label' => __('Höchstens pro Frage'), 'value' => $settings['max_upvotes_per_question'], 'aria-describedby' => 'qa-per-question-hint', ]) ?>

Form->control('settings.allow_self_upvote', [ 'type' => 'checkbox', 'label' => __('Stimmen für eigene Fragen erlauben'), 'checked' => (bool)$settings['allow_self_upvote'], 'aria-describedby' => 'qa-self-upvote-hint', ]) ?>

qaStage() === \App\Model\Entity\Slide::QA_COLLECT) : ?>

isInteractive() && !$slide->isQuiz() && !$slide->isQa()) : ?> Form->control('is_voting_open', [ 'type' => 'checkbox', 'label' => __('Abstimmung geöffnet'), 'checked' => $isNew ? true : $slide->is_voting_open, ]) ?>
Form->button($isNew ? __('Folie anlegen') : __('Speichern'), ['class' => 'button button--primary']) ?>
Form->end() ?>