Beispiel #1
0
 function loadList()
 {
     $_list = array();
     N2Plugin::callPlugin('sstype', 'onTypeList', array(&$_list, &$this->labels));
     $this->_list = array();
     /**
      * We have to force the proper order in the slider types
      */
     if (isset($_list['simple'])) {
         $this->_list['simple'] = $_list['simple'];
         unset($_list['simple']);
     }
     if (isset($_list['carousel'])) {
         $this->_list['carousel'] = $_list['carousel'];
         unset($_list['carousel']);
     }
     if (isset($_list['showcase'])) {
         $this->_list['showcase'] = $_list['showcase'];
         unset($_list['showcase']);
     }
     if (isset($_list['horizontalaccordion'])) {
         $this->_list['horizontalaccordion'] = $_list['horizontalaccordion'];
         unset($_list['horizontalaccordion']);
     }
     if (isset($_list['verticalaccordion'])) {
         $this->_list['verticalaccordion'] = $_list['verticalaccordion'];
         unset($_list['verticalaccordion']);
     }
     $this->_list += $_list;
 }
Beispiel #2
0
 /**
  * @param $slider N2SmartSlider
  */
 public function __construct($slider)
 {
     if (!$slider->isAdmin) {
         $params = $slider->params;
         $plugins = array();
         N2Plugin::callPlugin('sswidget', 'onWidgetList', array(&$plugins));
         foreach ($plugins as $k => $v) {
             $widget = $params->get('widget' . $k);
             if ($widget && $widget != 'disabled') {
                 $this->enabledWidgets[$k] = $widget;
             }
         }
         $positions = array();
         foreach ($this->enabledWidgets as $k => $v) {
             $class = 'N2SSPluginWidget' . $k . $v;
             if (class_exists($class, false)) {
                 $params->fillDefault(call_user_func(array($class, 'getDefaults')));
                 $positions += call_user_func_array(array($class, 'getPositions'), array(&$params));
             } else {
                 unset($this->enabledWidgets[$k]);
             }
         }
         $this->makePositions($positions, $params);
         foreach ($this->enabledWidgets as $k => $v) {
             $class = 'N2SSPluginWidget' . $k . $v;
             $this->widgets[$k] = call_user_func(array($class, 'render'), $slider, $slider->elementId, $params);
         }
     }
 }
Beispiel #3
0
 function loadList()
 {
     $_list = array();
     N2Plugin::callPlugin('ssresponsive', 'onResponsiveList', array(&$_list, &$this->labels));
     $this->_list = array();
     $this->_list += $_list;
 }
Beispiel #4
0
 /**
  * @param $name
  *
  * @return N2Application
  */
 public static function getApplication($name)
 {
     if (!isset(self::$applications[$name])) {
         self::_createApplication($name);
         N2Plugin::callPlugin('application', 'applicationLoaded', array($name));
     }
     return self::$applications[$name];
 }
Beispiel #5
0
 private static function _load()
 {
     static $loaded;
     if (!$loaded) {
         N2Plugin::callPlugin('ssitem', 'onNextendSliderItemShortcode', array(&self::$items));
         $loaded = true;
     }
 }
Beispiel #6
0
 private function getWidgetPath($name)
 {
     $list = array();
     N2Plugin::callPlugin('sswidget', 'onWidgetList', array(&$list));
     if (isset($list[$name])) {
         return $list[$name][1];
     }
     return false;
 }
Beispiel #7
0
    protected function renderType()
    {
        $params = $this->slider->params;
        N2JS::addFiles(N2Filesystem::translate(dirname(__FILE__) . "/gsap"), array("MainAnimationSimple.js", "TypeSimple.js", "ResponsiveSimple.js"), "smartslider-simple-type-frontend");
        N2JS::addFiles(N2Filesystem::translate(dirname(__FILE__) . "/gsap"), array("BackgroundAnimation.js"), "smartslider-simple-type-frontend");
        N2JS::addFiles(NEXTEND_SMARTSLIDER_ASSETS . "/js/animation", array("BackgroundAnimationAbstract.js", 'Flux.js'), "smartslider-simple-type-frontend");
        $background = $params->get('background');
        $css = $params->get('slider-css');
        $slidecss = $params->get('slide-css');
        if (!empty($background)) {
            $css = 'background-image: url(' . N2ImageHelper::fixed($background) . ');';
        }
        $this->initBackgroundAnimation();
        echo $this->openSliderElement();
        ?>

        <div class="n2-ss-slider-1" style="<?php 
        echo $css;
        ?>
">
            <?php 
        echo $this->getBackgroundVideo($params);
        ?>
            <div class="n2-ss-slider-2">
                <?php 
        if ($this->backgroundAnimation) {
            ?>
                    <div class="n2-ss-background-animation"></div>
                <?php 
        }
        ?>
                <div class="n2-ss-slider-3" style="<?php 
        echo $slidecss;
        ?>
">

                    <?php 
        echo $this->slider->staticHtml;
        foreach ($this->slider->slides as $i => $slide) {
            echo N2Html::tag('div', $slide->attributes + array('class' => 'n2-ss-slide n2-ss-canvas ' . $slide->classes, 'style' => $slide->style), $slide->background . $slide->getHTML());
        }
        ?>
                </div>
            </div>
        </div>
        <?php 
        $this->widgets->echoRemainder();
        echo N2Html::closeTag('div');
        $this->javaScriptProperties['mainanimation'] = array('type' => $params->get('animation'), 'duration' => intval($params->get('animation-duration')), 'delay' => intval($params->get('animation-delay')), 'ease' => $params->get('animation-easing'), 'parallax' => floatval($params->get('animation-parallax')), 'shiftedBackgroundAnimation' => $params->get('animation-shifted-background-animation'));
        $this->javaScriptProperties['mainanimation']['shiftedBackgroundAnimation'] = 0;
        $this->javaScriptProperties['carousel'] = intval($params->get('carousel'));
        $this->javaScriptProperties['dynamicHeight'] = intval($params->get('dynamic-height', '0'));
        $this->javaScriptProperties['dynamicHeight'] = 0;
        N2Plugin::callPlugin('nextendslider', 'onNextendSliderProperties', array(&$this->javaScriptProperties));
        N2JS::addFirstCode("new NextendSmartSliderSimple('#{$this->slider->elementId}', " . json_encode($this->javaScriptProperties) . ");");
        echo N2Html::clear();
    }
 function getOptions()
 {
     if ($this->_list == null) {
         $this->_list = array();
         N2Plugin::callPlugin(N2XmlHelper::getAttribute($this->_xml, 'group'), N2XmlHelper::getAttribute($this->_xml, 'method'), array(&$this->_list));
     }
     uasort($this->_list, array($this, 'sort'));
     return $this->_list;
 }
