*/
function __construct($attrs) // ~X2C
{
- if (isset($attrs['URL'])) {
- $this->attrs['URL'] = $attrs['URL'];
- unset($attrs['URL']);
- } else {
- $this->attrs['URL'] = '';
+ $link_attrs['URL'] = @$attrs['URL'];
+ unset($attrs['URL']);
+ $link_attrs['DESC'] = @$attrs['DESC'];
+ unset($attrs['DESC']);
+ if (isset($attrs['BIFE'])) {
+ $link_attrs['BIFE'] = $attrs['BIFE'];
+ $attrs['DATA-BIFE'] = $attrs['BIFE'];
+ unset($attrs['BIFE']);
+ }
+ $query = array();
+ foreach($attrs as $name => $value) {
+ if (substr($name, 0, 5) === 'DATA-') {
+ if ($name = substr($name, 5)) {
+ $query[] = urlencode($name) . '=' . urlencode($value);
+ }
+ }
}
+ if ($query) {
+ $link_attrs['URL'] .= '?' . join('&', $query);
+ }
+ parent::__construct($link_attrs);
+ }
+ // -X2C
+
+ // +X2C Operation 142
+ /**
+ * Gets a URL string based on Link attributes.
+ *
+ * @param array $attrs Link attributes.
+ *
+ * @return string
+ * @access public
+ */
+ function getURL($attrs) // ~X2C
+ {
+ $url = @$attrs['URL'];
+ unset($attrs['URL']);
if (isset($attrs['BIFE'])) {
- $this->attrs['BIFE'] = $attrs['BIFE'];
$attrs['DATA-BIFE'] = $attrs['BIFE'];
unset($attrs['BIFE']);
}
}
}
if ($query) {
- $this->attrs['QUERY'] = '?' . join('&', $query);
- } else {
- $this->attrs['QUERY'] = '';
+ $url .= '?' . join('&', $query);
}
+ return $url;
}
// -X2C
} // -X2C Class :Link
-?>
+?>
\ No newline at end of file