------------------------------------------------------------------------------- $Id$ -----------------------------------------------------------------------------*/ // +X2C includes require_once 'HTML/Common.php'; // ~X2C // +X2C Class 537 :MECON_HTML_Image /** * HTML Image representation. * * @package HTML * @access public */ class MECON_HTML_Image extends HTML_Common { // ~X2C // +X2C Operation 169 /** * Constructor. * * @param string $src Image location. * @param string $alt Alternate text. * @param array $attrs Other image attributes. * * @return void * @access public */ function MECON_HTML_Image($src = '', $alt = '', $attrs = array()) // ~X2C { if (is_array($attrs)) { $attrs['src'] = $src; $attrs['alt'] = $alt; } else { $attrs .= " src=$src alt=$alt"; } parent::HTML_Common($attrs); } // -X2C // +X2C Operation 170 /** * Converts to HTML output. * * @return string * @access public */ function toHtml() // ~X2C { $attrs = ''; $attributes = $this->getAttributes() + array('border' => 0); foreach ($attributes as $key => $val) { $attrs .= ' ' . $key . '="' . htmlentities($val) . '"'; } return ""; } // -X2C // +X2C Operation 171 /** * Gets image location. * * @return string * @access public */ function getSrc() // ~X2C { return $this->getAttribute('src'); } // -X2C // +X2C Operation 172 /** * Sets image location. * * @param string $src Image location. * * @return void * @access public */ function setSrc($src) // ~X2C { $this->updateAttributes(array('src' => $src)); } // -X2C // +X2C Operation 173 /** * Gets image alternate text. * * @return string * @access public */ function getAlt() // ~X2C { return $this->getAttribute('alt'); } // -X2C // +X2C Operation 174 /** * Sets image alternate text. * * @param string $alt Alternate text. * * @return void * @access public */ function setAlt($alt) // ~X2C { $this->updateAttributes(array('alt' => $alt)); } // -X2C } // -X2C Class :MECON_HTML_Image ?>