function _expandurl($url) { $m = array(); if (!preg_match('/^ ([^:]+) (:[:=]) (.+) $/x', $url, $m)) { return HTML::span(array('class' => 'error'), _("BAD semantic relation link")); } $this->_relation = urldecode($m[1]); $is_attribute = $m[2] == ':='; if ($is_attribute) { $this->_attribute = urldecode($m[3]); // since this stored in the markup cache, we are extra sensible // not to store false empty stuff. $units = new Units(); if (!DISABLE_UNITS and !$units->errcode) { $this->_attribute_base = $units->Definition($this->_attribute); $this->_unit = $units->baseunit($this->_attribute); } } else { $this->_page = urldecode($m[3]); } return $m; }