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 Autor: @@author <@@email>
23 -------------------------------------------------------------------------------
25 -----------------------------------------------------------------------------*/
29 // +X2C Class 537 :MECON_HTML_Image
31 * HTML Image representation.
36 class MECON_HTML_Image extends HTML_Common {
43 * @param string $src Image location.
44 * @param string $alt Alternate text.
45 * @param array $attrs Other image attributes.
50 function MECON_HTML_Image($src = '', $alt = '', $attrs = array()) // ~X2C
52 if (is_array($attrs)) {
56 $attrs .= " src=$src alt=$alt";
58 parent::HTML_Common($attrs);
64 * Converts to HTML output.
69 function toHtml() // ~X2C
72 $attributes = $this->getAttributes() + array('border' => 0, 'align' => 'middle');
73 foreach ($attributes as $key => $val) {
74 $attrs .= ' ' . $key . '="' . htmlentities($val) . '"';
76 return "<IMG$attrs/>";
82 * Gets image location.
87 function getSrc() // ~X2C
89 return $this->getAttribute('src');
95 * Sets image location.
97 * @param string $src Image location.
102 function setSrc($src) // ~X2C
104 $this->updateAttributes(array('src' => $src));
108 // +X2C Operation 173
110 * Gets image alternate text.
115 function getAlt() // ~X2C
117 return $this->getAttribute('alt');
121 // +X2C Operation 174
123 * Sets image alternate text.
125 * @param string $alt Alternate text.
130 function setAlt($alt) // ~X2C
132 $this->updateAttributes(array('alt' => $alt));
136 } // -X2C Class :MECON_HTML_Image