diff --git a/bricks.xml b/bricks.xml index 7e5f164d7f67c3dde6fca0ae8f32a1a10ad8e5f9..288ffbe77f9ae706428aa9f5c6ae89af7ddee512 100644 --- a/bricks.xml +++ b/bricks.xml @@ -132,13 +132,19 @@ <locale group="quiqqer/bricks" var="brick.control.setting.template"/> <option value="onlyImage" selected="selected"> - <locale group="quiqqer/bricks" var="brick.control.setting.template.onlyImages"/> + <locale group="quiqqer/bricks" + var="brick.control.setting.template.onlyImages"/> </option> <option value="imageAndText" selected="selected"> - <locale group="quiqqer/bricks" var="brick.control.setting.template.onlyImages"/> + <locale group="quiqqer/bricks" + var="brick.control.setting.template.imageAndText"/> </option> </setting> + <setting name="slideHeight" type="number" min="1"> + <locale group="quiqqer/bricks" var="brick.control.setting.slideHeight"/> + </setting> + <setting name="limit" type="number" min="1"> <locale group="quiqqer/bricks" var="brick.control.setting.limit"/> </setting> diff --git a/locale.xml b/locale.xml index 3d88d9d90913fba7550050addd3a167ec092c170..55aeb8f0d8dbe717ac33df92d9ae8e30c6af4f4e 100644 --- a/locale.xml +++ b/locale.xml @@ -330,6 +330,22 @@ <de><![CDATA[Seiten hinzufügen]]></de> <en><![CDATA[Add pages]]></en> </locale> + <locale name="brick.control.setting.template"> + <de><![CDATA[Slider Vorlage (template)]]></de> + <en><![CDATA[Slider template]]></en> + </locale> + <locale name="brick.control.setting.template.onlyImages"> + <de><![CDATA[Nur Bild (standard)]]></de> + <en><![CDATA[Only image (default)]]></en> + </locale> + <locale name="brick.control.setting.template.imageAndText"> + <de><![CDATA[Bild, Titel und Beschreibung]]></de> + <en><![CDATA[Image, title and description]]></en> + </locale> + <locale name="brick.control.setting.slideHeight"> + <de><![CDATA[Slider Höhe]]></de> + <en><![CDATA[Slider height]]></en> + </locale> <locale name="brick.control.setting.limit"> <de><![CDATA[Limit]]></de> <en><![CDATA[Limit]]></en> diff --git a/src/QUI/Bricks/Controls/Children/Slider.css b/src/QUI/Bricks/Controls/Children/Slider.OnlyImage.css similarity index 99% rename from src/QUI/Bricks/Controls/Children/Slider.css rename to src/QUI/Bricks/Controls/Children/Slider.OnlyImage.css index ffe9dcc84a77fb33dce47a9cbac526687c743a77..daa896660bf827aa35e7d9d9b8ae0739ebaf4416 100644 --- a/src/QUI/Bricks/Controls/Children/Slider.css +++ b/src/QUI/Bricks/Controls/Children/Slider.OnlyImage.css @@ -82,6 +82,7 @@ -webkit-transition: all 1s ease; max-height: calc(100% - 2px); width: auto; + max-width: initial; } .quiqqer-bricks-children-slider-child-display img:hover { diff --git a/src/QUI/Bricks/Controls/Children/Slider.php b/src/QUI/Bricks/Controls/Children/Slider.php index 2b164c31ae0075f5b65a74fb6463ada86e7210a0..7d0bfe19b5bfaf9f88db568051f2b77e603ed926 100644 --- a/src/QUI/Bricks/Controls/Children/Slider.php +++ b/src/QUI/Bricks/Controls/Children/Slider.php @@ -23,22 +23,18 @@ public function __construct($attributes = []) { // default options $this->setAttributes([ - 'class' => 'quiqqer-bricks-children-slider', - 'nodeName' => 'section', - 'site' => '', - 'order' => false, - 'limit' => false, - 'moreLink' => false, - 'data-qui' => 'package/quiqqer/bricks/bin/Controls/Children/Slider', - 'template' => null, // default -> onlyImage + 'class' => 'quiqqer-bricks-children-slider', + 'nodeName' => 'section', + 'site' => '', + 'order' => false, + 'limit' => false, + 'moreLink' => false, + 'data-qui' => 'package/quiqqer/bricks/bin/Controls/Children/Slider', + 'template' => false, // default -> onlyImage 'data-qui-options-usemobile' => false ]); - $this->addCSSFile( - dirname(__FILE__).'/Slider.css' - ); - parent::__construct($attributes); } @@ -52,7 +48,11 @@ public function getBody() $Engine = QUI::getTemplateManager()->getEngine(); $MoreLink = null; - if (!$this->getAttribute('height')) { + if (!$this->getAttribute('slideHeight')) { + $this->setAttribute('slideHeight', $this->getAttribute('height')); + } + + if (!$this->getAttribute('slideHeight')) { $this->setAttribute('slideHeight', 200); } @@ -64,16 +64,19 @@ public function getBody() } $template = $this->getTemplate(); + $css = $this->getTemplate(); switch ($this->getAttribute('template')) { case 'onlyImage': $template = dirname(__FILE__).'/Slider.OnlyImage.html'; + $css = dirname(__FILE__).'/Slider.OnlyImage.css'; break; case 'imageAndText': $template = dirname(__FILE__).'/Slider.ImageAndText.html'; + $css = dirname(__FILE__).'/Slider.ImageAndText.css'; if (!$this->getAttribute('slideHeight')) { - $this->setAttribute('slideHeight', 400); + $this->setAttribute('slideHeight', 500); } break; } @@ -84,6 +87,8 @@ public function getBody() 'MoreLink' => $MoreLink ]); + $this->addCSSFile($css); + return $Engine->fetch($template); } @@ -97,6 +102,16 @@ protected function getTemplate() return dirname(__FILE__).'/Slider.OnlyImage.html'; } + /** + * Return the control css + * + * @return string + */ + protected function getCSS() + { + return dirname(__FILE__).'/Slider.OnlyImage.css'; + } + /** * Return the children *