]> _ Git - cubeextranet.git/commitdiff
wip #3353 @0.5
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 21 Jan 2020 16:49:17 +0000 (16:49 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 21 Jan 2020 16:49:17 +0000 (16:49 +0000)
inc/ws/Util/html5/master/class.ws.html5.links.php

index 5c4c775b71250dd2bc765a4a7a788876444d956c..ddca2cbe9eb3f8c7a99e51199f21d1ba37d56ac6 100644 (file)
@@ -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()