1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52:
<?php
class ImgHTMLElement extends AbstractHTMLElement
{
private $url;
private $attributs = array();
public function __construct($url, $attributs = array(), $css_class = '')
{
if ($url instanceof Url)
{
$url = $url->rel();
}
$this->url = $url;
$this->attributs = $attributs;
$this->css_class = $css_class;
}
public function display()
{
$tpl = new FileTemplate('framework/builder/element/ImgHTMLElement.tpl');
$tpl->put_all(array(
'C_HAS_CSS_CLASSES' => $this->has_css_class(),
'CSS_CLASSES' => $this->get_css_class(),
'URL' => $this->url
));
foreach ($this->attributs as $type => $value)
{
$tpl->assign_block_vars('attributs', array(
'TYPE' => $type,
'VALUE' => $value
));
}
return $tpl->render();
}
}
?>