From: vincent@cubedesigners.com Date: Tue, 21 Jan 2020 16:49:17 +0000 (+0000) Subject: wip #3353 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=7995086daffcdb66a7f63506330b1cff3a9be047;p=cubeextranet.git wip #3353 @0.5 --- 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 5c4c775b7..ddca2cbe9 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.links.php +++ b/inc/ws/Util/html5/master/class.ws.html5.links.php @@ -1508,17 +1508,37 @@ class audioLink extends wsHTML5Link class wescoLink extends normalLink { + public static function _getURL($to) + { + return self::_getURLOfType('wesco', $to); + } public function getURL() { - return 'https://workshop.fluidbook.com/services/wescoRef?ref=' . $this->to; + return self::_getURL($this->to); } + protected static function _getURLOfType($type, $ref) + { + global $core; + $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 getTarget() { return '_blank'; } + public function getDefaultTooltip() + { + return 'click to open the link'; + } + } class pierronLink extends normalLink @@ -1723,17 +1743,7 @@ class customLink extends wescoLink } $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 getURL() - { - return self::_getURL($this->to); + return self::_getURLOfType($type, $ref); } public function getDefaultTooltip()