diff --git a/meta/definitions/software.php b/meta/definitions/software.php index 5296be7..ca7af47 100644 --- a/meta/definitions/software.php +++ b/meta/definitions/software.php @@ -2,7 +2,7 @@ use function DI\autowire, DI\create, DI\get; -use Zend\Diactoros\Response\TextResponse; +use Zend\Diactoros\Response\HtmlResponse; use TheBugs\JavascriptMiddleware; @@ -68,8 +68,8 @@ return [ CronardMiddleware::class => function($c) { $cronardMiddleware = new CronardMiddleware($c, getenv('CRON_KEY'), function() : ResponseInterface { - return new TextResponse(sprintf("%s - cron task begin...", date('Y-m-d H:i:s'))); - }); + return new HtmlResponse(sprintf("%s - cron task begin...", date('Y-m-d H:i:s'))); + }, [], $c->get(TaskFetcher::class)); return $cronardMiddleware->fromFile(getenv("META_PATH")."/crontab.php")->fromAnnotations($c->get(TaskFetcher::class)); }, diff --git a/src/ControllerTrait.php b/src/ControllerTrait.php index 785db8d..fe9c135 100644 --- a/src/ControllerTrait.php +++ b/src/ControllerTrait.php @@ -18,7 +18,8 @@ use Psr\Http\Message\ResponseInterface; use TheBugs\Email\MailerInterface; -use Notes\Route\Annotation\Object\Route as RouteParam, +use Notes\Cronard\Annotation\Method\Cronard, + Notes\Route\Annotation\Object\Route as RouteParam, Notes\Route\Annotation\Method\Route, Notes\Security\Annotation\Security, Notes\Security\Annotation\Taxus, diff --git a/view/lean/widget/message.phtml b/view/lean/widget/message.phtml index d43e0cf..2a2e931 100644 --- a/view/lean/widget/message.phtml +++ b/view/lean/widget/message.phtml @@ -1,4 +1,11 @@ -{% php $messageList = array_filter(array_merge($this->contextList, [ $context ?? null ])) %} +{% php + $messageList = $this->contextList; + $context ??= false; + + if ($context && ! in_array($context, $messageList)) { + $messageList[] = $context; + } +%} {% if $messageList %}