diff --git a/core/core.php b/core/core.php index 5d6bb7b3..81bd7741 100644 --- a/core/core.php +++ b/core/core.php @@ -1393,9 +1393,20 @@ class core extends common { } // Redirection if($output['redirect']) { - http_response_code(301); - header('Location:' . $output['redirect']); - exit(); + // Redirection Lity + if ($output['script'] === 'redirectdatality') { + $this->addOutput ([ + 'content' => 'Lien', + 'script' => '$(document).on("lity:close", function(event, instance) { + location.replace("' . helper::baseURl() . '"); + }); + document.getElementById("redirectdatality").click();' + ]); + } else { + http_response_code(301); + header('Location:' . $output['redirect']); + exit(); + } } } // Données en sortie applicables même lorsqu'une notice est présente diff --git a/module/redirection/redirection.php b/module/redirection/redirection.php index e000e5f8..8bf8db6a 100644 --- a/module/redirection/redirection.php +++ b/module/redirection/redirection.php @@ -19,7 +19,7 @@ class redirection extends common { 'index' => self::GROUP_VISITOR ]; - const REDIRECTION_VERSION = '1.3'; + const REDIRECTION_VERSION = '1.4'; /** * Configuration @@ -27,7 +27,10 @@ class redirection extends common { public function config() { // Soumission du formulaire if($this->isPost()) { - $this->setData(['module', $this->getUrl(0), 'url', $this->getInput('redirectionConfigUrl', helper::FILTER_URL, true)]); + $this->setData(['module', $this->getUrl(0), [ + 'url' => $this->getInput('redirectionConfigUrl', helper::FILTER_URL, true), + 'openIn' => $this->getInput('redirectionConfigOpenIn', helper::FILTER_BOOLEAN) + ]]); // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(), @@ -66,6 +69,7 @@ class redirection extends common { // Valeurs en sortie $this->addOutput([ 'redirect' => $this->getData(['module', $this->getUrl(0), 'url']), + 'script' => $this->getData(['module', $this->getUrl(0), 'openIn']) ? 'redirectdatality' : '', 'state' => true ]); } diff --git a/module/redirection/view/config/config.php b/module/redirection/view/config/config.php index 97102956..4f284fb3 100644 --- a/module/redirection/view/config/config.php +++ b/module/redirection/view/config/config.php @@ -21,6 +21,10 @@ 'placeholder' => 'http://', 'value' => $this->getData(['module', $this->getUrl(0), 'url']) ]); ?> + $this->getData(['module', $this->getUrl(0), 'openIn']) + ]); + ?>