X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/4a71fb9feda4277f1755ed095b3f74d9e5eacb4e..1209440ef94cb8b357936a78c56b9872d4fb5ae5:/lib/MECON/HTML/Link.php diff --git a/lib/MECON/HTML/Link.php b/lib/MECON/HTML/Link.php index 31e22bd..b1835c1 100644 --- a/lib/MECON/HTML/Link.php +++ b/lib/MECON/HTML/Link.php @@ -24,7 +24,9 @@ Autor: @@author <@@email> $Id$ -----------------------------------------------------------------------------*/ - +// +X2C includes +require_once 'HTML/Common.php'; +// ~X2C // +X2C Class 892 :MECON_HTML_Link /** @@ -124,10 +126,12 @@ class MECON_HTML_Link extends HTML_Common { $vars[] = urlencode($var) . '=' . urlencode($v); } if ($vars) { - $val = '?' . join('&', $vars); + $val .= '?' . join('&', $vars); } + } else { + $val = htmlentities($val); } - $attrs .= ' ' . $key . '="' . htmlentities($val) . '"'; + $attrs .= ' ' . $key . '="' . $val . '"'; } return "" . $this->getContents() . ''; } @@ -166,18 +170,14 @@ class MECON_HTML_Link extends HTML_Common { * Set a GET variable. * * @param string $key Key for the GET variable. - * @param mixed &$value Value for the variable. + * @param mixed $value Value for the variable. * * @return void * @access public */ - function setGetVar($key, &$value) // ~X2C + function setGetVar($key, $value) // ~X2C { - if (is_object($value)) { - $this->attrs[$key] =& $value; - } else { - $this->attrs[$key] = $value; - } + $this->_getVars[$key] = $value; } // -X2C @@ -224,13 +224,9 @@ If they doesn't exists, they are added, if they exists, they are updated. * @return void * @access public */ - function addContents(&$contents) // ~X2C + function addContents($contents) // ~X2C { - if (is_object($contents)) { - $this->_contents[] =& $contents; - } else { - $this->_contents[] = $contents; - } + $this->_contents[] = $contents; } // -X2C @@ -262,9 +258,10 @@ If they doesn't exists, they are added, if they exists, they are updated. */ function setContents($contents) // ~X2C { - $this->_contents = $contents; + $this->_contents = array($contents); } // -X2C } // -X2C Class :MECON_HTML_Link + ?> \ No newline at end of file