• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP N2Plugin类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中N2Plugin的典型用法代码示例。如果您正苦于以下问题:PHP N2Plugin类的具体用法?PHP N2Plugin怎么用?PHP N2Plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了N2Plugin类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: loadList

 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;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:30,代码来源:slidertype.php


示例2: __construct

 /**
  * @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);
         }
     }
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:32,代码来源:widgets.php


示例3: loadList

 function loadList()
 {
     $_list = array();
     N2Plugin::callPlugin('ssresponsive', 'onResponsiveList', array(&$_list, &$this->labels));
     $this->_list = array();
     $this->_list += $_list;
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:7,代码来源:sliderresponsive.php


示例4: getApplication

 /**
  * @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];
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:13,代码来源:base.php


示例5: _load

 private static function _load()
 {
     static $loaded;
     if (!$loaded) {
         N2Plugin::callPlugin('ssitem', 'onNextendSliderItemShortcode', array(&self::$items));
         $loaded = true;
     }
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:8,代码来源:item.php


示例6: getWidgetPath

 private function getWidgetPath($name)
 {
     $list = array();
     N2Plugin::callPlugin('sswidget', 'onWidgetList', array(&$list));
     if (isset($list[$name])) {
         return $list[$name][1];
     }
     return false;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:9,代码来源:Ajax.php


示例7: renderType

    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();
    }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:57,代码来源:type.php


示例8: getOptions

 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;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:9,代码来源:pluginmatrix.php


示例9: loadList

 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]]);
         }
     }
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:14,代码来源:plugingroup.php


示例10: fetchElement

 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();
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:19,代码来源:items.php


示例11: frontend

 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));
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:21,代码来源:predefined.php


示例12: array

        });');
        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');
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:30,代码来源:youtube.php


示例13: switch

            $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');
开发者ID:rfulwell,项目名称:transitionalresources.org,代码行数:30,代码来源:default.php


示例14: prepareImport

    {
        $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');
开发者ID:rfulwell,项目名称:transitionalresources.org,代码行数:30,代码来源:image.php


示例15: array

        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');
开发者ID:MBerguer,项目名称:wp-demo,代码行数:31,代码来源:image.php


示例16: onWidgetList

<?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');
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:15,代码来源:thumbnail.php


示例17: list

            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');
开发者ID:MBerguer,项目名称:wp-demo,代码行数:30,代码来源:image.php


示例18: create

 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());
         }
     }
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:95,代码来源:export.php


示例19: array

            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');
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:30,代码来源:horizontal.php


示例20: url

        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');
开发者ID:MBerguer,项目名称:wp-demo,代码行数:30,代码来源:vimeo.php



注:本文中的N2Plugin类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP N2Request类代码示例发布时间:2022-05-23
下一篇:
PHP N2Loader类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap