Skip to content
Code-Schnipsel Gruppen Projekte
Commit 7a017d4d erstellt von Jan Wennrich's avatar Jan Wennrich
Dateien durchsuchen

PromoSliderWallpaper only uses desktop's slides by default (#88)

Übergeordneter f3d8f664
No related branches found
No related tags found
1 Merge Request!5Feat only desktop slides by default
...@@ -337,6 +337,12 @@ ...@@ -337,6 +337,12 @@
<locale group="quiqqer/bricks" var="brick.control.promoslider.settings.desktopslides"/> <locale group="quiqqer/bricks" var="brick.control.promoslider.settings.desktopslides"/>
</setting> </setting>
<setting name="isMobileSlidesEnabled" type="hidden"
data-qui="package/quiqqer/bricks/bin/Controls/Slider/ToggleMobileSlidesSetting"
>
<locale group="quiqqer/bricks" var="brick.control.promoslider.settings.isMobileSlidesEnabled"/>
</setting>
<setting name="mobileslides" type="hidden" <setting name="mobileslides" type="hidden"
data-qui="package/quiqqer/bricks/bin/Controls/Slider/PromosliderSettings" data-qui="package/quiqqer/bricks/bin/Controls/Slider/PromosliderSettings"
> >
......
...@@ -25,17 +25,18 @@ public function __construct($attributes = array()) ...@@ -25,17 +25,18 @@ public function __construct($attributes = array())
{ {
// default options // default options
$this->setAttributes(array( $this->setAttributes(array(
'title' => '', 'title' => '',
'text' => '', 'text' => '',
'class' => 'quiqqer-bricks-promoslider-wallpaper', 'class' => 'quiqqer-bricks-promoslider-wallpaper',
'nodeName' => 'section', 'nodeName' => 'section',
'data-qui' => 'package/quiqqer/bricks/bin/Controls/Slider/PromosliderWallpaper', 'data-qui' => 'package/quiqqer/bricks/bin/Controls/Slider/PromosliderWallpaper',
'role' => 'listbox', 'role' => 'listbox',
'shownavigation' => true, 'shownavigation' => true,
'showarrows' => 'showHoverScale', 'showarrows' => 'showHoverScale',
'autostart' => false, 'autostart' => false,
'delay' => 5000, 'delay' => 5000,
'template' => dirname(__FILE__) . '/PromosliderWallpaper.html' 'template' => dirname(__FILE__) . '/PromosliderWallpaper.html',
'isMobileSlidesEnabled' => false
)); ));
$this->addCSSFile( $this->addCSSFile(
...@@ -112,6 +113,7 @@ public function getBody() ...@@ -112,6 +113,7 @@ public function getBody()
$this->setAttribute('data-qui-options-delay', 5000); $this->setAttribute('data-qui-options-delay', 5000);
$this->setAttribute('data-qui-options-shownavigation', false); $this->setAttribute('data-qui-options-shownavigation', false);
$this->setAttribute('data-qui-options-showarrows', false); $this->setAttribute('data-qui-options-showarrows', false);
$this->setAttribute('data-qui-options-isMobileSlidesEnabled', false);
if ($this->getAttribute('pagefit') === false) { if ($this->getAttribute('pagefit') === false) {
$this->setAttribute('pagefitcut', false); $this->setAttribute('pagefitcut', false);
...@@ -218,14 +220,24 @@ public function getBody() ...@@ -218,14 +220,24 @@ public function getBody()
$this->parseSlides($this->getAttribute('desktopslides'), 'desktop'); $this->parseSlides($this->getAttribute('desktopslides'), 'desktop');
$this->parseSlides($this->getAttribute('mobileslides'), 'mobile');
$Engine->assign(array( $options = array(
'this' => $this, 'this' => $this,
'desktopSlides' => $this->desktopSlides, 'desktopSlides' => $this->desktopSlides,
'mobileSlides' => $this->mobileSlides,
'Utils' => new Utils() 'Utils' => new Utils()
)); );
if ($this->getAttribute('isMobileSlidesEnabled') === "true") {
$this->parseSlides($this->getAttribute('mobileslides'), 'mobile');
$options['mobileSlides'] = $this->mobileSlides;
} else {
$this->parseSlides($this->getAttribute('desktopslides'), 'mobile');
$options['mobileSlides'] = $this->desktopSlides;
}
$Engine->assign($options);
return $Engine->fetch($this->getAttribute('template')); return $Engine->fetch($this->getAttribute('template'));
} }
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren