url($isUpdate ? 'update.html' : 'create.html'); $intent = $isUpdate ? 'update:' . $id : 'create'; $csrf = $ctx->csrfField($intent); $hiddenId = $isUpdate ? '' : ''; return '
' . $csrf . $hiddenId . '

Treść odpowiedzi

' . '
' . '
' . '

Podsumowanie

Zakres' . AppContext::e($ctx->t('All valid POP/IMAP mailboxes in this account')) . '
' . '
Start' . AppContext::e($startValue) . '
Koniec' . AppContext::e($endValue) . '
' . '
' . AppContext::e($ctx->t('Cancel')) . '
' . render_calendar_picker('start_value', 'Data rozpoczęcia', $startValue) . render_calendar_picker('end_value', 'Data zakończenia', $endValue) . '
'; } /** @param array $post @return array */ function normalize_rule_post(array $post): array { foreach (['start_value', 'end_value'] as $key) { $date = trim((string)($post[$key . '_date'] ?? '')); $hour = trim((string)($post[$key . '_hour'] ?? '')); if ($date !== '' && preg_match('/^[0-9]{2}$/', $hour)) { $post[$key] = $date . 'T' . $hour . ':00'; } } return $post; } function render_calendar_picker(string $name, string $title, string $value): string { $selectedDate = substr($value, 0, 10); $selectedHour = substr($value, 11, 2) ?: '09'; $days = ''; for ($week = 0, $day = 1; $week < 4; $week++) { $days .= ''; for ($i = 0; $i < 7; $i++, $day++) { $date = sprintf('2026-06-%02d', $day); $class = $date === $selectedDate ? ' is-selected' : ''; $days .= ''; } $days .= ''; } $hours = ''; foreach (['08', '09', '10', '11', '12', '13', '14', '15', '16', '17', '18'] as $hour) { $hours .= ''; } return '

' . AppContext::e($title) . '

' . AppContext::e($title) . '

Czerwiec 2026
' . '' . $days . '
PnWtŚrCzPtSbNd
' . '
Wybrano: ' . AppContext::e($selectedDate) . '
' . '

Godzina

Wybierz godzinę
' . $hours . '
' . '
'; } function render_preview_box(array $rule): string { return '
Temat: ' . AppContext::e((string)$rule['subject']) . '

' . nl2br(AppContext::e((string)$rule['body'])) . '
'; }