Newer
Older
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
53
54
55
56
57
58
<?php
/**
* This file contains QUI\Bricks\Controls\Image
*/
namespace QUI\Bricks\Controls;
use QUI;
/**
* Class Image
*
* @package quiqqer/bricks
*/
class Image extends QUI\Control
{
/**
* constructor
*
* @param array $attributes
*/
public function __construct($attributes = array())
{
// default options
$this->setAttributes(array(
'title' => 'Image Brick',
'contentList' => false
));
parent::__construct($attributes);
$this->addCSSFile(
dirname(__FILE__) . '/Image.css'
);
}
/**
* (non-PHPdoc)
*
* @see \QUI\Control::create()
*/
public function getBody()
{
$Engine = QUI::getTemplateManager()->getEngine();
$brickImage = $this->getAttribute('picture');
$brickLink = $this->getAttribute('link');
$Engine->assign(array(
'this' => $this,
'brickImage' => $brickImage,
'brickLink' => $brickLink
));
return $Engine->fetch(dirname(__FILE__) . '/Image.html');
}
}