From: Leandro Lucarella Date: Tue, 1 Jul 2003 18:44:29 +0000 (+0000) Subject: Se cambia el contructor y agrega funcionalidad. X-Git-Tag: svn_import~428 X-Git-Url: https://git.llucax.com/mecon/meconlib.git/commitdiff_plain/dc11c6a1d9dc79fdbf738720c99bb2d503a48c1a?ds=sidebyside Se cambia el contructor y agrega funcionalidad. --- diff --git a/pear_lib_tmp/HTML/Image.php b/pear_lib_tmp/HTML/Image.php index bb19f27..5c9df5b 100644 --- a/pear_lib_tmp/HTML/Image.php +++ b/pear_lib_tmp/HTML/Image.php @@ -21,32 +21,119 @@ // $Id$ // - // +X2C includes require_once 'HTML/Common.php'; // ~X2C // +X2C Class 214 :Image /** + * HTML Image representation. + * * @access public */ class HTML_Image extends HTML_Common { + /** + * List of valid HTML attributes for an Image. + * + * @var array $validAttrs + * @access protected + */ + var $_validAttrs = array('src', 'alt', 'longdesc', 'width', 'height', 'usemap', 'ismap', 'align', 'border', 'hspace', 'vspace', 'id', 'class', 'style', 'title', 'lang', 'dir', 'onclick', 'ondblclick', 'onmousedown', 'onmouseup', 'onmouseover', 'onmousemove', 'onmouseout', 'onkeypress', 'onkeydown', 'onkeyup'); + // ~X2C + // +X2C Operation 221 + /** + * Constructor. + * + * @param string $src Image location. + * @param string $alt Alternate text. + * @param array $attrs Other image attributes. + * + * @return void + * @access public + */ + function HTML_Image($src = '', $alt = '', $attrs = array())// ~X2C + { + $attrs['src'] = $src; + $attrs['alt'] = $alt; + parent::HTML_Common($attrs); + } + // -X2C + // +X2C Operation 216 /** + * Converts to HTML output. + * * @return string * @access public */ function toHtml()// ~X2C { $attrs = ''; - foreach ($this->_attributes as $key => $val) { + foreach ($this->getAttributes() as $key => $val) { $attrs .= ' ' . $key . '="' . htmlentities($val) . '"'; } - return ""; + return ""; + } + // -X2C + + // +X2C Operation 217 + /** + * Gets image location. + * + * @return string + * @access public + */ + function getSrc()// ~X2C + { + return $this->getAttribute('src'); + } + // -X2C + + // +X2C Operation 218 + /** + * Sets image location. + * + * @param string $src Image location. + * + * @return void + * @access public + */ + function setSrc($src)// ~X2C + { + $this->updateAttributes('src' => $src); + } + // -X2C + + // +X2C Operation 219 + /** + * Gets image alternate text. + * + * @return string + * @access public + */ + function getAlt()// ~X2C + { + return $this->getAttribute('alt'); + } + // -X2C + + // +X2C Operation 220 + /** + * Sets image alternate text. + * + * @param string $alt Alternate text. + * + * @return void + * @access public + */ + function setAlt($alt)// ~X2C + { + $this->updateAttributes('alt' => $alt); } // -X2C } // -X2C Class :Image + ?> diff --git a/pear_lib_tmp/HTML/Image/uml.xmi b/pear_lib_tmp/HTML/Image/uml.xmi index 31cabfa..a2ea2dc 100644 --- a/pear_lib_tmp/HTML/Image/uml.xmi +++ b/pear_lib_tmp/HTML/Image/uml.xmi @@ -9,25 +9,39 @@ - + - - + + + + + + + + + + + + + + + + - + - - + + - - + + @@ -39,7 +53,13 @@ + + + + + +