diff --git a/src/QUI/Timeline/Bricks/Timeline.php b/src/QUI/Timeline/Bricks/Timeline.php index 70549df9bf947b0162812d99406eb96568144a21..31ea089ffdf33c8be3a5434f154afffc28c81eac 100644 --- a/src/QUI/Timeline/Bricks/Timeline.php +++ b/src/QUI/Timeline/Bricks/Timeline.php @@ -7,7 +7,6 @@ namespace QUI\Timeline\Bricks; use QUI; -use QUI\Projects\Site\Utils; /** * Class Timeline @@ -17,5 +16,48 @@ class Timeline extends QUI\Control { + /** + * constructor + * + * @param array $attributes + */ + public function __construct($attributes = []) + { + // default options + $this->setAttributes([ + + ]); + + parent::__construct($attributes); + + $this->setAttribute('cacheable', 0); + } + + /** + * Return the inner body of the element + * Can be overwritten + * + * @return String + */ + public function getBody() + { + $Engine = QUI::getTemplateManager()->getEngine(); + $Control = new QUI\Timeline\Controls\Timeline(); + + $Control->setAttribute('parentInputList', $this->getAttribute('site')); + + $result = $Control->create(); + + $this->addCSSFiles($Control->getCSSFiles()); + + $options = [ + 'body' => $result + ]; + + $Engine->assign($options); + + return $Engine->fetch(\dirname(__FILE__) . '/Timeline.html'); + + } }