Beispiel #9
0
 function loadList()
 {
     if ($this->_list == null) {
         $this->_group = array();
         $this->_list = array();
         N2Plugin::callPlugin(N2XmlHelper::getAttribute($this->_xml, 'plugingroup'), N2XmlHelper::getAttribute($this->_xml, 'method'), array(&$this->_group, &$this->_list));
         $v = explode('_', $this->getValue());
         if (!isset($this->_list[$v[0]][$this->getValue()])) {
             $keys = array_keys($this->_list);
             $ks = array_keys($this->_list[$keys[0]]);
             $this->setValue($this->_list[$keys[0]][$ks[0]]);
         }
     }
 }
Beispiel #10
0
 function fetchElement()
 {
     $items = array();
     N2Plugin::callPlugin('ssitem', 'onNextendSliderItemList', array(&$items));
     ob_start();
     ?>
     <div id="smartslider-slide-toolbox-item" class="nextend-clearfix smartslider-slide-toolbox-view">
         <?php 
     $itemModel = new N2SmartsliderItemModel();
     foreach ($items as $type => $item) {
         echo N2Html::openTag("div", array("id" => "smartslider-slide-toolbox-item-type-{$type}", "style" => "display:none", "data-itemtemplate" => $item[1], "data-itemvalues" => $item[3]));
         $itemModel->renderForm($type, $item);
         echo N2Html::closeTag("div");
     }
     ?>
     </div>
     <?php 
     return ob_get_clean();
 }
Beispiel #11
0
 public static function frontend($force = false)
 {
     static $once;
     if ($once != null && !$force) {
         return;
     }
     $once = true;
     N2AssetsManager::getInstance();
     N2JS::addInline('window.N2PRO=' . N2PRO . ';', true);
     N2JS::addInline('window.N2GSAP=' . N2GSAP . ';', true);
     N2JS::addInline('window.N2PLATFORM="' . N2Platform::getPlatform() . '";', true);
     N2JS::addInline('window.nextend={localization: {}, deferreds:[], loadScript: function(url){n2jQuery.ready(function () {nextend.deferreds.push(n2.ajax({url:url,dataType:"script",cache:true,error:function(){console.log(arguments)}}))})}, ready: function(cb){n2.when.apply(n2, nextend.deferreds).done(function(){cb.call(window,n2)})}};', true);
     N2JS::jQuery($force);
     N2JS::addFiles(N2LIBRARYASSETS . "/js", array('consts.js', 'class.js', 'base64.js', 'mobile-detect.js'), 'nextend-frontend');
     N2JS::addFiles(N2LIBRARYASSETS . "/js/core/jquery", array("jquery.imagesloaded.js", "litebox.js", "jquery.universalpointer.js", "jquery.mousewheel.js", "EventBurrito.js"), "nextend-frontend");
     N2JS::modernizr();
     N2CSS::addFiles(N2LIBRARYASSETS . "/css", array('litebox.css'), 'nextend-frontend');
     self::animation($force);
     N2Loader::import('libraries.fonts.fonts');
     N2Plugin::callPlugin('fontservices', 'onFontManagerLoad', array($force));
 }
