本文整理汇总了PHP中nextendIsWordpress函数的典型用法代码示例。如果您正苦于以下问题:PHP nextendIsWordpress函数的具体用法?PHP nextendIsWordpress怎么用?PHP nextendIsWordpress使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了nextendIsWordpress函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fetchElement
function fetchElement()
{
global $smartslidercontroller, $ss2sliderafterform;
$this->_value = htmlspecialchars($this->_form->get($this->_name, $this->_default), ENT_QUOTES);
$this->_form->set($this->_name, $this->_value);
$html = '<div style="display:none;">' . parent::fetchElement() . '</div>';
$slider = null;
$params = new NextendData();
if (nextendIsJoomla()) {
nextendimportsmartslider2('nextend.smartslider.joomla.slider');
$module = new stdClass();
$module->id = 0;
$params->loadArray(array('slider' => intval($_GET['sliderid'])));
$slider = new NextendSliderJoomla($module, $params, dirname(__FILE__), true);
} else {
if (nextendIsWordpress()) {
nextendimportsmartslider2('nextend.smartslider.wordpress.slider');
$slider = new NextendSliderWordpress(intval($_GET['sliderid']), $params, dirname(__FILE__), true);
} else {
if (nextendIsMagento()) {
nextendimportsmartslider2('nextend.smartslider.magento.slider');
$slider = new NextendSliderMagento(intval($_GET['sliderid']), $params, dirname(__FILE__), true);
}
}
}
ob_start();
echo "<div id='smartslider-adjust-height' style='overflow:auto; margin: 5px; padding: 5px;'>";
$slider->render();
echo "</div>";
echo "<div id='smart-slider-layer-dummy' class='smart-slider-layer'></div>";
echo '<div class="smartslider-slide-advanced-layers" style="min-width: 1600px;"></div>';
$ss2sliderafterform = ob_get_clean();
$css = NextendCss::getInstance();
$css->addCssLibraryFile('jqueryui/jquery.ui.resizable.css');
$css->addCssFile(NEXTEND_SMART_SLIDER2_ASSETS . 'admin/css/layer.css');
$js = NextendJavascript::getInstance();
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.core.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.widget.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.mouse.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.resizable.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.draggable.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.sortable.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.droppable.min.js');
$js->addLibraryJsFile('jquery', NEXTENDLIBRARYASSETS . 'js' . DIRECTORY_SEPARATOR . 'base64.js');
$js->addLibraryJsFile('jquery', NEXTENDLIBRARYASSETS . 'js' . DIRECTORY_SEPARATOR . 'sortable.js');
$js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'console.js');
$js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slide.js');
$js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slide.layer.js');
$js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slide.item.js');
$js->addLibraryJsFile('jquery', NEXTEND_SMART_SLIDER2_ASSETS . 'admin' . DIRECTORY_SEPARATOR . 'js' . DIRECTORY_SEPARATOR . 'slide.layout.js');
$js->addLibraryJs('jquery', "\r\n njQuery(document).ready(function(){\r\n var el = \$('#smartslider-adjust-height');\r\n el.height(el[0].scrollHeight+10);\r\n \$(window).trigger('resize');\r\n });\r\n ndojo.addOnLoad(function(){\r\n SmartSliderAdminSlide('" . $slider->getId() . "','" . $slider->_activeSlide . "','" . $this->_id . "', '" . $smartslidercontroller->route('controller=layouts&action=create') . "');\r\n });\r\n ");
if (NextendSmartSliderSettings::get('slideeditoralert', 1)) {
$js->addLibraryJs('jquery', "\r\n njQuery(window).on('beforeunload', function() {\r\n if (njQuery.now()-window.nextendtime > 60000 && !window.nextendsave) { // 1 min\r\n return '" . NextendText::_('Your_slide_settings_has_not_been_submitted_yet') . "';\r\n } else {\r\n return;\r\n }\r\n });\r\n ");
}
return $html;
}
示例2: fetchElement
function fetchElement()
{
$image = NextendXmlGetAttribute($this->_xml, 'src');
if (nextendIsWordpress()) {
$imagewp = NextendXmlGetAttribute($this->_xml, 'wpsrc');
if ($imagewp) {
$image = $imagewp;
}
}
return "<a href='http://www.nextendweb.com/smart-slider#pricing' target='_blank'><img src='" . $image . "' /></a>";
}
示例3: loadList
function loadList()
{
if ($this->_list == null) {
if (nextendIsJoomla()) {
$this->loadJoomlaList();
} else {
if (nextendIsMagento()) {
$this->loadOtherList();
} else {
if (nextendIsWordpress()) {
$this->loadWordpressList();
}
}
}
}
}
示例4: fetchElement
function fetchElement()
{
$folder = NextendXmlGetAttribute($this->_xml, 'folder');
if ($folder === 'systemimages') {
if (nextendIsJoomla()) {
$folder = JPATH_SITE . '/images/';
} else {
if (nextendIsWordpress()) {
$folder = wp_upload_dir();
$folder = $folder['basedir'] . '/';
} else {
if (nextendIsMagento()) {
$folder = Mage::getBaseDir('media') . '/';
}
}
}
}
$this->addFolder($folder);
return parent::fetchElement();
}
示例5: render
static function render($slider, $id, $params)
{
$html = '';
$shadowcss = $params->get('shadowcss', false);
if ($shadowcss && $shadowcss != -1) {
$displayclass = self::getDisplayClass($params->get('widgetshadowdisplay', '0|*|always|*|0|*|0'), false);
list($style, $data) = self::getPosition($params->get('shadowposition', ''));
$width = NextendParse::parse($params->get('shadowwidth', 'width'));
if (is_numeric($width) || $width == 'auto' || substr($width, -1) == '%') {
$style .= 'width:' . $width . ';';
} else {
$data .= 'data-sswidth="' . $width . '" ';
}
$css = NextendCss::getInstance();
$css->addCssFile(NextendFilesystem::translateToMediaPath(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'shadow' . DIRECTORY_SEPARATOR . 'style.css'));
$info = pathinfo($shadowcss);
$class = 'nextend-shadow nextend-shadow-' . basename($shadowcss, '.' . $info['extension']);
$html .= '<div class="' . $displayclass . $class . '" style="line-height:0;' . $style . '" ' . $data . '><img src="' . (nextendIsWordpress() ? plugins_url('shadow/shadow/' . $info['basename'], __FILE__) : NextendUri::pathToUri(NextendFilesystem::getBasePath() . $shadowcss)) . '"/></div>';
}
return $html;
}
示例6: NextendSmartsliderAdminController
function NextendSmartsliderAdminController($key)
{
global $smartslidercontroller;
$smartslidercontroller = $this;
parent::NextendController($key);
if (!$this->canDo('core.manage')) {
$this->access = 0;
$this->message(NextendText::_('Access not allowed to this resource.'));
return;
}
nextendimport('nextend.css.css');
$css = NextendCss::getInstance();
$css->addCssLibraryFile('ni.css');
$this->_baseControllerPath = dirname(__FILE__);
$this->_routeMap = array('sliders' => array('sliders_slider' => array('default', 'create', 'edit', 'full'), 'sliders_generator' => array('default', 'edit')), 'slides' => array('sliders_slides' => array('default', 'create', 'edit', 'order')), 'layouts' => array('sliders_layouts' => array('default', 'create', 'edit')), 'settings' => array('sliders_settings' => array('default', 'layout', 'font')), 'help' => array('sliders_help' => array('default')));
$this->init();
if (nextendIsJoomla()) {
$this->_router->_baseurl = 'index.php?option=com_smartslider2';
} else {
if (nextendIsWordpress()) {
$this->_router->_baseurl = 'admin.php?page=nextend-smart-slider2';
}
}
}
示例7: preg_match
?>
</h2>
<table class="ni">
<tr>
<td >
<label for="slidertitle" id="slidertitle-lbl"><?php
echo NextendText::_('Version_Number');
?>
</label> </td>
<td >
<?php
if (nextendIsJoomla()) {
preg_match('/<version>(.*?)<\\/version>/', file_get_contents(JPATH_ADMINISTRATOR . '/components/com_smartslider2/smartslider2.xml'), $out);
echo $out[1];
} else {
if (nextendIsWordpress()) {
$plg = get_plugin_data(NEXTEND_SMART_SLIDER2 . basename(NEXTEND_SMART_SLIDER2) . '.php');
echo $plg['Version'];
} else {
if (nextendIsMagento()) {
echo (string) Mage::getConfig()->getNode()->modules->Nextend_SmartSlider2->version;
}
}
}
?>
</td>
</tr>
<tr>
<td>
<label for="slidertitle" id="slidertitle-lbl"><?php
示例8: NextendSliderCache
function NextendSliderCache($slider)
{
nextendimportsmartslider2('nextend.smartslider.check');
nextendimport('nextend.css.css');
nextendimport('nextend.javascript.javascript');
nextendimport('nextend.fonts.google');
$this->slider = $slider;
$sliderid = $slider->_sliderid;
$recache = false;
$cached = json_decode(NextendSmartSliderStorage::get('slidercache' . $sliderid), true);
if (nextendIsWordpress()) {
$time = current_time('timestamp');
} else {
$time = time();
}
nextendimportsmartslider2('nextend.smartslider.admin.models.slides');
$slidesModel = new NextendSmartsliderAdminModelSlides(null);
$slides = $slidesModel->getSlides($sliderid, '');
$slideexpire = null;
foreach ($slides as $s) {
$publish_up = strtotime($s['publish_up']);
if ($publish_up && $publish_up > $time && ($slideexpire == null || $publish_up < $slideexpire)) {
$slideexpire = $publish_up;
}
$publish_down = strtotime($s['publish_down']);
if ($publish_down && $publish_down > $time && ($slideexpire == null || $publish_down < $slideexpire)) {
$slideexpire = $publish_down;
}
}
if (is_array($cached)) {
if (NextendSmartSliderStorage::get('sliderchanged' . $sliderid) == 1) {
$recache = true;
} else {
if (isset($cached['time']) && isset($cached['expire']) && $cached['time'] < time() - $cached['expire'] * 60 * 60) {
$recache = true;
} else {
if (isset($cached['slideexpire']) && $cached['slideexpire'] < $time) {
$recache = true;
}
}
}
} else {
$recache = true;
}
if (!$recache) {
$data = $cached['data'];
if (isset($data['css'])) {
if (!NextendFilesystem::fileexists(NextendFilesystem::absoluteURLToPath($data['css']))) {
$recache = true;
}
} else {
$recache = true;
}
if (!isset($data['libraries']) || !isset($data['libraries']['jquery']) || !isset($data['libraries']['jquery']['jsfiles']) || count($data['libraries']['jquery']['jsfiles']) == 0) {
$recache = true;
}
}
//$recache = true;
if ($recache) {
$data = $this->render();
$cached = array('time' => time(), 'data' => $data);
if ($this->slider->_generatorParams->get('enabled', 0)) {
$generatorcached = json_decode(NextendSmartSliderStorage::get('generator' . $sliderid), true);
if (is_array($generatorcached)) {
$cached['time'] = $generatorcached['time'];
$cached['expire'] = $this->slider->_generatorParams->get('cachetime', '24');
}
}
if ($slideexpire) {
$cached['slideexpire'] = $slideexpire;
}
NextendSmartSliderStorage::set('slidercache' . $sliderid, json_encode($cached));
NextendSmartSliderStorage::set('sliderchanged' . $sliderid, '0');
}
$this->cssurl = $data['css'];
if (nextendIsWordPress()) {
add_action('nextend_css', array($this, 'addCSS'));
} elseif (nextendIsMagento()) {
Nextend_SmartSlider2_Model_Observer::$sliders[] = array($this, 'addCSS');
} else {
$this->addCSS();
}
$js = NextendJavascript::getInstance();
foreach ($data['js']['core'] as $j) {
$js->addJsFile($j);
}
if (isset($data['libraries']) && count($data['libraries'])) {
foreach ($data['libraries'] as $library => $jss) {
$js->loadLibrary($library);
if (!empty($jss['js'])) {
$js->addLibraryJs($library, $jss['js']);
}
if (count($jss['jsfiles'])) {
foreach ($jss['jsfiles'] as $j) {
$js->addLibraryJsFile($library, $j);
}
}
}
}
if (isset($data['fonts']) && count($data['fonts'])) {
//.........这里部分代码省略.........
示例9: loadSlides
function loadSlides()
{
$slides = array();
$generateslides = NextendParse::parse($this->_generatorParams->get('generateslides', '0|*|0|*|0'));
$createslides = intval($generateslides[1]);
$staticslides = intval($generateslides[2]);
$publishbetween = (array) NextendParse::parse($this->_generatorSlideParams->get('publishdates', '|*|'));
if (!isset($publishbetween[1])) {
$publishbetween[1] = '';
}
if (!$this->_backend && $this->_generatorParams->get('enabled', 0) && $createslides == 0 && ($publishbetween[0] == '' || strtotime($publishbetween[0]) < time()) && ($publishbetween[1] == '' || strtotime($publishbetween[1]) > time())) {
nextendimportsmartslider2('nextend.smartslider.generator');
$this->generator = new NextendSmartsliderGenerator($this->_generatorParams, $this->_generatorSlideParams, $this->_sliderid);
$slides = $this->generator->generateSlides($this->_sliderid);
} else {
nextendimportsmartslider2('nextend.smartslider.admin.models.slides');
$slidesModel = new NextendSmartsliderAdminModelSlides(null);
$where = '';
$date = '';
if (nextendIsWordpress()) {
$date = current_time('mysql');
} else {
$date = date('Y-m-d H:i:s');
}
if ($this->_backend) {
$where = " AND ((published = 1 AND (publish_up = '0000-00-00 00:00:00' OR publish_up < '" . $date . "') AND (publish_down = '0000-00-00 00:00:00' OR publish_down > '" . $date . "')) OR id = " . NextendRequest::getInt('slideid') . ") ";
} else {
$where = " AND published = 1 AND (publish_up = '0000-00-00 00:00:00' OR publish_up < '" . $date . "') AND (publish_down = '0000-00-00 00:00:00' OR publish_down > '" . $date . "') ";
}
$slides = $slidesModel->getSlides($this->_sliderid, $where);
if (!$this->_backend && $createslides && !$staticslides) {
nextendimportsmartslider2('nextend.smartslider.generator');
$this->generator = new NextendSmartsliderGenerator($this->_generatorParams, $this->_generatorSlideParams, $this->_sliderid);
$source = $this->_generatorParams->get('source', '');
if ($source) {
$this->generator->initDatasource($source);
for ($i = 0; $i < count($slides); $i++) {
if ($slides[$i]['generator'] > 0) {
$slides[$i] = $this->generator->makeSlide($slides[$i]);
}
}
}
}
}
$this->_activeSlide = 0;
return $slides;
}
示例10: fetchElement
function fetchElement()
{
$css = NextendCss::getInstance();
$css->addCssFile(NEXTEND_SMART_SLIDER2_ASSETS . 'admin/css/createquick.css');
$css->addCssLibraryFile('element/textarea.css');
$js = NextendJavascript::getInstance();
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.core.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.widget.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.mouse.min.js');
$js->addLibraryJsLibraryFile('jquery', 'ui/jquery.ui.sortable.min.js');
$this->_value = $this->_form->get($this->_name, $this->_default);
$images = json_decode($this->_value, true);
$html = '<div id="selected-images-container" class="">';
if (nextendIsWordpress()) {
add_filter('media_view_strings', 'custom_media_uploader_tabs', 5);
function custom_media_uploader_tabs($strings)
{
$strings['insertMediaTitle'] = "Image";
$strings['insertIntoPost'] = "Add to slider";
// remove options
if (isset($strings['createGalleryTitle'])) {
unset($strings['createGalleryTitle']);
}
if (isset($strings['insertFromUrlTitle'])) {
unset($strings['insertFromUrlTitle']);
}
return $strings;
}
wp_enqueue_style('editor');
if (function_exists('wp_enqueue_media')) {
wp_enqueue_media();
} else {
wp_enqueue_style('thickbox');
wp_enqueue_script('media-upload');
wp_enqueue_script('thickbox');
}
$html .= '<a title="Add Image" data-editor="content" class="button add-image" href="#">
<span class="wp-media-buttons-icon"></span> Add Image
</a>
<div style="clear: both;"></div>';
} else {
if (nextendIsMagento()) {
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/ext-tree.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/ext-tree-checkbox.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'extjs/fix-defer.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/variables.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/wysiwyg/widget.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'lib/flex.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'lib/FABridge.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/flexuploader.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'mage/adminhtml/browser.js"></script>';
$html .= '<script type="text/javascript" src="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'prototype/window.js"></script>';
$html .= '<link rel="stylesheet" type="text/css" href="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_JS) . 'prototype/windows/themes/default.css" media="screen"/>';
$html .= '<link rel="stylesheet" type="text/css" href="' . Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_SKIN) . 'adminhtml/default/default/lib/prototype/windows/themes/magento.css" media="screen"/>';
$html .= '<a title="Add Image" data-editor="content" class="button add-image" href="#">
<span class="wp-media-buttons-icon"></span> Add Image
</a>
<input type="hidden" id="magentohidden" />
<div style="clear: both;"></div>';
}
}
$html .= '<div id="delete-image"></div>
<ul id="selected-images">';
if (is_array($images)) {
$i = 0;
foreach ($images as $img) {
$html .= '<li>';
$html .= '<img src="' . NextendUri::fixrelative($img['image']) . '" data-src="' . $img['image'] . '" /><div class="field-container">';
$html .= '
<div class="nextend-mixed-group">
<div class="nextend-mixed-label">
<label for="title' . $i . '" id="title' . $i . '-lbl">Title</label>
</div>
<div class="nextend-mixed-element">
<div class="nextend-text ">
<input type="text" autocomplete="off" style="width:390px;" value="' . $img['title'] . '" name="" id="title' . $i . '">
</div>
</div>
</div>';
$html .= '
<div class="nextend-mixed-group" style="clear: both;">
<div class="nextend-mixed-label">
<label for="link' . $i . '" id="link' . $i . '-lbl">Link</label>
</div>
<div class="nextend-mixed-element">
<div class="nextend-text">
<input type="text" autocomplete="off" style="width:390px;" value="' . $img['url'] . '" name="" id="link' . $i . '">
</div>
</div>
</div>';
$html .= '
<div class="nextend-mixed-group" style="clear: both;">
<div class="nextend-mixed-label">
<label for="description' . $i . '" id="description' . $i . '-lbl">Description</label>
</div>
<div class="nextend-mixed-element">
<div class="nextend-textarea ">
<textarea autocomplete="off" style="width:400px; height: 40px;" name="" id="description' . $i . '">' . $img['description'] . '</textarea>
</div>
</div>
//.........这里部分代码省略.........
示例11: fullAction
function fullAction()
{
if (nextendIsJoomla()) {
$this->display('default', 'full');
} else {
if (nextendIsWordpress()) {
$this->display('default', 'fullwordpress');
}
}
}
示例12: ss2_css_image_replace
function ss2_css_image_replace($ms)
{
global $zip;
if (substr($ms[1], 0, 2) == '//') {
$ms[1] = 'http:' . $ms[1];
}
$path = NextendFilesystem::absoluteURLToPath($ms[1]);
if (NextendFilesystem::fileexists($path)) {
if (nextendIsJoomla()) {
$rel = str_replace('plugins/', 'images/', NextendFilesystem::pathToRelativePath($path));
} else {
if (nextendIsWordpress()) {
$rel = str_replace(NEXTEND_SMART_SLIDER2 . 'plugins/', 'images/', $path);
}
}
$zip->addFile(NextendFilesystem::readFile($path), $rel);
return 'url(' . $rel . ')';
}
}