forked from ZwiiCMS-Team/ZwiiCMS
Test de redirection
This commit is contained in:
parent
57dd3ea049
commit
3e0525d2fe
@ -1393,9 +1393,20 @@ class core extends common {
|
|||||||
}
|
}
|
||||||
// Redirection
|
// Redirection
|
||||||
if($output['redirect']) {
|
if($output['redirect']) {
|
||||||
http_response_code(301);
|
// Redirection Lity
|
||||||
header('Location:' . $output['redirect']);
|
if ($output['script'] === 'redirectdatality') {
|
||||||
exit();
|
$this->addOutput ([
|
||||||
|
'content' => '<a href="' . $output['redirect'] . '" class="displayNone" data-lity id="redirectdatality">Lien</a>',
|
||||||
|
'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
|
// Données en sortie applicables même lorsqu'une notice est présente
|
||||||
|
@ -19,7 +19,7 @@ class redirection extends common {
|
|||||||
'index' => self::GROUP_VISITOR
|
'index' => self::GROUP_VISITOR
|
||||||
];
|
];
|
||||||
|
|
||||||
const REDIRECTION_VERSION = '1.3';
|
const REDIRECTION_VERSION = '1.4';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Configuration
|
* Configuration
|
||||||
@ -27,7 +27,10 @@ class redirection extends common {
|
|||||||
public function config() {
|
public function config() {
|
||||||
// Soumission du formulaire
|
// Soumission du formulaire
|
||||||
if($this->isPost()) {
|
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
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'redirect' => helper::baseUrl() . $this->getUrl(),
|
'redirect' => helper::baseUrl() . $this->getUrl(),
|
||||||
@ -66,6 +69,7 @@ class redirection extends common {
|
|||||||
// Valeurs en sortie
|
// Valeurs en sortie
|
||||||
$this->addOutput([
|
$this->addOutput([
|
||||||
'redirect' => $this->getData(['module', $this->getUrl(0), 'url']),
|
'redirect' => $this->getData(['module', $this->getUrl(0), 'url']),
|
||||||
|
'script' => $this->getData(['module', $this->getUrl(0), 'openIn']) ? 'redirectdatality' : '',
|
||||||
'state' => true
|
'state' => true
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,10 @@
|
|||||||
'placeholder' => 'http://',
|
'placeholder' => 'http://',
|
||||||
'value' => $this->getData(['module', $this->getUrl(0), 'url'])
|
'value' => $this->getData(['module', $this->getUrl(0), 'url'])
|
||||||
]); ?>
|
]); ?>
|
||||||
|
<?php echo template::checkbox('redirectionConfigOpenIn', true , 'Ouvrir dans une popup intégrée', [
|
||||||
|
'checked' => $this->getData(['module', $this->getUrl(0), 'openIn'])
|
||||||
|
]);
|
||||||
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col6">
|
<div class="col6">
|
||||||
|
Loading…
Reference in New Issue
Block a user