From 9a23ab0e3155f256a3c0b913cddb3ae70c19c208 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 9 May 2016 13:23:50 +0000 Subject: [PATCH] HTML5 links, redirection script #408 @1 --- inc/ws/Controlleur/class.ws.services.php | 12 ++++++++++++ inc/ws/Util/html5/class.ws.html5.links.php | 18 ++++++++++++++++-- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 14773ef15..c60d3ce0e 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -712,6 +712,18 @@ class wsServices extends cubeFlashGateway { header('Location: http://www.wesco-eshop.fr'); } + public function pierronRef() { + global $core; + $ref = $this->args['ref']; + + $r = $core->con->select('SELECT url FROM pierronref WHERE ref="' . $core->con->escape($ref) . '"'); + if ($r->count()) { + header('Location: http://www.pierron.fr/' . $r->url); + exit; + } + header('Location: http://www.pierron.fr/'); + } + public function flfRef() { global $core; diff --git a/inc/ws/Util/html5/class.ws.html5.links.php b/inc/ws/Util/html5/class.ws.html5.links.php index ece867e4a..36055e7fd 100644 --- a/inc/ws/Util/html5/class.ws.html5.links.php +++ b/inc/ws/Util/html5/class.ws.html5.links.php @@ -65,6 +65,8 @@ class wsHTML5Link { return new flfLink($id, $init, $compiler); } else if ($compiler->book->parametres->customLinkClass == 'InpesPopinLink') { return new inpesPopinLink($id, $init, $compiler); + } else if ($compiler->book->parametres->customLinkClass == 'PierronLink') { + return new pierronLink($id, $init, $compiler); } case 8: case 9: @@ -885,7 +887,19 @@ class audioLink extends wsHTML5Link { class wescoLink extends normalLink { public function getURL() { - return 'http://workshop.fluidbook.com/services/wescoRef?ref=' . $this->to; + return 'https://workshop.fluidbook.com/services/wescoRef?ref=' . $this->to; + } + + public function getTarget() { + return '_blank'; + } + +} + +class pierronLink extends normalLink { + + public function getURL() { + return 'https://workshop.fluidbook.com/services/pierronRef?ref=' . $this->to; } public function getTarget() { @@ -967,7 +981,7 @@ class statsTagLink extends wsHTML5Link { class flfLink extends wescoLink { public function getURL() { - return 'http://workshop.fluidbook.com/services/flfRef?ref=' . $this->to; + return 'https://workshop.fluidbook.com/services/flfRef?ref=' . $this->to; } public function getTarget() { -- 2.39.5