17 lines
580 B
PHP
17 lines
580 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
return static function (AppContext $ctx): void {
|
|
$ok = [];
|
|
$status = $ctx->query('status');
|
|
if ($status === 'created') { $ok[] = $ctx->t('Rule created.'); }
|
|
if ($status === 'updated') { $ok[] = $ctx->t('Rule updated.'); }
|
|
if ($status === 'deleted') {
|
|
$name = $ctx->query('name');
|
|
$ok[] = $name !== '' ? $ctx->t('Global autoresponder deleted.', ['name' => $name]) : $ctx->t('Rule deleted.');
|
|
}
|
|
if ($status === 'toggled') { $ok[] = $ctx->t('Rule status changed.'); }
|
|
|
|
render_rules_index($ctx, $ok);
|
|
};
|