Beispiel #12
0
        });');
        return N2Html::tag('div', array('id' => $itemId, 'style' => 'position: absolute; top: 0; left: 0; width: 100%; height: 100%;' . $style));
    }
    function _renderAdmin($data, $itemId, $slider, $slide)
    {
        return N2Html::tag('div', array("style" => 'width: 100%; height: 100%; background: url(' . N2ImageHelper::fixed($data->getIfEmpty('image', '$system$/images/placeholder/video.png')) . ') no-repeat 50% 50%; background-size: cover;'));
    }
    function parseYoutubeUrl($youTubeUrl)
    {
        preg_match('/^.*((youtu.be\\/)|(v\\/)|(\\/u\\/\\w\\/)|(embed\\/)|(watch\\?))\\??v?=?([^#\\&\\?]*).*/', $youTubeUrl, $matches);
        if ($matches && isset($matches[7]) && strlen($matches[7]) == 11) {
            return $matches[7];
        }
        return $youTubeUrl;
    }
    function getValues()
    {
        return array('code' => 'qesNtYIBDfs', 'youtubeurl' => 'https://www.youtube.com/watch?v=MKmIwHAFjSU', 'image' => '$system$/images/placeholder/video.png', 'autoplay' => 0, 'controls' => 1, 'defaultimage' => 'maxresdefault', 'related' => '0', 'vq' => 'default', 'center' => 0, 'loop' => 0);
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . $this->_identifier . DIRECTORY_SEPARATOR;
    }
    public function getFilled($slide, $data)
    {
        $data->set('youtubeurl', $slide->fill($data->get('youtubeurl', '')));
        return $data;
    }
}
N2Plugin::addPlugin('ssitem', 'N2SSPluginItemYouTube');
            $area = $params->get(self::$key . 'position-area');
            switch ($area) {
                case '5':
                case '6':
                case '7':
                case '8':
                    $attributes['data-sstop'] = '0';
                    break;
            }
        }
        return N2Html::tag('div', $displayAttributes + $attributes + array('class' => $displayClass . 'nextend-thumbnail nextend-thumbnail-default nextend-thumbnail-' . $orientation, 'style' => $style), $previous . $next . N2Html::tag('div', array('class' => 'nextend-thumbnail-inner'), N2Html::tag('div', array('class' => $barStyle . 'nextend-thumbnail-scroller'), $slides)));
    }
    public static function prepareExport($export, $params)
    {
        $export->addVisual($params->get(self::$key . 'style-bar'));
        $export->addVisual($params->get(self::$key . 'style-slides'));
        $export->addVisual($params->get(self::$key . 'title-style'));
        $export->addVisual($params->get(self::$key . 'title-font'));
        $export->addVisual($params->get(self::$key . 'description-font'));
    }
    public static function prepareImport($import, $params)
    {
        $params->set(self::$key . 'style-bar', $import->fixSection($params->get(self::$key . 'style-bar', '')));
        $params->set(self::$key . 'style-slides', $import->fixSection($params->get(self::$key . 'style-slides', '')));
        $params->set(self::$key . 'title-style', $import->fixSection($params->get(self::$key . 'title-style', '')));
        $params->set(self::$key . 'title-font', $import->fixSection($params->get(self::$key . 'title-font', '')));
        $params->set(self::$key . 'description-font', $import->fixSection($params->get(self::$key . 'description-font', '')));
    }
}
N2Plugin::addPlugin('sswidgetthumbnail', 'N2SSPluginWidgetThumbnailDefault');
    {
        $export->addImage($params->get(self::$key . 'previous-image', ''));
        $export->addImage($params->get(self::$key . 'next-image', ''));
        $export->addVisual($params->get(self::$key . 'style'));
    }
    public static function prepareImport($import, $params)
    {
        $params->set(self::$key . 'previous-image', $import->fixImage($params->get(self::$key . 'previous-image', '')));
        $params->set(self::$key . 'next-image', $import->fixImage($params->get(self::$key . 'next-image', '')));
        $params->set(self::$key . 'style', $import->fixSection($params->get(self::$key . 'style', '')));
    }
}
class N2SSPluginWidgetArrowImageSmallRectangle extends N2SSPluginWidgetArrowImage
{
    var $_name = 'imageSmallRectangle';
    static function getDefaults()
    {
        return array_merge(N2SSPluginWidgetArrowImage::getDefaults(), array('widget-arrow-responsive-desktop' => 0.8, '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' => 'eyJuYW1lIjoiU3RhdGljIiwiZGF0YSI6W3siYmFja2dyb3VuZGNvbG9yIjoiMDAwMDAwYWIiLCJwYWRkaW5nIjoiMnwqfDJ8KnwyfCp8MnwqfHB4IiwiYm94c2hhZG93IjoiMHwqfDB8KnwwfCp8MHwqfDAwMDAwMGZmIiwiYm9yZGVyIjoiMHwqfHNvbGlkfCp8MDAwMDAwZmYiLCJib3JkZXJyYWRpdXMiOiIzIiwiZXh0cmEiOiIifSx7ImJhY2tncm91bmRjb2xvciI6IjAxYWRkM2Q5In1dfQ=='));
    }
}
N2Plugin::addPlugin('sswidgetarrow', 'N2SSPluginWidgetArrowImageSmallRectangle');
class N2SSPluginWidgetArrowImageEmpty extends N2SSPluginWidgetArrowImage
{
    var $_name = 'imageEmpty';
    static function getDefaults()
    {
        return array_merge(N2SSPluginWidgetArrowImage::getDefaults(), 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' => ''));
    }
}
N2Plugin::addPlugin('sswidgetarrow', 'N2SSPluginWidgetArrowImageEmpty');
Beispiel #15
0
        self::initDefaultStyle();
        return array('image' => '$system$/images/placeholder/image.png', 'alt' => n2_('Image is not available'), 'title' => '', 'link' => '#|*|_self', 'size' => '100%|*|auto', 'style' => self::$style, 'cssclass' => '', 'image-optimize' => 1);
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . $this->_identifier . DIRECTORY_SEPARATOR;
    }
    public function getFilled($slide, $data)
    {
        $data->set('image', $slide->fill($data->get('image', '')));
        $data->set('alt', $slide->fill($data->get('alt', '')));
        $data->set('title', $slide->fill($data->get('title', '')));
        $data->set('link', $slide->fill($data->get('link', '#|*|')));
        return $data;
    }
    public function prepareExport($export, $data)
    {
        $export->addImage($data->get('image'));
        $export->addVisual($data->get('style'));
        $export->addLightbox($data->get('link'));
    }
    public function prepareImport($import, $data)
    {
        $data->set('image', $import->fixImage($data->get('image')));
        $data->set('style', $import->fixSection($data->get('style')));
        $data->set('link', $import->fixLightbox($data->get('link')));
        return $data;
    }
}
N2Plugin::addPlugin('ssitem', 'N2SSPluginItemImage');
N2Pluggable::addAction('smartsliderDefault', 'N2SSPluginItemImage::onSmartsliderDefaultSettings');
Beispiel #16
0
<?php

