本文整理汇总了PHP中N2Plugin::addPlugin方法的典型用法代码示例。如果您正苦于以下问题:PHP N2Plugin::addPlugin方法的具体用法?PHP N2Plugin::addPlugin怎么用?PHP N2Plugin::addPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类N2Plugin
的用法示例。
在下文中一共展示了N2Plugin::addPlugin方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: preg_replace
// 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');
示例2: onGeneratorList
<?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');
}
示例3: array
N2Pluggable::addAction('fontFamily', array($this, 'onFontFamily'));
}
}
}
function onFontManagerLoadBackend()
{
N2JS::addInline('new NextendFontServiceGoogle("' . implode(',', self::$styles) . '","' . implode(',', self::$subsets) . '", ' . json_encode(self::$fonts) . ');');
}
function addStyle($parameters, $weight)
{
if ($parameters->get('google-style-' . $weight, 0)) {
self::$styles[] = $weight;
}
}
function addSubset($parameters, $subset)
{
if ($parameters->get('google-set-' . $subset, 0)) {
self::$subsets[] = $subset;
}
}
function onFontFamily($family)
{
if (in_array($family, self::$fonts)) {
foreach (self::$styles as $style) {
N2GoogleFonts::addFont($family, $style);
}
}
}
}
N2Plugin::addPlugin('fontservices', 'N2SystemPluginFontServiceGoogle');
示例4: 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');
示例5: 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');
示例6: 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');
示例7: defined
<?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');
示例8: 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');
示例9: defined
**/
defined('_JEXEC') or die('Restricted access');
class N2SSPluginResponsiveFullWidth extends N2PluginBase
{
private static $name = 'fullwidth';
function onResponsiveList(&$list, &$labels)
{
$list[self::$name] = $this->getPath();
$labels[self::$name] = n2_x('Fullwidth', 'Slider responsive mode');
}
static function getPath()
{
return dirname(__FILE__) . DIRECTORY_SEPARATOR . self::$name . DIRECTORY_SEPARATOR;
}
}
N2Plugin::addPlugin('ssresponsive', 'N2SSPluginResponsiveFullWidth');
class N2SSResponsiveFullWidth
{
private $params, $responsive;
/**
* @param $params
* @param $responsive N2SmartSliderFeatureResponsive
*/
public function __construct($params, $responsive)
{
$this->params = $params;
$this->responsive = $responsive;
$this->responsive->scaleDown = 1;
$this->responsive->scaleUp = 1;
$this->responsive->minimumHeight = intval($this->params->get('responsiveSliderHeightMin', 0));
$this->responsive->maximumHeight = intval($this->params->get('responsiveSliderHeightMax', 3000));
示例10: onWidgetList
<?php
class N2SSPluginWidgetBullet extends N2PluginBase
{
private static $group = 'bullet';
function onWidgetList(&$list)
{
$list[self::$group] = array(n2_('Bullets'), $this->getPath(), 2);
}
function getPath()
{
return dirname(__FILE__) . DIRECTORY_SEPARATOR . self::$group . DIRECTORY_SEPARATOR;
}
}
N2Plugin::addPlugin('sswidget', 'N2SSPluginWidgetBullet');
示例11: onTypeList
<?php
class N2SSPluginTypeSimple extends N2PluginBase
{
private static $name = 'simple';
function onTypeList(&$list, &$labels)
{
$list[self::$name] = $this->getPath();
$labels[self::$name] = n2_x('Simple', 'Slider type');
}
static function getPath()
{
return dirname(__FILE__) . DIRECTORY_SEPARATOR . self::$name . DIRECTORY_SEPARATOR;
}
}
N2Plugin::addPlugin('sstype', 'N2SSPluginTypeSimple');
示例12: onResponsiveList
<?php
class N2SSPluginResponsiveAuto extends N2PluginBase
{
private static $name = 'auto';
function onResponsiveList(&$list, &$labels)
{
$list[self::$name] = $this->getPath();
$labels[self::$name] = n2_x('Auto', 'Slider responsive mode');
}
static function getPath()
{
return dirname(__FILE__) . DIRECTORY_SEPARATOR . self::$name . DIRECTORY_SEPARATOR;
}
}
N2Plugin::addPlugin('ssresponsive', 'N2SSPluginResponsiveAuto');
class N2SSResponsiveAuto
{
private $params, $responsive;
public function __construct($params, $responsive)
{
$this->params = $params;
$this->responsive = $responsive;
$this->responsive->scaleDown = intval($this->params->get('responsiveScaleDown', 1));
$this->responsive->scaleUp = intval($this->params->get('responsiveScaleUp', 0));
$this->responsive->minimumHeight = intval($this->params->get('responsiveSliderHeightMin', 0));
$this->responsive->maximumHeight = intval($this->params->get('responsiveSliderHeightMax', 3000));
$this->responsive->maximumSlideWidth = intval($this->params->get('responsiveSlideWidthMax', 3000));
}
}
示例13: defined
<?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');
N2Loader::import('libraries.plugins.N2SliderGeneratorPluginAbstract', 'smartslider');
class N2SSPluginGeneratorJoomlaContent extends N2PluginBase
{
public static $group = 'joomlacontent';
public static $groupLabel = 'Joomla content';
function onGeneratorList(&$group, &$list)
{
$group[self::$group] = self::$groupLabel;
if (!isset($list[self::$group])) {
$list[self::$group] = array();
}
$list[self::$group]['article'] = N2GeneratorInfo::getInstance(self::$groupLabel, n2_('Articles'), $this->getPath() . 'article')->setType('article');
$list[self::$group]['category'] = N2GeneratorInfo::getInstance(self::$groupLabel, n2_('Categories'), $this->getPath() . 'category')->setType('article');
}
function getPath()
{
return dirname(__FILE__) . DIRECTORY_SEPARATOR;
}
}
N2Plugin::addPlugin('ssgenerator', 'N2SSPluginGeneratorJoomlaContent');
示例14: list
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');
示例15: onWidgetList
<?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');