rules->all($ctx->daUser->username()); $ok = []; $status = $ctx->query('status'); if ($status === 'created') { $ok[] = $ctx->t('Rule created.'); } if ($status === 'updated') { $ok[] = $ctx->t('Rule updated.'); } if ($status === 'deleted') { $ok[] = $ctx->t('Rule deleted.'); } if ($status === 'toggled') { $ok[] = $ctx->t('Rule status changed.'); } if ($rules === []) { $body = '

' . AppContext::e($ctx->t('No global autoresponders')) . '

' . '

' . AppContext::e($ctx->t('All valid POP/IMAP mailboxes in this account')) . '

' . '' . AppContext::e($ctx->t('Add autoresponder')) . '
'; $ctx->render('Global autoresponders', $body, $ok); return; } $rows = ''; foreach ($rules as $rule) { $id = (string)$rule['id']; $enabled = !empty($rule['enabled']); $rows .= '' . AppContext::e($ctx->t($enabled ? 'Enabled' : 'Disabled')) . ''; $rows .= '' . AppContext::e((string)$rule['subject']) . '
' . date('Y-m-d H:i', (int)($rule['updated_at'] ?? time())) . ''; $rows .= '' . AppContext::e(date('Y-m-d H:i', (int)$rule['start_ts'])) . '
do ' . AppContext::e(date('Y-m-d H:i', (int)$rule['end_ts'])) . ''; $rows .= '' . AppContext::e($rule['dynamic_scope'] ? 'Dynamiczny' : 'Snapshot') . ''; $rows .= '' . AppContext::e($ctx->t('Edit')) . ''; $rows .= '' . AppContext::e($ctx->t('Preview')) . ''; $rows .= '
' . $ctx->csrfField('toggle:' . $id) . '
'; $rows .= '' . AppContext::e($ctx->t('Delete')) . ''; $rows .= '
'; } $body = '

' . AppContext::e($ctx->t('Global autoresponders')) . '

' . AppContext::e($ctx->t('All valid POP/IMAP mailboxes in this account')) . '

' . '' . AppContext::e($ctx->t('Add autoresponder')) . '
' . '' . $rows . '
Status' . AppContext::e($ctx->t('Subject')) . 'Okres wysyƂkiZakresAkcje
'; $ctx->render('Global autoresponders', $body, $ok); };