class N2SSPluginWidgetThumbnail extends N2PluginBase
{
    private static $group = 'thumbnail';
    function onWidgetList(&$list)
    {
        $list[self::$group] = array(n2_('Thumbnails'), $this->getPath(), 6);
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . self::$group . DIRECTORY_SEPARATOR;
    }
}
N2Plugin::addPlugin('sswidget', 'N2SSPluginWidgetThumbnail');
Beispiel #17
0
            list($color, $opacity) = N2Color::colorToSVG($pauseColor);
            $pause = 'data:image/svg+xml;base64,' . base64_encode(str_replace(array('fill="#FFF"', 'opacity="1"'), array('fill="#' . $color . '"', 'opacity="' . $opacity . '"'), N2Filesystem::readFile(N2ImageHelper::fixed($pause, true))));
        } else {
            $pause = N2ImageHelper::fixed($pause);
        }
        if ($play && $pause) {
            N2CSS::addFile(N2Filesystem::translate(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'image' . DIRECTORY_SEPARATOR . 'style.css'), $id);
            N2JS::addFile(N2Filesystem::translate(dirname(__FILE__) . '/image/autoplay.js'), $id);
            list($displayClass, $displayAttributes) = self::getDisplayAttributes($params, self::$key);
            $styleClass = N2StyleRenderer::render($params->get(self::$key . 'style'), 'heading', $slider->elementId, 'div#' . $slider->elementId . ' ');
            list($style, $attributes) = self::getPosition($params, self::$key);
            N2JS::addInline('new NextendSmartSliderWidgetAutoplayImage("' . $id . '", ' . floatval($params->get(self::$key . 'responsive-desktop')) . ', ' . floatval($params->get(self::$key . 'responsive-tablet')) . ', ' . floatval($params->get(self::$key . 'responsive-mobile')) . ');');
            $html = N2Html::tag('div', $displayAttributes + $attributes + array('class' => $displayClass . $styleClass . 'nextend-autoplay nextend-autoplay-image', 'style' => $style), N2Html::image($play, '', array('class' => 'nextend-autoplay-play n2-ow')) . N2Html::image($pause, '', array('class' => 'nextend-autoplay-pause n2-ow')));
        }
        return $html;
    }
    public static function prepareExport($export, $params)
    {
        $export->addImage($params->get(self::$key . 'play-image', ''));
        $export->addImage($params->get(self::$key . 'pause-image', ''));
        $export->addVisual($params->get(self::$key . 'style'));
    }
    public static function prepareImport($import, $params)
    {
        $params->set(self::$key . 'play-image', $import->fixImage($params->get(self::$key . 'play-image', '')));
        $params->set(self::$key . 'pause-image', $import->fixImage($params->get(self::$key . 'pause-image', '')));
        $params->set(self::$key . 'style', $import->fixSection($params->get(self::$key . 'style', '')));
    }
}
N2Plugin::addPlugin('sswidgetautoplay', 'N2SSPluginWidgetAutoplayImage');
Beispiel #18
0
 public function create($saveAsFile = false)
 {
     $this->backup = new N2SmartSliderBackup();
     $slidersModel = new N2SmartsliderSlidersModel();
     if ($this->backup->slider = $slidersModel->get($this->sliderId)) {
         $this->backup->slider['params'] = new N2Data($this->backup->slider['params'], true);
         $slidesModel = new N2SmartsliderSlidesModel();
         $this->backup->slides = $slidesModel->getAll($this->backup->slider['id']);
         if (empty($this->backup->slider['type'])) {
             $this->backup->slider['type'] = 'simple';
         }
         $class = 'N2SSPluginType' . $this->backup->slider['type'];
         N2Loader::importPath(call_user_func(array($class, "getPath")) . NDS . 'backup');
         $class = 'N2SmartSliderBackup' . $this->backup->slider['type'];
         call_user_func_array(array($class, 'export'), array($this, $this->backup->slider));
         $enabledWidgets = array();
         $plugins = array();
         N2Plugin::callPlugin('sswidget', 'onWidgetList', array(&$plugins));
         $params = $this->backup->slider['params'];
         foreach ($plugins as $k => $v) {
             $widget = $params->get('widget' . $k);
             if ($widget && $widget != 'disabled') {
                 $enabledWidgets[$k] = $widget;
             }
         }
         foreach ($enabledWidgets as $k => $v) {
             $class = 'N2SSPluginWidget' . $k . $v;
             if (class_exists($class, false)) {
                 $params->fillDefault(call_user_func(array($class, 'getDefaults')));
                 call_user_func_array(array($class, 'prepareExport'), array($this, &$params));
             } else {
                 unset($enabledWidgets);
             }
         }
         for ($i = 0; $i < count($this->backup->slides); $i++) {
             $slide = $this->backup->slides[$i];
             self::addImage($slide['thumbnail']);
             $slide['params'] = new N2Data($slide['params'], true);
             self::addImage($slide['params']->get('backgroundImage'));
             self::addLightbox($slide['params']->get('link'));
             N2SmartSliderLayer::prepareExport($this, $slide['slide']);
             if (!empty($slide['generator_id'])) {
                 N2Loader::import("models.generator", "smartslider");
                 $generatorModel = new N2SmartsliderGeneratorModel();
                 $this->backup->generators[] = $generatorModel->get($slide['generator_id']);
             }
         }
         $zip = new N2ZipFile();
         $this->images = array_unique($this->images);
         $this->visuals = array_unique($this->visuals);
         foreach ($this->images as $image) {
             $this->backup->NextendImageManager_ImageData[$image] = N2ImageManager::getImageData($image, true);
             if ($this->backup->NextendImageManager_ImageData[$image]) {
                 self::addImage($this->backup->NextendImageManager_ImageData[$image]['tablet']['image']);
                 self::addImage($this->backup->NextendImageManager_ImageData[$image]['mobile']['image']);
             } else {
                 unset($this->backup->NextendImageManager_ImageData[$image]);
             }
         }
         $this->images = array_unique($this->images);
         $usedNames = array();
         foreach ($this->images as $image) {
             $file = N2ImageHelper::fixed($image, true);
             if (N2Filesystem::fileexists($file)) {
                 $fileName = strtolower(basename($file));
                 while (in_array($fileName, $usedNames)) {
                     $fileName = $this->uniqueCounter . $fileName;
                     $this->uniqueCounter++;
                 }
                 $usedNames[] = $fileName;
                 $this->backup->imageTranslation[$image] = $fileName;
                 $zip->addFile(file_get_contents($file), 'images/' . $fileName);
             }
         }
         foreach ($this->visuals as $visual) {
             $this->backup->visuals[] = N2StorageSectionAdmin::getById($visual);
         }
         $zip->addFile(serialize($this->backup), 'data');
         if (!$saveAsFile) {
             ob_end_clean();
             header('Content-disposition: attachment; filename=' . preg_replace('/[^a-zA-Z0-9_-]/', '', $this->backup->slider['title']) . '.ss3');
             header('Content-type: application/zip');
             echo $zip->file();
             n2_exit(true);
         } else {
             $file = preg_replace('/[^a-zA-Z0-9_-]/', '', $this->backup->slider['title']) . '.ss3';
             $folder = N2Platform::getPublicDir();
             $folder .= '/export/';
             if (!N2Filesystem::existsFolder($folder)) {
                 N2Filesystem::createFolder($folder);
             }
             N2Filesystem::createFile($folder . $file, $zip->file());
         }
     }
 }
