<?php
/*
* (C) Copyright by Christian Möller
* All Rights reserved
*
* This file is part of the WCL (Web Control Library).
*
* WCL is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Foobar is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WCL. If not, see <http://www.gnu.org/licenses/>.
*/
class wuiImage extends wuiLabel {
var $img_src,
$img_width,
$img_height,
$img_alt;
function wuiImage($name, $image = 0) { parent::IControl($name); parent::setBaseTag("img"); $this->img_src = $image; }
function setImage($image) {
if (!_eventmode()) $this->img_src = $image;
_eventmode_add("src",'"'.$image.'"');
}
function getImage() {
if (!_eventmode()) return $this->img_src;
else return parent::get_this().".src";
}
function setSize($width, $height) {
if (!_eventmode()) $this->img_width = $width;
if (!_eventmode()) $this->img_height = $height;
_eventmode_add("width", $width);
_eventmode_add("height", $height);
}
function render() {
$out = '<img src="'.$this->img_src.'"';
if ($this->img_width)
$out .= 'width='.$this->img_width;
if ($this->img_height)
$out .= ' height='.$this->img_height;
if ($this->img_alt)
$out .= ' alt="'.$this->text.'" ';
$out .= parent::render_style();
$out .= '>';
return $out;
}
}
?>