From 6a95d0f5ec01adca0fc91ba1c2200bebbd46045c Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Tue, 18 Dec 2018 18:10:16 +0000 Subject: [PATCH] wip #2438 @0.5 --- inc/ws/Controlleur/class.ws.services.php | 14 +++++++++- .../html5/master/class.ws.html5.links.php | 27 +++++++++++++++++++ 2 files changed, 40 insertions(+), 1 deletion(-) diff --git a/inc/ws/Controlleur/class.ws.services.php b/inc/ws/Controlleur/class.ws.services.php index 7cdab649e..d148674b2 100644 --- a/inc/ws/Controlleur/class.ws.services.php +++ b/inc/ws/Controlleur/class.ws.services.php @@ -797,6 +797,19 @@ class wsServices extends cubeFlashGateway header('Location: http://www.wesco-eshop.fr'); } + public function wsref() + { + global $core; + $e = explode('|', $_GET['ref'], 2); + $type = trim($e[0]); + $ref = trim($e[1]); + + $r = $core->con->select("SELECT * FROM wsref WHERE ref='" . $core->con->escape($ref) . "' AND type='" . $core->con->escape($type) . "'"); + if ($r->count()) { + header('Location: ' . $r->url); + } + } + public function pierronRef() { global $core; @@ -1365,7 +1378,6 @@ class wsServices extends cubeFlashGateway $version = 40; - $gpu = trim($gpu); $c = $core->con->openCursor('gpu_log'); diff --git a/inc/ws/Util/html5/master/class.ws.html5.links.php b/inc/ws/Util/html5/master/class.ws.html5.links.php index ebcbd6f68..1946d631e 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -86,6 +86,8 @@ class wsHTML5Link return new wescoSalesLink($id, $init, $compiler); case 'AtlanticDownloadLink': return new atlanticDownloadLink($id, $init, $compiler); + default : + return new customLink($id, $init, $compiler); } break; case 8: @@ -1563,6 +1565,31 @@ class haguenauManifLink extends internalLink } +class customLink extends wescoLink +{ + public function getURL() + { + global $core; + $e = explode(':', $this->to, 2); + if (!count($e) == 1) { + return 'https://workshop.fluidbook.com/services/wsref?ref=' . urlencode($this->to); + } + $type = trim($e[0]); + $ref = trim($e[1]); + + $r = $core->con->select("SELECT * FROM wsref WHERE ref='" . $core->con->escape($ref) . "' AND type='" . $core->con->escape($type) . "'"); + if ($r->count()) { + return $r->url; + } + return 'https://workshop.fluidbook.com/services/wsref?ref=' . urlencode($type . '|' . $ref); + } + + public function getDefaultTooltip() + { + return 'click to open the link'; + } +} + class zoomLink extends normalLink { protected $maxzoom_default = 2; -- 2.39.5