Beispiel #19
0
            if ($showDescription && !empty($description)) {
                $slides[$i] .= N2Html::tag('span', array('class' => $fontDescription), $separator . $description);
            }
        }
        $parameters = array('overlay' => $params->get(self::$key . 'position-mode') != 'simple' || $params->get(self::$key . 'overlay'), 'area' => intval($params->get(self::$key . 'position-area')), 'animate' => intval($params->get(self::$key . 'animate')));
        N2JS::addInline('new NextendSmartSliderWidgetBarHorizontal("' . $id . '", ' . json_encode($slides) . ', ' . json_encode($parameters) . ');');
        return N2Html::tag("div", $displayAttributes + $attributes + array("class" => $displayClass . "nextend-bar nextend-bar-horizontal", "style" => $style), N2Html::tag("div", array("class" => $styleClass, "style" => $innerStyle), $slides[$slider->_activeSlide]));
    }
    public static function prepareExport($export, $params)
    {
        $export->addVisual($params->get(self::$key . 'style'));
        $export->addVisual($params->get(self::$key . 'font-title'));
        $export->addVisual($params->get(self::$key . 'font-description'));
    }
    public static function prepareImport($import, $params)
    {
        $params->set(self::$key . 'style', $import->fixSection($params->get(self::$key . 'style', '')));
        $params->set(self::$key . 'font-title', $import->fixSection($params->get(self::$key . 'font-title', '')));
        $params->set(self::$key . 'font-description', $import->fixSection($params->get(self::$key . 'font-description', '')));
    }
}
class N2SSPluginWidgetBarHorizontalFull extends N2SSPluginWidgetBarHorizontal
{
    var $_name = 'horizontalFull';
    static function getDefaults()
    {
        return array_merge(N2SSPluginWidgetBarHorizontal::getDefaults(), array('widget-bar-position-offset' => 0, 'widget-bar-style' => 'eyJuYW1lIjoiU3RhdGljIiwiZGF0YSI6W3siYmFja2dyb3VuZGNvbG9yIjoiMDAwMDAwYWIiLCJwYWRkaW5nIjoiMjB8KnwyMHwqfDIwfCp8MjB8KnxweCIsImJveHNoYWRvdyI6IjB8KnwwfCp8MHwqfDB8KnwwMDAwMDBmZiIsImJvcmRlciI6IjB8Knxzb2xpZHwqfDAwMDAwMGZmIiwiYm9yZGVycmFkaXVzIjoiMCIsImV4dHJhIjoiIn1dfQ==', 'widget-bar-full-width' => 1, 'widget-bar-align' => 'left'));
    }
}
N2Plugin::addPlugin('sswidgetbar', 'N2SSPluginWidgetBarHorizontalFull');
Beispiel #20
0
        if (!empty($image)) {
            $style = 'cursor:pointer; background: url(' . N2ImageHelper::fixed($data->get('image')) . ') no-repeat 50% 50%; background-size: cover';
            $hasImage = 1;
            $playImage = '<img class="n2-video-play n2-ow" src="' . N2ImageHelperAbstract::SVGToBase64('$ss$/images/play.svg') . '"/>';
        }
        N2JS::addInline('window["' . $slider->elementId . '"].ready(function() {
                var vimeo = new NextendSmartSliderVimeoItem(this, "' . $itemId . '", "' . $slider->elementId . '", ' . $data->toJSON() . ', ' . $hasImage . ');
            });
        ');
        return N2Html::tag('div', array('id' => $itemId, 'style' => 'position: absolute; top: 0; left: 0; width: 100%; height: 100%;' . $style), $playImage);
    }
    function _renderAdmin($data, $itemId, $slider, $slide)
    {
        return N2Html::tag('div', array("style" => 'width: 100%; height: 100%; background: url(' . N2ImageHelper::fixed($data->getIfEmpty('image', '$system$/images/placeholder/video.png')) . ') no-repeat 50% 50%; background-size: cover;'), '<img class="n2-video-play n2-ow" src="' . N2ImageHelperAbstract::SVGToBase64('$ss$/images/play.svg') . '"/>');
    }
    function getValues()
    {
        return array('vimeourl' => '75251217', 'image' => '$system$/images/placeholder/video.png', 'center' => 0, 'autoplay' => 0, 'title' => 1, 'byline' => 1, 'portrait' => 0, 'color' => '00adef', 'loop' => 0);
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . $this->_identifier . DIRECTORY_SEPARATOR;
    }
    public function getFilled($slide, $data)
    {
        $data->set('vimeourl', $slide->fill($data->get('vimeourl', '')));
        return $data;
    }
}
N2Plugin::addPlugin('ssitem', 'N2SSPluginItemVimeo');
Beispiel #21
0
 public function render()
 {
     if (!$this->loadSlider()) {
         return false;
     }
     if (count($this->slides) == 0) {
         return false;
     }
     $this->assets = $this->getSliderTypeResource('css');
     $this->assets->render();
     $this->slides[$this->_activeSlide]->setActive();
     for ($i = 0; $i < count($this->slides); $i++) {
         $this->slides[$i]->prepare();
         $this->slides[$i]->setSlidesParams();
     }
     $this->renderStaticSlide();
     $slider = $this->sliderType->render();
     if (!$this->isAdmin) {
         N2Plugin::callPlugin('ssitem', 'onNextendSliderRender', array(&$slider, $this->elementId));
     }
     $slider = str_replace('n2-ss-0', $this->elementId, $slider);
     $dependency = intval($this->params->get('dependency'));
     if (!N2Platform::$isAdmin && $dependency > 0) {
         $slider = '<script id="' . $this->elementId . '" data-dependency="' . $dependency . '" type="rocket/slider">' . str_replace(array('<script', '</script'), array('<_s_c_r_i_p_t', '<_/_s_c_r_i_p_t'), $slider) . '</script>';
     }
     $slider = $this->features->translateUrl->renderSlider($slider);
     $slider = $this->features->align->renderSlider($slider, $this->assets->sizes['width']);
     $slider = $this->features->margin->renderSlider($slider);
     $slider .= $this->features->fadeOnLoad->renderPlaceholder($this->assets->sizes);
     return "\n<!-- Nextend Smart Slider 3 #" . $this->sliderId . " - BEGIN -->\n" . $slider . "\n<!-- Nextend Smart Slider 3 #" . $this->sliderId . " - END -->\n";
 }
