当前位置: 首页>>代码示例>>PHP>>正文


PHP N2Plugin类代码示例

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


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


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