cvs: php4 /pear/HTML Common.php
| From: | Adam Daniel | Date: | Thu, 15 Nov 2001 16:29:11 +0000 |
| Subject: | cvs: php4 /pear/HTML Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-1324@lists.php.net to get a copy of this message | ||
adaniel Thu Nov 15 11:29:11 2001 EDT
Modified files:
/php4/pear/HTML Common.php
Log:
fixed bug in getAttribute and added getAttributes
Index: php4/pear/HTML/Common.php
diff -u php4/pear/HTML/Common.php:1.10 php4/pear/HTML/Common.php:1.11
--- php4/pear/HTML/Common.php:1.10 Mon Aug 13 17:04:35 2001
+++ php4/pear/HTML/Common.php Thu Nov 15 11:29:11 2001
@@ -16,13 +16,13 @@
// | Authors: Adam Daniel <adaniel1@eesus.jnj.com> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.10 2001/08/13 21:04:35 adaniel Exp $
+// $Id: Common.php,v 1.11 2001/11/15 16:29:11 adaniel Exp $
/**
* Base class for all HTML classes
*
* @author Adam Daniel <adaniel1@eesus.jnj.com>
- * @version 1.5
+ * @version 1.6
* @since PHP 4.0.3pl1
* @abstract
*/
@@ -69,7 +69,7 @@
*/
function apiVersion()
{
- return 1.4;
+ return 1.6;
} // end func apiVersion
/**
@@ -220,14 +220,9 @@
*/
function getAttribute($attr)
{
- if (is_array($this->_attributes)) {
- while (list($key, $value) = each($this->_attributes)) {
- if (is_int($key) && strtoupper($value) == strtoupper($attr)) {
- return true;
- } elseif (strtolower($key) == strtolower($attr)){
- return $value;
- }
- }
+ $attr = strtolower($attr);
+ if (is_array($this->_attributes) && isset($this->_attributes[$attr])) {
+ return $this->_attributes[$attr];
}
return false;
} //end func getAttribute
@@ -241,6 +236,19 @@
{
$this->_attributes = $this->_parseAttributes($attributes);
} // end func _setAttributes
+
+ /**
+ * Returns an assoc array of attributes
+ *
+ * @since 1.6
+ * @access public
+ * @return void
+ * @throws
+ */
+ function getAttributes()
+ {
+ return $this->_attributes;
+ } //end func getAttributes
/**
* Updates the passed attributes without changing the other existing attributes