Beispiel #22
0
<?php

if (N2Platform::$isWordpress) {
    N2Loader::import('libraries.plugins.N2SliderGeneratorPluginAbstract', 'smartslider');
    class N2SSPluginGeneratorPosts extends N2SliderGeneratorPluginAbstract
    {
        public static $_group = 'posts';
        public static $groupLabel = 'WordPress';
        function onGeneratorList(&$group, &$list)
        {
            $group[self::$_group] = 'Posts';
            if (!isset($list[self::$_group])) {
                $list[self::$_group] = array();
            }
            $list[self::$_group]['posts'] = N2GeneratorInfo::getInstance(self::$groupLabel, n2_('Posts by filter'), $this->getPath() . 'posts')->setType('article');
            $list[self::$_group]['postsbyids'] = N2GeneratorInfo::getInstance(self::$groupLabel, n2_('Posts by IDs'), $this->getPath() . 'postsbyids')->setType('article');
        }
        function getPath()
        {
            return dirname(__FILE__) . DIRECTORY_SEPARATOR;
        }
    }
    N2Plugin::addPlugin('ssgenerator', 'N2SSPluginGeneratorPosts');
}
Beispiel #23
0
<?php

/**
* @author    Roland Soos
* @copyright (C) 2015 Nextendweb.com
* @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html
**/
defined('_JEXEC') or die('Restricted access');
class N2SSPluginWidgetAutoplay extends N2PluginBase
{
    private static $group = 'autoplay';
    function onWidgetList(&$list)
    {
        $list[self::$group] = array(n2_('Autoplay'), $this->getPath(), 3);
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . self::$group . DIRECTORY_SEPARATOR;
    }
}
N2Plugin::addPlugin('sswidget', 'N2SSPluginWidgetAutoplay');
Beispiel #24
0
        // under certain strange conditions it could create a P of entirely whitespace
        $pee = preg_replace('!<p>([^<]+)</(div|address|form)>!', "<p>\$1</p></\$2>", $pee);
        $pee = preg_replace('!<p>\\s*(</?' . $allblocks . '[^>]*>)\\s*</p>!', "\$1", $pee);
        // don't pee all over a tag
        $pee = preg_replace("|<p>(<li.+?)</p>|", "\$1", $pee);
        // problem with nested lists
        $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote\$1><p>", $pee);
        $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee);
        $pee = preg_replace('!<p>\\s*(</?' . $allblocks . '[^>]*>)!', "\$1", $pee);
        $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\\s*</p>!', "\$1", $pee);
        if ($br) {
            $pee = preg_replace_callback('/<(script|style).*?<\\/\\1>/s', 'N2SSPluginItemText::_autop_newline_preservation_helper', $pee);
            $pee = preg_replace('|(?<!<br />)\\s*\\n|', "<br />\n", $pee);
            // optionally make line breaks
            $pee = str_replace('<WPPreserveNewline />', "\n", $pee);
        }
        $pee = preg_replace('!(</?' . $allblocks . '[^>]*>)\\s*<br />!', "\$1", $pee);
        $pee = preg_replace('!<br />(\\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)!', '$1', $pee);
        $pee = preg_replace("|\n</p>\$|", '</p>', $pee);
        if (!empty($pre_tags)) {
            $pee = str_replace(array_keys($pre_tags), array_values($pre_tags), $pee);
        }
        return $pee;
    }
    public static function _autop_newline_preservation_helper($matches)
    {
        return str_replace("\n", "<WPPreserveNewline />", $matches[0]);
    }
}
N2Plugin::addPlugin('ssitem', 'N2SSPluginItemText');
N2Pluggable::addAction('smartsliderDefault', 'N2SSPluginItemText::onSmartsliderDefaultSettings');
Beispiel #25
0
    {
        self::initDefaultFont();
        self::initDefaultStyle();
        return array('content' => n2_('MORE'), 'nowrap' => 1, 'fullwidth' => 0, 'link' => '#|*|_self', 'font' => self::$font, 'style' => self::$style, 'class' => '');
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . $this->_identifier . DIRECTORY_SEPARATOR;
    }
    public function getFilled($slide, $data)
    {
        $data->set('content', $slide->fill($data->get('content', '')));
        $data->set('link', $slide->fill($data->get('link', '#|*|')));
        return $data;
    }
    public function prepareExport($export, $data)
    {
        $export->addVisual($data->get('font'));
        $export->addVisual($data->get('style'));
        $export->addLightbox($data->get('link'));
    }
    public function prepareImport($import, $data)
    {
        $data->set('font', $import->fixSection($data->get('font')));
        $data->set('style', $import->fixSection($data->get('style')));
        $data->set('link', $import->fixLightbox($data->get('link')));
        return $data;
    }
}
N2Plugin::addPlugin('ssitem', 'N2SSPluginItemButton');
N2Pluggable::addAction('smartsliderDefault', 'N2SSPluginItemButton::onSmartsliderDefaultSettings');
Beispiel #26
0
<?php

