1 <?php /* vim: set binary expandtab tabstop=4 shiftwidth=4 textwidth=80:
2 -------------------------------------------------------------------------------
3 Ministerio de EconomÃa
5 -------------------------------------------------------------------------------
6 This file is part of meconlib.
8 meconlib is free software; you can redistribute it and/or modify it under
9 the terms of the GNU General Public License as published by the Free
10 Software Foundation; either version 2 of the License, or (at your option)
13 meconlib is distributed in the hope that it will be useful, but WITHOUT
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License; if not,
18 write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
19 Boston, MA 02111-1307 USA
20 -------------------------------------------------------------------------------
21 Creado: Thu Aug 21 15:09:10 2003
22 Author: Leandro Lucarella <llucar@mecon.gov.ar>
23 -------------------------------------------------------------------------------
25 -----------------------------------------------------------------------------*/
28 require_once 'HTML/Common.php';
31 // +X2C Class 537 :MECON_HTML_Image
33 * HTML Image representation.
38 class MECON_HTML_Image extends HTML_Common {
45 * @param string $src Image location.
46 * @param string $alt Alternate text.
47 * @param array $attrs Other image attributes.
52 function MECON_HTML_Image($src = '', $alt = '', $attrs = array()) // ~X2C
54 if (is_array($attrs)) {
58 $attrs .= " src=$src alt=$alt";
60 parent::HTML_Common($attrs);
66 * Converts to HTML output.
71 function toHtml() // ~X2C
74 $attributes = $this->getAttributes() + array('border' => 0);
75 foreach ($attributes as $key => $val) {
76 $attrs .= ' ' . $key . '="' . htmlentities($val) . '"';
78 return "<img$attrs/>";
84 * Gets image location.
89 function getSrc() // ~X2C
91 return $this->getAttribute('src');
97 * Sets image location.
99 * @param string $src Image location.
104 function setSrc($src) // ~X2C
106 $this->updateAttributes(array('src' => $src));
110 // +X2C Operation 173
112 * Gets image alternate text.
117 function getAlt() // ~X2C
119 return $this->getAttribute('alt');
123 // +X2C Operation 174
125 * Sets image alternate text.
127 * @param string $alt Alternate text.
132 function setAlt($alt) // ~X2C
134 $this->updateAttributes(array('alt' => $alt));
138 } // -X2C Class :MECON_HTML_Image