| Current Path : /proc/1908984/root/proc/self/root/proc/self/root/proc/2411249/cwd/ |
| Current File : //proc/1908984/root/proc/self/root/proc/self/root/proc/2411249/cwd/Widget.tar |
AbstractWidget.php 0000644 00000004016 15235664647 0010207 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget;
use Nextend\Framework\Data\Data;
use Nextend\Framework\Form\ContainerInterface;
use Nextend\Framework\Pattern\GetAssetsPathTrait;
use Nextend\SmartSlider3\BackupSlider\ExportSlider;
use Nextend\SmartSlider3\BackupSlider\ImportSlider;
use Nextend\SmartSlider3\Widget\Group\AbstractWidgetGroup;
abstract class AbstractWidget {
use GetAssetsPathTrait;
protected $name;
protected $key;
protected $defaults = array();
/**
* AbstractWidget constructor.
*
* @param AbstractWidgetGroup $widgetGroup
* @param string $name
* @param array $defaults
*/
public function __construct($widgetGroup, $name, $defaults = array()) {
$this->name = $name;
$this->defaults = array_merge($this->defaults, $defaults);
$widgetGroup->addWidget($name, $this);
}
public function getName() {
return $this->name;
}
public function getSubFormImagePath() {
return self::getAssetsPath() . '/' . $this->name . '.png';
}
public function getDefaults() {
return $this->defaults;
}
/**
* @param SliderWidget $sliderWidget
*
* @return AbstractWidgetFrontend
*/
public function createFrontend($sliderWidget, $params) {
$className = static::class . 'Frontend';
$params->fillDefault($this->getDefaults());
return new $className($sliderWidget, $this, $params);
}
public function getKey() {
return $this->key;
}
/**
* @param ExportSlider $export
* @param Data $params
*/
public function prepareExport($export, $params) {
}
/**
* @param ImportSlider $import
* @param Data $params
*/
public function prepareImport($import, $params) {
}
/**
* @param ContainerInterface $container
*/
abstract public function renderFields($container);
} AbstractWidgetFrontend.php 0000644 00000011467 15235664647 0011717 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget;
use Nextend\Framework\Data\Data;
use Nextend\Framework\Pattern\GetAssetsPathTrait;
use Nextend\SmartSlider3\Slider\Slider;
abstract class AbstractWidgetFrontend {
use GetAssetsPathTrait;
/** @var SliderWidget */
protected $sliderWidget;
/**
* @var Slider
*/
protected $slider;
/** @var AbstractWidget */
protected $widget;
protected $key;
/**
* @var Data
*/
protected $params;
/**
* AbstractWidgetFrontend constructor.
*
* @param SliderWidget $sliderWidget
* @param AbstractWidget $widget
*/
public function __construct($sliderWidget, $widget, $params) {
$this->sliderWidget = $sliderWidget;
$this->slider = $sliderWidget->slider;
$this->widget = $widget;
$this->params = $params;
$this->key = $widget->getKey();
}
protected function addToPlacement($key, $renderCallback) {
$params = $this->params;
if ($params->get($key . 'mode') == 'simple') {
$area = intval($params->get($key . 'area'));
$stack = intval($params->get($key . 'stack', 1));
$this->sliderWidget->addToSimplePlacement($renderCallback, $this->translateArea($area), $stack, $params->get($key . 'offset', 0));
} else {
$horizontalSide = $params->get($key . 'horizontal', 'left');
$horizontalPosition = $params->get($key . 'horizontal-position', 0);
$horizontalUnit = $params->get($key . 'horizontal-unit', 'px');
$verticalSide = $params->get($key . 'vertical', 'top');
$verticalPosition = $params->get($key . 'vertical-position', 0);
$verticalUnit = $params->get($key . 'vertical-unit', 'px');
$this->sliderWidget->addToAdvancedPlacement($renderCallback, $horizontalSide, $horizontalPosition, $horizontalUnit, $verticalSide, $verticalPosition, $verticalUnit);
}
}
protected function translateArea($area) {
static $areas = array(
1 => 'above',
2 => 'absolute-left-top',
3 => 'absolute-center-top',
4 => 'absolute-right-top',
5 => 'absolute-left',
6 => 'absolute-left-center',
7 => 'absolute-right-center',
8 => 'absolute-right',
9 => 'absolute-left-bottom',
10 => 'absolute-center-bottom',
11 => 'absolute-right-bottom',
12 => 'below',
);
return $areas[$area];
}
public function getDefaults() {
return $this->widget->getDefaults();
}
/**
* @param Data $params
* @param string $key
* @param integer $showOnMobileDefault
*
* @return array
*/
protected function getDisplayAttributes($params, $key, $showOnMobileDefault = 0) {
$attributes = array(
'class' => 'n2-ss-widget'
);
if (!$params->get($key . 'display-desktoplandscape', 1)) {
$attributes['data-hide-desktoplandscape'] = 1;
}
if (!$params->get($key . 'display-desktopportrait', 1)) {
$attributes['data-hide-desktopportrait'] = 1;
}
if (!$params->get($key . 'display-tabletlandscape', 1)) {
$attributes['data-hide-tabletlandscape'] = 1;
}
if (!$params->get($key . 'display-tabletportrait', 1)) {
$attributes['data-hide-tabletportrait'] = 1;
}
if (!$params->get($key . 'display-mobilelandscape', $showOnMobileDefault)) {
$attributes['data-hide-mobilelandscape'] = 1;
}
if (!$params->get($key . 'display-mobileportrait', $showOnMobileDefault)) {
$attributes['data-hide-mobileportrait'] = 1;
}
if ($params->get($key . 'display-hover', 0)) {
$attributes['class'] .= ' n2-ss-widget-display-hover';
}
$excludeSlides = $params->get($key . 'exclude-slides', '');
if (!empty($excludeSlides)) {
$attributes['data-exclude-slides'] = $excludeSlides;
}
return $attributes;
}
public static function getOrientationByPosition($mode, $area, $set = 'auto', $default = 'horizontal') {
if ($mode == 'advanced') {
if ($set == 'auto') {
return $default;
}
return $set;
}
if ($set != 'auto') {
return $set;
}
switch ($area) {
case '5':
case '6':
case '7':
case '8':
return 'vertical';
break;
}
return 'horizontal';
}
} SliderWidget.php 0000644 00000014237 15235664647 0007674 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Slider\Slider;
class SliderWidget {
/** @var AbstractWidgetFrontend[] */
private $enabledWidgets = array();
public $widgets = array();
public $left = array();
public $right = array();
/**
* @var WidgetPlacementSimple[]
*/
private $placements = array();
/**
* @var WidgetPlacementAdvanced
*/
private $placementAdvanced;
public $slider;
/**
* @param $slider Slider
*/
public function __construct($slider) {
$this->slider = $slider;
$params = $slider->params;
$this->placements['above'] = new WidgetPlacementSimple('above');
$this->placements['below'] = new WidgetPlacementSimple('below');
$this->placements['left'] = new WidgetPlacementSimple('left');
$this->placements['right'] = new WidgetPlacementSimple('right');
$this->placements['absolute-left'] = new WidgetPlacementSimple('absolute-left');
$this->placements['absolute-right'] = new WidgetPlacementSimple('absolute-right');
$this->placements['absolute-left-top'] = new WidgetPlacementSimple('absolute-left-top');
$this->placements['absolute-center-top'] = new WidgetPlacementSimple('absolute-center-top');
$this->placements['absolute-right-top'] = new WidgetPlacementSimple('absolute-right-top');
$this->placements['absolute-left-center'] = new WidgetPlacementSimple('absolute-left-center');
$this->placements['absolute-right-center'] = new WidgetPlacementSimple('absolute-right-center');
$this->placements['absolute-left-bottom'] = new WidgetPlacementSimple('absolute-left-bottom');
$this->placements['absolute-center-bottom'] = new WidgetPlacementSimple('absolute-center-bottom');
$this->placements['absolute-right-bottom'] = new WidgetPlacementSimple('absolute-right-bottom');
$this->placementAdvanced = new WidgetPlacementAdvanced('advanced');
$widgetGroups = WidgetGroupFactory::getGroups();
foreach ($widgetGroups as $groupName => $group) {
$isEnabled = false;
if ($params->has('widget-' . $group->getName() . '-enabled')) {
$isEnabled = $params->get('widget-' . $group->getName() . '-enabled', 0);
} else {
$oldValue = $params->get('widget' . $groupName);
if ($oldValue != 'disabled' && $oldValue != '') {
$isEnabled = true;
}
}
if ($isEnabled) {
$widget = $group->getWidget($params->get('widget' . $groupName));
if ($widget) {
$this->enabledWidgets[$groupName] = $widget->createFrontend($this, $params);
}
}
}
}
public function addToSimplePlacement($renderCallback, $placement, $stack, $offset = 0) {
$this->placements[$placement]->add($renderCallback, $stack, $offset);
}
public function addToAdvancedPlacement($renderCallback, $horizontalSide, $horizontalPosition, $horizontalUnit, $verticalSide, $verticalPosition, $verticalUnit) {
$this->placementAdvanced->add($renderCallback, $horizontalSide, $horizontalPosition, $horizontalUnit, $verticalSide, $verticalPosition, $verticalUnit);
}
/**
* @param $innerHTML
*
* @return mixed|string contains already escaped data
*/
public function wrapSlider($innerHTML) {
$insideAbsoluteHTML = '';
$insideAbsolutes = array(
'absolute-left-top',
'absolute-center-top',
'absolute-right-top',
'absolute-left-center',
'absolute-right-center',
'absolute-left-bottom',
'absolute-center-bottom',
'absolute-right-bottom'
);
foreach ($insideAbsolutes as $insideAbsolute) {
if (!$this->placements[$insideAbsolute]->empty()) {
$insideAbsoluteHTML .= $this->placements[$insideAbsolute]->render();
}
}
if (!$this->placementAdvanced->empty()) {
$insideAbsoluteHTML .= $this->placementAdvanced->render();
}
if (!empty($insideAbsoluteHTML)) {
$innerHTML = Html::tag('div', array(
'class' => 'n2-ss-slider-wrapper-inside'
), $innerHTML . $insideAbsoluteHTML);
}
$leftHTML = '';
if (!$this->placements['left']->empty()) {
$leftHTML = $this->placements['left']->render();
}
if (!$this->placements['absolute-left']->empty()) {
$leftHTML .= $this->placements['absolute-left']->render();
}
$rightHTML = '';
if (!$this->placements['right']->empty()) {
$rightHTML = $this->placements['right']->render();
}
if (!$this->placements['absolute-right']->empty()) {
$rightHTML .= $this->placements['absolute-right']->render();
}
if (!empty($leftHTML) || !empty($rightHTML)) {
$innerHTML = Html::tag('div', array(
'class' => 'n2-ss-slider-controls-side'
), $leftHTML . $innerHTML . $rightHTML);
}
$templateRows = array();
if (!$this->placements['above']->empty()) {
$innerHTML = $this->placements['above']->render() . $innerHTML;
$templateRows[] = 'auto';
}
$templateRows[] = '1fr';
if (!$this->placements['below']->empty()) {
$innerHTML .= $this->placements['below']->render();
$templateRows[] = 'auto';
}
if (count($templateRows) > 1) {
/**
* Full page responsive type need this grid to properly render
*/
$innerHTML = Html::tag('div', array(
'class' => 'n2-ss-slider-wrapper-outside',
'style' => 'grid-template-rows:' . implode(' ', $templateRows)
), $innerHTML);
}
return $innerHTML;
}
} WidgetGroupFactory.php 0000644 00000002571 15235664647 0011074 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\Framework\Pattern\SingletonTrait;
use Nextend\SmartSlider3\Widget\Group\AbstractWidgetGroup;
use Nextend\SmartSlider3\Widget\Group\Arrow;
use Nextend\SmartSlider3\Widget\Group\Autoplay;
use Nextend\SmartSlider3\Widget\Group\Bar;
use Nextend\SmartSlider3\Widget\Group\Bullet;
use Nextend\SmartSlider3\Widget\Group\Shadow;
use Nextend\SmartSlider3\Widget\Group\Thumbnail;
class WidgetGroupFactory {
use SingletonTrait, PluggableTrait;
/** @var AbstractWidgetGroup[] */
private static $groups = array();
protected function init() {
new Arrow();
new Autoplay();
new Bar();
new Bullet();
new Shadow();
new Thumbnail();
$this->makePluggable('SliderWidgetGroup');
}
/**
* @param AbstractWidgetGroup $group
*/
public static function addGroup($group) {
self::$groups[$group->getName()] = $group;
}
/**
* @return AbstractWidgetGroup[]
*/
public static function getGroups() {
return self::$groups;
}
/**
* @param $name
*
* @return AbstractWidgetGroup
*/
public static function getGroup($name) {
return self::$groups[$name];
}
}
WidgetGroupFactory::getInstance(); WidgetPlacement.php 0000644 00000000454 15235664647 0010356 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget;
class WidgetPlacement {
protected $name;
protected $items = array();
public function __construct($name) {
$this->name = $name;
}
public function empty() {
return empty($this->items);
}
} WidgetPlacementAdvanced.php 0000644 00000005501 15235664647 0012002 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget;
use Nextend\Framework\View\Html;
class WidgetPlacementAdvanced extends WidgetPlacement {
protected $items = array();
protected $variables = array();
public function add($renderCallback, $horizontalSide, $horizontalPosition, $horizontalUnit, $verticalSide, $verticalPosition, $verticalUnit) {
$attributes = array(
'style' => ''
);
$transforms = array();
if (is_numeric($horizontalPosition)) {
$attributes['style'] .= $horizontalSide . ':' . $horizontalPosition . $horizontalUnit . ';';
} else {
$attributes['style'] .= $horizontalSide . ':0;';
$transforms[] = 'translateX(' . $this->toCSSCalc($horizontalSide == 'left' ? 1 : -1, $horizontalPosition) . ')';
}
if (is_numeric($verticalPosition)) {
$attributes['style'] .= $verticalSide . ':' . $verticalPosition . $verticalUnit . ';';
} else {
$attributes['style'] .= $verticalSide . ':0;';
$transforms[] = 'translateY(' . $this->toCSSCalc($verticalSide == 'top' ? 1 : -1, $verticalPosition) . ')';
}
if (!empty($transforms)) {
$attributes['style'] .= 'transform:' . implode(' ', $transforms) . ';';
}
$this->items[] = array(
'renderCallback' => $renderCallback,
'attributes' => $attributes
);
}
public function render() {
$out = '';
foreach ($this->items as $item) {
$out .= call_user_func($item['renderCallback'], $item['attributes']);
}
if (!empty($out)) {
return Html::tag('div', array(
'class' => 'n2-ss-slider-controls n2-ss-slider-controls-' . $this->name,
'data-variables' => implode(',', array_unique($this->variables))
), $out);
}
return '';
}
private function toCSSCalc($modifier, $expression) {
// Remove whitespaces
$expression = preg_replace('/\s+/', '', $expression);
// take care of minus symbol on single number
$expression = preg_replace('/([+\-*\/])[\-]/', '$1[minus]', $expression);
$expression = preg_replace('/[+\-*\/]/', ' $0 ', $expression);
$expression = str_replace('[minus]', '-1 * ', $expression);
preg_match_all('/[a-zA-Z][a-zA-Z0-9]*/', $expression, $matches);
foreach ($matches as $match) {
if (!empty($match)) {
$this->variables = array_merge($this->variables, $match);
}
}
$expression = preg_replace('/[a-zA-Z][a-zA-Z0-9]*/', 'var(--$0, 0)', $expression);
return 'calc(' . $modifier . 'px * (' . $expression . '))';
}
} WidgetPlacementSimple.php 0000644 00000002265 15235664647 0011532 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget;
use Nextend\Framework\View\Html;
class WidgetPlacementSimple extends WidgetPlacement {
public function add($renderCallback, $stack, $offset = 0) {
$this->items[] = array(
'stack' => $stack,
'renderCallback' => $renderCallback,
'offset' => $offset
);
}
public function render() {
usort($this->items, function ($a, $b) {
if ($a['stack'] == $b['stack']) {
return 0;
}
return ($a['stack'] < $b['stack']) ? -1 : 1;
});
$out = '';
foreach ($this->items as $item) {
$attributes = array();
if ($item['offset'] != 0) {
$attributes['style'] = '--widget-offset:' . $item['offset'] . 'px;';
}
$out .= call_user_func($item['renderCallback'], $attributes);
}
if (!empty($out)) {
return Html::tag('div', array(
'class' => 'n2-ss-slider-controls n2-ss-slider-controls-' . $this->name
), $out);
}
return '';
}
} Thumbnail/Basic/ThumbnailBasic.php 0000644 00000024021 15235664647 0013127 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Thumbnail\Basic;
use Nextend\Framework\Form\Element\Font;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Form\Element\Text\FieldImage;
use Nextend\Framework\Form\Element\Text\Number;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\AbstractWidget;
class ThumbnailBasic extends AbstractWidget {
protected $key = 'widget-thumbnail-';
protected $defaults = array(
'widget-thumbnail-position-mode' => 'simple',
'widget-thumbnail-position-area' => 12,
'widget-thumbnail-action' => 'click',
'widget-thumbnail-style-bar' => '{"data":[{"backgroundcolor":"242424ff","padding":"3|*|3|*|3|*|3|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":""}]}',
'widget-thumbnail-style-slides' => '{"data":[{"backgroundcolor":"00000000","padding":"0|*|0|*|0|*|0|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|ffffff00","borderradius":"0","opacity":"40","extra":"margin: 3px;\ntransition: all 0.4s;"},{"border":"0|*|solid|*|ffffffcc","opacity":"100","extra":""}]}',
'widget-thumbnail-arrow' => 1,
'widget-thumbnail-arrow-image' => '',
'widget-thumbnail-arrow-width' => 26,
'widget-thumbnail-arrow-offset' => 0,
'widget-thumbnail-arrow-prev-alt' => 'previous arrow',
'widget-thumbnail-arrow-next-alt' => 'next arrow',
'widget-thumbnail-title-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"3|*|10|*|3|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":"bottom: 0;\nleft: 0;"}]}',
'widget-thumbnail-title' => 0,
'widget-thumbnail-title-font' => '{"data":[{"color":"ffffffff","size":"12||px","tshadow":"0|*|0|*|0|*|000000ab","afont":"Montserrat","lineheight":"1.2","bold":0,"italic":0,"underline":0,"align":"left"},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-thumbnail-description' => 0,
'widget-thumbnail-description-font' => '{"data":[{"color":"ffffffff","size":"12||px","tshadow":"0|*|0|*|0|*|000000ab","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":0,"underline":0,"align":"left"},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-thumbnail-caption-placement' => 'overlay',
'widget-thumbnail-caption-size' => 100,
'widget-thumbnail-group' => 1,
'widget-thumbnail-orientation' => 'auto',
'widget-thumbnail-size' => '100%',
'widget-thumbnail-show-image' => 1,
'widget-thumbnail-width' => 100,
'widget-thumbnail-height' => 60,
'widget-thumbnail-align-content' => 'start'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-thumbnail-default-row-1');
new WidgetPosition($row1, 'widget-thumbnail-position', n2_('Position'));
new Select($row1, 'widget-thumbnail-action', n2_('Action'), '', array(
'options' => array(
'click' => n2_('Click'),
'mouseenter' => n2_('Hover')
)
));
new Select($row1, 'widget-thumbnail-align-content', n2_('Align thumbnails'), '', array(
'options' => array(
'start' => n2_('Start'),
'center' => n2_('Center'),
'end' => n2_('End'),
'space-between' => n2_('Space between'),
'space-around' => n2_('Space around')
)
));
new Style($row1, 'widget-thumbnail-style-bar', n2_('Bar'), '', array(
'mode' => 'simple',
'style2' => 'sliderwidget-thumbnail-style-slides',
'preview' => 'SmartSliderAdminWidgetThumbnailBasic'
));
new Style($row1, 'widget-thumbnail-style-slides', n2_('Thumbnail'), '', array(
'mode' => 'dot',
'style2' => 'sliderwidget-thumbnail-style-bar',
'preview' => 'SmartSliderAdminWidgetThumbnailBasic'
));
$rowCaption = new FieldsetRow($container, 'widget-thumbnail-default-row-caption');
new Style($rowCaption, 'widget-thumbnail-title-style', n2_('Caption'), '', array(
'mode' => 'simple',
'post' => 'break',
'font' => 'sliderwidget-thumbnail-title-font',
'preview' => 'SmartSliderAdminWidgetThumbnailBasic'
));
new OnOff($rowCaption, 'widget-thumbnail-title', n2_('Title'), '', array(
'relatedFieldsOn' => array(
'sliderwidget-thumbnail-title-font'
)
));
new Font($rowCaption, 'widget-thumbnail-title-font', '', '', array(
'mode' => 'simple',
'style' => 'sliderwidget-thumbnail-title-style',
'preview' => 'SmartSliderAdminWidgetThumbnailBasic'
));
new OnOff($rowCaption, 'widget-thumbnail-description', n2_('Description'), '', array(
'relatedFieldsOn' => array(
'sliderwidget-thumbnail-description-font'
)
));
new Font($rowCaption, 'widget-thumbnail-description-font', '', '', array(
'mode' => 'simple',
'style' => 'sliderwidget-thumbnail-title-style',
'preview' => 'SmartSliderAdminWidgetThumbnailBasic'
));
new Select($rowCaption, 'widget-thumbnail-caption-placement', n2_('Placement'), '', array(
'options' => array(
'before' => n2_('Before'),
'overlay' => n2_('Overlay'),
'after' => n2_('After')
)
));
new Number($rowCaption, 'widget-thumbnail-caption-size', n2_('Size'), '', array(
'wide' => 5,
'unit' => 'px',
'tipLabel' => n2_('Size'),
'tipDescription' => n2_('The height (horizontal orientation) or width (vertical orientation) of the caption container.')
));
$rowArrow = new FieldsetRow($container, 'widget-thumbnail-default-row-arrow');
new OnOff($rowArrow, 'widget-thumbnail-arrow', n2_('Arrow'), 1, array(
'relatedFieldsOn' => array(
'sliderwidget-thumbnail-arrow-image',
'sliderwidget-thumbnail-arrow-width',
'sliderwidget-thumbnail-arrow-offset',
'sliderwidget-thumbnail-arrow-prev-alt',
'sliderwidget-thumbnail-arrow-next-alt'
)
));
new Number($rowArrow, 'widget-thumbnail-arrow-width', n2_('Size'), 26, array(
'wide' => 4,
'unit' => 'px'
));
new Number($rowArrow, 'widget-thumbnail-arrow-offset', n2_('Offset'), 0, array(
'wide' => 4,
'unit' => 'px'
));
new Text($rowArrow, 'widget-thumbnail-arrow-prev-alt', n2_('Previous alt tag'), 'previous arrow', array(
'style' => 'width:100px;'
));
new Text($rowArrow, 'widget-thumbnail-arrow-next-alt', n2_('Next alt tag'), 'next arrow', array(
'style' => 'width:100px;'
));
new FieldImage($rowArrow, 'widget-thumbnail-arrow-image', n2_('Next arrow image'), '', array(
'tipLabel' => n2_('Next arrow image'),
'tipDescription' => n2_('The previous arrow image will be mirrored.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1857-thumbnails#arrow'
));
$row4 = new FieldsetRow($container, 'widget-thumbnail-default-row-4');
new Number($row4, 'widget-thumbnail-group', n2_('Group by'), '', array(
'unit' => n2_x('thumbnails', 'Unit'),
'wide' => 3,
'tipLabel' => n2_('Group by'),
'tipDescription' => n2_('You can break your thumbnails into rows or columns.')
));
new Select($row4, 'widget-thumbnail-orientation', n2_('Orientation'), '', array(
'options' => array(
'auto' => n2_('Auto'),
'horizontal' => n2_('Horizontal'),
'vertical' => n2_('Vertical')
)
));
new Text($row4, 'widget-thumbnail-size', n2_('Size'), '', array(
'style' => 'width:150px;',
'tipLabel' => n2_('Size'),
'tipDescription' => n2_('The height (horizontal orientation) or width (vertical orientation) of the thumbnail container in px or %.')
));
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'style-bar'));
$export->addVisual($params->get($this->key . 'style-slides'));
$export->addVisual($params->get($this->key . 'title-style'));
$export->addVisual($params->get($this->key . 'title-font'));
$export->addVisual($params->get($this->key . 'description-font'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'style-bar', $import->fixSection($params->get($this->key . 'style-bar', '')));
$params->set($this->key . 'style-slides', $import->fixSection($params->get($this->key . 'style-slides', '')));
$params->set($this->key . 'title-style', $import->fixSection($params->get($this->key . 'title-style', '')));
$params->set($this->key . 'title-font', $import->fixSection($params->get($this->key . 'title-font', '')));
$params->set($this->key . 'description-font', $import->fixSection($params->get($this->key . 'description-font', '')));
}
} Thumbnail/Basic/ThumbnailBasicFrontend.php 0000644 00000033551 15235664647 0014637 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Thumbnail\Basic;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\FastImageSize\FastImageSize;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Misc\Base64;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class ThumbnailBasicFrontend extends AbstractWidgetFrontend {
private static $thumbnailTypes = array(
'videoDark' => '<svg class="n2-thumbnail-dot-type" xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48"><circle cx="24" cy="24" r="24" fill="#000" opacity=".6"/><path fill="#FFF" d="M19.8 32c-.124 0-.247-.028-.36-.08-.264-.116-.436-.375-.44-.664V16.744c.005-.29.176-.55.44-.666.273-.126.592-.1.84.07l10.4 7.257c.2.132.32.355.32.595s-.12.463-.32.595l-10.4 7.256c-.14.1-.31.15-.48.15z"/></svg>'
);
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
$showThumbnail = intval($params->get($this->key . 'show-image'));
$showTitle = intval($params->get($this->key . 'title'));
$showDescription = intval($params->get($this->key . 'description'));
if (!$showThumbnail && !$showTitle && !$showDescription) {
// Nothing to show
return '';
}
$parameters = array(
'action' => $params->get($this->key . 'action'),
'minimumThumbnailCount' => max(1, intval($params->get($this->key . 'minimum-thumbnail-count')))
);
$displayAttributes = $this->getDisplayAttributes($params, $this->key);
$barStyle = $slider->addStyle($params->get($this->key . 'style-bar'), 'simple');
$slideStyle = $slider->addStyle($params->get($this->key . 'style-slides'), 'dot');
$width = intval($slider->params->get($this->key . 'width', 100));
$height = intval($slider->params->get($this->key . 'height', 60));
$css = '';
if ($showThumbnail) {
$css .= 'div#' . $this->slider->elementId . ' .n2-thumbnail-dot img{width:' . $width . 'px;height:' . $height . 'px}';
} else {
$css .= 'div#' . $this->slider->elementId . ' .n2-thumbnail-dot{min-width:' . $width . 'px;min-height:' . $height . 'px}';
}
if (!empty($css)) {
$this->slider->addDeviceCSS('all', $css);
}
$tabletWidth = intval($slider->params->get($this->key . 'tablet-width', $width));
$tabletHeight = intval($slider->params->get($this->key . 'tablet-height', $height));
if ($tabletWidth !== $width || $tabletHeight !== $height) {
$css = '';
if ($showThumbnail) {
$css .= 'div#' . $this->slider->elementId . ' .n2-thumbnail-dot img{width:' . $tabletWidth . 'px;height:' . $tabletHeight . 'px}';
} else {
$css .= 'div#' . $this->slider->elementId . ' .n2-thumbnail-dot{min-width:' . $tabletWidth . 'px;min-height:' . $tabletHeight . 'px}';
}
if (!empty($css)) {
$this->slider->addDeviceCSS('tabletportrait', $css);
$this->slider->addDeviceCSS('tabletlandscape', $css);
}
}
$mobileWidth = intval($slider->params->get($this->key . 'mobile-width', $width));
$mobileHeight = intval($slider->params->get($this->key . 'mobile-height', $height));
if ($mobileWidth !== $width || $mobileHeight !== $height) {
$css = '';
if ($showThumbnail) {
$css .= 'div#' . $this->slider->elementId . ' .n2-thumbnail-dot img{width:' . $mobileWidth . 'px;height:' . $mobileHeight . 'px}';
} else {
$css .= 'div#' . $this->slider->elementId . ' .n2-thumbnail-dot{min-width:' . $mobileWidth . 'px;min-height:' . $mobileHeight . 'px}';
}
if (!empty($css)) {
$this->slider->addDeviceCSS('mobileportrait', $css);
$this->slider->addDeviceCSS('mobilelandscape', $css);
}
}
$captionPlacement = $slider->params->get($this->key . 'caption-placement', 'overlay');
if (!$showThumbnail) {
$captionPlacement = 'before';
}
if (!$showTitle && !$showDescription) {
$captionPlacement = 'overlay';
}
$captionSize = intval($slider->params->get($this->key . 'caption-size', 100));
$orientation = $params->get($this->key . 'orientation');
$orientation = $this->getOrientationByPosition($params->get($this->key . 'position-mode'), $params->get($this->key . 'position-area'), $orientation, 'vertical');
$captionExtraStyle = '';
switch ($captionPlacement) {
case 'before':
case 'after':
switch ($orientation) {
case 'vertical':
$captionExtraStyle .= "width: " . $captionSize . "px";
break;
default:
$captionExtraStyle .= "height: " . $captionSize . "px";
}
break;
}
if ($orientation == 'vertical') {
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-thumbnail-vertical.min.js', 'w-thumbnail-vertical');
$slider->features->addInitCallback('new _N2.SmartSliderWidgetThumbnailDefaultVertical(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetThumbnailDefaultVertical');
} else {
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-thumbnail-horizontal.min.js', 'w-thumbnail-horizontal');
$slider->features->addInitCallback('new _N2.SmartSliderWidgetThumbnailDefaultHorizontal(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetThumbnailDefaultHorizontal');
}
$group = max(1, intval($params->get($this->key . 'group')));
$style = '';
$size = $params->get($this->key . 'size');
if (is_numeric($size)) {
$size .= '%';
}
if ($orientation == 'horizontal') {
if (substr($size, -1) == '%' || substr($size, -2) == 'px') {
$style .= 'width:' . $size . ';';
if (substr($size, -1) == '%') {
$attributes['data-width-percent'] = substr($size, 0, -1);
}
}
$scrollerStyle = 'grid-template-rows:repeat(' . $group . ', 1fr)';
} else {
if (substr($size, -1) == '%' || substr($size, -2) == 'px') {
$style .= 'height:' . $size . ';';
}
$scrollerStyle = 'grid-template-columns:repeat(' . $group . ', 1fr)';
}
$previous = $next = '';
$nextSizeAttributes = array();
$previousSizeAttributes = array();
$showArrow = intval($slider->params->get($this->key . 'arrow', 1));
if ($showArrow) {
$arrowImagePrevious = $arrowImageNext = ResourceTranslator::toUrl($slider->params->get($this->key . 'arrow-image', ''));
$arrowWidth = intval($slider->params->get($this->key . 'arrow-width', 26));
$commonStyle = '';
if (!empty($arrowWidth)) {
$commonStyle = 'width:' . $arrowWidth . 'px;';
}
$previousStyle = $nextStyle = $commonStyle;
if (empty($arrowImagePrevious)) {
$image = self::getAssetsPath() . '/thumbnail-up-arrow.svg';
FastImageSize::initAttributes($image, $previousSizeAttributes);
$arrowImagePrevious = 'data:image/svg+xml;base64,' . Base64::encode(Filesystem::readFile($image));
if ($orientation === 'horizontal') {
$previousStyle .= 'transform:rotateZ(-90deg);';
}
} else {
FastImageSize::initAttributes(ResourceTranslator::urlToResource($arrowImagePrevious), $previousSizeAttributes);
switch ($orientation) {
case 'vertical':
$previousStyle .= 'transform:rotateY(180deg) rotateX(180deg);';
break;
default:
$previousStyle .= 'transform:rotateZ(180deg);';
}
}
if (empty($arrowImageNext)) {
$image = self::getAssetsPath() . '/thumbnail-down-arrow.svg';
FastImageSize::initAttributes($image, $nextSizeAttributes);
$arrowImageNext = 'data:image/svg+xml;base64,' . Base64::encode(Filesystem::readFile($image));
if ($orientation === 'horizontal') {
$nextStyle .= 'transform:rotateZ(-90deg);';
}
} else {
$nextStyle .= 'transform:none;';
FastImageSize::initAttributes(ResourceTranslator::urlToResource($arrowImageNext), $nextSizeAttributes);
}
$previous = Html::tag('div', array(
'class' => 'nextend-thumbnail-button nextend-thumbnail-previous'
), Html::image($arrowImagePrevious, $slider->params->get($this->key . 'arrow-prev-alt', 'previous arrow'), $previousSizeAttributes + Html::addExcludeLazyLoadAttributes(array(
'style' => $previousStyle,
'loading' => 'lazy'
))));
$next = Html::tag('div', array(
'class' => 'nextend-thumbnail-button nextend-thumbnail-next'
), Html::image($arrowImageNext, $slider->params->get($this->key . 'arrow-next-alt', 'next arrow'), $nextSizeAttributes + Html::addExcludeLazyLoadAttributes(array(
'style' => $nextStyle,
'loading' => 'lazy'
))));
}
$captionStyle = '';
if ($showTitle || $showDescription) {
$captionStyle = $slider->addStyle($params->get($this->key . 'title-style'), 'simple');
}
$titleFont = '';
if ($showTitle) {
$titleFont = $slider->addFont($params->get($this->key . 'title-font'), 'simple');
}
$descriptionFont = '';
if ($showDescription) {
$descriptionFont = $slider->addFont($params->get($this->key . 'description-font'), 'simple');
}
$dots = array();
$slides = $slider->getSlides();
foreach ($slides as $slide) {
$dotHTML = array();
if ($showThumbnail) {
$dotHTML[] = $slide->renderThumbnailImage($width, $height, array(
'alt' => $slide->getThumbnailAltDynamic()
));
$thumbnailType = $slide->getThumbnailType();
if (isset(self::$thumbnailTypes[$thumbnailType])) {
$dotHTML[] = self::$thumbnailTypes[$thumbnailType];
}
}
if ($showTitle || $showDescription) {
$captionHTML = '';
if ($showTitle) {
$title = $slide->getTitle();
if (!empty($title)) {
$captionHTML .= '<div class="' . $titleFont . '">' . $title . '</div>';
}
}
if ($showDescription) {
$description = $slide->getDescription();
if (!empty($description)) {
$captionHTML .= '<div class="' . $descriptionFont . '">' . $description . '</div>';
}
}
if (!empty($captionHTML)) {
$dotHTML[] = Html::tag('div', array(
'class' => $captionStyle . ' n2-ss-caption n2-ow n2-caption-' . $captionPlacement,
'style' => $captionExtraStyle
), $captionHTML);
}
}
$dots[] = Html::tag('div', $slide->showOnAttributes + array(
'class' => 'n2-thumbnail-dot ' . $slideStyle,
'data-slide-public-id' => $slide->getPublicID(),
'role' => 'button',
'aria-label' => $slide->getTitle(),
'tabindex' => '0'
), implode('', $dotHTML));
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'class' => 'nextend-thumbnail nextend-thumbnail-default nextend-thumbnail-' . $orientation . ' n2-ow-all',
'data-has-next' => 0,
'data-has-previous' => 0,
'style' => $style
)), Html::tag('div', array(
'class' => 'nextend-thumbnail-inner ' . $barStyle
), Html::tag('div', array(
'class' => 'nextend-thumbnail-scroller n2-align-content-' . $params->get('widget-thumbnail-align-content'),
'style' => $scrollerStyle
), implode('', $dots))) . $previous . $next);
}
protected function translateArea($area) {
if ($area == 5) {
return 'left';
} else if ($area == 8) {
return 'right';
}
return parent::translateArea($area);
}
} Shadow/AbstractWidgetShadow.php 0000644 00000000334 15235664647 0012601 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Shadow;
use Nextend\SmartSlider3\Widget\AbstractWidget;
abstract class AbstractWidgetShadow extends AbstractWidget {
protected $key = 'widget-shadow-';
} Shadow/ShadowImage/ShadowImage.php 0000644 00000002775 15235664647 0013117 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Shadow\ShadowImage;
use Nextend\Framework\Form\Element\Radio\ImageListFromFolder;
use Nextend\Framework\Form\Element\Text\FieldImage;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Widget\Shadow\AbstractWidgetShadow;
class ShadowImage extends AbstractWidgetShadow {
protected $defaults = array(
'widget-shadow-position-mode' => 'simple',
'widget-shadow-position-area' => 12,
'widget-shadow-position-stack' => 3,
'widget-shadow-shadow-image' => '',
'widget-shadow-shadow' => '$ss$/plugins/widgetshadow/shadow/shadow/shadow/dark.png'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-shadow-row-1');
$fieldShadow = new ImageListFromFolder($row1, 'widget-shadow-shadow', n2_('Shadow'), '', array(
'folder' => self::getAssetsPath() . '/shadow/',
'width' => 582,
'column' => 1,
'hasDisabled' => false
));
new FieldImage($fieldShadow, 'widget-shadow-shadow-image', n2_('Custom'), '');
}
public function prepareExport($export, $params) {
$export->addImage($params->get($this->key . 'shadow-image', ''));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'shadow-image', $import->fixImage($params->get($this->key . 'shadow-image', '')));
}
} Shadow/ShadowImage/ShadowImageFrontend.php 0000644 00000004210 15235664647 0014601 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Shadow\ShadowImage;
use Nextend\Framework\FastImageSize\FastImageSize;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class ShadowImageFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
$shadow = $params->get($this->key . 'shadow-image');
if (empty($shadow)) {
$shadow = $params->get($this->key . 'shadow');
if ($shadow == -1) {
$shadow = null;
} else {
$shadow = self::getAssetsUri() . '/shadow/' . basename($shadow);
}
}
if (!$shadow) {
return '';
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
$displayAttributes = $this->getDisplayAttributes($params, $this->key);
$slider->features->addInitCallback("new _N2.SmartSliderWidget(this, 'shadow', '.nextend-shadow');");
$slider->sliderType->addJSDependency('SmartSliderWidget');
$sizeAttributes = array();
FastImageSize::initAttributes(ResourceTranslator::urlToResource($shadow), $sizeAttributes);
return Html::tag('div', Html::mergeAttributes($displayAttributes, array(
'class' => "nextend-shadow n2-ow-all"
)), Html::image(ResourceTranslator::toUrl($shadow), 'Shadow', $sizeAttributes + Html::addExcludeLazyLoadAttributes(array(
'style' => 'display: block; width:100%;max-width:none;',
'class' => 'nextend-shadow-image',
'loading' => 'lazy'
))));
}
} Group/AbstractWidgetGroup.php 0000644 00000007670 15235664647 0012331 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Group;
use Nextend\Framework\Form\ContainerInterface;
use Nextend\Framework\Form\Element\CheckboxOnOff;
use Nextend\Framework\Form\Element\Group\GroupCheckboxOnOff;
use Nextend\Framework\Form\Form;
use Nextend\Framework\Pattern\OrderableTrait;
use Nextend\SmartSlider3\Widget\AbstractWidget;
use Nextend\SmartSlider3\Widget\WidgetGroupFactory;
abstract class AbstractWidgetGroup {
use OrderableTrait;
/** @var AbstractWidget[] */
private $widgets = array();
protected $showOnMobileDefault = 0;
public function __construct() {
WidgetGroupFactory::addGroup($this);
}
public abstract function getName();
public abstract function getLabel();
/**
* @param $name
* @param AbstractWidget $widget
*/
public function addWidget($name, $widget) {
$this->widgets[$name] = $widget;
}
/**
* @return AbstractWidget[]
*/
public function getWidgets() {
return $this->widgets;
}
/**
* @param $name
*
* @return AbstractWidget
*/
public function getWidget($name) {
return $this->widgets[$name];
}
/**
* @param ContainerInterface $container
*/
abstract public function renderFields($container);
/**
* @param Form $form
*/
protected function compatibility($form) {
$name = $this->getName();
/**
* Convert to the new control form with the enable field
*/
if (!$form->has('widget-' . $name . '-enabled')) {
if ($form->get('widget' . $name, 'disabled') !== 'disabled') {
$form->set('widget-' . $name . '-enabled', 1);
} else {
$form->set('widget-' . $name . '-enabled', 0);
}
}
$widgets = $this->getWidgets();
$widgetPreset = $form->get('widget' . $name);
if (!isset($widgets[$widgetPreset])) {
$widgetPreset = key($widgets);
$form->set('widget' . $name, $widgetPreset);
}
$widget = $widgets[$widgetPreset];
$form->fillDefault($widget->getDefaults());
}
protected function addHideOnFeature($key, $row) {
$groupShowOn = new GroupCheckboxOnOff($row, $key, n2_('Hide on'));
new CheckboxOnOff($groupShowOn, $key . 'mobileportrait', false, 'ssi_16 ssi_16--mobileportrait', $this->showOnMobileDefault, array(
'invert' => true,
'checkboxTip' => n2_('Mobile')
));
new CheckboxOnOff($groupShowOn, $key . 'mobilelandscape', false, 'ssi_16 ssi_16--mobileportraitlarge', $this->showOnMobileDefault, array(
'invert' => true,
'checkboxTip' => n2_('Large mobile'),
'rowClass' => 'n2-slider-settings-require--mobilelandscape'
));
new CheckboxOnOff($groupShowOn, $key . 'tabletportrait', false, 'ssi_16 ssi_16--tabletportrait', 1, array(
'invert' => true,
'checkboxTip' => n2_('Tablet')
));
new CheckboxOnOff($groupShowOn, $key . 'tabletlandscape', false, 'ssi_16 ssi_16--tabletportraitlarge', 1, array(
'invert' => true,
'checkboxTip' => n2_('Large tablet'),
'rowClass' => 'n2-slider-settings-require--tabletlandscape'
));
new CheckboxOnOff($groupShowOn, $key . 'desktopportrait', false, 'ssi_16 ssi_16--desktopportrait', 1, array(
'invert' => true,
'checkboxTip' => n2_('Desktop')
));
new CheckboxOnOff($groupShowOn, $key . 'desktoplandscape', false, 'ssi_16 ssi_16--desktoplandscape', 1, array(
'invert' => true,
'checkboxTip' => n2_('Large desktop'),
'rowClass' => 'n2-slider-settings-require--desktoplandscape'
));
}
} Group/Arrow.php 0000644 00000006150 15235664647 0007467 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Group;
use Nextend\Framework\Form\Container\ContainerTab;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Arrow\ArrowImage\ArrowImage;
class Arrow extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 1;
public function __construct() {
parent::__construct();
new ArrowImage($this, 'imageSmallRectangle', array(
'widget-arrow-desktop-image-width' => 26,
'widget-arrow-tablet-image-width' => 26,
'widget-arrow-previous' => '$ss$/plugins/widgetarrow/image/image/previous/full.svg',
'widget-arrow-next' => '$ss$/plugins/widgetarrow/image/image/next/full.svg',
'widget-arrow-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"2|*|2|*|2|*|2|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":""},{"backgroundcolor":"FF9139FF"}]}'
));
new ArrowImage($this, 'imageEmpty', array(
'widget-arrow-previous' => '$ss$/plugins/widgetarrow/image/image/previous/thin-horizontal.svg',
'widget-arrow-next' => '$ss$/plugins/widgetarrow/image/image/next/thin-horizontal.svg',
'widget-arrow-style' => ''
));
$this->makePluggable('SliderWidgetArrow');
}
public function getName() {
return 'arrow';
}
public function getLabel() {
return n2_('Arrows');
}
/**
* @param ContainerTab $container
*/
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
/**
* Used for field removal: /controls/widget-arrow
*/
$table = new ContainerTable($container, 'widget-arrow', n2_('Arrow'));
new OnOff($table->getFieldsetLabel(), 'widget-arrow-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widget-arrow'
)
));
$row1 = $table->createRow('widget-arrow-1');
$ajaxUrl = $form->createAjaxUrl(array("slider/renderwidgetarrow"));
new ControlTypePicker($row1, 'widgetarrow', $table, $ajaxUrl, $this, 'imageEmpty');
$row2 = $table->createRow('widget-arrow-2');
new OnOff($row2, 'widget-arrow-display-hover', n2_('Shows on hover'), 0);
$this->addHideOnFeature('widget-arrow-display-', $row2);
new Text($row2, 'widget-arrow-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1782-arrow#hide-on-slides'
));
}
} Group/Autoplay.php 0000644 00000010325 15235664647 0010172 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Group;
use Nextend\Framework\Data\Data;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Parser\Common;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Autoplay\AutoplayImage\AutoplayImage;
class Autoplay extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 3;
protected $showOnMobileDefault = 1;
public function __construct() {
parent::__construct();
new AutoplayImage($this, 'image');
$this->makePluggable('SliderWidgetAutoplay');
}
public function getName() {
return 'autoplay';
}
public function getLabel() {
return n2_('Autoplay');
}
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
$autoplayFinish = $form->get('autoplayfinish');
if (!$form->has('autoplayLoop') && !empty($autoplayFinish)) {
$this->upgradeData($form);
}
$table = new ContainerTable($container, 'widget-autoplay', n2_('Button'));
new OnOff($table->getFieldsetLabel(), 'widget-autoplay-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widget-autoplay'
)
));
$row1 = $table->createRow('widget-bullet-1');
$url = $form->createAjaxUrl(array("slider/renderwidgetautoplay"));
new ControlTypePicker($row1, 'widgetautoplay', $table, $url, $this, 'image');
$row2 = $table->createRow('widget-bullet-2');
new OnOff($row2, 'widget-autoplay-display-hover', n2_('Shows on hover'), 0);
$this->addHideOnFeature('widget-autoplay-display-', $row2);
new Text($row2, 'widget-autoplay-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1807-slider-settings-autoplay#hide-on-slides'
));
}
/**
* For compatibility with legacy autoplay values.
*
* @param Data $data
*/
protected function upgradeData($data) {
if (!$data->has('autoplayLoop')) {
list($interval, $intervalModifier, $intervalSlide) = (array)Common::parse($data->get('autoplayfinish', '1|*|loop|*|current'));
if ($interval <= 0) {
// 0|*|slide|*|current -> In old versions it brought to the Next slide.
if ($interval <= 0 && $intervalModifier === 'slide' && $intervalSlide === 'next') {
$data->set('autoplayfinish', '1|*|slide|*|current');
$data->set('autoplayLoop', 0);
}
// 0|*|loop/slide/slideindex|*|current -> Infinite loop
// 0|*|loop|*|next -> Infinite loop
if ($intervalSlide === 'current' || ($intervalModifier === 'loop' && $intervalSlide === 'next')) {
$data->set('autoplayfinish', '1|*|loop|*|current');
$data->set('autoplayLoop', 1);
}
// 0|*|slideindex|*|next -> In old versions it always brought to the 2nd slide.
if ($intervalModifier === 'slideindex' && $intervalSlide === 'next') {
$data->set('autoplayfinish', '2|*|slideindex|*|current');
$data->set('autoplayLoop', '0');
}
} else {
//next is not allowed for "slide" and "slideindex" interval modifiers
if ($intervalModifier === 'slide' || $intervalModifier === 'slideindex') {
$data->set('autoplayfinish', $interval . '|*|' . $intervalModifier . '|*|current');
}
// turn off Loop, and work with the original settings
$data->set('autoplayLoop', '0');
}
}
}
} Group/Bar.php 0000644 00000005063 15235664647 0007103 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Group;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Bar\BarHorizontal\BarHorizontal;
class Bar extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 5;
protected $showOnMobileDefault = 1;
public function __construct() {
parent::__construct();
new BarHorizontal($this, 'horizontal');
new BarHorizontal($this, 'horizontalFull', array(
'widget-bar-position-offset' => 0,
'widget-bar-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"20|*|20|*|20|*|20|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":""}]}',
'widget-bar-full-width' => 1,
'widget-bar-align' => 'left'
));
$this->makePluggable('SliderWidgetBar');
}
public function getName() {
return 'bar';
}
public function getLabel() {
return n2_('Text bar');
}
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
/**
* Used for field removal: /controls/widget-bar
*/
$table = new ContainerTable($container, 'widget-bar', n2_('Text bar'));
new OnOff($table->getFieldsetLabel(), 'widget-bar-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widget-bar'
)
));
$row1 = $table->createRow('widget-bar-1');
$ajaxUrl = $form->createAjaxUrl(array("slider/renderwidgetbar"));
new ControlTypePicker($row1, 'widgetbar', $table, $ajaxUrl, $this, 'horizontal');
$row2 = $table->createRow('widget-bar-2');
new OnOff($row2, 'widget-bar-display-hover', n2_('Shows on hover'), 0);
$this->addHideOnFeature('widget-bar-display-', $row2);
new Text($row2, 'widget-bar-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1856-text-bar#hide-on-slides'
));
}
} Group/Bullet.php 0000644 00000007705 15235664647 0007633 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Group;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Bullet\BulletTransition\BulletTransition;
class Bullet extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 2;
protected $showOnMobileDefault = 1;
public function __construct() {
parent::__construct();
new BulletTransition($this, 'transition');
$this->makePluggable('SliderWidgetBullet');
}
public function getName() {
return 'bullet';
}
public function getLabel() {
return n2_('Bullets');
}
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
/**
* Used for field removal: /controls/widget-bullet
*/
$table = new ContainerTable($container, 'widget-bullet', n2_('Bullets'));
new OnOff($table->getFieldsetLabel(), 'widget-bullet-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widget-bullet'
)
));
$row1 = $table->createRow('widget-bullet-1');
$url = $form->createAjaxUrl(array("slider/renderwidgetbullet"));
new ControlTypePicker($row1, 'widgetbullet', $table, $url, $this);
$row2 = $table->createRow('widget-bullet-2');
new OnOff($row2, 'widget-bullet-thumbnail-show-image', n2_('Image'), 0, array(
'relatedFieldsOn' => array(
'sliderwidget-bullet-thumbnail-width',
'sliderwidget-bullet-thumbnail-height',
'sliderwidget-bullet-thumbnail-style',
'sliderwidget-bullet-thumbnail-side'
)
));
new NumberAutoComplete($row2, 'widget-bullet-thumbnail-width', n2_('Width'), 100, array(
'unit' => 'px',
'values' => array(
60,
100,
150,
200
),
'wide' => 4
));
new NumberAutoComplete($row2, 'widget-bullet-thumbnail-height', n2_('Height'), 60, array(
'unit' => 'px',
'values' => array(
60,
100,
150,
200
),
'wide' => 4
));
new Style($row2, 'widget-bullet-thumbnail-style', n2_('Style'), '{"data":[{"backgroundcolor":"00000080","padding":"3|*|3|*|3|*|3|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":"margin: 5px;background-size:cover;"}]}', array(
'mode' => 'simple',
'preview' => 'SmartSliderAdminWidgetBulletThumbnail'
));
new Select($row2, 'widget-bullet-thumbnail-side', n2_('Side'), 'before', array(
'options' => array(
'before' => n2_('Before'),
'after' => n2_('After')
)
));
$row3 = $table->createRow('widget-bullet-3');
new OnOff($row3, 'widget-bullet-display-hover', n2_('Shows on hover'), 0);
$this->addHideOnFeature('widget-bullet-display-', $row3);
new Text($row3, 'widget-bullet-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1804-bullet#hide-on-slides'
));
}
} Group/Shadow.php 0000644 00000003633 15235664647 0007625 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Group;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Shadow\ShadowImage\ShadowImage;
class Shadow extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 7;
public function __construct() {
parent::__construct();
new ShadowImage($this, 'shadow');
$this->makePluggable('SliderWidgetShadow');
}
public function getName() {
return 'shadow';
}
public function getLabel() {
return n2_('Shadow');
}
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
$table = new ContainerTable($container, 'widgetshadow', n2_('Shadow'));
new OnOff($table->getFieldsetLabel(), 'widget-shadow-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widgetshadow'
)
));
$row1 = $table->createRow('widget-shadow-1');
$url = $form->createAjaxUrl(array("slider/renderwidgetshadow"));
new ControlTypePicker($row1, 'widgetshadow', $table, $url, $this);
$row2 = $table->createRow('widget-shadow-2');
$this->addHideOnFeature('widget-shadow-display-', $row2);
new Text($row2, 'widget-shadow-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1858-shadow#hide-on-slides'
));
}
} Group/Thumbnail.php 0000644 00000010410 15235664647 0010312 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Group;
use Nextend\Framework\Form\Container\ContainerTab;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Form\Element\Text\NumberAutoComplete;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Thumbnail\Basic\ThumbnailBasic;
class Thumbnail extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 6;
public function __construct() {
parent::__construct();
new ThumbnailBasic($this, 'default');
$this->makePluggable('SliderWidgetThumbnail');
}
public function getName() {
return 'thumbnail';
}
public function getLabel() {
return n2_('Thumbnails');
}
/**
* @param ContainerTab $container
*/
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
/**
* Used for field removal: /controls/widget-thumbnail
*/
$table = new ContainerTable($container, 'widget-thumbnail', n2_('Thumbnails'));
new OnOff($table->getFieldsetLabel(), 'widget-thumbnail-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widget-thumbnail'
)
));
$row1 = $table->createRow('widget-thumbnail-1');
$row2 = $table->createRow('widget-thumbnail-2');
new OnOff($row2, 'widget-thumbnail-show-image', n2_('Image'), 1);
new NumberAutoComplete($row2, 'widget-thumbnail-width', n2_('Desktop width'), 100, array(
'unit' => 'px',
'values' => array(
60,
100,
150,
200
),
'wide' => 4
));
new NumberAutoComplete($row2, 'widget-thumbnail-height', n2_('Height'), 60, array(
'unit' => 'px',
'values' => array(
60,
100,
150,
200
),
'wide' => 4
));
new NumberAutoComplete($row2, 'widget-thumbnail-tablet-width', n2_('Tablet width'), 100, array(
'unit' => 'px',
'values' => array(
60,
100,
150,
200
),
'wide' => 4
));
new NumberAutoComplete($row2, 'widget-thumbnail-tablet-height', n2_('Height'), 60, array(
'unit' => 'px',
'values' => array(
60,
100,
150,
200
),
'wide' => 4
));
new NumberAutoComplete($row2, 'widget-thumbnail-mobile-width', n2_('Mobile width'), 100, array(
'unit' => 'px',
'values' => array(
60,
100,
150,
200
),
'wide' => 4
));
new NumberAutoComplete($row2, 'widget-thumbnail-mobile-height', n2_('Height'), 60, array(
'unit' => 'px',
'values' => array(
60,
100,
150,
200
),
'wide' => 4
));
$ajaxUrl = $form->createAjaxUrl(array("slider/renderwidgetthumbnail"));
new ControlTypePicker($row1, 'widgetthumbnail', $table, $ajaxUrl, $this, 'default');
$row3 = $table->createRow('widget-thumbnail-3');
new OnOff($row3, 'widget-thumbnail-display-hover', n2_('Shows on hover'), 0);
$this->addHideOnFeature('widget-thumbnail-display-', $row3);
new Text($row3, 'widget-thumbnail-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1857-thumbnails#hide-on-slides'
));
}
} Bullet/AbstractBullet.php 0000644 00000000471 15235664647 0011443 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Bullet;
use Nextend\SmartSlider3\Widget\AbstractWidget;
abstract class AbstractBullet extends AbstractWidget {
protected $key = 'widget-bullet-';
public function getCommonAssetsPath() {
return dirname(__FILE__) . '/Assets';
}
} Bullet/AbstractBulletFrontend.php 0000644 00000001633 15235664647 0013144 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Bullet;
use Nextend\Framework\Platform\Platform;
use Nextend\Framework\Url\Url;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
abstract class AbstractBulletFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
if ($params->get($this->key . 'thumbnail-show-image')) {
$this->slider->exposeSlideData['thumbnail'] = true;
}
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function getCommonAssetsUri() {
return Url::pathToUri($this->getCommonAssetsPath());
}
public function getCommonAssetsPath() {
return Platform::filterAssetsPath(dirname(__FILE__) . '/Assets');
}
} Bullet/BulletTransition/BulletTransition.php 0000644 00000007376 15235664647 0015347 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Bullet\BulletTransition;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\Bullet\AbstractBullet;
class BulletTransition extends AbstractBullet {
protected $defaults = array(
'widget-bullet-position-mode' => 'simple',
'widget-bullet-position-area' => 10,
'widget-bullet-position-offset' => 10,
'widget-bullet-action' => 'click',
'widget-bullet-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"5|*|5|*|5|*|5|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"50","extra":"margin: 4px;"},{"backgroundcolor":"1D81F9FF"}]}',
'widget-bullet-bar' => '',
'widget-bullet-align' => 'center',
'widget-bullet-orientation' => 'auto',
'widget-bullet-bar-full-size' => 0,
'widget-bullet-thumbnail-show-image' => 0,
'widget-bullet-thumbnail-width' => 60,
'widget-bullet-thumbnail-style' => '{"data":[{"backgroundcolor":"00000080","padding":"3|*|3|*|3|*|3|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":"margin: 5px;"}]}',
'widget-bullet-thumbnail-side' => 'before'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-bullet-transition-row-1');
new WidgetPosition($row1, 'widget-bullet-position', n2_('Position'));
new Select($row1, 'widget-bullet-action', n2_('Action'), '', array(
'options' => array(
'click' => n2_('Click'),
'mouseenter' => n2_('Hover')
)
));
$row2 = new FieldsetRow($container, 'widget-bullet-transition-row-2');
new Style($row2, 'widget-bullet-style', n2_('Dot'), '', array(
'mode' => 'dot',
'style2' => 'sliderwidget-bullet-bar',
'preview' => 'SmartSliderAdminWidgetBulletTransition'
));
new Style($row2, 'widget-bullet-bar', n2_('Bar'), '', array(
'mode' => 'simple',
'style2' => 'sliderwidget-bullet-style',
'preview' => 'SmartSliderAdminWidgetBulletTransition'
));
new OnOff($row2, 'widget-bullet-bar-full-size', n2_('Bar full size'), '', array(
'relatedFieldsOn' => array(
'sliderwidget-bullet-align'
)
));
new Select($row2, 'widget-bullet-align', n2_('Align'), '', array(
'options' => array(
'left' => n2_('Left'),
'center' => n2_('Center'),
'right' => n2_('Right')
)
));
new Select($row2, 'widget-bullet-orientation', n2_('Orientation'), '', array(
'options' => array(
'auto' => n2_('Auto'),
'horizontal' => n2_('Horizontal'),
'vertical' => n2_('Vertical')
)
));
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'style'));
$export->addVisual($params->get($this->key . 'bar'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style')));
$params->set($this->key . 'bar', $import->fixSection($params->get($this->key . 'bar')));
}
} Bullet/BulletTransition/BulletTransitionFrontend.php 0000644 00000006412 15235664647 0017035 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Bullet\BulletTransition;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\Bullet\AbstractBulletFrontend;
class BulletTransitionFrontend extends AbstractBulletFrontend {
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if ($slider->getSlidesCount() <= 1) {
return '';
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup($this->getCommonAssetsPath() . '/dist/w-bullet.min.js', 'w-bullet');
$displayAttributes = $this->getDisplayAttributes($params, $this->key, 1);
$bulletStyle = $slider->addStyle($params->get($this->key . 'style'), 'dot');
$barStyle = $slider->addStyle($params->get($this->key . 'bar'), 'simple');
$orientation = $this->getOrientationByPosition($params->get($this->key . 'position-mode'), $params->get($this->key . 'position-area'), $params->get($this->key . 'orientation'), 'horizontal');
$parameters = array(
'area' => intval($params->get($this->key . 'position-area')),
'dotClasses' => $bulletStyle,
'mode' => '',
'action' => $params->get($this->key . 'action')
);
if ($params->get($this->key . 'thumbnail-show-image')) {
$parameters['thumbnail'] = 1;
$parameters['thumbnailWidth'] = intval($params->get($this->key . 'thumbnail-width'));
$parameters['thumbnailHeight'] = intval($params->get($this->key . 'thumbnail-height'));
$parameters['thumbnailStyle'] = $slider->addStyle($params->get($this->key . 'thumbnail-style'), 'simple', '');
$side = $params->get($this->key . 'thumbnail-side');
if ($side == 'before') {
if ($orientation == 'vertical') {
$position = 'left';
} else {
$position = 'top';
}
} else {
if ($orientation == 'vertical') {
$position = 'right';
} else {
$position = 'bottom';
}
}
$parameters['thumbnailPosition'] = $position;
}
$slider->features->addInitCallback('new _N2.SmartSliderWidgetBulletTransition(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetBulletTransition');
$fullSize = intval($params->get($this->key . 'bar-full-size'));
return Html::tag("div", Html::mergeAttributes($attributes, $displayAttributes, array(
"class" => 'n2-ss-control-bullet n2-ow-all n2-ss-control-bullet-' . $orientation . ($fullSize ? ' n2-ss-control-bullet-fullsize' : '')
)), Html::tag("div", array(
"class" => $barStyle . " nextend-bullet-bar n2-bar-justify-content-" . $params->get($this->key . 'align')
), '<div class="n2-bullet ' . $bulletStyle . '" style="visibility:hidden;"></div>'));
}
} Bar/AbstractWidgetBar.php 0000644 00000000321 15235664647 0011333 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Bar;
use Nextend\SmartSlider3\Widget\AbstractWidget;
abstract class AbstractWidgetBar extends AbstractWidget {
protected $key = 'widget-bar-';
} Bar/BarHorizontal/BarHorizontal.php 0000644 00000013506 15235664647 0013344 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Bar\BarHorizontal;
use Nextend\Framework\Form\Element\Font;
use Nextend\Framework\Form\Element\Grouping;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\Bar\AbstractWidgetBar;
class BarHorizontal extends AbstractWidgetBar {
protected $defaults = array(
'widget-bar-position-mode' => 'simple',
'widget-bar-position-area' => 10,
'widget-bar-position-offset' => 30,
'widget-bar-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"5|*|20|*|5|*|20|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"40","extra":""}]}',
'widget-bar-show-title' => 1,
'widget-bar-font-title' => '{"data":[{"color":"ffffffff","size":"14||px","tshadow":"0|*|0|*|0|*|000000c7","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":0,"underline":0,"align":"left","extra":"vertical-align: middle;"},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-bar-show-description' => 1,
'widget-bar-font-description' => '{"data":[{"color":"ffffffff","size":"14||px","tshadow":"0|*|0|*|0|*|000000c7","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":1,"underline":0,"align":"left","extra":"vertical-align: middle;"},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-bar-slide-count' => 0,
'widget-bar-width' => '100%',
'widget-bar-full-width' => 0,
'widget-bar-separator' => ' - ',
'widget-bar-align' => 'center',
'widget-bar-animate' => 0
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-bar-horizontal-row-1');
new WidgetPosition($row1, 'widget-bar-position', n2_('Position'));
new OnOff($row1, 'widget-bar-animate', n2_('Animate'));
new Style($row1, 'widget-bar-style', n2_('Bar'), '', array(
'mode' => 'simple',
'font' => 'sliderwidget-bar-font-title',
'font2' => 'sliderwidget-bar-font-description',
'preview' => 'SmartSliderAdminWidgetBarHorizontal'
));
$rowTitle = new FieldsetRow($container, 'widget-bar-horizontal-row-title');
new OnOff($rowTitle, 'widget-bar-show-title', n2_('Title'), 0, array(
'relatedFieldsOn' => array(
'sliderwidget-bar-font-title',
'sliderwidget-bar-slide-count-container'
)
));
new Font($rowTitle, 'widget-bar-font-title', '', '', array(
'mode' => 'simple',
'style' => 'sliderwidget-bar-style',
'preview' => 'SmartSliderAdminWidgetBarHorizontal'
));
$rowDescription = new FieldsetRow($container, 'widget-bar-horizontal-row-description');
new OnOff($rowDescription, 'widget-bar-show-description', n2_('Description'), 0, array(
'relatedFieldsOn' => array(
'sliderwidget-bar-font-description',
'sliderwidget-bar-slide-count'
)
));
new Font($rowDescription, 'widget-bar-font-description', '', '', array(
'mode' => 'simple',
'style' => 'sliderwidget-bar-style',
'preview' => 'SmartSliderAdminWidgetBarHorizontal'
));
$row4 = new FieldsetRow($container, 'widget-bar-horizontal-row-4');
$slideCountContainer = new Grouping($row4, 'widget-bar-slide-count-container');
new OnOff($slideCountContainer, 'widget-bar-slide-count', n2_('Slide count'), 0, array(
'tipLabel' => n2_('Slide count'),
'tipDescription' => n2_('The "Title" will be the index of the slide and "Description" will be the total number of slides.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1856-text-bar#slide-count'
));
new Text($row4, 'widget-bar-width', n2_('Width'), '');
new OnOff($row4, 'widget-bar-full-width', n2_('Full width'));
new Text($row4, 'widget-bar-separator', n2_('Separator'), 0, array(
'tipLabel' => n2_('Separator'),
'tipDescription' => sprintf(n2_('You can set what separates the Tex bar Title and Description. This separator is used at the Slide count option, too, to separate the current and total slide number. %1$s To put the Description to a new line, use the <br> HTML tag.'), '<br>'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1856-text-bar#separator'
));
new Select($row4, 'widget-bar-align', n2_('Align'), '', array(
'options' => array(
'left' => n2_('Left'),
'center' => n2_('Center'),
'right' => n2_('Right')
)
));
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'style'));
$export->addVisual($params->get($this->key . 'font-title'));
$export->addVisual($params->get($this->key . 'font-description'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style', '')));
$params->set($this->key . 'font-title', $import->fixSection($params->get($this->key . 'font-title', '')));
$params->set($this->key . 'font-description', $import->fixSection($params->get($this->key . 'font-description', '')));
}
} Bar/BarHorizontal/BarHorizontalFrontend.php 0000644 00000006254 15235664647 0015046 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Bar\BarHorizontal;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class BarHorizontalFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
if (intval($params->get($this->key . 'show-description'))) {
$this->slider->exposeSlideData['description'] = true;
}
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-bar-horizontal.min.js', 'w-bar-horizontal');
$displayAttributes = $this->getDisplayAttributes($params, $this->key, 1);
$styleClass = $slider->addStyle($params->get($this->key . 'style'), 'simple');
$fontTitle = $slider->addFont($params->get($this->key . 'font-title'), 'simple');
$fontDescription = $slider->addFont($params->get($this->key . 'font-description'), 'simple');
$style = 'text-align: ' . $params->get($this->key . 'align') . ';';
$width = $params->get($this->key . 'width');
if (is_numeric($width) || substr($width, -1) == '%' || substr($width, -2) == 'px') {
$style .= 'width:' . $width . ';';
}
$innerStyle = '';
if (!$params->get($this->key . 'full-width')) {
$innerStyle = 'display: inline-block;';
}
$showTitle = intval($params->get($this->key . 'show-title'));
$showDescription = intval($params->get($this->key . 'show-description'));
$parameters = array(
'area' => intval($params->get($this->key . 'position-area')),
'animate' => intval($params->get($this->key . 'animate')),
'showTitle' => $showTitle,
'fontTitle' => $fontTitle,
'slideCount' => intval($params->get($this->key . 'slide-count', 0)),
'showDescription' => $showDescription,
'fontDescription' => $fontDescription,
'separator' => $params->get($this->key . 'separator')
);
$slider->features->addInitCallback('new _N2.SmartSliderWidgetBarHorizontal(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetBarHorizontal');
return Html::tag("div", Html::mergeAttributes($attributes, $displayAttributes, array(
"class" => "nextend-bar nextend-bar-horizontal n2-ss-widget-hidden n2-ow-all",
"style" => $style
)), Html::tag("div", array(
"class" => $styleClass,
"style" => $innerStyle
), '<span class="' . $fontTitle . '"> </span>'));
}
} Arrow/AbstractWidgetArrow.php 0000644 00000000331 15235664647 0012310 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Arrow;
use Nextend\SmartSlider3\Widget\AbstractWidget;
abstract class AbstractWidgetArrow extends AbstractWidget {
protected $key = 'widget-arrow-';
} Arrow/ArrowImage/ArrowImage.php 0000644 00000020463 15235664647 0012470 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Arrow\ArrowImage;
use Nextend\Framework\Form\Element\Grouping;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Radio\ImageListFromFolder;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Form\Element\Text\Color;
use Nextend\Framework\Form\Element\Text\FieldImage;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\Arrow\AbstractWidgetArrow;
class ArrowImage extends AbstractWidgetArrow {
protected $defaults = array(
'widget-arrow-desktop-image-width' => 32,
'widget-arrow-tablet-image-width' => 32,
'widget-arrow-mobile-image-width' => 16,
'widget-arrow-previous-image' => '',
'widget-arrow-previous' => '$ss$/plugins/widgetarrow/image/image/previous/normal.svg',
'widget-arrow-previous-color' => 'ffffffcc',
'widget-arrow-previous-hover' => 0,
'widget-arrow-previous-hover-color' => 'ffffffcc',
'widget-arrow-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"20|*|10|*|20|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"5","extra":""},{"backgroundcolor":"000000cf"}]}',
'widget-arrow-previous-position-mode' => 'simple',
'widget-arrow-previous-position-area' => 6,
'widget-arrow-previous-position-offset' => 15,
'widget-arrow-next-position-mode' => 'simple',
'widget-arrow-next-position-area' => 7,
'widget-arrow-next-position-offset' => 15,
'widget-arrow-animation' => 'fade',
'widget-arrow-mirror' => 1,
'widget-arrow-next-image' => '',
'widget-arrow-next' => '$ss$/plugins/widgetarrow/image/image/next/normal.svg',
'widget-arrow-next-color' => 'ffffffcc',
'widget-arrow-next-hover' => 0,
'widget-arrow-next-hover-color' => 'ffffffcc',
'widget-arrow-previous-alt' => 'previous arrow',
'widget-arrow-next-alt' => 'next arrow',
'widget-arrow-base64' => 1
);
public function renderFields($container) {
$rowPrevious = new FieldsetRow($container, 'widget-arrow-image-row-previous');
$fieldPrevious = new ImageListFromFolder($rowPrevious, 'widget-arrow-previous', n2_x('Previous', 'Arrow direction'), '', array(
'folder' => self::getAssetsPath() . '/previous/'
));
new FieldImage($fieldPrevious, 'widget-arrow-previous-image', n2_('Previous image'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-arrow-image-row-icon-grouping-previous-color-container'
)
));
$groupingPreviousColorContainer = new Grouping($rowPrevious, 'widget-arrow-image-row-icon-grouping-previous-color-container');
$groupingPreviousColor = new Grouping($groupingPreviousColorContainer, 'widget-arrow-image-row-icon-grouping-previous-color');
new Color($groupingPreviousColor, 'widget-arrow-previous-color', n2_('Color'), '', array(
'alpha' => true
));
new OnOff($groupingPreviousColor, 'widget-arrow-previous-hover', n2_('Hover'), 0, array(
'relatedFieldsOn' => array(
'sliderwidget-arrow-previous-hover-color'
)
));
new Color($groupingPreviousColor, 'widget-arrow-previous-hover-color', n2_('Hover color'), '', array(
'alpha' => true
));
new OnOff($rowPrevious, 'widget-arrow-mirror', n2_('Mirror'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-arrow-image-row-icon-grouping-next'
)
));
$groupingNext = new Grouping($rowPrevious, 'widget-arrow-image-row-icon-grouping-next');
$fieldNext = new ImageListFromFolder($groupingNext, 'widget-arrow-next', n2_x('Next', 'Arrow direction'), '', array(
'folder' => self::getAssetsPath() . '/next/'
));
new FieldImage($fieldNext, 'widget-arrow-next-image', n2_('Next image'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-arrow-image-row-icon-grouping-next-color-container'
)
));
$groupingNextColorContainer = new Grouping($groupingNext, 'widget-arrow-image-row-icon-grouping-next-color-container');
$groupingNextColor = new Grouping($groupingNextColorContainer, 'widget-arrow-image-row-icon-grouping-next-color');
new Color($groupingNextColor, 'widget-arrow-next-color', n2_('Color'), '', array(
'alpha' => true
));
new OnOff($groupingNextColor, 'widget-arrow-next-hover', n2_('Hover'), 0, array(
'relatedFieldsOn' => array(
'sliderwidget-arrow-next-hover-color'
)
));
new Color($groupingNextColor, 'widget-arrow-next-hover-color', n2_('Hover color'), '', array(
'alpha' => true
));
$row2 = new FieldsetRow($container, 'widget-arrow-image-row-2');
new Style($row2, 'widget-arrow-style', n2_('Arrow'), '', array(
'mode' => 'button',
'preview' => 'SmartSliderAdminWidgetArrowImage',
));
new WidgetPosition($row2, 'widget-arrow-previous-position', n2_('Previous position'));
new WidgetPosition($row2, 'widget-arrow-next-position', n2_('Next position'));
new Select($row2, 'widget-arrow-animation', n2_('Animation'), '', array(
'options' => array(
'none' => n2_('None'),
'fade' => n2_('Fade'),
'horizontal' => n2_('Horizontal'),
'vertical' => n2_('Vertical'),
)
));
$row3 = new FieldsetRow($container, 'widget-arrow-image-row-3');
new Text($row3, 'widget-arrow-previous-alt', n2_('Previous alt tag'), 'previous arrow');
new Text($row3, 'widget-arrow-next-alt', n2_('Next alt tag'), 'next arrow');
new OnOff($row3, 'widget-arrow-base64', n2_('Base64'), 1, array(
'tipLabel' => n2_('Base64'),
'tipDescription' => n2_('Base64 encoded arrow images are loading faster and they are colorable. But optimization plugins often have errors in their codes related to them, so if your arrow won\'t load, turn this option off.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1782-arrow#base64',
'relatedFieldsOn' => array(
'sliderwidget-arrow-image-row-icon-grouping-previous-color',
'sliderwidget-arrow-image-row-icon-grouping-next-color'
)
));
$row4 = new FieldsetRow($container, 'widget-arrow-image-row-4');
new Text\Number($row4, 'widget-arrow-desktop-image-width', n2_('Image width - Desktop'), '', array(
'wide' => 4,
'unit' => 'px'
));
new Text\Number($row4, 'widget-arrow-tablet-image-width', n2_('Image width - Tablet'), '', array(
'wide' => 4,
'unit' => 'px'
));
new Text\Number($row4, 'widget-arrow-mobile-image-width', n2_('Image width - Mobile'), '', array(
'wide' => 4,
'unit' => 'px'
));
}
public function prepareExport($export, $params) {
$export->addImage($params->get($this->key . 'previous-image', ''));
$export->addImage($params->get($this->key . 'next-image', ''));
$export->addVisual($params->get($this->key . 'style'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'previous-image', $import->fixImage($params->get($this->key . 'previous-image', '')));
$params->set($this->key . 'next-image', $import->fixImage($params->get($this->key . 'next-image', '')));
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style', '')));
}
} Arrow/ArrowImage/ArrowImageFrontend.php 0000644 00000025613 15235664647 0014172 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Arrow\ArrowImage;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\FastImageSize\FastImageSize;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Misc\Base64;
use Nextend\Framework\Parser\Color;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class ArrowImageFrontend extends AbstractWidgetFrontend {
protected $rendered = false;
protected $previousArguments;
protected $nextArguments;
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
if ($this->isRenderable('previous')) {
$this->addToPlacement($this->key . 'previous-position-', array(
$this,
'renderPrevious'
));
}
if ($this->isRenderable('next')) {
$this->addToPlacement($this->key . 'next-position-', array(
$this,
'renderNext'
));
}
}
private function isRenderable($side) {
$arrow = $this->params->get($this->key . $side . '-image');
if (empty($arrow)) {
$arrow = $this->params->get($this->key . $side);
if ($arrow == -1) {
$arrow = null;
}
}
return !!$arrow;
}
public function renderPrevious($attributes = array()) {
$this->render();
if ($this->previousArguments) {
array_unshift($this->previousArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->previousArguments);
}
return '';
}
public function renderNext($attributes = array()) {
$this->render();
if ($this->nextArguments) {
array_unshift($this->nextArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->nextArguments);
}
return '';
}
private function render() {
if ($this->rendered) return;
$this->rendered = true;
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if ($slider->getSlidesCount() <= 1) {
return '';
}
$previousImage = $params->get($this->key . 'previous-image');
$previousValue = $params->get($this->key . 'previous');
$previousColor = $params->get($this->key . 'previous-color');
$previousHover = $params->get($this->key . 'previous-hover');
$previousHoverColor = $params->get($this->key . 'previous-hover-color');
if (empty($previousImage)) {
if ($previousValue == -1) {
$previous = false;
} else {
$previous = ResourceTranslator::pathToResource(self::getAssetsPath() . '/previous/' . basename($previousValue));
}
} else {
$previous = $previousImage;
}
if ($params->get($this->key . 'mirror')) {
$nextColor = $previousColor;
$nextHover = $previousHover;
$nextHoverColor = $previousHoverColor;
if (empty($previousImage)) {
if ($previousValue == -1) {
$next = false;
} else {
$next = ResourceTranslator::pathToResource(self::getAssetsPath() . '/next/' . basename($previousValue));
}
} else {
$next = $previousImage;
$slider->addCSS('#' . $id . '-arrow-next' . '{transform: rotate(180deg);}');
}
} else {
$next = $params->get($this->key . 'next-image');
$nextColor = $params->get($this->key . 'next-color');
$nextHover = $params->get($this->key . 'next-hover');
$nextHoverColor = $params->get($this->key . 'next-hover-color');
if (empty($next)) {
$nextValue = $params->get($this->key . 'next');
if ($nextValue == -1) {
$next = false;
} else {
$next = ResourceTranslator::pathToResource(self::getAssetsPath() . '/next/' . basename($nextValue));
}
}
}
if ($previous || $next) {
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-arrow-image.min.js', 'w-arrow-image');
$displayAttributes = $this->getDisplayAttributes($params, $this->key);
$animation = $params->get($this->key . 'animation');
if ($animation == 'none' || $animation == 'fade') {
$styleClass = $slider->addStyle($params->get($this->key . 'style'), 'heading');
} else {
$styleClass = $slider->addStyle($params->get($this->key . 'style'), 'heading-active');
}
if ($previous) {
$this->previousArguments = array(
$id,
$animation,
'previous',
$previous,
$displayAttributes,
$styleClass,
$previousColor,
$previousHover,
$previousHoverColor
);
}
if ($next) {
$this->nextArguments = array(
$id,
$animation,
'next',
$next,
$displayAttributes,
$styleClass,
$nextColor,
$nextHover,
$nextHoverColor
);
}
$desktopWidth = $params->get('widget-arrow-desktop-image-width');
$tabletWidth = $params->get('widget-arrow-tablet-image-width');
$mobileWidth = $params->get('widget-arrow-mobile-image-width');
$slider->addDeviceCSS('all', 'div#' . $id . ' .nextend-arrow img{width: ' . $desktopWidth . 'px}');
if ($tabletWidth != $desktopWidth) {
$slider->addDeviceCSS('tabletportrait', 'div#' . $id . ' .nextend-arrow img{width: ' . $tabletWidth . 'px}');
$slider->addDeviceCSS('tabletlandscape', 'div#' . $id . ' .nextend-arrow img{width: ' . $tabletWidth . 'px}');
}
if ($mobileWidth != $desktopWidth) {
$slider->addDeviceCSS('mobileportrait', 'div#' . $id . ' .nextend-arrow img{width: ' . $mobileWidth . 'px}');
$slider->addDeviceCSS('mobilelandscape', 'div#' . $id . ' .nextend-arrow img{width: ' . $mobileWidth . 'px}');
}
$slider->features->addInitCallback('new _N2.SmartSliderWidgetArrowImage(this);');
$slider->sliderType->addJSDependency('SmartSliderWidgetArrowImage');
}
}
/**
* @param array $attributes
* @param string $id
* @param string $animation
* @param string $side
* @param string $imageRaw
* @param string $displayAttributes
* @param string $styleClass
* @param string $color
* @param int $hover
* @param string $hoverColor
*
* @return string
*/
private function getHTML($attributes, $id, $animation, $side, $imageRaw, $displayAttributes, $styleClass, $color = 'ffffffcc', $hover = 0, $hoverColor = 'ffffffcc') {
$imageHover = null;
$ext = pathinfo($imageRaw, PATHINFO_EXTENSION);
/**
* We can not colorize SVGs when base64 disabled.
*/
if ($ext == 'svg' && ResourceTranslator::isResource($imageRaw) && $this->params->get($this->key . 'base64', 1)) {
list($color, $opacity) = Color::colorToSVG($color);
$content = Filesystem::readFile(ResourceTranslator::toPath($imageRaw));
$image = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), $content));
if ($hover) {
list($color, $opacity) = Color::colorToSVG($hoverColor);
$imageHover = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), $content));
}
} else {
$image = ResourceTranslator::toUrl($imageRaw);
}
$alt = $this->params->get($this->key . $side . '-alt', $side . ' arrow');
$sizeAttributes = array();
FastImageSize::initAttributes($imageRaw, $sizeAttributes);
if ($imageHover === null) {
$image = Html::image($image, $alt, $sizeAttributes + Html::addExcludeLazyLoadAttributes());
} else {
$image = Html::image($image, $alt, $sizeAttributes + Html::addExcludeLazyLoadAttributes(array(
'class' => 'n2-arrow-normal-img'
))) . Html::image($imageHover, $alt, $sizeAttributes + Html::addExcludeLazyLoadAttributes(array(
'class' => 'n2-arrow-hover-img'
)));
}
if ($animation == 'none' || $animation == 'fade') {
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'id' => $id . '-arrow-' . $side,
'class' => $styleClass . 'nextend-arrow n2-ow-all nextend-arrow-' . $side . ' nextend-arrow-animated-' . $animation,
'role' => 'button',
'aria-label' => $alt,
'tabindex' => '0'
)), $image);
}
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'id' => $id . '-arrow-' . $side,
'class' => 'nextend-arrow nextend-arrow-animated n2-ow-all nextend-arrow-animated-' . $animation . ' nextend-arrow-' . $side,
'role' => 'button',
'aria-label' => $alt,
'tabindex' => '0'
)), Html::tag('div', array(
'class' => $styleClass
), $image) . Html::tag('div', array(
'class' => $styleClass . ' n2-active'
), $image));
}
} Autoplay/AbstractWidgetAutoplay.php 0000644 00000000342 15235664647 0013522 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Autoplay;
use Nextend\SmartSlider3\Widget\AbstractWidget;
abstract class AbstractWidgetAutoplay extends AbstractWidget {
protected $key = 'widget-autoplay-';
} Autoplay/AutoplayImage/AutoplayImage.php 0000644 00000011627 15235664647 0014406 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Autoplay\AutoplayImage;
use Nextend\Framework\Form\Element\Grouping;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Radio\ImageListFromFolder;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text\Color;
use Nextend\Framework\Form\Element\Text\FieldImage;
use Nextend\Framework\Form\Element\Text\Number;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\Autoplay\AbstractWidgetAutoplay;
class AutoplayImage extends AbstractWidgetAutoplay {
protected $defaults = array(
'widget-autoplay-desktop-image-width' => 16,
'widget-autoplay-tablet-image-width' => 16,
'widget-autoplay-mobile-image-width' => 8,
'widget-autoplay-play-image' => '',
'widget-autoplay-play-color' => 'ffffffcc',
'widget-autoplay-play' => '$ss$/plugins/widgetautoplay/image/image/play/small-light.svg',
'widget-autoplay-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"10|*|10|*|10|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":""},{"backgroundcolor":"000000ab"}]}',
'widget-autoplay-position-mode' => 'simple',
'widget-autoplay-position-area' => 4,
'widget-autoplay-position-offset' => 15,
'widget-autoplay-mirror' => 1,
'widget-autoplay-pause-image' => '',
'widget-autoplay-pause-color' => 'ffffffcc',
'widget-autoplay-pause' => '$ss$/plugins/widgetautoplay/image/image/pause/small-light.svg'
);
public function renderFields($container) {
$rowIcon = new FieldsetRow($container, 'widget-autoplay-image-row-icon');
$fieldPlay = new ImageListFromFolder($rowIcon, 'widget-autoplay-play', n2_('Play'), '', array(
'folder' => self::getAssetsPath() . '/play/',
'hasDisabled' => false
));
new FieldImage($fieldPlay, 'widget-autoplay-play-image', n2_('Custom'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-autoplay-play-color'
)
));
new Color($rowIcon, 'widget-autoplay-play-color', n2_('Color'), '', array(
'alpha' => true
));
new Style($rowIcon, 'widget-autoplay-style', n2_('Style'), '', array(
'mode' => 'button',
'preview' => 'SmartSliderAdminWidgetAutoplayImage'
));
new OnOff($rowIcon, 'widget-autoplay-mirror', n2_('Mirror'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-autoplay-pause',
'sliderwidget-autoplay-pause-color'
)
));
$fieldPause = new ImageListFromFolder($rowIcon, 'widget-autoplay-pause', n2_('Pause'), '', array(
'folder' => self::getAssetsPath() . '/pause/',
'post' => 'break'
));
new FieldImage($fieldPause, 'widget-autoplay-pause-image', n2_('Custom'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-autoplay-pause-color-grouping'
)
));
$groupingPauseColor = new Grouping($rowIcon, 'widget-autoplay-pause-color-grouping');
new Color($groupingPauseColor, 'widget-autoplay-pause-color', n2_('Color'), '', array(
'alpha' => true
));
$row2 = new FieldsetRow($container, 'widget-autoplay-image-row-2');
new Number($row2, 'widget-autoplay-desktop-image-width', n2_('Image width - Desktop'), '', array(
'wide' => 4,
'unit' => 'px'
));
new Number($row2, 'widget-autoplay-tablet-image-width', n2_('Image width - Tablet'), '', array(
'wide' => 4,
'unit' => 'px'
));
new Number($row2, 'widget-autoplay-mobile-image-width', n2_('Image width - Mobile'), '', array(
'wide' => 4,
'unit' => 'px'
));
new WidgetPosition($row2, 'widget-autoplay-position', n2_('Position'));
}
public function prepareExport($export, $params) {
$export->addImage($params->get($this->key . 'play-image', ''));
$export->addImage($params->get($this->key . 'pause-image', ''));
$export->addVisual($params->get($this->key . 'style'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'play-image', $import->fixImage($params->get($this->key . 'play-image', '')));
$params->set($this->key . 'pause-image', $import->fixImage($params->get($this->key . 'pause-image', '')));
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style', '')));
}
} Autoplay/AutoplayImage/AutoplayImageFrontend.php 0000644 00000015061 15235664647 0016102 0 ustar 00 <?php
namespace Nextend\SmartSlider3\Widget\Autoplay\AutoplayImage;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Cast;
use Nextend\Framework\FastImageSize\FastImageSize;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Misc\Base64;
use Nextend\Framework\Parser\Color;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class AutoplayImageFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if (!$params->get('autoplay', 0)) {
return '';
}
$sizeAttributes = array();
$html = '';
$playImage = $params->get($this->key . 'play-image');
$playValue = $params->get($this->key . 'play');
$playColor = $params->get($this->key . 'play-color');
if (empty($playImage)) {
if ($playValue == -1) {
$play = null;
} else {
$play = ResourceTranslator::pathToResource(self::getAssetsPath() . '/play/' . basename($playValue));
}
} else {
$play = $playImage;
}
if ($params->get($this->key . 'mirror')) {
$pauseColor = $playColor;
if (!empty($playImage)) {
$pause = $playImage;
} else {
$pause = ResourceTranslator::pathToResource(self::getAssetsPath() . '/pause/' . basename($playValue));
}
} else {
$pause = $params->get($this->key . 'pause-image');
$pauseColor = $params->get($this->key . 'pause-color');
if (empty($pause)) {
$pauseValue = $params->get($this->key . 'pause');
if ($pauseValue == -1) {
$pause = null;
} else {
$pause = ResourceTranslator::pathToResource(self::getAssetsPath() . '/pause/' . basename($pauseValue));
}
}
}
$ext = pathinfo($play, PATHINFO_EXTENSION);
if ($ext == 'svg' && ResourceTranslator::isResource($play)) {
FastImageSize::initAttributes($playColor, $sizeAttributes);
list($color, $opacity) = Color::colorToSVG($playColor);
$play = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), Filesystem::readFile(ResourceTranslator::toPath($play))));
} else {
FastImageSize::initAttributes($play, $sizeAttributes);
$play = ResourceTranslator::toUrl($play);
}
$ext = pathinfo($pause, PATHINFO_EXTENSION);
if ($ext == 'svg' && ResourceTranslator::isResource($pause)) {
list($color, $opacity) = Color::colorToSVG($pauseColor);
$pause = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), Filesystem::readFile(ResourceTranslator::toPath($pause))));
} else {
$pause = ResourceTranslator::toUrl($pause);
}
if ($play && $pause) {
$desktopWidth = $params->get('widget-autoplay-desktop-image-width');
$tabletWidth = $params->get('widget-autoplay-tablet-image-width');
$mobileWidth = $params->get('widget-autoplay-mobile-image-width');
$slider->addDeviceCSS('all', 'div#' . $id . ' .nextend-autoplay img{width: ' . $desktopWidth . 'px}');
if ($tabletWidth != $desktopWidth) {
$slider->addDeviceCSS('tabletportrait', 'div#' . $id . ' .nextend-autoplay img{width: ' . $tabletWidth . 'px}');
$slider->addDeviceCSS('tabletlandscape', 'div#' . $id . ' .nextend-autoplay img{width: ' . $tabletWidth . 'px}');
}
if ($mobileWidth != $desktopWidth) {
$slider->addDeviceCSS('mobileportrait', 'div#' . $id . ' .nextend-autoplay img{width: ' . $mobileWidth . 'px}');
$slider->addDeviceCSS('mobilelandscape', 'div#' . $id . ' .nextend-autoplay img{width: ' . $mobileWidth . 'px}');
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-autoplay.min.js', 'w-autoplay');
$displayAttributes = $this->getDisplayAttributes($params, $this->key, 1);
$styleClass = $slider->addStyle($params->get($this->key . 'style'), 'heading');
$slider->features->addInitCallback('new _N2.SmartSliderWidgetAutoplayImage(this, ' . Cast::floatToString($params->get($this->key . 'responsive-desktop')) . ', ' . Cast::floatToString($params->get($this->key . 'responsive-tablet')) . ', ' . Cast::floatToString($params->get($this->key . 'responsive-mobile')) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetAutoplayImage');
$html = Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'class' => $styleClass . 'nextend-autoplay n2-ow-all nextend-autoplay-image',
'role' => 'button',
'aria-label' => n2_('Play autoplay'),
'data-pause-label' => n2_('Pause autoplay'),
'data-play-label' => n2_('Play autoplay'),
'tabindex' => '0'
)), Html::image($play, 'Play', $sizeAttributes + HTML::addExcludeLazyLoadAttributes(array(
'class' => 'nextend-autoplay-play'
))) . Html::image($pause, 'Pause', $sizeAttributes + HTML::addExcludeLazyLoadAttributes(array(
'class' => 'nextend-autoplay-pause'
))));
}
return $html;
}
} WidgetLoader.php 0000644 00000026350 15241527131 0007636 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget;
use Nextend\Framework\Plugin;
use Nextend\SmartSlider3\Widget\Arrow\ArrowImage\ArrowImage;
use Nextend\SmartSlider3\Widget\Autoplay\AutoplayImage\AutoplayImage;
use Nextend\SmartSlider3\Widget\Bullet\BulletTransition\BulletTransition;
use Nextend\SmartSlider3\Widget\Group\AbstractWidgetGroup;
use Nextend\SmartSlider3\Widget\Thumbnail\Basic\ThumbnailBasic;
use Nextend\SmartSlider3Pro\Widget\Arrow\ArrowGrow\ArrowGrow;
use Nextend\SmartSlider3Pro\Widget\Arrow\ArrowImageBar\ArrowImageBar;
use Nextend\SmartSlider3Pro\Widget\Arrow\ArrowReveal\ArrowReveal;
use Nextend\SmartSlider3Pro\Widget\Arrow\ArrowText\ArrowText;
use Nextend\SmartSlider3Pro\Widget\Bar\BarVertical\BarVertical;
use Nextend\SmartSlider3Pro\Widget\Bullet\BulletNumbers\BulletNumbers;
use Nextend\SmartSlider3Pro\Widget\Bullet\BulletText\BulletText;
use Nextend\SmartSlider3Pro\Widget\FullScreen\FullScreenImage\FullScreenImage;
use Nextend\SmartSlider3Pro\Widget\Group\FullScreen;
use Nextend\SmartSlider3Pro\Widget\Group\Html;
use Nextend\SmartSlider3Pro\Widget\Group\Indicator;
use Nextend\SmartSlider3Pro\Widget\Html\HtmlCode\HtmlCode;
use Nextend\SmartSlider3Pro\Widget\Indicator\IndicatorPie\IndicatorPie;
use Nextend\SmartSlider3Pro\Widget\Indicator\IndicatorStripe\IndicatorStripe;
class WidgetLoader {
public function __construct() {
Plugin::addAction('PluggableFactorySliderWidgetGroup', array(
$this,
'sliderWidgetGroup'
));
Plugin::addAction('PluggableFactorySliderWidgetArrow', array(
$this,
'sliderWidgetArrow'
));
Plugin::addAction('PluggableFactorySliderWidgetBullet', array(
$this,
'sliderWidgetBullet'
));
Plugin::addAction('PluggableFactorySliderWidgetAutoplay', array(
$this,
'sliderWidgetAutoplay'
));
Plugin::addAction('PluggableFactorySliderWidgetBar', array(
$this,
'sliderWidgetBar'
));
Plugin::addAction('PluggableFactorySliderWidgetIndicator', array(
$this,
'sliderWidgetIndicator'
));
Plugin::addAction('PluggableFactorySliderWidgetHtml', array(
$this,
'sliderWidgetHtml'
));
Plugin::addAction('PluggableFactorySliderWidgetFullScreen', array(
$this,
'sliderWidgetFullScreen'
));
Plugin::addAction('PluggableFactorySliderWidgetThumbnail', array(
$this,
'sliderWidgetThumbnail'
));
}
public function sliderWidgetGroup() {
new FullScreen();
new Indicator();
new Html();
}
/**
* @param AbstractWidgetGroup $group
*/
public function sliderWidgetArrow($group) {
new ArrowImage($group, 'image');
new ArrowImage($group, 'imageBigRectangle', array(
'widget-arrow-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"20|*|20|*|20|*|20|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":""},{"backgroundcolor":"5F39C2FF"}]}',
'widget-arrow-animation' => 'horizontal',
'widget-arrow-previous-position-offset' => 0,
'widget-arrow-next-position-offset' => 0,
));
new ArrowImage($group, 'imageVertical', array(
'widget-arrow-previous' => '$ss$/plugins/widgetarrow/image/image/previous/simple-vertical.svg',
'widget-arrow-next' => '$ss$/plugins/widgetarrow/image/image/next/simple-vertical.svg',
'widget-arrow-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"10|*|10|*|10|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":""},{"backgroundcolor":"04C018FF"}]}',
'widget-arrow-previous-position-area' => 3,
'widget-arrow-next-position-area' => 10,
));
new ArrowGrow($group, 'grow');
new ArrowImageBar($group, 'imagebar');
new ArrowReveal($group, 'reveal');
new ArrowText($group, 'text');
}
/**
* @param AbstractWidgetGroup $group
*/
public function sliderWidgetAutoplay($group) {
new AutoplayImage($group, 'imageBlue', array(
'widget-autoplay-position-area' => 11,
'widget-autoplay-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"10|*|10|*|10|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":""},{"backgroundcolor":"04C018FF"}]}'
));
}
/**
* @param AbstractWidgetGroup $group
*/
public function sliderWidgetHtml($group) {
new HtmlCode($group, 'html');
}
/**
* @param AbstractWidgetGroup $group
*/
public function sliderWidgetFullScreen($group) {
new FullScreenImage($group, 'image');
new FullScreenImage($group, 'imageBlue', array(
'widget-fullscreen-tonormal' => '$ss$/plugins/widgetfullscreen/image/image/tonormal/full2.svg',
'widget-fullscreen-tofull' => '$ss$/plugins/widgetfullscreen/image/image/tofull/full2.svg',
'widget-fullscreen-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"10|*|10|*|10|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":""},{"backgroundcolor":"04C018FF"}]}'
));
}
/**
* @param AbstractWidgetGroup $group
*/
public function sliderWidgetBullet($group) {
new BulletTransition($group, 'transitionBorder', array(
'widget-bullet-style' => '{"data":[{"backgroundcolor":"00000000","padding":"5|*|5|*|5|*|5|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"2|*|solid|*|000000c2","borderradius":"50","extra":"margin: 4px;"},{"backgroundcolor":"000000ba","border":"2|*|solid|*|ffffff00"}]}'
));
new BulletTransition($group, 'transitionRectangle', array(
'widget-bullet-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"8|*|8|*|8|*|8|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":"margin: 4px;"},{"backgroundcolor":"04C018FF"}]}'
));
new BulletTransition($group, 'transitionBar', array(
'widget-bullet-style' => '{"data":[{"backgroundcolor":"00000000","padding":"5|*|5|*|5|*|5|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"2|*|solid|*|000000c2","borderradius":"50","extra":"margin: 4px 3px;"},{"backgroundcolor":"000000ba","border":"2|*|solid|*|ffffff00"}]}',
'widget-bullet-bar' => '{"data":[{"backgroundcolor":"ffffff80","padding":"2|*|5|*|2|*|5|*|px","boxshadow":"0|*|1|*|5|*|0|*|00000033","border":"0|*|solid|*|000000ff","borderradius":"50","extra":""}]}',
));
new BulletNumbers($group, 'numbers');
new BulletText($group, 'text');
}
/**
* @param AbstractWidgetGroup $group
*/
public function sliderWidgetIndicator($group) {
new IndicatorPie($group, 'pie');
new IndicatorPie($group, 'pieFull', array(
'widget-indicator-thickness' => 100,
'widget-indicator-track' => 'ffffff00',
'widget-indicator-bar' => 'ffffff80',
));
new IndicatorStripe($group, 'stripe');
}
/**
* @param AbstractWidgetGroup $group
*/
public function sliderWidgetBar($group) {
new BarVertical($group, 'vertical');
}
/**
* @param AbstractWidgetGroup $group
*/
public function sliderWidgetThumbnail($group) {
new ThumbnailBasic($group, 'defaultHorizontal', array(
'widget-thumbnail-style-bar' => '{"data":[{"backgroundcolor":"242424ff","padding":"0|*|0|*|0|*|0|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":""}]}',
'widget-thumbnail-style-slides' => '{"data":[{"backgroundcolor":"00000000","padding":"0|*|0|*|0|*|0|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|ffffff00","borderradius":"0","opacity":"40","extra":"transition: all 0.4s;\nbackground-size: cover;"},{"border":"0|*|solid|*|ffffffcc","opacity":"100","extra":""}]}',
'widget-thumbnail-title-style' => '{"data":[{"backgroundcolor":"00000000","padding":"3|*|10|*|3|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":"bottom: 0;\nleft: 0;"}]}',
'widget-thumbnail-title' => 1,
'widget-thumbnail-title-font' => '{"data":[{"color":"ffffffff","size":"14||px","tshadow":"0|*|0|*|0|*|000000ab","afont":"Montserrat","lineheight":"1.4","bold":0,"italic":0,"underline":0,"align":"left"},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-thumbnail-description' => 1,
'widget-thumbnail-caption-placement' => 'after'
));
new ThumbnailBasic($group, 'defaultHorizontalGallery', array(
'widget-thumbnail-title' => 0,
'widget-thumbnail-group' => 2
));
new ThumbnailBasic($group, 'defaultVertical', array(
'widget-thumbnail-position-area' => 5,
'widget-thumbnail-title' => 1,
));
new ThumbnailBasic($group, 'defaultVerticalText', array(
'widget-thumbnail-position-area' => 5,
'widget-thumbnail-style-slides' => '{"data":[{"backgroundcolor":"00000000","padding":"0|*|0|*|0|*|0|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|ffffff00","borderradius":"0","opacity":"60","extra":"background-size: cover;\nmargin: 10px 0;\n"},{"backgroundcolor":"00000000","opacity":"100","extra":"background-size: cover;\nmargin: 10px 0;\n"}]}',
'widget-thumbnail-title-style' => '{"data":[{"backgroundcolor":"00000000","padding":"3|*|10|*|3|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":"bottom: 0;\nleft: 0;"}]}',
'widget-thumbnail-title' => 1,
'widget-thumbnail-title-font' => '{"data":[{"color":"ffffffe6","size":"14||px","tshadow":"0|*|0|*|0|*|000000ab","afont":"Montserrat","lineheight":"1.8","bold":0,"italic":0,"underline":0,"align":"left","extra":""},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-thumbnail-description' => 1,
'widget-thumbnail-description-font' => '{"data":[{"color":"ffffff7d","size":"12||px","tshadow":"0|*|0|*|0|*|000000ab","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":0,"underline":0,"align":"left"},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-thumbnail-caption-size' => 200,
'widget-thumbnail-show-image' => 0,
'widget-thumbnail-width' => 100,
'widget-thumbnail-height' => 60,
'widget-thumbnail-caption-placement' => 'after'
));
}
} Html/HtmlCode/HtmlCode.php 0000644 00000001572 15241527141 0011366 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Html\HtmlCode;
use Nextend\Framework\Form\Element\Textarea;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\AbstractWidget;
class HtmlCode extends AbstractWidget {
protected $key = 'widget-html-';
protected $defaults = array(
'widget-html-position-mode' => 'simple',
'widget-html-position-area' => 2,
'widget-html-code' => '',
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-html-row-1');
new WidgetPosition($row1, 'widget-html-position', n2_('Position'));
new Textarea($row1, 'widget-html-code', 'HTML', '', array(
'height' => 300,
'width' => 600
));
}
} Html/HtmlCode/HtmlCodeFrontend.php 0000644 00000002054 15241527144 0013065 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Html\HtmlCode;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class HtmlCodeFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$params = $this->params;
$slider->features->addInitCallback("new _N2.SmartSliderWidget(this, 'html', '.n2-widget-html');");
$slider->sliderType->addJSDependency('SmartSliderWidget');
$displayAttributes = $this->getDisplayAttributes($params, $this->key, 1);
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
"class" => "n2-widget-html"
)), $params->get($this->key . 'code'));
}
} FullScreen/FullScreenImage/FullScreenImage.php 0000644 00000012072 15241527152 0015337 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\FullScreen\FullScreenImage;
use Nextend\Framework\Form\Element\Grouping;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Radio\ImageListFromFolder;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text\Color;
use Nextend\Framework\Form\Element\Text\FieldImage;
use Nextend\Framework\Form\Element\Text\Number;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\AbstractWidget;
class FullScreenImage extends AbstractWidget {
protected $key = 'widget-fullscreen-';
protected $defaults = array(
'widget-fullscreen-desktop-image-width' => 16,
'widget-fullscreen-tablet-image-width' => 16,
'widget-fullscreen-mobile-image-width' => 8,
'widget-fullscreen-tonormal-image' => '',
'widget-fullscreen-tonormal-color' => 'ffffffcc',
'widget-fullscreen-tonormal' => '$ss$/plugins/widgetfullscreen/image/image/tonormal/full1.svg',
'widget-fullscreen-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"10|*|10|*|10|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":""},{"backgroundcolor":"000000ab"}]}',
'widget-fullscreen-position-mode' => 'simple',
'widget-fullscreen-position-area' => 4,
'widget-fullscreen-position-offset' => 15,
'widget-fullscreen-mirror' => 1,
'widget-fullscreen-tofull-image' => '',
'widget-fullscreen-tofull-color' => 'ffffffcc',
'widget-fullscreen-tofull' => '$ss$/plugins/widgetfullscreen/image/image/tofull/full1.svg'
);
public function renderFields($container) {
$rowIcon = new FieldsetRow($container, 'widget-bullet-transition-row-icon');
$fieldToNormal = new ImageListFromFolder($rowIcon, 'widget-fullscreen-tonormal', n2_('To normal'), '', array(
'folder' => self::getAssetsPath() . '/tonormal/'
));
new FieldImage($fieldToNormal, 'widget-fullscreen-tonormal-image', n2_('Custom'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-fullscreen-tonormal-color'
)
));
new Color($rowIcon, 'widget-fullscreen-tonormal-color', n2_('Color'), '', array(
'alpha' => true
));
new OnOff($rowIcon, 'widget-fullscreen-mirror', n2_('Mirror'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-fullscreen-tofull',
'sliderwidget-fullscreen-tofull-color'
)
));
$fieldToFull = new ImageListFromFolder($rowIcon, 'widget-fullscreen-tofull', n2_('To fullscreen'), '', array(
'folder' => self::getAssetsPath() . '/tofull/'
));
new FieldImage($fieldToFull, 'widget-fullscreen-tofull-image', n2_('Custom'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-fullscreen-tofull-color-grouping'
)
));
$groupingPauseColor = new Grouping($rowIcon, 'widget-fullscreen-tofull-color-grouping');
new Color($groupingPauseColor, 'widget-fullscreen-tofull-color', n2_('Color'), '', array(
'alpha' => true
));
$row3 = new FieldsetRow($container, 'widget-fullscreen-image-row-3');
new Style($row3, 'widget-fullscreen-style', n2_('Fullscreen'), '', array(
'mode' => 'button',
'preview' => 'SmartSliderAdminWidgetFullScreenImage'
));
new WidgetPosition($row3, 'widget-fullscreen-position', n2_('Position'));
$row4 = new FieldsetRow($container, 'widget-fullscreen-image-row-4');
new Number($row4, 'widget-fullscreen-desktop-image-width', n2_('Image width - Desktop'), '', array(
'wide' => 4,
'unit' => 'px'
));
new Number($row4, 'widget-fullscreen-tablet-image-width', n2_('Image width - Tablet'), '', array(
'wide' => 4,
'unit' => 'px'
));
new Number($row4, 'widget-fullscreen-mobile-image-width', n2_('Image width - Mobile'), '', array(
'wide' => 4,
'unit' => 'px'
));
}
public function prepareExport($export, $params) {
$export->addImage($params->get($this->key . 'tonormal-image', ''));
$export->addImage($params->get($this->key . 'tofull-image', ''));
$export->addVisual($params->get($this->key . 'style'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'tonormal-image', $import->fixImage($params->get($this->key . 'tonormal-image', '')));
$params->set($this->key . 'tofull-image', $import->fixImage($params->get($this->key . 'tofull-image', '')));
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style', '')));
}
} FullScreen/FullScreenImage/FullScreenImageFrontend.php 0000644 00000015226 15241527155 0017046 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\FullScreen\FullScreenImage;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Cast;
use Nextend\Framework\FastImageSize\FastImageSize;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Misc\Base64;
use Nextend\Framework\Parser\Color;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class FullScreenImageFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
$html = '';
$sizeAttributes = array();
$toNormalImage = $params->get($this->key . 'tonormal-image');
$toNormalValue = $params->get($this->key . 'tonormal');
$toNormalColor = $params->get($this->key . 'tonormal-color');
if (empty($toNormalImage)) {
if ($toNormalValue == -1) {
$toNormal = null;
} else {
$toNormal = ResourceTranslator::pathToResource(self::getAssetsPath() . '/tonormal/' . basename($toNormalValue));
}
} else {
$toNormal = $toNormalImage;
}
if ($params->get($this->key . 'mirror')) {
$toFullColor = $toNormalColor;
if (!empty($toNormalImage)) {
$toFull = $toNormalImage;
} else {
$toFull = ResourceTranslator::pathToResource(self::getAssetsPath() . '/tofull/' . basename($toNormalValue));
}
} else {
$toFull = $params->get($this->key . 'tofull-image');
$toFullColor = $params->get($this->key . 'tofull-color');
if (empty($toFull)) {
$toFullValue = $params->get($this->key . 'tofull');
if ($toFull == -1) {
$toFull = null;
} else {
$toFull = ResourceTranslator::pathToResource(self::getAssetsPath() . '/tofull/' . basename($toFullValue));
}
}
}
if ($toNormal && $toFull) {
$desktopWidth = $params->get('widget-fullscreen-desktop-image-width');
$tabletWidth = $params->get('widget-fullscreen-tablet-image-width');
$mobileWidth = $params->get('widget-fullscreen-mobile-image-width');
$slider->addDeviceCSS('all', '#' . $id . ' .n2-full-screen-widget img{width: ' . $desktopWidth . 'px}');
if ($tabletWidth != $desktopWidth) {
$slider->addDeviceCSS('tabletportrait', 'div#' . $id . ' .n2-full-screen-widget img{width: ' . $tabletWidth . 'px}');
$slider->addDeviceCSS('tabletlandscape', 'div#' . $id . ' .n2-full-screen-widget img{width: ' . $tabletWidth . 'px}');
}
if ($mobileWidth != $desktopWidth) {
$slider->addDeviceCSS('mobileportrait', 'div#' . $id . ' .n2-full-screen-widget img{width: ' . $mobileWidth . 'px}');
$slider->addDeviceCSS('mobilelandscape', 'div#' . $id . ' .n2-full-screen-widget img{width: ' . $mobileWidth . 'px}');
}
FastImageSize::initAttributes($toNormal, $sizeAttributes);
$ext = pathinfo($toNormal, PATHINFO_EXTENSION);
if ($ext == 'svg' && ResourceTranslator::isResource($toNormal)) {
list($color, $opacity) = Color::colorToSVG($toNormalColor);
$toNormal = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), Filesystem::readFile(ResourceTranslator::toPath($toNormal))));
} else {
$toNormal = ResourceTranslator::toUrl($toNormal);
}
$ext = pathinfo($toFull, PATHINFO_EXTENSION);
if ($ext == 'svg' && ResourceTranslator::isResource($toFull)) {
list($color, $opacity) = Color::colorToSVG($toFullColor);
$toFull = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), Filesystem::readFile(ResourceTranslator::toPath($toFull))));
} else {
$toFull = ResourceTranslator::toUrl($toFull);
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-fullscreen.min.js', 'w-fullscreen');
$displayAttributes = $this->getDisplayAttributes($params, $this->key);
$styleClass = $slider->addStyle($params->get($this->key . 'style'), 'heading');
$slider->features->addInitCallback('new _N2.SmartSliderWidgetFullScreenImage(this, ' . Cast::floatToString($params->get($this->key . 'responsive-desktop')) . ', ' . Cast::floatToString($params->get($this->key . 'responsive-tablet')) . ', ' . Cast::floatToString($params->get($this->key . 'responsive-mobile')) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetFullScreenImage');
$html = Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'class' => $styleClass . 'n2-full-screen-widget n2-ow-all n2-full-screen-widget-image nextend-fullscreen'
)), Html::image($toNormal, n2_('Exit full screen'), $sizeAttributes + Html::addExcludeLazyLoadAttributes(array(
'class' => 'n2-full-screen-widget-to-normal',
'role' => 'button',
'tabindex' => '0'
))) . Html::image($toFull, n2_('Enter Full screen'), $sizeAttributes + Html::addExcludeLazyLoadAttributes(array(
'class' => 'n2-full-screen-widget-to-full',
'role' => 'button',
'tabindex' => '0'
))));
}
return $html;
}
} Bullet/BulletNumbers/BulletNumbers.php 0000644 00000011165 15241527157 0014067 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Bullet\BulletNumbers;
use Nextend\Framework\Form\Element\Font;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\Bullet\AbstractBullet;
class BulletNumbers extends AbstractBullet {
protected $defaults = array(
'widget-bullet-position-mode' => 'simple',
'widget-bullet-position-area' => 10,
'widget-bullet-position-offset' => 5,
'widget-bullet-action' => 'click',
'widget-bullet-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"5|*|9|*|5|*|9|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":"min-width: 10px;\nmargin: 4px;"},{"backgroundcolor":"5F39C2FF","padding":"5|*|9|*|5|*|9|*|px"}]}',
'widget-bullet-font' => '{"data":[{"color":"ffffffff","size":"14||px","tshadow":"0|*|0|*|0|*|000000ff","afont":"Montserrat","lineheight":"1.2","bold":0,"italic":0,"underline":0,"align":"center","extra":""},{"color":"ffffffff"}]}',
'widget-bullet-bar' => '',
'widget-bullet-align' => 'center',
'widget-bullet-orientation' => 'auto',
'widget-bullet-bar-full-size' => 0,
'widget-bullet-overlay' => 0,
'widget-bullet-thumbnail-show-image' => 0,
'widget-bullet-thumbnail-width' => 60,
'widget-bullet-thumbnail-style' => '{"data":[{"backgroundcolor":"00000080","padding":"3|*|3|*|3|*|3|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":"margin: 5px;"}]}',
'widget-bullet-thumbnail-side' => 'before'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-bullet-number-row-1');
new WidgetPosition($row1, 'widget-bullet-position', n2_('Position'));
new Select($row1, 'widget-bullet-action', n2_('Action'), '', array(
'options' => array(
'click' => n2_('Click'),
'mouseenter' => n2_('Hover')
)
));
$row2 = new FieldsetRow($container, 'widget-bullet-number-row-2');
new Style($row2, 'widget-bullet-style', n2_('Dot'), '', array(
'mode' => 'dot',
'font' => 'sliderwidget-bullet-font',
'style2' => 'sliderwidget-bullet-bar',
'preview' => 'SmartSliderAdminWidgetBulletNumbers'
));
new Font($row2, 'widget-bullet-font', n2_('Text'), '', array(
'mode' => 'dot',
'style' => 'sliderwidget-bullet-style',
'style2' => 'sliderwidget-bullet-bar',
'preview' => 'SmartSliderAdminWidgetBulletNumbers'
));
new Style($row2, 'widget-bullet-bar', n2_('Bar'), '', array(
'mode' => 'simple',
'font' => 'sliderwidget-bullet-font',
'style2' => 'sliderwidget-bullet-style',
'preview' => 'SmartSliderAdminWidgetBulletNumbers'
));
new OnOff($row2, 'widget-bullet-bar-full-size', n2_('Bar full size'), '');
new Select($row2, 'widget-bullet-align', n2_('Align'), '', array(
'options' => array(
'left' => n2_('Left'),
'center' => n2_('Center'),
'right' => n2_('Right')
)
));
new Select($row2, 'widget-bullet-orientation', n2_('Orientation'), '', array(
'options' => array(
'auto' => n2_('Auto'),
'horizontal' => n2_('Horizontal'),
'vertical' => n2_('Vertical')
)
));
new OnOff($row2, 'widget-bullet-overlay', n2_('Overlay'), '');
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'style'));
$export->addVisual($params->get($this->key . 'bar'));
$export->addVisual($params->get($this->key . 'font'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style')));
$params->set($this->key . 'bar', $import->fixSection($params->get($this->key . 'bar')));
$params->set($this->key . 'font', $import->fixSection($params->get($this->key . 'font')));
}
} Bullet/BulletNumbers/BulletNumbersFrontend.php 0000644 00000007012 15241527161 0015556 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Bullet\BulletNumbers;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\Bullet\AbstractBulletFrontend;
class BulletNumbersFrontend extends AbstractBulletFrontend {
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if ($slider->getSlidesCount() <= 1) {
return '';
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup($this->getCommonAssetsPath() . '/dist/w-bullet.min.js', 'w-bullet');
$displayAttributes = $this->getDisplayAttributes($params, $this->key, 1);
$bulletStyle = $slider->addStyle($params->get($this->key . 'style'), 'dot');
$barStyle = $slider->addStyle($params->get($this->key . 'bar'), 'simple');
$bulletFont = $slider->addFont($params->get($this->key . 'font'), 'dot');
$orientation = $this->getOrientationByPosition($params->get($this->key . 'position-mode'), $params->get($this->key . 'position-area'), $params->get($this->key . 'orientation'), 'horizontal');
$parameters = array(
'overlay' => ($params->get($this->key . 'position-mode') || $params->get($this->key . 'overlay')) ? 1 : 0,
'area' => intval($params->get($this->key . 'position-area')),
'dotClasses' => $bulletStyle . $bulletFont,
'mode' => 'numeric',
'action' => $params->get($this->key . 'action')
);
if ($params->get($this->key . 'thumbnail-show-image')) {
$parameters['thumbnail'] = 1;
$parameters['thumbnailWidth'] = intval($params->get($this->key . 'thumbnail-width'));
$parameters['thumbnailHeight'] = intval($params->get($this->key . 'thumbnail-height'));
$parameters['thumbnailStyle'] = $slider->addStyle($params->get($this->key . 'thumbnail-style'), 'simple', '');
$side = $params->get($this->key . 'thumbnail-side', 'before');
if ($side == 'before') {
if ($orientation == 'vertical') {
$position = 'left';
} else {
$position = 'top';
}
} else {
if ($orientation == 'vertical') {
$position = 'right';
} else {
$position = 'bottom';
}
}
$parameters['thumbnailPosition'] = $position;
}
$slider->features->addInitCallback('new _N2.SmartSliderWidgetBulletTransition(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetBulletTransition');
$fullSize = intval($params->get($this->key . 'bar-full-size'));
return Html::tag("div", Html::mergeAttributes($attributes, $displayAttributes, array(
"class" => 'n2-ss-control-bullet n2-ow-all n2-ss-control-bullet-' . $orientation . ($fullSize ? ' n2-ss-control-bullet-fullsize' : '')
)), Html::tag("div", array(
"class" => $barStyle . " nextend-bullet-bar n2-bar-justify-content-" . $params->get($this->key . 'align')
), '<div class="n2-bullet ' . $bulletStyle . $bulletFont . '" style="visibility:hidden;"> </div>'));
}
} Bullet/BulletText/BulletText.php 0000644 00000011064 15241527164 0012705 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Bullet\BulletText;
use Nextend\Framework\Form\Element\Font;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\Bullet\AbstractBullet;
class BulletText extends AbstractBullet {
protected $defaults = array(
'widget-bullet-position-mode' => 'simple',
'widget-bullet-position-area' => 10,
'widget-bullet-position-offset' => 5,
'widget-bullet-action' => 'click',
'widget-bullet-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"5|*|15|*|5|*|15|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"30","extra":"margin: 4px;"},{"backgroundcolor":"04C018FF"}]}',
'widget-bullet-font' => '{"data":[{"color":"ffffffff","size":"12||px","tshadow":"0|*|0|*|0|*|000000ff","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":0,"underline":0,"align":"left","extra":""},{"color":"ffffffff"}]}',
'widget-bullet-bar' => '',
'widget-bullet-align' => 'center',
'widget-bullet-orientation' => 'auto',
'widget-bullet-bar-full-size' => 0,
'widget-bullet-overlay' => 0,
'widget-bullet-thumbnail-show-image' => 0,
'widget-bullet-thumbnail-width' => 60,
'widget-bullet-thumbnail-style' => '{"data":[{"backgroundcolor":"00000080","padding":"3|*|3|*|3|*|3|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":"margin: 5px;"}]}',
'widget-bullet-thumbnail-side' => 'before'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-bullet-text-row-1');
new WidgetPosition($row1, 'widget-bullet-position', n2_('Position'));
new Select($row1, 'widget-bullet-action', n2_('Action'), '', array(
'options' => array(
'click' => n2_('Click'),
'mouseenter' => n2_('Hover')
)
));
$row2 = new FieldsetRow($container, 'widget-bullet-text-row-2');
new Style($row2, 'widget-bullet-style', n2_('Dot'), '', array(
'mode' => 'dot',
'font' => 'sliderwidget-bullet-font',
'style2' => 'sliderwidget-bullet-bar',
'preview' => 'SmartSliderAdminWidgetBulletText'
));
new Font($row2, 'widget-bullet-font', n2_('Text'), '', array(
'mode' => 'dot',
'style' => 'sliderwidget-bullet-style',
'style2' => 'sliderwidget-bullet-bar',
'preview' => 'SmartSliderAdminWidgetBulletText'
));
new Style($row2, 'widget-bullet-bar', n2_('Bar'), '', array(
'mode' => 'simple',
'font' => 'sliderwidget-bullet-font',
'style2' => 'sliderwidget-bullet-style',
'preview' => 'SmartSliderAdminWidgetBulletText'
));
new OnOff($row2, 'widget-bullet-bar-full-size', n2_('Bar full size'), '');
new Select($row2, 'widget-bullet-align', n2_('Align'), '', array(
'options' => array(
'left' => n2_('Left'),
'center' => n2_('Center'),
'right' => n2_('Right')
)
));
new Select($row2, 'widget-bullet-orientation', n2_('Orientation'), '', array(
'options' => array(
'auto' => n2_('Auto'),
'horizontal' => n2_('Horizontal'),
'vertical' => n2_('Vertical')
)
));
new OnOff($row2, 'widget-bullet-overlay', n2_('Overlay'), '');
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'style'));
$export->addVisual($params->get($this->key . 'bar'));
$export->addVisual($params->get($this->key . 'font'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style')));
$params->set($this->key . 'bar', $import->fixSection($params->get($this->key . 'bar')));
$params->set($this->key . 'font', $import->fixSection($params->get($this->key . 'font')));
}
} Bullet/BulletText/BulletTextFrontend.php 0000644 00000007046 15241527166 0014414 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Bullet\BulletText;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\Bullet\AbstractBulletFrontend;
class BulletTextFrontend extends AbstractBulletFrontend {
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if ($slider->getSlidesCount() <= 1) {
return '';
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup($this->getCommonAssetsPath() . '/dist/w-bullet.min.js', 'w-bullet');
$displayAttributes = $this->getDisplayAttributes($params, $this->key, 1);
$bulletStyle = $slider->addStyle($params->get($this->key . 'style'), 'dot');
$barStyle = $slider->addStyle($params->get($this->key . 'bar'), 'simple');
$bulletFont = $slider->addFont($params->get($this->key . 'font'), 'dot');
$orientation = $this->getOrientationByPosition($params->get($this->key . 'position-mode'), $params->get($this->key . 'position-area'), $params->get($this->key . 'orientation'), 'horizontal');
$parameters = array(
'overlay' => ($params->get($this->key . 'position-mode') != 'simple' || $params->get($this->key . 'overlay') || $orientation == 'vertical') ? 1 : 0,
'area' => intval($params->get($this->key . 'position-area')),
'dotClasses' => $bulletStyle . $bulletFont,
'mode' => 'title',
'action' => $params->get($this->key . 'action')
);
if ($params->get($this->key . 'thumbnail-show-image')) {
$parameters['thumbnail'] = 1;
$parameters['thumbnailWidth'] = intval($params->get($this->key . 'thumbnail-width'));
$parameters['thumbnailHeight'] = intval($params->get($this->key . 'thumbnail-height'));
$parameters['thumbnailStyle'] = $slider->addStyle($params->get($this->key . 'thumbnail-style'), 'simple', '');
$side = $params->get($this->key . 'thumbnail-side');
if ($side == 'before') {
if ($orientation == 'vertical') {
$position = 'left';
} else {
$position = 'top';
}
} else {
if ($orientation == 'vertical') {
$position = 'right';
} else {
$position = 'bottom';
}
}
$parameters['thumbnailPosition'] = $position;
}
$slider->features->addInitCallback('new _N2.SmartSliderWidgetBulletTransition(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetBulletTransition');
$fullSize = intval($params->get($this->key . 'bar-full-size'));
return Html::tag("div", Html::mergeAttributes($attributes, $displayAttributes, array(
"class" => 'n2-ss-control-bullet n2-ow-all n2-ss-control-bullet-' . $orientation . ($fullSize ? ' n2-ss-control-bullet-fullsize' : '')
)), Html::tag("div", array(
"class" => $barStyle . " nextend-bullet-bar n2-bar-justify-content-" . $params->get($this->key . 'align')
), '<div class="n2-bullet ' . $bulletStyle . $bulletFont . '" style="visibility:hidden;"> </div>'));
}
} Bar/BarVertical/BarVertical.php 0000644 00000006763 15241527174 0012401 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Bar\BarVertical;
use Nextend\Framework\Form\Element\Font;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\Bar\AbstractWidgetBar;
class BarVertical extends AbstractWidgetBar {
protected $defaults = array(
'widget-bar-position-mode' => 'simple',
'widget-bar-position-area' => 6,
'widget-bar-position-offset' => 0,
'widget-bar-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"20|*|20|*|20|*|20|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"0","extra":""}]}',
'widget-bar-font-title' => '{"data":[{"color":"ffffffff","size":"16||px","tshadow":"0|*|0|*|0|*|000000c7","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":0,"underline":0,"align":"left"},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-bar-font-description' => '{"data":[{"color":"ffffffff","size":"12||px","tshadow":"0|*|0|*|0|*|000000c7","afont":"Montserrat","lineheight":"1.6","bold":0,"italic":0,"underline":0,"align":"left","extra":"margin-top:10px;"},{"color":"fc2828ff","afont":"Raleway,Arial","size":"25||px"},{}]}',
'widget-bar-width' => '200px',
'widget-bar-height' => '100%',
'widget-bar-animate' => 0
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-bar-vertical-row-1');
new WidgetPosition($row1, 'widget-bar-position', n2_('Position'));
new OnOff($row1, 'widget-bar-animate', n2_('Animate'));
new Style($row1, 'widget-bar-style', n2_('Bar'), '', array(
'mode' => 'simple',
'font' => 'sliderwidget-bar-font-title',
'font2' => 'sliderwidget-bar-font-description',
'preview' => 'SmartSliderAdminWidgetBarVertical'
));
new Font($row1, 'widget-bar-font-title', n2_('Title'), '', array(
'mode' => 'simple',
'style' => 'sliderwidget-bar-style',
'preview' => 'SmartSliderAdminWidgetBarVertical'
));
new Font($row1, 'widget-bar-font-description', n2_('Description'), '', array(
'mode' => 'simple',
'style' => 'sliderwidget-bar-style',
'preview' => 'SmartSliderAdminWidgetBarVertical'
));
$row2 = new FieldsetRow($container, 'widget-bar-vertical-row-2');
new Text($row2, 'widget-bar-width', n2_('Width'));
new Text($row2, 'widget-bar-height', n2_('Height'), '');
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'style'));
$export->addVisual($params->get($this->key . 'font-title'));
$export->addVisual($params->get($this->key . 'font-description'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style', '')));
$params->set($this->key . 'font-title', $import->fixSection($params->get($this->key . 'font-title', '')));
$params->set($this->key . 'font-description', $import->fixSection($params->get($this->key . 'font-description', '')));
}
} Bar/BarVertical/BarVerticalFrontend.php 0000644 00000006271 15241527201 0014062 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Bar\BarVertical;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class BarVerticalFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->slider->exposeSlideData['description'] = true;
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-bar-vertical.min.js', 'w-bar-vertical');
$displayAttributes = $this->getDisplayAttributes($params, $this->key, 1);
$styleClass = $slider->addStyle($params->get($this->key . 'style'), 'simple');
$fontTitle = $slider->addFont($params->get($this->key . 'font-title'), 'simple');
$fontDescription = $slider->addFont($params->get($this->key . 'font-description'), 'simple');
$style = 'text-align: ' . $params->get($this->key . 'align', 'left') . ';';
$width = $params->get($this->key . 'width');
if (is_numeric($width) || substr($width, -1) == '%' || substr($width, -2) == 'px') {
$style .= 'width:' . $width . ';';
if (substr($width, -1) == '%') {
$attributes['data-width-percent'] = substr($width, 0, -1);
}
}
$height = $params->get($this->key . 'height');
if (is_numeric($height) || substr($height, -1) == '%' || substr($height, -2) == 'px') {
$style .= 'height:' . $height . ';';
if (substr($height, -1) == '%') {
$attributes['data-height-percent'] = substr($height, 0, -1);
}
}
$parameters = array(
'area' => intval($params->get($this->key . 'position-area')),
'animate' => intval($params->get($this->key . 'animate')),
'fontTitle' => $fontTitle,
'fontDescription' => $fontDescription
);
$slider->features->addInitCallback('new _N2.SmartSliderWidgetBarVertical(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetBarVertical');
return Html::tag("div", Html::mergeAttributes($attributes, $displayAttributes, array(
"class" => "nextend-bar nextend-bar-vertical n2-ss-widget-hidden n2-ow-all",
"style" => $style
)), Html::tag("div", array(
"class" => $styleClass
), Html::tag("div", array(), '')));
}
protected function translateArea($area) {
if ($area == 5) {
return 'left';
} else if ($area == 8) {
return 'right';
}
return parent::translateArea($area);
}
} Arrow/ArrowText/ArrowText.php 0000644 00000006102 15241527206 0012250 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Arrow\ArrowText;
use Nextend\Framework\Form\Element\Font;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3\Widget\Arrow\AbstractWidgetArrow;
class ArrowText extends AbstractWidgetArrow {
protected $key = 'widget-arrow-';
protected $defaults = array(
'widget-arrow-style' => '{"data":[{"backgroundcolor":"000000ab","padding":"8|*|10|*|8|*|10|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"3","extra":""},{"backgroundcolor":"04C018FF"}]}',
'widget-arrow-font' => '{"data":[{"color":"ffffffff","size":"12||px","tshadow":"0|*|0|*|0|*|000000ff","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":0,"underline":0,"align":"left","extra":""},{}]}',
'widget-arrow-previous-position-mode' => 'simple',
'widget-arrow-previous-position-area' => 6,
'widget-arrow-previous-position-offset' => 15,
'widget-arrow-next-position-mode' => 'simple',
'widget-arrow-next-position-area' => 7,
'widget-arrow-next-position-offset' => 15
);
public function __construct($widgetGroup, $name, $defaults = array()) {
parent::__construct($widgetGroup, $name, array_merge(array(
'widget-arrow-previous-label' => n2_('Prev'),
'widget-arrow-next-label' => n2_('Next')
), $defaults));
}
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-arrow-text-row-1');
new Text($row1, 'widget-arrow-previous-label', n2_('Previous label'));
new Text($row1, 'widget-arrow-next-label', n2_('Next label'));
$row2 = new FieldsetRow($container, 'widget-arrow-text-row-2');
new Style($row2, 'widget-arrow-style', n2_('Arrow'), '', array(
'mode' => 'button',
'font' => 'sliderwidget-arrow-font',
'preview' => 'SmartSliderAdminWidgetArrowText'
));
new Font($row2, 'widget-arrow-font', n2_('Text'), '', array(
'mode' => 'link',
'style' => 'sliderwidget-arrow-style',
'preview' => 'SmartSliderAdminWidgetArrowText'
));
new WidgetPosition($row2, 'widget-arrow-previous-position', n2_('Previous position'));
new WidgetPosition($row2, 'widget-arrow-next-position', n2_('Next position'));
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'font'));
$export->addVisual($params->get($this->key . 'style'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'font', $import->fixSection($params->get($this->key . 'font', '')));
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style', '')));
}
} Arrow/ArrowText/ArrowTextFrontend.php 0000644 00000007423 15241527211 0013753 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Arrow\ArrowText;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class ArrowTextFrontend extends AbstractWidgetFrontend {
protected $rendered = false;
protected $previousArguments;
protected $nextArguments;
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'previous-position-', array(
$this,
'renderPrevious'
));
$this->addToPlacement($this->key . 'next-position-', array(
$this,
'renderNext'
));
}
public function renderPrevious($attributes = array()) {
$this->render();
if ($this->previousArguments) {
array_unshift($this->previousArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->previousArguments);
}
return '';
}
public function renderNext($attributes = array()) {
$this->render();
if ($this->nextArguments) {
array_unshift($this->nextArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->nextArguments);
}
return '';
}
private function render() {
if ($this->rendered) return;
$this->rendered = true;
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if ($slider->getSlidesCount() <= 1) {
return;
}
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-arrow-text.min.js', 'w-arrow-text');
$slider->features->addInitCallback('new _N2.SmartSliderWidgetArrowText(this);');
$slider->sliderType->addJSDependency('SmartSliderWidgetArrowText');
$displayAttributes = $this->getDisplayAttributes($params, $this->key);
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
$font = $slider->addFont($params->get($this->key . 'font'), 'hover');
$style = $slider->addStyle($params->get($this->key . 'style'), 'heading');
$this->previousArguments = array(
$id,
'previous',
$displayAttributes,
$font,
$style
);
$this->nextArguments = array(
$id,
'next',
$displayAttributes,
$font,
$style
);
}
private function getHtml($attributes, $id, $side, $displayAttributes, $font, $styleClass) {
$label = '';
switch ($side) {
case 'previous':
$label = n2_('Previous slide');
break;
case 'next':
$label = n2_('Next slide');
break;
}
$html = Html::openTag("div", Html::mergeAttributes($attributes, $displayAttributes, array(
'id' => $id . '-arrow-' . $side,
"class" => "nextend-arrow nextend-arrow-{$side} n2-ow-all",
'tabindex' => '0',
'role' => 'button',
'aria-label' => $label
)));
$html .= Html::tag('div', array(
"class" => $styleClass . ' ' . $font . ' nextend-arrow-text',
"style" => 'display:inline-block'
), $this->params->get($this->key . $side . '-label'));
$html .= Html::closeTag("div");
return $html;
}
} Arrow/ArrowReveal/ArrowReveal.php 0000644 00000010476 15241527214 0013044 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Arrow\ArrowReveal;
use Nextend\Framework\Form\Element\Font;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Radio\ImageListFromFolder;
use Nextend\Framework\Form\Element\Select;
use Nextend\Framework\Form\Element\Text\Color;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Widget\Arrow\AbstractWidgetArrow;
class ArrowReveal extends AbstractWidgetArrow {
protected $defaults = array(
'widget-arrow-previous-position-mode' => 'simple',
'widget-arrow-previous-position-area' => 6,
'widget-arrow-previous-position-offset' => 0,
'widget-arrow-next-position-mode' => 'simple',
'widget-arrow-next-position-area' => 7,
'widget-arrow-next-position-offset' => 0,
'widget-arrow-font' => '',
'widget-arrow-background' => '00000080',
'widget-arrow-title-show' => 0,
'widget-arrow-title-font' => '{"data":[{"color":"ffffffff","size":"12||px","tshadow":"0|*|0|*|0|*|000000ff","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":0,"underline":0,"align":"left","extra":""},{}]}',
'widget-arrow-title-background' => '000000cc',
'widget-arrow-animation' => 'slide',
'widget-arrow-previous-color' => 'ffffffcc',
'widget-arrow-previous' => '$ss$/plugins/widgetarrow/reveal/reveal/previous/simple-horizontal.svg',
'widget-arrow-mirror' => 1,
'widget-arrow-next-color' => 'ffffffcc',
'widget-arrow-next' => '$ss$/plugins/widgetarrow/reveal/reveal/next/simple-horizontal.svg'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-arrow-reveal-row-1');
new Color($row1, 'widget-arrow-background', n2_('Background'), '', array(
'alpha' => true
));
new Select($row1, 'widget-arrow-animation', n2_('Animation'), '', array(
'options' => array(
'slide' => n2_x('Slide', 'Animation'),
'fade' => n2_('Fade'),
'turn' => n2_('Turn')
)
));
$rowPrevious = new FieldsetRow($container, 'widget-arrow-reveal-row-previous');
new ImageListFromFolder($rowPrevious, 'widget-arrow-previous', n2_x('Previous', 'Arrow direction'), '', array(
'post' => 'break',
'folder' => self::getAssetsPath() . '/previous/'
));
new Color($rowPrevious, 'widget-arrow-previous-color', n2_('Color'), '', array(
'alpha' => true
));
new OnOff($rowPrevious, 'widget-arrow-mirror', n2_('Mirror'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-arrow-next',
'sliderwidget-arrow-next-color'
)
));
new ImageListFromFolder($rowPrevious, 'widget-arrow-next', n2_x('Next', 'Arrow direction'), '', array(
'post' => 'break',
'folder' => self::getAssetsPath() . '/next/'
));
new Color($rowPrevious, 'widget-arrow-next-color', n2_('Color'), '', array(
'alpha' => true
));
$rowTitle = new FieldsetRow($container, 'widget-arrow-reveal-row-title');
new OnOff($rowTitle, 'widget-arrow-title-show', n2_('Slide title'), 0, array(
'relatedFieldsOn' => array(
'sliderwidget-arrow-title-font',
'sliderwidget-arrow-title-background'
)
));
new Font($rowTitle, 'widget-arrow-title-font', n2_('Font'), '', array(
'mode' => 'link',
'preview' => 'SmartSliderAdminWidgetArrowReveal'
));
new Color($rowTitle, 'widget-arrow-title-background', n2_('Background color'), '', array(
'alpha' => true
));
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'title-font'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'title-font', $import->fixSection($params->get($this->key . 'title-font', '')));
}
} Arrow/ArrowReveal/ArrowRevealFrontend.php 0000644 00000015236 15241527221 0014541 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Arrow\ArrowReveal;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Misc\Base64;
use Nextend\Framework\Parser\Color;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class ArrowRevealFrontend extends AbstractWidgetFrontend {
protected $rendered = false;
protected $previousArguments;
protected $nextArguments;
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->slider->exposeSlideData['thumbnail'] = true;
$this->addToPlacement($this->key . 'previous-position-', array(
$this,
'renderPrevious'
));
$this->addToPlacement($this->key . 'next-position-', array(
$this,
'renderNext'
));
}
public function renderPrevious($attributes = array()) {
$this->render();
if ($this->previousArguments) {
array_unshift($this->previousArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->previousArguments);
}
return '';
}
public function renderNext($attributes = array()) {
$this->render();
if ($this->nextArguments) {
array_unshift($this->nextArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->nextArguments);
}
return '';
}
private function render() {
if ($this->rendered) return;
$this->rendered = true;
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if ($slider->getSlidesCount() <= 1) {
return;
}
$RGBA = Color::colorToRGBA($params->get($this->key . 'background'));
$titleRGBA = Color::colorToRGBA($params->get($this->key . 'title-background'));
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId,
"arrowBackgroundRGBA" => $RGBA,
"titleBackgroundRGBA" => $titleRGBA
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-arrow-reveal.min.js', 'w-arrow-reveal');
$previousValue = basename($params->get($this->key . 'previous'));
if ($previousValue == -1) {
$previous = false;
} else {
$previous = ResourceTranslator::pathToResource(self::getAssetsPath() . '/previous/' . $previousValue);
}
$previousColor = $params->get($this->key . 'previous-color');
if ($params->get($this->key . 'mirror')) {
if ($previousValue == -1) {
$next = false;
} else {
$next = ResourceTranslator::pathToResource(self::getAssetsPath() . '/next/' . $previousValue);
}
$nextColor = $previousColor;
} else {
$nextValue = basename($params->get($this->key . 'next'));
if ($nextValue == -1) {
$next = false;
} else {
$next = ResourceTranslator::pathToResource(self::getAssetsPath() . '/next/' . $nextValue);
}
$nextColor = $params->get($this->key . 'next-color');
}
$fontClass = $slider->addFont($params->get($this->key . 'title-font'), 'simple');
$animation = $params->get($this->key . 'animation');
$animationClass = ' n2-ss-arrow-animation-' . $animation;
if ($previous) {
$this->previousArguments = array(
$id,
'previous',
$previous,
$fontClass,
$animationClass,
$previousColor
);
}
if ($next) {
$this->nextArguments = array(
$id,
'next',
$next,
$fontClass,
$animationClass,
$nextColor
);
}
$slider->features->addInitCallback('new _N2.SmartSliderWidgetArrowReveal(this,"' . $animation . '");');
$slider->sliderType->addJSDependency('SmartSliderWidgetArrowReveal');
}
/**
* @param array $attributes
* @param $id
* @param $side
* @param $image
* @param $fontClass
* @param $animationClass
* @param $color
*
* @return string
*/
private function getHTML($attributes, $id, $side, $image, $fontClass, $animationClass, $color) {
$displayAttributes = $this->getDisplayAttributes($this->params, $this->key);
$ext = pathinfo($image, PATHINFO_EXTENSION);
if ($ext == 'svg' && ResourceTranslator::isResource($image)) {
list($color, $opacity) = Color::colorToSVG($color);
$image = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), Filesystem::readFile(ResourceTranslator::toPath($image))));
} else {
$image = ResourceTranslator::toUrl($image);
}
$label = '';
switch ($side) {
case 'previous':
$label = n2_('Previous slide');
break;
case 'next':
$label = n2_('Next slide');
break;
}
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'id' => $id . '-arrow-' . $side,
'class' => 'nextend-arrow n2-ow nextend-arrow-reveal nextend-arrow-' . $side . $animationClass,
'role' => 'button',
'aria-label' => $label,
'tabindex' => '0'
)), Html::tag('div', array(
'class' => ' nextend-arrow-image n2-ow'
), $this->params->get($this->key . 'title-show') ? Html::tag('div', array(
'class' => $fontClass . ' nextend-arrow-title n2-ow'
), '') : '') . Html::tag('div', array(
'class' => 'nextend-arrow-arrow n2-ow',
'style' => 'background-image: url(' . $image . ');'
), ''));
}
} Arrow/ArrowImageBar/ArrowImageBar.php 0000644 00000005010 15241527224 0013513 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Arrow\ArrowImageBar;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Radio\ImageListFromFolder;
use Nextend\Framework\Form\Element\Text\Color;
use Nextend\Framework\Form\Element\Text\Number;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Widget\Arrow\AbstractWidgetArrow;
class ArrowImageBar extends AbstractWidgetArrow {
protected $defaults = array(
'widget-arrow-previous-position-mode' => 'simple',
'widget-arrow-previous-position-area' => 2,
'widget-arrow-previous-position-offset' => 0,
'widget-arrow-next-position-mode' => 'simple',
'widget-arrow-next-position-area' => 4,
'widget-arrow-next-position-offset' => 0,
'widget-arrow-width' => 100,
'widget-arrow-previous-color' => 'ffffffcc',
'widget-arrow-previous' => '$ss$/plugins/widgetarrow/imagebar/imagebar/previous/simple-horizontal.svg',
'widget-arrow-mirror' => 1,
'widget-arrow-next-color' => 'ffffffcc',
'widget-arrow-next' => '$ss$/plugins/widgetarrow/imagebar/imagebar/next/simple-horizontal.svg'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-arrow-image-bar-row-1');
new Number($row1, 'widget-arrow-width', n2_('Width'), 0, array(
'style' => 'width:40px;',
'unit' => 'px'
));
$rowIcon = new FieldsetRow($container, 'widget-arrow-image-bar-row-icon');
new ImageListFromFolder($rowIcon, 'widget-arrow-previous', n2_x('Previous', 'Arrow direction'), '', array(
'folder' => self::getAssetsPath() . '/previous/'
));
new Color($rowIcon, 'widget-arrow-previous-color', n2_('Color'), '', array(
'alpha' => true
));
new OnOff($rowIcon, 'widget-arrow-mirror', n2_('Mirror'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-arrow-next',
'sliderwidget-arrow-next-color'
)
));
new ImageListFromFolder($rowIcon, 'widget-arrow-next', n2_x('Next', 'Arrow direction'), '', array(
'folder' => self::getAssetsPath() . '/next/'
));
new Color($rowIcon, 'widget-arrow-next-color', n2_('Color'), '', array(
'alpha' => true
));
}
} Arrow/ArrowImageBar/ArrowImageBarFrontend.php 0000644 00000013636 15241527230 0015225 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Arrow\ArrowImageBar;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Data\Data;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Misc\Base64;
use Nextend\Framework\Parser\Color;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class ArrowImageBarFrontend extends AbstractWidgetFrontend {
protected $rendered = false;
protected $previousArguments;
protected $nextArguments;
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->slider->exposeSlideData['thumbnail'] = true;
$this->addToPlacement($this->key . 'previous-position-', array(
$this,
'renderPrevious'
));
$this->addToPlacement($this->key . 'next-position-', array(
$this,
'renderNext'
));
}
public function renderPrevious($attributes = array()) {
$this->render();
if ($this->previousArguments) {
array_unshift($this->previousArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->previousArguments);
}
return '';
}
public function renderNext($attributes = array()) {
$this->render();
if ($this->nextArguments) {
array_unshift($this->nextArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->nextArguments);
}
return '';
}
private function render() {
if ($this->rendered) return;
$this->rendered = true;
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if ($slider->getSlidesCount() <= 1) {
return;
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-arrow-imagebar.min.js', 'w-arrow-imagebar');
$previousValue = basename($params->get($this->key . 'previous'));
if ($previousValue == -1) {
$previous = false;
} else {
$previous = ResourceTranslator::pathToResource(self::getAssetsPath() . '/previous/' . $previousValue);
}
$previousColor = $params->get($this->key . 'previous-color');
if ($params->get($this->key . 'mirror')) {
if ($previousValue == -1) {
$next = false;
} else {
$next = ResourceTranslator::pathToResource(self::getAssetsPath() . '/next/' . $previousValue);
}
$nextColor = $previousColor;
} else {
$nextValue = basename($params->get($this->key . 'next'));
if ($nextValue == -1) {
$next = false;
} else {
$next = ResourceTranslator::pathToResource(self::getAssetsPath() . '/next/' . $nextValue);
}
$nextColor = $params->get($this->key . 'next-color');
}
if ($previous) {
$this->previousArguments = array(
$id,
'previous',
$previous,
$previousColor
);
}
if ($next) {
$this->nextArguments = array(
$id,
'next',
$next,
$nextColor
);
}
$slider->features->addInitCallback('new _N2.SmartSliderWidgetArrowImageBar(this);');
$slider->sliderType->addJSDependency('SmartSliderWidgetArrowImageBar');
}
/**
* @param array $attributes
* @param $id
* @param Data $params
* @param $side
*
* @return string
*/
private function getHTML($attributes, $id, $side, $image, $color) {
$displayAttributes = $this->getDisplayAttributes($this->params, $this->key);
$ext = pathinfo($image, PATHINFO_EXTENSION);
if ($ext == 'svg' && ResourceTranslator::isResource($image)) {
list($color, $opacity) = Color::colorToSVG($color);
$image = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), Filesystem::readFile(ResourceTranslator::toPath($image))));
} else {
$image = ResourceTranslator::toUrl($image);
}
$style = 'width: ' . intval($this->params->get($this->key . 'width')) . 'px';
$label = '';
switch ($side) {
case 'previous':
$label = n2_('Previous slide');
break;
case 'next':
$label = n2_('Next slide');
break;
}
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'id' => $id . '-arrow-' . $side,
'class' => 'nextend-arrow nextend-arrow-imagebar n2-ow-all nextend-arrow-' . $side,
'style' => $style,
'role' => 'button',
'aria-label' => $label,
'tabindex' => '0'
)), Html::tag('div', array(
'class' => 'nextend-arrow-image'
), '') . Html::tag('div', array(
'class' => 'nextend-arrow-arrow',
'style' => 'background-image: url(' . $image . ');'
), ''));
}
} Arrow/ArrowGrow/ArrowGrowFrontend.php 0000644 00000014176 15241527233 0013746 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Arrow\ArrowGrow;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Filesystem\Filesystem;
use Nextend\Framework\Misc\Base64;
use Nextend\Framework\Parser\Color;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class ArrowGrowFrontend extends AbstractWidgetFrontend {
protected $rendered = false;
protected $previousArguments;
protected $nextArguments;
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'previous-position-', array(
$this,
'renderPrevious'
));
$this->addToPlacement($this->key . 'next-position-', array(
$this,
'renderNext'
));
}
public function renderPrevious($attributes = array()) {
$this->render();
if ($this->previousArguments) {
array_unshift($this->previousArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->previousArguments);
}
return '';
}
public function renderNext($attributes = array()) {
$this->render();
if ($this->nextArguments) {
array_unshift($this->nextArguments, $attributes);
return call_user_func_array(array(
$this,
'getHTML'
), $this->nextArguments);
}
return '';
}
private function render() {
if ($this->rendered) return;
$this->rendered = true;
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if ($slider->getSlidesCount() <= 1) {
return '';
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-arrow-grow.min.js', 'w-arrow-grow');
$previousValue = basename($params->get($this->key . 'previous'));
if ($previousValue == -1) {
$previous = false;
} else {
$previous = ResourceTranslator::pathToResource(self::getAssetsPath() . '/previous/' . $previousValue);
}
$previousColor = $params->get($this->key . 'previous-color');
if ($params->get($this->key . 'mirror')) {
if ($previousValue == -1) {
$next = false;
} else {
$next = ResourceTranslator::pathToResource(self::getAssetsPath() . '/next/' . $previousValue);
}
$nextColor = $previousColor;
} else {
$nextValue = basename($params->get($this->key . 'next'));
if ($nextValue == -1) {
$next = false;
} else {
$next = ResourceTranslator::pathToResource(self::getAssetsPath() . '/next/' . $nextValue);
}
$nextColor = $params->get($this->key . 'next-color');
}
$fontClass = $slider->addFont($params->get($this->key . 'font'), 'hover');
$styleClass = $slider->addStyle($params->get($this->key . 'style'), 'heading');
if ($previous) {
$this->previousArguments = array(
$id,
'previous',
$previous,
$fontClass,
$styleClass,
$previousColor
);
}
if ($next) {
$this->nextArguments = array(
$id,
'next',
$next,
$fontClass,
$styleClass,
$nextColor
);
}
$slider->features->addInitCallback('new _N2.SmartSliderWidgetArrowGrow(this, ' . $params->get($this->key . 'animation-delay') . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetArrowGrow');
}
/**
* @param array $attributes
* @param $id
* @param $side
* @param $image
* @param $fontClass
* @param $styleClass
* @param $color
*
* @return string
*/
protected function getHTML($attributes, $id, $side, $image, $fontClass, $styleClass, $color) {
$displayAttributes = $this->getDisplayAttributes($this->params, $this->key);
$ext = pathinfo($image, PATHINFO_EXTENSION);
if ($ext == 'svg' && ResourceTranslator::isResource($image)) {
list($color, $opacity) = Color::colorToSVG($color);
$image = 'data:image/svg+xml;base64,' . Base64::encode(str_replace(array(
'fill="#FFF"',
'opacity="1"'
), array(
'fill="#' . $color . '"',
'opacity="' . $opacity . '"'
), Filesystem::readFile(ResourceTranslator::toPath($image))));
} else {
$image = ResourceTranslator::toUrl($image);
}
$label = '';
switch ($side) {
case 'previous':
$label = n2_('Previous slide');
break;
case 'next':
$label = n2_('Next slide');
break;
}
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'id' => $id . '-arrow-' . $side,
'class' => $styleClass . 'nextend-arrow n2-ow-all nextend-arrow-grow nextend-arrow-' . $side,
'role' => 'button',
'aria-label' => $label,
'tabindex' => '0'
)), Html::tag('div', array(
'class' => $fontClass . ' nextend-arrow-title'
), '') . Html::tag('div', array(
'class' => 'nextend-arrow-arrow',
'style' => 'background-image: url(' . $image . ');'
), ''));
}
} Arrow/ArrowGrow/ArrowGrow.php 0000644 00000007241 15241527236 0012244 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Arrow\ArrowGrow;
use Nextend\Framework\Form\Element\Font;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Radio\ImageListFromFolder;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text\Color;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Widget\Arrow\AbstractWidgetArrow;
class ArrowGrow extends AbstractWidgetArrow {
protected $defaults = array(
'widget-arrow-previous-position-mode' => 'simple',
'widget-arrow-previous-position-area' => 6,
'widget-arrow-previous-position-offset' => 15,
'widget-arrow-next-position-mode' => 'simple',
'widget-arrow-next-position-area' => 7,
'widget-arrow-next-position-offset' => 15,
'widget-arrow-style' => '{"data":[{"backgroundcolor":"00000080","padding":"3|*|3|*|3|*|3|*|px","boxshadow":"0|*|0|*|0|*|0|*|000000ff","border":"0|*|solid|*|000000ff","borderradius":"50","extra":""},{"backgroundcolor":"1D81F9FF"}]}',
'widget-arrow-font' => '{"data":[{"color":"ffffffff","size":"12||px","tshadow":"0|*|0|*|0|*|000000ff","afont":"Montserrat","lineheight":"1.3","bold":0,"italic":0,"underline":0,"align":"left","extra":""},{}]}',
'widget-arrow-previous-color' => 'ffffffcc',
'widget-arrow-previous' => '$ss$/plugins/widgetarrow/grow/grow/previous/simple-horizontal.svg',
'widget-arrow-mirror' => 1,
'widget-arrow-next-color' => 'ffffffcc',
'widget-arrow-next' => '$ss$/plugins/widgetarrow/grow/grow/next/simple-horizontal.svg'
);
public function renderFields($container) {
$rowIcon = new FieldsetRow($container, 'widget-arrow-grow-row-icon');
new ImageListFromFolder($rowIcon, 'widget-arrow-previous', n2_x('Previous', 'Arrow direction'), '', array(
'folder' => self::getAssetsPath() . '/previous/'
));
new Color($rowIcon, 'widget-arrow-previous-color', n2_('Color'), '', array(
'alpha' => true
));
new OnOff($rowIcon, 'widget-arrow-mirror', n2_('Mirror'), '', array(
'relatedFieldsOff' => array(
'sliderwidget-arrow-next',
'sliderwidget-arrow-next-color'
)
));
new ImageListFromFolder($rowIcon, 'widget-arrow-next', n2_x('Next', 'Arrow direction'), '', array(
'folder' => self::getAssetsPath() . '/next/'
));
new Color($rowIcon, 'widget-arrow-next-color', n2_('Color'), '', array(
'alpha' => true
));
$row3 = new FieldsetRow($container, 'widget-arrow-grow-row-3');
new Style($row3, 'widget-arrow-style', n2_('Arrow'), '', array(
'mode' => 'button',
'preview' => 'SmartSliderAdminWidgetArrowGrow'
));
new Font($row3, 'widget-arrow-font', n2_('Text'), '', array(
'mode' => 'link',
'preview' => 'SmartSliderAdminWidgetArrowGrow',
'style' => 'sliderwidget-arrow-style'
));
}
public function prepareExport($export, $params) {
$export->addVisual($params->get($this->key . 'style'));
$export->addVisual($params->get($this->key . 'font'));
}
public function prepareImport($import, $params) {
$params->set($this->key . 'style', $import->fixSection($params->get($this->key . 'style', '')));
$params->set($this->key . 'font', $import->fixSection($params->get($this->key . 'font', '')));
}
} Indicator/AbstractWidgetIndicator.php 0000644 00000000346 15241527242 0013744 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Indicator;
use Nextend\SmartSlider3\Widget\AbstractWidget;
abstract class AbstractWidgetIndicator extends AbstractWidget {
protected $key = 'widget-indicator-';
} Indicator/IndicatorStripe/IndicatorStripe.php 0000644 00000003102 15241527244 0015401 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Indicator\IndicatorStripe;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Form\Element\Text\Color;
use Nextend\Framework\Form\Element\Text\Number;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3Pro\Widget\Indicator\AbstractWidgetIndicator;
class IndicatorStripe extends AbstractWidgetIndicator {
protected $defaults = array(
'widget-indicator-position-mode' => 'simple',
'widget-indicator-position-area' => 9,
'widget-indicator-width' => '100%',
'widget-indicator-height' => 6,
'widget-indicator-track' => '000000ab',
'widget-indicator-bar' => '1D81F9FF'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-indicator-stripe-1');
new WidgetPosition($row1, 'widget-indicator-position', n2_('Position'));
new Text($row1, 'widget-indicator-width', n2_('Width'), '', array(
'style' => 'width:30px;',
'unit' => 'px'
));
new Number($row1, 'widget-indicator-height', n2_('Height'), '', array(
'wide' => 4,
'unit' => 'px'
));
new Color($row1, 'widget-indicator-track', n2_('Track color'), '', array(
'alpha' => true
));
new Color($row1, 'widget-indicator-bar', n2_('Bar color'), '', array(
'alpha' => true
));
}
} Indicator/IndicatorStripe/IndicatorStripeFrontend.php 0000644 00000004536 15241527250 0017112 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Indicator\IndicatorStripe;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Parser\Color;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class IndicatorStripeFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if (!$params->get('autoplay', 0)) {
return '';
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-indicator-stripe.min.js', 'w-indicator-stripe');
$displayAttributes = $this->getDisplayAttributes($params, $this->key);
$trackRGBA = Color::colorToRGBA($params->get($this->key . 'track'));
$barRGBA = Color::colorToRGBA($params->get($this->key . 'bar'));
$style = '';
$width = $params->get($this->key . 'width');
if (is_numeric($width) || substr($width, -1) == '%' || substr($width, -2) == 'px') {
$style .= 'width:' . $width . ';';
}
$height = intval($params->get($this->key . 'height'));
$parameters = array(
'area' => intval($params->get($this->key . 'position-area'))
);
$slider->features->addInitCallback('new _N2.SmartSliderWidgetIndicatorStripe(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetIndicatorStripe');
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'class' => "nextend-indicator nextend-indicator-stripe n2-ow-all",
'style' => 'background-color:' . $trackRGBA . ';' . $style
)), Html::tag('div', array(
'class' => "nextend-indicator-track",
'style' => 'height: ' . $height . 'px;background-color:' . $barRGBA . ';'
), ''));
}
} Indicator/IndicatorPie/IndicatorPie.php 0000644 00000003453 15241527252 0014127 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Indicator\IndicatorPie;
use Nextend\Framework\Form\Element\Style;
use Nextend\Framework\Form\Element\Text\Color;
use Nextend\Framework\Form\Element\Text\Number;
use Nextend\Framework\Form\Fieldset\FieldsetRow;
use Nextend\SmartSlider3\Form\Element\Group\WidgetPosition;
use Nextend\SmartSlider3Pro\Widget\Indicator\AbstractWidgetIndicator;
class IndicatorPie extends AbstractWidgetIndicator {
protected $defaults = array(
'widget-indicator-position-mode' => 'simple',
'widget-indicator-position-area' => 4,
'widget-indicator-position-offset' => 15,
'widget-indicator-size' => 25,
'widget-indicator-thickness' => 30,
'widget-indicator-track' => '000000ab',
'widget-indicator-bar' => 'ffffffff'
);
public function renderFields($container) {
$row1 = new FieldsetRow($container, 'widget-indicator-pie-1');
new WidgetPosition($row1, 'widget-indicator-position', n2_('Position'));
new Number($row1, 'widget-indicator-size', n2_('Size'), '', array(
'wide' => 4,
'unit' => 'px'
));
new Number($row1, 'widget-indicator-thickness', n2_('Line thickness'), '', array(
'wide' => 3,
'unit' => '%'
));
new Color($row1, 'widget-indicator-track', n2_('Track color'), '', array(
'alpha' => true
));
new Color($row1, 'widget-indicator-bar', n2_('Bar color'), '', array(
'alpha' => true
));
new Style($row1, 'widget-indicator-style', n2_('Style'), '', array(
'mode' => 'button',
'preview' => 'SmartSliderAdminWidgetIndicatorPie'
));
}
} Indicator/IndicatorPie/IndicatorPieFrontend.php 0000644 00000004236 15241527255 0015632 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Indicator\IndicatorPie;
use Nextend\Framework\Asset\Js\Js;
use Nextend\Framework\Parser\Color;
use Nextend\Framework\View\Html;
use Nextend\SmartSlider3\Widget\AbstractWidgetFrontend;
class IndicatorPieFrontend extends AbstractWidgetFrontend {
public function __construct($sliderWidget, $widget, $params) {
parent::__construct($sliderWidget, $widget, $params);
$this->addToPlacement($this->key . 'position-', array(
$this,
'render'
));
}
public function render($attributes = array()) {
$slider = $this->slider;
$id = $this->slider->elementId;
$params = $this->params;
if (!$params->get('autoplay', 0)) {
return '';
}
$slider->addLess(self::getAssetsPath() . '/style.n2less', array(
"sliderid" => $slider->elementId
));
Js::addStaticGroup(self::getAssetsPath() . '/dist/w-indicator-pie.min.js', 'w-indicator-pie');
$displayAttributes = $this->getDisplayAttributes($params, $this->key);
$track = Color::colorToSVG($params->get($this->key . 'track'));
$bar = Color::colorToSVG($params->get($this->key . 'bar'));
$parameters = array(
'backstroke' => $track[0],
'backstrokeopacity' => $track[1],
'frontstroke' => $bar[0],
'frontstrokeopacity' => $bar[1],
'size' => intval($params->get($this->key . 'size')),
'thickness' => $params->get($this->key . 'thickness') / 100
);
$styleClass = $slider->addStyle($params->get($this->key . 'style'), 'heading');
$slider->features->addInitCallback('new _N2.SmartSliderWidgetIndicatorPie(this, ' . json_encode($parameters) . ');');
$slider->sliderType->addJSDependency('SmartSliderWidgetIndicatorPie');
return Html::tag('div', Html::mergeAttributes($attributes, $displayAttributes, array(
'class' => $styleClass . " nextend-indicator nextend-indicator-pie n2-ow-all"
)));
}
} Group/FullScreen.php 0000644 00000004764 15241527261 0010433 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Group;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\Message\Warning;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Group\AbstractWidgetGroup;
class FullScreen extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 9;
public function __construct() {
parent::__construct();
$this->makePluggable('SliderWidgetFullScreen');
}
public function getName() {
return 'fullscreen';
}
public function getLabel() {
return n2_('Fullscreen');
}
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
/**
* Used for field removal: /controls/widget-fullscreen
*/
$table = new ContainerTable($container, 'widget-fullscreen', n2_('Fullscreen'));
new OnOff($table->getFieldsetLabel(), 'widget-fullscreen-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widget-fullscreen'
)
));
$fullscreenWarning = $table->createRow('widget-fullscreen-warning');
$warningText = sprintf(n2_('%1$s does not support the full screen API. For this reason the full screen button will not appear on %1$s devices.'), 'iPhone');
new Warning($fullscreenWarning, 'widget-fullscreen-warning-iphone', $warningText);
$row1 = $table->createRow('widget-fullscreen-1');
$url = $form->createAjaxUrl(array("slider/renderwidgetfullscreen"));
new ControlTypePicker($row1, 'widgetfullscreen', $table, $url, $this, 'image');
$row2 = $table->createRow('widget-fullscreen-2');
new OnOff($row2, 'widget-fullscreen-display-hover', n2_('Shows on hover'), 0);
$this->addHideOnFeature('widget-fullscreen-display-', $row2);
new Text($row2, 'widget-fullscreen-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1859-fullscreen#hide-on-slides'
));
}
} Group/Html.php 0000644 00000003714 15241527265 0007273 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Group;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Group\AbstractWidgetGroup;
class Html extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 10;
protected $showOnMobileDefault = 1;
public function __construct() {
parent::__construct();
$this->makePluggable('SliderWidgetHtml');
}
public function getName() {
return 'html';
}
public function getLabel() {
return 'HTML';
}
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
$table = new ContainerTable($container, 'widget-html', 'HTML');
new OnOff($table->getFieldsetLabel(), 'widget-html-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widget-html'
)
));
$row1 = $table->createRow('widget-html-1');
$url = $form->createAjaxUrl(array("slider/renderwidgethtml"));
new ControlTypePicker($row1, 'widgethtml', $table, $url, $this, 'html');
$row2 = $table->createRow('widget-html-2');
new OnOff($row2, 'widget-html-display-hover', n2_('Shows on hover'), 0);
$this->addHideOnFeature('widget-html-display-', $row2);
new Text($row2, 'widget-html-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1860-html#hide-on-slides'
));
}
} Group/Indicator.php 0000644 00000004006 15241527266 0010277 0 ustar 00 <?php
namespace Nextend\SmartSlider3Pro\Widget\Group;
use Nextend\Framework\Form\Container\ContainerTable;
use Nextend\Framework\Form\Element\OnOff;
use Nextend\Framework\Form\Element\Text;
use Nextend\Framework\Pattern\PluggableTrait;
use Nextend\SmartSlider3\Form\Element\ControlTypePicker;
use Nextend\SmartSlider3\Widget\Group\AbstractWidgetGroup;
class Indicator extends AbstractWidgetGroup {
use PluggableTrait;
public $ordering = 4;
public function __construct() {
parent::__construct();
$this->makePluggable('SliderWidgetIndicator');
}
public function getName() {
return 'indicator';
}
public function getLabel() {
return n2_('Indicator');
}
public function renderFields($container) {
$form = $container->getForm();
$this->compatibility($form);
$table = new ContainerTable($container, 'widget-indicator', n2_('Indicator'));
new OnOff($table->getFieldsetLabel(), 'widget-indicator-enabled', false, 0, array(
'relatedFieldsOn' => array(
'table-rows-widget-indicator'
)
));
$row1 = $table->createRow('widget-indicator-1');
$url = $form->createAjaxUrl(array("slider/renderwidgetindicator"));
new ControlTypePicker($row1, 'widgetindicator', $table, $url, $this);
$row2 = $table->createRow('widget-indicator-2');
new OnOff($row2, 'widget-indicator-display-hover', n2_('Shows on hover'), 0);
$this->addHideOnFeature('widget-indicator-display-', $row2);
new Text($row2, 'widget-indicator-exclude-slides', n2_('Hide on slides'), '', array(
'tipLabel' => n2_('Hide on slides'),
'tipDescription' => n2_('List the slides separated by commas on which you want the controls to be hidden.'),
'tipLink' => 'https://smartslider.helpscoutdocs.com/article/1807-slider-settings-autoplay#hide-on-slides-35'
));
}
}