class N2SSPluginWidgetBar extends N2PluginBase
{
    private static $group = 'bar';
    function onWidgetList(&$list)
    {
        $list[self::$group] = array(n2_('Bar'), $this->getPath(), 5);
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . self::$group . DIRECTORY_SEPARATOR;
    }
}
N2Plugin::addPlugin('sswidget', 'N2SSPluginWidgetBar');
    <div class="n2-layers-tab" style="display:block;">

        <div id="smartslider-slide-toolbox-layer">
            <?php 
$class = 'N2SSPluginType' . $slider['type'];
N2Loader::importPath(call_user_func(array($class, "getPath")) . NDS . 'type');
$itemDefaults = call_user_func(array('N2SmartSliderType' . $slider['type'], 'getItemDefaults'));
?>
            <script type="text/javascript">
                window.ssitemmarker = true;
            </script>
            <div id="n2-ss-item-container" class="n2-sidebar-list-bg">
                <?php 
$items = array();
N2Plugin::callPlugin('ssitem', 'onNextendSliderItemList', array(&$items));
N2SSPluginItemAbstract::sortItems($items);
foreach ($items as $type => $item) {
    echo N2Html::tag('div', array('class' => 'n2-h5 n2-ss-core-item n2-ss-core-item-' . $type, 'data-layerproperties' => json_encode((object) array_merge($item[5], $itemDefaults)), 'data-item' => $type), N2Html::tag('div', array(), $item[0]));
}
?>
            </div>
            <script type="text/javascript">
                delete window.ssitemmarker;
            </script>

            <div id="n2-ss-layers-items-list">
                <ul class="n2-list n2-h4 n2-list-orderable">

                </ul>
            </div>
