<?php
namespace Website\Widgets\Carousel; use Moto; class Widget extends Moto\System\Widgets\AbstractWidget { protected $_name = 'carousel'; protected static $_defaultProperties = array( 'preset' => 'default', 'animation' => '', 'spacing' => array( 'top' => 'auto', 'right' => 'auto', 'bottom' => 'auto', 'left' => 'auto', ), 'items' => array(), 'slideshowEnabled' => true, 'slideshowDelay' => 5, 'slideshowAnimationType' => 'fade', 'showNextPrev' => true, 'showPaginationDots' => true, 'slideWidth' => 300, 'minSlides' => 4, 'maxSlides' => 4, 'moveSlides' => 1, 'margins' => 20, ); protected $_templateType = 'templates'; protected $_widgetId = true; public function exportFrontendSettings() { $props = $this->getProperties(array( 'slideshowEnabled', 'slideshowDelay', 'showNextPrev', 'showPaginationDots', 'slideWidth', 'minSlides', 'maxSlides', 'moveSlides', 'margins', )); $props['itemsCount'] = count($this->getPropertyValue('items', array())); return json_encode($props); } } 