本文整理汇总了PHP中RevSliderOperations类的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderOperations类的具体用法?PHP RevSliderOperations怎么用?PHP RevSliderOperations使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RevSliderOperations类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_slider_speed
//.........这里部分代码省略.........
echo __("Show Details", REVSLIDER_TEXTDOMAIN);
?>
</span></span>
</span>
<span class="tp-clearfix" style="height:15px"></span>
<?php
//get css files
echo '<ul class="tp-monitor-list" id="monitor-CSS-details" style="margin-bottom:15px;display:none;">';
if (file_exists(RS_PLUGIN_PATH . '/public/assets/css/settings.css')) {
$fs = filesize(RS_PLUGIN_PATH . '/public/assets/css/settings.css');
$_li = '<li class="tp-monitor-listli">';
if ($fs < 60000) {
$_li .= '<span class="tp-monitor-good"></span>';
} else {
if ($fs < 100000) {
$_li .= '<span class="tp-monitor-well"></span>';
} else {
$_li .= '<span class="tp-monitor-warning"></span>';
}
}
$_li .= '<span class="tp-monitor-size">' . size_format($fs, 0) . '</span>';
$_li .= '<span class="tp-monitor-file">';
$_li .= __('css/settings.css', REVSLIDER_TEXTDOMAIN);
$_li .= '</span>';
$_li .= '</li>';
if ($fs > 99999) {
$issues .= $_li;
}
echo $_li;
$total_size += $fs;
$css_size += $fs;
}
$custom_css = RevSliderOperations::getStaticCss();
$custom_css = RevSliderCssParser::compress_css($custom_css);
$_li = '<li class="tp-monitor-listli">';
if (strlen($custom_css) < 50000) {
$_li .= '<span class="tp-monitor-good"></span>';
} else {
if (strlen($custom_css) < 100000) {
$_li .= '<span class="tp-monitor-well"></span>';
} else {
$_li .= '<span class="tp-monitor-warning"></span>';
}
}
$_li .= '<span class="tp-monitor-size">' . size_format(strlen($custom_css), 0) . '</span>';
$_li .= '<span class="tp-monitor-file">';
$_li .= __('Static Styles', REVSLIDER_TEXTDOMAIN);
$_li .= '</span>';
$_li .= '</li>';
if (strlen($custom_css) > 49999) {
$issues .= $_li;
}
echo $_li;
$total_size += strlen($custom_css);
$css_size += strlen($custom_css);
if (!empty($used_captions)) {
$captions = array();
foreach ($used_captions as $class => $val) {
$cap = RevSliderOperations::getCaptionsContentArray($class);
if (!empty($cap)) {
$captions[] = $cap;
}
}
$styles = RevSliderCssParser::parseArrayToCss($captions, "\n");
$styles = RevSliderCssParser::compress_css($styles);
示例2: key
$revs->initByID($sID);
//check if we already have slides, if yes, go to first
$arrS = $revs->getSlides(false);
if (empty($arrS)) {
$slideID = $revs->createSlideFromData(array('sliderid' => $sID), true);
} else {
$slideID = key($arrS);
}
}
}
$patternViewSlide = self::getViewUrl("slide", "id=[slideid]");
//init slide object
$slide = new RevSlide();
$slide->initByID($slideID);
$slideParams = $slide->getParams();
$operations = new RevSliderOperations();
//init slider object
$sliderID = $slide->getSliderID();
$slider = new RevSlider();
$slider->initByID($sliderID);
$sliderParams = $slider->getParams();
$arrSlideNames = $slider->getArrSlideNames();
$arrSlides = $slider->getSlides(false);
$arrSlidesWPML = $slider->getSlidesWPML(false, $slide);
$arrSliders = $slider->getArrSlidersShort($sliderID);
$selectSliders = RevSliderFunctions::getHTMLSelect($arrSliders, "", "id='selectSliders'", true);
//check if slider is template
$sliderTemplate = $slider->getParam("template", "false");
//set slide delay
$sliderDelay = $slider->getParam("delay", "9000");
$slideDelay = $slide->getParam("delay", "");
示例3: wp_create_nonce
<?php
if (!defined('ABSPATH')) {
exit;
}
global $revSliderVersion;
$wrapperClass = "";
if (RevSliderGlobals::$isNewVersion == false) {
$wrapperClass = " oldwp";
}
$nonce = wp_create_nonce("revslider_actions");
$rsop = new RevSliderOperations();
$glval = $rsop->getGeneralSettingsValues();
?>
<?php
$waitstyle = '';
if (isset($_REQUEST['update_shop'])) {
$waitstyle = 'display:block';
}
?>
<div id="waitaminute" style="<?php
echo $waitstyle;
?>
">
<div class="waitaminute-message"><i class="eg-icon-emo-coffee"></i><br><?php
_e("Please Wait...", REVSLIDER_TEXTDOMAIN);
?>
</div>
</div>
示例4: RevSliderOperations
if ($isWpmlExists && $useWpml == "on") {
$wpmlActive = true;
$parentSlide = $slide->getParentSlide();
$arrChildLangs = $parentSlide->getArrChildrenLangs();
}
}
//<!-- load good font -->
$operations = new RevSliderOperations();
$googleFont = $slider->getParam("google_font", array());
if (!empty($googleFont)) {
if (is_array($googleFont)) {
foreach ($googleFont as $key => $font) {
echo RevSliderOperations::getCleanFontImport($font);
}
} else {
echo RevSliderOperations::getCleanFontImport($googleFont);
}
}
if ($slide->isStaticSlide() || $slider->isSlidesFromPosts()) {
//insert sliderid for preview
?>
<input type="hidden" id="sliderid" value="<?php
echo $slider->getID();
?>
" /><?php
}
require self::getPathTemplate('template-selector');
?>
<div class="wrap settings_wrap">
示例5: add_style_settings_to_layer
/**
* add missing new style fields to the layers as all layers would be broken without this
* @since 5.0
*/
public static function add_style_settings_to_layer($sliders = false)
{
$sr = new RevSlider();
$sl = new RevSliderSlide();
$operations = new RevSliderOperations();
if ($sliders === false) {
//do it on all Sliders
$sliders = $sr->getArrSliders(false);
} else {
$sliders = array($sliders);
}
$styles = $operations->getCaptionsContentArray();
if (!empty($sliders) && is_array($sliders)) {
foreach ($sliders as $slider) {
$slides = $slider->getSlides();
$staticID = $sl->getStaticSlideID($slider->getID());
if ($staticID !== false) {
$msl = new RevSliderSlide();
if (strpos($staticID, 'static_') === false) {
$staticID = 'static_' . $slider->getID();
}
$msl->initByID($staticID);
if ($msl->getID() !== '') {
$slides = array_merge($slides, array($msl));
}
}
if (!empty($slides) && is_array($slides)) {
foreach ($slides as $slide) {
$layers = $slide->getLayers();
if (!empty($layers) && is_array($layers)) {
foreach ($layers as $lk => $layer) {
$static_styles = (array) RevSliderFunctions::getVal($layer, 'static_styles', array());
$def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
$defh_val = (array) RevSliderFunctions::getVal($layer, 'deformation-hover', array());
if (empty($def_val)) {
//add parallax always!
$def_val['parallax'] = RevSliderFunctions::getVal($layer, 'parallax_level', '-');
$layers[$lk]['deformation'] = $def_val;
//check for selected style in styles, then add all deformations to the layer
$cur_style = RevSliderFunctions::getVal($layer, 'style', '');
if (trim($cur_style) == '') {
continue;
}
$wws = false;
foreach ($styles as $style) {
if ($style['handle'] == '.tp-caption.' . $cur_style) {
$wws = $style;
break;
}
}
if ($wws == false) {
continue;
}
$css_idle = '';
$css_hover = '';
$wws['params'] = (array) $wws['params'];
$wws['hover'] = (array) $wws['hover'];
$wws['advanced'] = (array) $wws['advanced'];
if (isset($wws['params']['font-family'])) {
$def_val['font-family'] = $wws['params']['font-family'];
}
if (isset($wws['params']['padding'])) {
$raw_pad = $wws['params']['padding'];
if (!is_array($raw_pad)) {
$raw_pad = explode(' ', $raw_pad);
}
switch (count($raw_pad)) {
case 1:
$raw_pad = array($raw_pad[0], $raw_pad[0], $raw_pad[0], $raw_pad[0]);
break;
case 2:
$raw_pad = array($raw_pad[0], $raw_pad[1], $raw_pad[0], $raw_pad[1]);
break;
case 3:
$raw_pad = array($raw_pad[0], $raw_pad[1], $raw_pad[2], $raw_pad[1]);
break;
}
$def_val['padding'] = $raw_pad;
}
if (isset($wws['params']['font-style'])) {
$def_val['font-style'] = $wws['params']['font-style'];
}
if (isset($wws['params']['text-decoration'])) {
$def_val['text-decoration'] = $wws['params']['text-decoration'];
}
if (isset($wws['params']['background-color'])) {
if (RevSliderFunctions::isrgb($wws['params']['background-color'])) {
$def_val['background-color'] = RevSliderFunctions::rgba2hex($wws['params']['background-color']);
} else {
$def_val['background-color'] = $wws['params']['background-color'];
}
}
if (isset($wws['params']['background-transparency'])) {
$def_val['background-transparency'] = $wws['params']['background-transparency'];
if ($def_val['background-transparency'] > 1) {
$def_val['background-transparency'] /= 100;
//.........这里部分代码省略.........
示例6: RevSliderOperations
<?php
/**
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2015 ThemePunch
*/
if (!defined('ABSPATH')) {
exit;
}
$operations = new RevSliderOperations();
$rs_nav = new RevSliderNavigation();
$arrValues = $operations->getGeneralSettingsValues();
$arr_navigations = $rs_nav->get_all_navigations();
$transitions = $operations->getArrTransition();
$_width = isset($arrValues['width']) ? $arrValues['width'] : 1240;
$_width_notebook = isset($arrValues['width_notebook']) ? $arrValues['width_notebook'] : 1024;
$_width_tablet = isset($arrValues['width_tablet']) ? $arrValues['width_tablet'] : 778;
$_width_mobile = isset($arrValues['width_mobile']) ? $arrValues['width_mobile'] : 480;
if (!isset($is_edit)) {
$is_edit = false;
}
if (!isset($linksEditSlides)) {
$linksEditSlides = '';
}
?>
<script>
jQuery(document).ready(function(){function r(r){var i;return r=r.replace(/ /g,""),r.match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)?(i=100*parseFloat(r.match(/rgba\(\d+\,\d+\,\d+\,([^\)]+)\)/)[1]).toFixed(2),i=parseInt(i)):i=100,i}function i(r,i,e,t){var n,o,c;n=i.data("a8cIris"),o=i.data("wpWpColorPicker"),n._color._alpha=r,c=n._color.toString(),i.val(c),o.toggler.css({"background-color":c}),t&&a(r,e),i.wpColorPicker("color",c)}function a(r,i){i.slider("value",r),i.find(".ui-slider-handle").text(r.toString())}Color.prototype.toString=function(r){if("no-alpha"==r)return this.toCSS("rgba","1").replace(/\s+/g,"");if(1>this._alpha)return this.toCSS("rgba",this._alpha).replace(/\s+/g,"");var i=parseInt(this._color,10).toString(16);if(this.error)return"";if(i.length<6)for(var a=6-i.length-1;a>=0;a--)i="0"+i;return"#"+i},jQuery.fn.alphaColorPicker=function(){return this.each(function(){var e,t,n,o,c,l,s,d,u,p,f;e=jQuery(this),e.wrap('<div class="alpha-color-picker-wrap"></div>'),n=e.attr("data-palette")||"true",o=e.attr("data-show-opacity")||"true",c=e.attr("data-default-color")||"",l=-1!==n.indexOf("|")?n.split("|"):"false"==n?!1:!0,t=e.val().replace(/\s+/g,""),""==t&&(t=c),s={change:function(i,a){try{jQuery(this).closest('.placeholder-single-wrapper').find('.placeholder-checkbox').attr('checked','checked');drawToolBarPreview();} catch(e) {};var t,n,o,l;t=e.attr("data-customize-setting-link"),n=e.wpColorPicker("color"),c==n&&(o=r(n),u.find(".ui-slider-handle").text(o)),"undefined"!=typeof wp.customize&&wp.customize(t,function(r){r.set(n)}),l=d.find(".transparency"),l.css("background-color",a.color.toString("no-alpha"))},palettes:l},e.wpColorPicker(s),d=e.parents(".wp-picker-container:first"),jQuery('<div class="alpha-color-picker-container"><div class="min-click-zone click-zone"></div><div class="max-click-zone click-zone"></div><div class="alpha-slider"></div><div class="transparency"></div></div>').appendTo(d.find(".wp-picker-holder")),u=d.find(".alpha-slider"),p=r(t),f={create:function(r,i){var a=jQuery(this).slider("value");jQuery(this).find(".ui-slider-handle").text(a),jQuery(this).siblings(".transparency ").css("background-color",t)},value:p,range:"max",step:1,min:0,max:100,animate:300},u.slider(f),"true"==o&&u.find(".ui-slider-handle").addClass("show-opacity"),d.find(".min-click-zone").on("click",function(){i(0,e,u,!0)}),d.find(".max-click-zone").on("click",function(){i(100,e,u,!0)}),d.find(".iris-palette").on("click",function(){var i,t;i=jQuery(this).css("background-color"),t=r(i),a(t,u),100!=t&&(i=i.replace(/[^,]+(?=\))/,(t/100).toFixed(2))),e.wpColorPicker("color",i)}),d.find(".button.wp-picker-default").on("click",function(){var i=r(c);a(i,u)}),e.on("input",function(){var i=jQuery(this).val(),e=r(i);a(e,u)}),u.slider().on("slide",function(r,a){var t=parseFloat(a.value)/100;i(t,e,u,!1),jQuery(this).find(".ui-slider-handle").text(a.value)})})}});
</script>
<div class="wrap settings_wrap">
示例7: get_responsive_size
public static function get_responsive_size($slider)
{
$operations = new RevSliderOperations();
$arrValues = $operations->getGeneralSettingsValues();
$enable_custom_size_notebook = $slider->slider->getParam('enable_custom_size_notebook', 'off');
$enable_custom_size_tablet = $slider->slider->getParam('enable_custom_size_tablet', 'off');
$enable_custom_size_iphone = $slider->slider->getParam('enable_custom_size_iphone', 'off');
$adv_resp_sizes = $enable_custom_size_notebook == 'on' || $enable_custom_size_tablet == 'on' || $enable_custom_size_iphone == 'on' ? true : false;
if ($adv_resp_sizes == true) {
$width = $slider->slider->getParam("width", 1240, RevSlider::FORCE_NUMERIC);
$width .= ',' . $slider->slider->getParam("width_notebook", 1024, RevSlider::FORCE_NUMERIC);
$width .= ',' . $slider->slider->getParam("width_tablet", 778, RevSlider::FORCE_NUMERIC);
$width .= ',' . $slider->slider->getParam("width_mobile", 480, RevSlider::FORCE_NUMERIC);
$height = $slider->slider->getParam("height", 868, RevSlider::FORCE_NUMERIC);
$height .= ',' . $slider->slider->getParam("height_notebook", 768, RevSlider::FORCE_NUMERIC);
$height .= ',' . intval($slider->slider->getParam("height_tablet", 960, RevSlider::FORCE_NUMERIC));
$height .= ',' . intval($slider->slider->getParam("height_mobile", 720, RevSlider::FORCE_NUMERIC));
$responsive = isset($arrValues['width']) ? $arrValues['width'] : '1240';
$def = isset($arrValues['width']) ? $arrValues['width'] : '1240';
$responsive .= ',';
if ($enable_custom_size_notebook == 'on') {
$responsive .= isset($arrValues['width_notebook']) ? $arrValues['width_notebook'] : '1024';
$def = isset($arrValues['width_notebook']) ? $arrValues['width_notebook'] : '1024';
} else {
$responsive .= $def;
}
$responsive .= ',';
if ($enable_custom_size_tablet == 'on') {
$responsive .= isset($arrValues['width_tablet']) ? $arrValues['width_tablet'] : '778';
$def = isset($arrValues['width_tablet']) ? $arrValues['width_tablet'] : '778';
} else {
$responsive .= $def;
}
$responsive .= ',';
if ($enable_custom_size_iphone == 'on') {
$responsive .= isset($arrValues['width_mobile']) ? $arrValues['width_mobile'] : '480';
$def = isset($arrValues['width_mobile']) ? $arrValues['width_mobile'] : '480';
} else {
$responsive .= $def;
}
return array('level' => $responsive, 'height' => $height, 'width' => $width);
} else {
return array('height' => $slider->slider->getParam("height", "868", RevSlider::FORCE_NUMERIC), 'width' => $slider->slider->getParam("width", "1240", RevSlider::FORCE_NUMERIC));
}
}
示例8: onFrontAjaxAction
/**
* onAjax action handler
*/
public static function onFrontAjaxAction()
{
$db = new RevSliderDB();
$slider = new RevSlider();
$slide = new RevSlide();
$operations = new RevSliderOperations();
$token = self::getPostVar("token", false);
//verify the token
$isVerified = wp_verify_nonce($token, 'RevSlider_Front');
$error = false;
if ($isVerified) {
$data = self::getPostVar('data', false);
switch (self::getPostVar('client_action', false)) {
case 'get_slider_html':
$id = intval(self::getPostVar('id', 0));
if ($id > 0) {
$html = '';
add_filter('revslider_add_js_delay', array('RevSliderAdmin', 'rev_set_js_delay'));
ob_start();
$slider_class = RevSliderOutput::putSlider($id);
$html = ob_get_contents();
//add styling
$custom_css = RevSliderOperations::getStaticCss();
$custom_css = RevSliderCssParser::compress_css($custom_css);
$styles = $db->fetch(RevSliderGlobals::$table_css);
$styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
$styles = RevSliderCssParser::compress_css($styles);
$html .= '<style type="text/css">' . $custom_css . '</style>';
$html .= '<style type="text/css">' . $styles . '</style>';
ob_clean();
ob_end_clean();
$result = !empty($slider_class) && $html !== '' ? true : false;
if (!$result) {
$error = __('Slider not found', 'revslider');
} else {
if ($html !== false) {
self::ajaxResponseData($html);
} else {
$error = __('Slider not found', 'revslider');
}
}
} else {
$error = __('No Data Received', 'revslider');
}
break;
}
} else {
$error = true;
}
if ($error !== false) {
$showError = __('Loading Error', 'revslider');
if ($error !== true) {
$showError = __('Loading Error: ', 'revslider') . $error;
}
self::ajaxResponseError($showError, false);
}
exit;
}
示例9: importSliderFromPost
//.........这里部分代码省略.........
if (!empty($exist)) {
//update the animation, get the ID
if ($updateAnim == "true") {
//overwrite animation if exists
$arrUpdate = array();
$arrUpdate['params'] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
$db->update(RevSliderGlobals::$table_layer_anims, $arrUpdate, array('handle' => $animation['handle']));
$anim_id = $exist['0']['id'];
} else {
//insert with new handle
$arrInsert = array();
$arrInsert["handle"] = 'copy_' . $animation['handle'];
$arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
$anim_id = $db->insert(RevSliderGlobals::$table_layer_anims, $arrInsert);
}
} else {
//insert the animation, get the ID
$arrInsert = array();
$arrInsert["handle"] = $animation['handle'];
$arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
$anim_id = $db->insert(RevSliderGlobals::$table_layer_anims, $arrInsert);
}
//and set the current customin-oldID and customout-oldID in slider params to new ID from $id
$content = str_replace(array('customin-' . $animation['id'] . '"', 'customout-' . $animation['id'] . '"'), array('customin-' . $anim_id . '"', 'customout-' . $anim_id . '"'), $content);
}
dmp(__("animations imported!", REVSLIDER_TEXTDOMAIN));
} else {
dmp(__("no custom animations found, if slider uses custom animations, the provided export may be broken...", REVSLIDER_TEXTDOMAIN));
}
//overwrite/append static-captions.css
if (!empty($static)) {
if ($updateStatic == "true") {
//overwrite file
RevSliderOperations::updateStaticCss($static);
} elseif ($updateStatic == 'none') {
//do nothing
} else {
//append
$static_cur = RevSliderOperations::getStaticCss();
$static = $static_cur . "\n" . $static;
RevSliderOperations::updateStaticCss($static);
}
}
//overwrite/create dynamic-captions.css
//parse css to classes
$dynamicCss = RevSliderCssParser::parseCssToArray($dynamic);
if (is_array($dynamicCss) && $dynamicCss !== false && count($dynamicCss) > 0) {
foreach ($dynamicCss as $class => $styles) {
//check if static style or dynamic style
$class = trim($class);
if (strpos($class, ',') !== false && strpos($class, '.tp-caption') !== false) {
//we have something like .tp-caption.redclass, .redclass
$class_t = explode(',', $class);
foreach ($class_t as $k => $cl) {
if (strpos($cl, '.tp-caption') !== false) {
$class = $cl;
}
}
}
if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
//.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
continue;
}
//is a dynamic style
if (strpos($class, ':hover') !== false) {
$class = trim(str_replace(':hover', '', $class));
示例10: RevSliderOperations
<?php
if (!defined('ABSPATH')) {
exit;
}
$operations = new RevSliderOperations();
$arrValues = $operations->getGeneralSettingsValues();
$role = RevSliderBase::getVar($arrValues, 'role', 'admin');
$includes_globally = RevSliderBase::getVar($arrValues, 'includes_globally', 'on');
$pages_for_includes = RevSliderBase::getVar($arrValues, 'pages_for_includes', '');
$js_to_footer = RevSliderBase::getVar($arrValues, 'js_to_footer', 'off');
$js_defer = RevSliderBase::getVar($arrValues, 'js_defer', 'off');
$show_dev_export = RevSliderBase::getVar($arrValues, 'show_dev_export', 'off');
$change_font_loading = RevSliderBase::getVar($arrValues, 'change_font_loading', '');
$enable_logs = RevSliderBase::getVar($arrValues, 'enable_logs', 'off');
$enable_newschannel = apply_filters('revslider_set_notifications', 'on');
$enable_newschannel = RevSliderBase::getVar($arrValues, "enable_newschannel", $enable_newschannel);
$width = RevSliderBase::getVar($arrValues, 'width', 1240);
$width_notebook = RevSliderBase::getVar($arrValues, 'width_notebook', 1024);
$width_tablet = RevSliderBase::getVar($arrValues, 'width_tablet', 778);
$width_mobile = RevSliderBase::getVar($arrValues, 'width_mobile', 480);
$force_activation_box = RevSliderBase::getVar($arrValues, 'force_activation_box', 'off');
?>
<div id="dialog_general_settings" title="<?php
_e("General Settings", 'revslider');
?>
" style="display:none;">
<div class="settings_wrapper unite_settings_wide">
<form name="form_general_settings" id="form_general_settings">
示例11: getUsedFonts
/**
* get all used fonts in the current Slide
* @since: 5.1.0
*/
public function getUsedFonts($full = false)
{
$this->validateInited();
$op = new RevSliderOperations();
$fonts = array();
$all_fonts = $op->getArrFontFamilys();
if (!empty($this->arrLayers)) {
foreach ($this->arrLayers as $key => $layer) {
$def = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
$font = RevSliderFunctions::getVal($def, 'font-family', '');
$static = (array) RevSliderFunctions::getVal($layer, 'static_styles', array());
foreach ($all_fonts as $f) {
if (strtolower(str_replace(array('"', "'", ' '), '', $f['label'])) == strtolower(str_replace(array('"', "'", ' '), '', $font)) && $f['type'] == 'googlefont') {
if (!isset($fonts[$f['label']])) {
$fonts[$f['label']] = array('variants' => array(), 'subsets' => array());
}
if ($full) {
//if full, add all.
//switch the variants around here!
$mv = array();
if (!empty($f['variants'])) {
foreach ($f['variants'] as $fvk => $fvv) {
$mv[$fvv] = $fvv;
}
}
$fonts[$f['label']] = array('variants' => $mv, 'subsets' => $f['subsets']);
} else {
//Otherwise add only current font-weight plus italic or not
$fw = (array) RevSliderFunctions::getVal($static, 'font-weight', '400');
$fs = RevSliderFunctions::getVal($def, 'font-style', '');
if ($fs == 'italic') {
foreach ($fw as $mf => $w) {
//we check if italic is available at all for the font!
if ($w == '400') {
if (array_search('italic', $f['variants']) !== false) {
$fw[$mf] = 'italic';
}
} else {
if (array_search($w . 'italic', $f['variants']) !== false) {
$fw[$mf] = $w . 'italic';
}
}
}
}
foreach ($fw as $mf => $w) {
$fonts[$f['label']]['variants'][$w] = true;
}
$fonts[$f['label']]['subsets'] = $f['subsets'];
//subsets always get added, needs to be done then by the Slider Settings
}
break;
}
}
}
}
return apply_filters('revslider_slide_getUsedFonts', $fonts, $this);
}
示例12: importSliderFromPost
//.........这里部分代码省略.........
//$animation['id'], $animation['handle'], $animation['params']
$exist = $db->fetch(RevSliderGlobals::$table_layer_anims, $db->prepare("handle = %s", array($animation['handle'])));
if (!empty($exist)) {
//update the animation, get the ID
if ($updateAnim == "true") {
//overwrite animation if exists
$arrUpdate = array();
$arrUpdate['params'] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
$db->update(RevSliderGlobals::$table_layer_anims, $arrUpdate, array('handle' => $animation['handle']));
$anim_id = $exist['0']['id'];
} else {
//insert with new handle
$arrInsert = array();
$arrInsert["handle"] = 'copy_' . $animation['handle'];
$arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
$anim_id = $db->insert(RevSliderGlobals::$table_layer_anims, $arrInsert);
}
} else {
//insert the animation, get the ID
$arrInsert = array();
$arrInsert["handle"] = $animation['handle'];
$arrInsert["params"] = stripslashes(json_encode(str_replace("'", '"', $animation['params'])));
$anim_id = $db->insert(RevSliderGlobals::$table_layer_anims, $arrInsert);
}
//and set the current customin-oldID and customout-oldID in slider params to new ID from $id
$content = str_replace(array('customin-' . $animation['id'] . '"', 'customout-' . $animation['id'] . '"'), array('customin-' . $anim_id . '"', 'customout-' . $anim_id . '"'), $content);
}
dmp(__("animations imported!", 'revslider'));
}
//overwrite/append static-captions.css
if (!empty($static)) {
if ($updateStatic == "true") {
//overwrite file
RevSliderOperations::updateStaticCss($static);
} elseif ($updateStatic == 'none') {
//do nothing
} else {
//append
$static_cur = RevSliderOperations::getStaticCss();
$static = $static_cur . "\n" . $static;
RevSliderOperations::updateStaticCss($static);
}
}
//overwrite/create dynamic-captions.css
//parse css to classes
$dynamicCss = RevSliderCssParser::parseCssToArray($dynamic);
if (is_array($dynamicCss) && $dynamicCss !== false && count($dynamicCss) > 0) {
foreach ($dynamicCss as $class => $styles) {
//check if static style or dynamic style
$class = trim($class);
if (strpos($class, ',') !== false && strpos($class, '.tp-caption') !== false) {
//we have something like .tp-caption.redclass, .redclass
$class_t = explode(',', $class);
foreach ($class_t as $k => $cl) {
if (strpos($cl, '.tp-caption') !== false) {
$class = $cl;
}
}
}
if (strpos($class, ':hover') === false && strpos($class, ':') !== false || strpos($class, " ") !== false || strpos($class, ".tp-caption") === false || (strpos($class, ".") === false || strpos($class, "#") !== false) || strpos($class, ">") !== false) {
//.tp-caption>.imageclass or .tp-caption.imageclass>img or .tp-caption.imageclass .img
continue;
}
//is a dynamic style
if (strpos($class, ':hover') !== false) {
$class = trim(str_replace(':hover', '', $class));
示例13: onActivateHook
public static function onActivateHook()
{
$options = array();
$options = apply_filters('revslider_mod_activation_option', $options);
$operations = new RevSliderOperations();
$operations->updateGeneralSettings($options);
}
示例14: RevSliderOperations
<?php
/**
* @author ThemePunch <info@themepunch.com>
* @link http://www.themepunch.com/
* @copyright 2015 ThemePunch
*/
if (!defined('ABSPATH')) {
exit;
}
$operations = new RevSliderOperations();
$rs_nav = new RevSliderNavigation();
$arrValues = $operations->getGeneralSettingsValues();
$arr_navigations = $rs_nav->get_all_navigations();
$transitions = $operations->getArrTransition();
$_width = isset($arrValues['width']) ? $arrValues['width'] : 1240;
$_width_notebook = isset($arrValues['width_notebook']) ? $arrValues['width_notebook'] : 1024;
$_width_tablet = isset($arrValues['width_tablet']) ? $arrValues['width_tablet'] : 778;
$_width_mobile = isset($arrValues['width_mobile']) ? $arrValues['width_mobile'] : 480;
if (!isset($is_edit)) {
$is_edit = false;
}
if (!isset($linksEditSlides)) {
$linksEditSlides = '';
}
?>
<div class="wrap settings_wrap">
<div class="clear_both"></div>
<div class="title_line" style="margin-bottom:0px !important">
<div id="icon-options-general" class="icon32"></div>
示例15: putSliderBase
/**
*
* put html slider on the html page.
* @param $data - mixed, can be ID ot Alias.
*/
public function putSliderBase($sliderID, $gal_ids = array(), $markup_export = false, $settings = array(), $order = array())
{
$this->markup_export = $markup_export;
try {
$slver = apply_filters('revslider_remove_version', RevSliderGlobals::SLIDER_REVISION);
self::$sliderSerial++;
$this->slider = new RevSlider();
if ($sliderID !== '-99') {
$this->slider->initByMixed($sliderID);
} else {
//do default
$this->slider->initByMixed($sliderID);
}
//modify settings if there are any special settings given through the shortcode
if (!empty($settings)) {
$this->modify_settings($settings);
}
//modify settings for admin preview mode
if ($this->previewMode == true) {
$this->modifyPreviewModeSettings();
}
//set slider language
$isWpmlExists = RevSliderWpml::isWpmlExists();
$useWpml = $this->slider->getParam("use_wpml", "off");
if ($isWpmlExists && $useWpml == "on") {
if ($this->previewMode == false) {
$this->sliderLang = RevSliderFunctionsWP::getCurrentLangCode();
}
}
//edit html before slider
$htmlBeforeSlider = "";
if ($markup_export === true) {
$htmlBeforeSlider .= '<!-- FONT -->';
}
if ($this->slider->getParam("load_googlefont", "false") == "true") {
$googleFont = $this->slider->getParam("google_font");
if (is_array($googleFont)) {
foreach ($googleFont as $key => $font) {
}
} else {
$htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($googleFont);
}
}
$gfonts = $this->slider->getParam("google_font", array());
if (!empty($gfonts) && is_array($gfonts)) {
foreach ($gfonts as $gf) {
$gf = str_replace(array('"', '+'), array('', ' '), $gf);
$htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($gf);
}
}
//add all google fonts of layers
$gfsubsets = $this->slider->getParam("subsets", array());
$gf = $this->slider->getUsedFonts(false);
foreach ($gf as $gfk => $gfv) {
$tcf = $gfk . ':';
if (!empty($gfv['variants'])) {
$mgfirst = true;
foreach ($gfv['variants'] as $mgvk => $mgvv) {
if (!$mgfirst) {
$tcf .= ',';
}
$tcf .= $mgvk;
$mgfirst = false;
}
}
if (!empty($gfv['subsets'])) {
$mgfirst = true;
foreach ($gfv['subsets'] as $ssk => $ssv) {
if (array_search(esc_attr($gfk . '+' . $ssv), $gfsubsets) !== false) {
if ($mgfirst) {
$tcf .= '&subset=';
}
if (!$mgfirst) {
$tcf .= ',';
}
$tcf .= $ssv;
$mgfirst = false;
}
}
}
$htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($tcf);
}
if ($markup_export === true) {
$htmlBeforeSlider .= '<!-- /FONT -->';
}
//pub js to body handle
if ($this->slider->getParam("js_to_body", "false") == "true") {
$operations = new RevSliderOperations();
$arrValues = $operations->getGeneralSettingsValues();
$enable_logs = RevSliderFunctions::getVal($arrValues, "enable_logs", 'off');
if ($markup_export === true) {
$htmlBeforeSlider .= '<!-- SCRIPTINCLUDE -->';
}
if ($enable_logs == 'on') {
$urlIncludeJS = RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.enablelog.js?rev=' . $slver;
//.........这里部分代码省略.........