Beispiel #28
0
                if ($orientation == 'vertical') {
                    $position = 'right';
                } else {
                    $position = 'bottom';
                }
            }
            $parameters['thumbnailPosition'] = $position;
        }
        $parameters['thumbnails'] = $thumbnails;
        $parameters['action'] = $params->get(self::$key . 'action');
        $parameters['numeric'] = 0;
        N2JS::addInline('new NextendSmartSliderWidgetBulletTransition("' . $id . '", ' . json_encode($parameters) . ');');
        $fullSize = intval($params->get(self::$key . 'bar-full-size'));
        if ($fullSize) {
            $displayClass .= "n2-bullet-bar-full-size ";
        }
        return N2Html::tag("div", $displayAttributes + $attributes + array("class" => $displayClass . $barStyle . "nextend-bullet-bar nextend-bullet-bar-" . $orientation, "style" => "text-align: " . $params->get(self::$key . 'align') . ";" . $style), $html);
    }
    public static function prepareExport($export, $params)
    {
        $export->addVisual($params->get(self::$key . 'style'));
        $export->addVisual($params->get(self::$key . 'bar'));
    }
    public static function prepareImport($import, $params)
    {
        $params->set(self::$key . 'style', $import->fixSection($params->get(self::$key . 'style')));
        $params->set(self::$key . 'bar', $import->fixSection($params->get(self::$key . 'bar')));
    }
}
N2Plugin::addPlugin('sswidgetbullet', 'N2SSPluginWidgetBulletTransition');
Beispiel #29
0
            if ($shadow == -1) {
                $shadow = null;
            }
        }
        if (!$shadow) {
            return '';
        }
        N2JS::addFile(N2Filesystem::translate(dirname(__FILE__) . '/shadow/shadow.js'), $id);
        list($displayClass, $displayAttributes) = self::getDisplayAttributes($params, self::$key);
        list($style, $attributes) = self::getPosition($params, self::$key);
        $width = $params->get(self::$key . 'width');
        if (is_numeric($width) || substr($width, -1) == '%' || substr($width, -2) == 'px') {
            $style .= 'width:' . $width . ';';
        } else {
            $attributes['data-sswidth'] = $width;
        }
        $parameters = array('overlay' => $params->get(self::$key . 'position-mode') != 'simple' || 0, 'area' => intval($params->get(self::$key . 'position-area')));
        N2JS::addInline('new NextendSmartSliderWidgetShadow("' . $id . '", ' . json_encode($parameters) . ');');
        return N2Html::tag('div', $displayAttributes + $attributes + array('class' => $displayClass . "nextend-shadow", 'style' => $style), N2Html::image(N2ImageHelper::fixed($shadow), 'Shadow', array('style' => 'display: block; width:100%;max-width:none;', 'class' => 'n2-ow nextend-shadow-image')));
    }
    public static function prepareExport($export, $params)
    {
        $export->addImage($params->get(self::$key . 'shadow-image', ''));
    }
    public static function prepareImport($import, $params)
    {
        $params->set(self::$key . 'shadow-image', $import->fixImage($params->get(self::$key . 'shadow-image', '')));
    }
}
N2Plugin::addPlugin('sswidgetshadow', 'N2SSPluginWidgetShadowShadow');
Beispiel #30
0
<?php

class N2SSPluginWidgetArrow extends N2PluginBase
{
    private static $group = 'arrow';
    function onWidgetList(&$list)
    {
        $list[self::$group] = array(n2_('Arrows'), $this->getPath(), 1);
    }
    function getPath()
    {
        return dirname(__FILE__) . DIRECTORY_SEPARATOR . self::$group . DIRECTORY_SEPARATOR;
    }
}
N2Plugin::addPlugin('sswidget', 'N2SSPluginWidgetArrow');