return static::_getURL($this->to);
}
- protected static function _getURLOfType($type, $ref)
+ protected static function _getURLOfType($type, $ref, $default = null)
{
global $core;
+ $e = explode(':', $ref, 2);
+ if (count($e) == 2 && $e[0] == $type) {
+ $ref = $e[1];
+ }
$nospaceref = str_replace(' ', '', $ref);
$r = $core->con->select("SELECT * FROM wsref WHERE (ref='" . $core->con->escape($ref) . "' OR ref='" . $core->con->escape($nospaceref) . "') AND type='" . $core->con->escape($type) . "'");
if ($r->count()) {
return $r->url;
}
- return 'https://workshop.fluidbook.com/services/wsref?ref=' . urlencode($type . '|' . $ref);
+ if (null === $default) {
+ return 'https://workshop.fluidbook.com/services/wsref?ref=' . urlencode($type . '|' . $ref);
+ }
+ return $default;
}