diff --git a/bricks.xml b/bricks.xml index 4623ee8c57287721a6a412d6d03e393571207559..7db7645b0305747048a7ba12c67294abcb92e959 100644 --- a/bricks.xml +++ b/bricks.xml @@ -47,6 +47,21 @@ <setting name="showLinks" type="checkbox"> <locale group="quiqqer/timeline" var="brick.timeline.setting.showLinks"/> </setting> + + <setting name="template" type="select"> + <locale group="quiqqer/timeline" + var="brick.timeline.setting.order"/> + + <option value="VerticalBothSides"> + <locale group="quiqqer/timeline" + var="brick.timeline.setting.template.verticalBothSides"/> + </option> + </setting> + + <setting name="limit" type="number"> + <locale group="quiqqer/timeline" + var="brick.timeline.setting.limit"/> + </setting> </settings> </brick> diff --git a/locale.xml b/locale.xml index 310e2f16f221478371d080e012bb2831bfe45901..00967f507abfd74d9bc1c2ecdf9a5818c8f04ac6 100644 --- a/locale.xml +++ b/locale.xml @@ -85,6 +85,21 @@ <en><![CDATA[Show hyperlinks for each site?]]></en> </locale> + <locale name="brick.timeline.setting.template"> + <de><![CDATA[Vorlage]]></de> + <en><![CDATA[Template]]></en> + </locale> + + <locale name="brick.timeline.setting.template.verticalBothSides"> + <de><![CDATA[Vertikale Zeitleiste mit Inhalt und Symbol (Bild)]]></de> + <en><![CDATA[Vertical timeline wiht content and icon (image)]]></en> + </locale> + + <locale name="brick.timeline.setting.limit"> + <de><![CDATA[Limit (Grundlimit 10)]]></de> + <en><![CDATA[Limit (basic limit it 10)]]></en> + </locale> + </groups> <groups name="quiqqer/timeline" datatype="php"> diff --git a/src/QUI/Timeline/Bricks/Timeline.php b/src/QUI/Timeline/Bricks/Timeline.php index f19e9a45beca632e0937e92da1a3cd558a456d33..569511503a356acf97301a8027df42b838c4585a 100644 --- a/src/QUI/Timeline/Bricks/Timeline.php +++ b/src/QUI/Timeline/Bricks/Timeline.php @@ -25,8 +25,11 @@ public function __construct($attributes = []) { // default options $this->setAttributes([ - 'image' => 'original', // original, cover - 'order' => 'c_date ASC', + 'image' => 'original', // original, cover + 'order' => 'c_date ASC', + 'showLinks' => true, + 'template' => 'VerticalBothSides', + 'limit' => 10 ]); parent::__construct($attributes); @@ -45,11 +48,22 @@ public function getBody() $Engine = QUI::getTemplateManager()->getEngine(); $Control = new QUI\Timeline\Controls\Timeline(); + $limit = $this->getAttribute('limit'); + + if ($limit === '') { + $limit = 10; + } + + if ($limit <= 0) { + $limit = 1; + } + $Control->setAttribute('parentInputList', $this->getAttribute('site')); $Control->setAttribute('imageFit', $this->getAttribute('image')); $Control->setAttribute('order', $this->getAttribute('order')); $Control->setAttribute('showLinks', $this->getAttribute('showLinks')); - + $Control->setAttribute('display', $this->getAttribute('template')); + $Control->setAttribute('limit', $limit); $result = $Control->create(); $this->addCSSFiles($Control->getCSSFiles());