From 876d50e199f135733a447187720e4cf9eb85e26f Mon Sep 17 00:00:00 2001
From: Campii <dominik.chrzanowski183@gmail.com>
Date: Wed, 16 Mar 2022 10:04:05 +0100
Subject: [PATCH] feat: Added basic functionality [Timeline] quiqqer/timeline#1

---
 src/QUI/Timeline/Bricks/Timeline.php | 44 +++++++++++++++++++++++++++-
 1 file changed, 43 insertions(+), 1 deletion(-)

diff --git a/src/QUI/Timeline/Bricks/Timeline.php b/src/QUI/Timeline/Bricks/Timeline.php
index 70549df..31ea089 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');
+
+    }
 
 }
-- 
GitLab