From a4667fa0980d5892b0084cbbb1fdb789f0fe63d9 Mon Sep 17 00:00:00 2001 From: Tim van Dijen <tvdijen@gmail.com> Date: Fri, 22 Nov 2019 20:21:06 +0100 Subject: [PATCH] Remove unnecessary use of Translate::t --- .../core/lib/Controller/ExceptionController.php | 16 ---------------- modules/core/templates/no_cookie.twig | 6 +++--- modules/core/templates/short_sso_interval.twig | 4 ++-- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/modules/core/lib/Controller/ExceptionController.php b/modules/core/lib/Controller/ExceptionController.php index 022dac938..0c829e8f7 100644 --- a/modules/core/lib/Controller/ExceptionController.php +++ b/modules/core/lib/Controller/ExceptionController.php @@ -99,20 +99,6 @@ class ExceptionController } $t = new Template($this->config, 'core:no_cookie.tpl.php'); - $translator = $t->getTranslator(); - - /** @var string $header */ - $header = $translator->t('{core:no_cookie:header}'); - - /** @var string $desc */ - $desc = $translator->t('{core:no_cookie:description}'); - - /** @var string $retry */ - $retry = $translator->t('{core:no_cookie:retry}'); - - $t->data['header'] = htmlspecialchars($header); - $t->data['description'] = htmlspecialchars($desc); - $t->data['retry'] = htmlspecialchars($retry); $t->data['retryURL'] = $retryURL; return $t; } @@ -147,10 +133,8 @@ class ExceptionController $t = new Template($this->config, 'core:short_sso_interval.tpl.php'); $translator = $t->getTranslator(); - $t->data['target'] = Module::getModuleURL('core/short_sso_interval.php'); $t->data['params'] = ['StateId' => $stateId]; $t->data['trackId'] = $this->session->getTrackID(); - $t->data['header'] = $translator->t('{core:short_sso_interval:warning_header}'); $t->data['autofocus'] = 'contbutton'; return $t; } diff --git a/modules/core/templates/no_cookie.twig b/modules/core/templates/no_cookie.twig index 7205318e2..aaf5f2b57 100644 --- a/modules/core/templates/no_cookie.twig +++ b/modules/core/templates/no_cookie.twig @@ -3,11 +3,11 @@ {% extends "base.twig" %} {% block content %} - <h2>{{ header }}</h2> - <p>{{ description }}</p> + <h2>{{ '{core:no_cookie:header}'|trans }}</h2> + <p>{{ '{core:no_cookie:description}'|trans }}</p> {% if retryURL is not null %} <ul> - <li><a href="{{ retryURL|escape('html') }}" id="retry">{{ retry }}</a></li> + <li><a href="{{ retryURL|escape('html') }}" id="retry">{{ '{core:no_cookie:retry}'|trans }}</a></li> </ul> {% endif %} {% endblock %} diff --git a/modules/core/templates/short_sso_interval.twig b/modules/core/templates/short_sso_interval.twig index 542e174c0..c4aa3e9ea 100644 --- a/modules/core/templates/short_sso_interval.twig +++ b/modules/core/templates/short_sso_interval.twig @@ -2,8 +2,8 @@ {% extends "base.twig" %} {% block content %} - <h1>{{ header }}</h1> - <form style="display: inline; margin: 0px; padding: 0px" action="{{ target|escape('html') }}"> + <h1>{{ '{core:short_sso_interval:warning_header}'|trans }}</h1> + <form style="display: inline; margin: 0px; padding: 0px" action="{{ moduleUrl('core/short_sso_interval.php') }}"> {% for name, value in params %} <input type="hidden" name="{{ name|escape('html') }}" value="{{ value|escape('html') }}"> {% endfor %} -- GitLab