本文整理汇总了PHP中RevSliderCssParser类的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderCssParser类的具体用法?PHP RevSliderCssParser怎么用?PHP RevSliderCssParser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RevSliderCssParser类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onAddScripts
/**
*
* a must function. you can not use it, but the function must stay there!
*/
public static function onAddScripts()
{
global $wp_version;
$slver = apply_filters('revslider_remove_version', RevSliderGlobals::SLIDER_REVISION);
$style_pre = '';
$style_post = '';
if ($wp_version < 3.7) {
$style_pre = '<style type="text/css">';
$style_post = '</style>';
}
$operations = new RevSliderOperations();
$arrValues = $operations->getGeneralSettingsValues();
$includesGlobally = RevSliderFunctions::getVal($arrValues, "includes_globally", "on");
$includesFooter = RevSliderFunctions::getVal($arrValues, "js_to_footer", "off");
$strPutIn = RevSliderFunctions::getVal($arrValues, "pages_for_includes");
$isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
//put the includes only on pages with active widget or shortcode
// if the put in match, then include them always (ignore this if)
if ($isPutIn == false && $includesGlobally == "off") {
$isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
$hasShortcode = RevSliderFunctionsWP::hasShortcode("rev_slider");
if ($isWidgetActive == false && $hasShortcode == false) {
return false;
}
}
wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL . 'public/assets/css/settings.css', array(), $slver);
$custom_css = RevSliderOperations::getStaticCss();
$custom_css = RevSliderCssParser::compress_css($custom_css);
if (trim($custom_css) == '') {
$custom_css = '#rs-demo-id {}';
}
wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
$setBase = is_ssl() ? "https://" : "http://";
wp_enqueue_script(array('jquery'));
//add icon sets
//wp_register_style('rs-icon-set-fa-icon-', RS_PLUGIN_URL .'public/assets/fonts/font-awesome/css/font-awesome.css', array(), $slver);
//wp_register_style('rs-icon-set-pe-7s-', RS_PLUGIN_URL .'public/assets/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css', array(), $slver);
if ($includesFooter == "off") {
$waitfor = array('jquery');
$enable_logs = RevSliderFunctions::getVal($arrValues, "enable_logs", 'off');
if ($enable_logs == 'on') {
wp_enqueue_script('enable-logs', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.enablelog.js', $waitfor, $slver);
$waitfor[] = 'enable-logs';
}
wp_enqueue_script('tp-tools', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.tools.min.js', $waitfor, $slver);
wp_enqueue_script('revmin', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.revolution.min.js', 'tp-tools', $slver);
} else {
//put javascript to footer
add_action('wp_footer', array('RevSliderFront', 'putJavascript'));
}
add_action('wp_head', array('RevSliderFront', 'add_meta_generator'));
add_action("wp_footer", array('RevSliderFront', "load_icon_fonts"));
// Async JS Loading
$js_defer = RevSliderBase::getVar($arrValues, 'js_defer', 'off');
if ($js_defer != 'off') {
add_filter('clean_url', array('RevSliderFront', 'add_defer_forscript'), 11, 1);
}
add_action('wp_before_admin_bar_render', array('RevSliderFront', 'add_admin_menu_nodes'));
add_action('wp_footer', array('RevSliderFront', 'putAdminBarMenus'));
}
示例2: update_css_styles
/**
* update the styles to meet requirements for version 5.0
* @since 5.0
*/
public static function update_css_styles()
{
$css = new RevSliderCssParser();
$db = new RevSliderDB();
$styles = $db->fetch(RevSliderGlobals::$table_css);
$default_classes = RevSliderCssParser::default_css_classes();
$cs = array('background-color' => 'backgroundColor', 'border-color' => 'borderColor', 'border-radius' => 'borderRadius', 'border-style' => 'borderStyle', 'border-width' => 'borderWidth', 'color' => 'color', 'font-family' => 'fontFamily', 'font-size' => 'fontSize', 'font-style' => 'fontStyle', 'font-weight' => 'fontWeight', 'line-height' => 'lineHeight', 'opacity' => 'opacity', 'padding' => 'padding', 'text-decoration' => 'textDecoration', 'x' => 'x', 'y' => 'y', 'z' => 'z', 'skewx' => 'skewx', 'skewy' => 'skewy', 'scalex' => 'scalex', 'scaley' => 'scaley', 'opacity' => 'opacity', 'xrotate' => 'xrotate', 'yrotate' => 'yrotate', '2d_rotation' => '2d_rotation', 'layer_2d_origin_x' => 'layer_2d_origin_x', 'layer_2d_origin_y' => 'layer_2d_origin_y', '2d_origin_x' => '2d_origin_x', '2d_origin_y' => '2d_origin_y', 'pers' => 'pers', 'color-transparency' => 'color-transparency', 'background-transparency' => 'background-transparency', 'border-transparency' => 'border-transparency', 'css_cursor' => 'css_cursor', 'speed' => 'speed', 'easing' => 'easing', 'corner_left' => 'corner_left', 'corner_right' => 'corner_right', 'parallax' => 'parallax');
foreach ($styles as $key => $attr) {
if (isset($attr['advanced'])) {
$adv = json_decode($attr['advanced'], true);
// = array('idle' => array(), 'hover' => '');
} else {
$adv = array('idle' => array(), 'hover' => '');
}
if (!isset($adv['idle'])) {
$adv['idle'] = array();
}
if (!isset($adv['hover'])) {
$adv['hover'] = array();
}
//only do this to styles prior 5.0
$settings = json_decode($attr['settings'], true);
if (!empty($settings) && isset($settings['translated'])) {
if (version_compare($settings['translated'], 5.0, '>=')) {
continue;
}
}
$idle = json_decode($attr['params'], true);
$hover = json_decode($attr['hover'], true);
//check if in styles, there is type, then change the type text to something else
$the_type = 'text';
if (!empty($idle)) {
foreach ($idle as $style => $value) {
if ($style == 'type') {
$the_type = $value;
}
if (!isset($cs[$style])) {
$adv['idle'][$style] = $value;
unset($idle[$style]);
}
}
}
if (!empty($hover)) {
foreach ($hover as $style => $value) {
if (!isset($cs[$style])) {
$adv['hover'][$style] = $value;
unset($hover[$style]);
}
}
}
$settings['translated'] = 5.0;
//set the style version to 5.0
$settings['type'] = $the_type;
//set the type version to text, since 5.0 we also have buttons and shapes, so we need to differentiate from now on
if (!isset($settings['version'])) {
if (isset($default_classes[$styles[$key]['handle']])) {
$settings['version'] = $default_classes[$styles[$key]['handle']];
} else {
$settings['version'] = 'custom';
//set the version to custom as its not in the defaults
}
}
$styles[$key]['params'] = json_encode($idle);
$styles[$key]['hover'] = json_encode($hover);
$styles[$key]['advanced'] = json_encode($adv);
$styles[$key]['settings'] = json_encode($settings);
}
//save now all styles back to database
foreach ($styles as $key => $attr) {
$ret = $db->update(RevSliderGlobals::$table_css, array('settings' => $styles[$key]['settings'], 'params' => $styles[$key]['params'], 'hover' => $styles[$key]['hover'], 'advanced' => $styles[$key]['advanced']), array('id' => $attr['id']));
}
}
示例3: 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;
}
示例4: wp_enqueue_script
//check if slider is template
$sliderTemplate = $slider->getParam("template", "false");
//set slide delay
$sliderDelay = $slider->getParam("delay", "9000");
$slideDelay = $slide->getParam("delay", "");
if (empty($slideDelay)) {
$slideDelay = $sliderDelay;
}
//add tools.min.js
wp_enqueue_script('tp-tools', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.tools.min.js', array(), RevSliderGlobals::SLIDER_REVISION);
$arrLayers = $slide->getLayers();
//set Layer settings
$cssContent = $operations->getCaptionsContent();
$arrCaptionClasses = $operations->getArrCaptionClasses($cssContent);
//$arrCaptionClassesSorted = $operations->getArrCaptionClasses($cssContent);
$arrCaptionClassesSorted = RevSliderCssParser::get_captions_sorted();
$arrFontFamily = $operations->getArrFontFamilys($slider);
$arrCSS = $operations->getCaptionsContentArray();
$arrButtonClasses = $operations->getButtonClasses();
$arrAnim = $operations->getFullCustomAnimations();
$arrAnimDefaultIn = $operations->getArrAnimations(false);
$arrAnimDefaultOut = $operations->getArrEndAnimations(false);
$arrAnimDefault = array_merge($arrAnimDefaultIn, $arrAnimDefaultOut);
//set various parameters needed for the page
$width = $sliderParams["width"];
$height = $sliderParams["height"];
$imageUrl = $slide->getImageUrl();
$imageID = $slide->getImageID();
$slider_type = $slider->getParam('source_type', 'gallery');
/**
* Get Slider params which will be used as default on Slides
示例5: get_slider_speed
//.........这里部分代码省略.........
?>
</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);
$_li = '<li class="tp-monitor-listli">';
示例6: add_custom_navigation_css
public function add_custom_navigation_css($slides)
{
$rs_nav = new RevSliderNavigation();
$all_navs = $rs_nav->get_all_navigations();
$slider_type = $this->slider->getParam('slider-type');
$enable_arrows = $this->slider->getParam('enable_arrows', 'off');
$enable_bullets = $this->slider->getParam('enable_bullets', 'off');
$enable_tabs = $this->slider->getParam('enable_tabs', 'off');
$enable_thumbnails = $this->slider->getParam('enable_thumbnails', 'off');
if ($slider_type !== 'hero' && ($enable_arrows == 'on' || $enable_bullets == 'on' || $enable_tabs == 'on' || $enable_thumbnails == 'on')) {
if (!empty($slides)) {
foreach ($slides as $slide) {
$navigation_arrow_style = $this->slider->getParam('navigation_arrow_style', 'round');
$navigation_bullets_style = $this->slider->getParam('navigation_bullets_style', 'round');
$tabs_style = $this->slider->getParam('tabs_style', 'round');
$thumbnails_style = $this->slider->getParam('thumbnails_style', 'round');
if (!empty($all_navs)) {
foreach ($all_navs as $cur_nav) {
//get modifications out, wrap the class with slide class to be specific
if ($enable_arrows == 'on' && $cur_nav['handle'] == $navigation_arrow_style) {
$this->rev_custom_navigation_css .= $rs_nav->add_placeholder_sub_modifications($cur_nav['css']['arrows'], $cur_nav['handle'], 'arrows', $cur_nav['settings'], $slide, $this) . "\n";
}
if ($enable_bullets == 'on' && $cur_nav['handle'] == $navigation_bullets_style) {
$this->rev_custom_navigation_css .= $rs_nav->add_placeholder_sub_modifications($cur_nav['css']['bullets'], $cur_nav['handle'], 'bullets', $cur_nav['settings'], $slide, $this) . "\n";
}
if ($enable_tabs == 'on' && $cur_nav['handle'] == $tabs_style) {
$this->rev_custom_navigation_css .= $rs_nav->add_placeholder_sub_modifications($cur_nav['css']['tabs'], $cur_nav['handle'], 'tabs', $cur_nav['settings'], $slide, $this) . "\n";
}
if ($enable_thumbnails == 'on' && $cur_nav['handle'] == $thumbnails_style) {
$this->rev_custom_navigation_css .= $rs_nav->add_placeholder_sub_modifications($cur_nav['css']['thumbs'], $cur_nav['handle'], 'thumbs', $cur_nav['settings'], $slide, $this) . "\n";
}
}
}
}
if ($this->markup_export === true) {
echo '<!-- STYLE -->';
}
if (!is_admin()) {
echo '<script>var htmlDiv = document.getElementById("rs-plugin-settings-inline-css"); var htmlDivCss="';
} else {
echo "<style>";
}
if (!is_admin()) {
echo addslashes(RevSliderCssParser::compress_css($this->rev_custom_navigation_css)) . '";
if(htmlDiv) {
htmlDiv.innerHTML = htmlDiv.innerHTML + htmlDivCss;
}else{
var htmlDiv = document.createElement("div");
htmlDiv.innerHTML = "<style>" + htmlDivCss + "</style>";
document.getElementsByTagName("head")[0].appendChild(htmlDiv.childNodes[0]);
}
</script>' . "\n";
} else {
echo $this->rev_custom_navigation_css . '</style>';
}
if ($this->markup_export === true) {
echo '<!-- /STYLE -->';
}
}
}
}
示例7: add_inline_styles
/**
* Output Dynamic Inline Styles
*/
public function add_inline_styles()
{
if (!is_admin()) {
echo '<script>var htmlDiv = document.getElementById("rs-plugin-settings-inline-css"); var htmlDivCss="';
} else {
echo "<style>";
}
$db = new RevSliderDB();
$styles = $db->fetch(RevSliderGlobals::$table_css);
foreach ($styles as $key => $style) {
$handle = str_replace('.tp-caption', '', $style['handle']);
if (!isset($this->class_include[$handle])) {
unset($styles[$key]);
}
}
$styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
$styles = RevSliderCssParser::compress_css($styles);
if (!is_admin()) {
echo addslashes($styles) . '";
if(htmlDiv) {
htmlDiv.innerHTML = htmlDiv.innerHTML + htmlDivCss;
}
else{
var htmlDiv = document.createElement("div");
htmlDiv.innerHTML = "<style>" + htmlDivCss + "</style>";
document.getElementsByTagName("head")[0].appendChild(htmlDiv.childNodes[0]);
}
</script>' . "\n";
} else {
echo $styles . '</style>';
}
}
示例8: importSliderFromPost
//.........这里部分代码省略.........
$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));
$arrInsert = array();
$arrInsert["hover"] = json_encode($styles);
$arrInsert["settings"] = json_encode(array('hover' => 'true'));
} else {
$arrInsert = array();
$arrInsert["params"] = json_encode($styles);
$arrInsert["settings"] = '';
}
//check if class exists
$result = $db->fetch(RevSliderGlobals::$table_css, "handle = '" . $class . "'");
if (!empty($result)) {
//update
示例9: importSliderFromPost
//.........这里部分代码省略.........
$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));
$arrInsert = array();
$arrInsert["hover"] = json_encode($styles);
$arrInsert["settings"] = json_encode(array('hover' => 'true'));
} else {
$arrInsert = array();
$arrInsert["params"] = json_encode($styles);
$arrInsert["settings"] = '';
}
//check if class exists
$result = $db->fetch(RevSliderGlobals::$table_css, $db->prepare("handle = %s", array($class)));
if (!empty($result)) {
//update
示例10: add_inline_styles
/**
* Output Dynamic Inline Styles
*/
public function add_inline_styles()
{
if (!is_admin()) {
echo '<script>var htmlDiv = document.getElementById("rs-plugin-settings-inline-css");htmlDiv.innerHTML = htmlDiv.innerHTML + unescape("';
} else {
echo "<style>";
}
$db = new RevSliderDB();
$styles = $db->fetch(RevSliderGlobals::$table_css);
foreach ($styles as $key => $style) {
$handle = str_replace('.tp-caption', '', $style['handle']);
if (!isset($this->class_include[$handle])) {
unset($styles[$key]);
}
}
$styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
$styles = RevSliderCssParser::compress_css($styles);
if (!is_admin()) {
echo addslashes($styles) . '");</script>' . "\n";
} else {
echo $styles . '</style>';
}
}
示例11: add_inline_styles
/**
* Output Dynamic Inline Styles
*/
public function add_inline_styles()
{
if (!is_admin()) {
echo '<script>document.write("<style type=\\"text/css\\">';
} else {
echo "<style>";
}
$db = new RevSliderDB();
$styles = $db->fetch(RevSliderGlobals::$table_css);
foreach ($styles as $key => $style) {
$handle = str_replace('.tp-caption', '', $style['handle']);
if (!isset($this->class_include[$handle])) {
unset($styles[$key]);
}
}
$styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
$styles = RevSliderCssParser::compress_css($styles);
if (!is_admin()) {
echo addslashes($styles) . '</style>");</script>' . "\n";
} else {
echo $styles . '</style>';
}
}
示例12: add_placeholder_sub_modifications
/**
* Check the CSS for placeholders, replace them with correspinding values
* @since: 5.2.0
**/
public function add_placeholder_sub_modifications($css, $handle, $type, $settings, $slide, $output)
{
$c_css = '';
if (!is_array($settings)) {
$settings = json_decode($settings, true);
}
if (isset($settings['placeholders']) && is_array($settings['placeholders']) && !empty($settings['placeholders'])) {
//first check for media queries, generate more than one staple
$marr = RevSliderCssParser::parse_media_blocks($css);
if (!empty($marr)) {
//handle them separated
foreach ($marr as $media => $mr) {
$css = str_replace($mr, '', $css);
//clean @media query from $mr
$mr = RevSliderCssParser::clear_media_block($mr);
//remove media query and bracket
$d = RevSliderCssParser::parseCssToArray($mr);
$ret = $this->preset_return_array_css($d, $settings, $slide, $handle, $type, $output);
if (trim($ret) !== '') {
$c_css .= "\n" . $media . ' {' . "\n";
$c_css .= $ret;
$c_css .= "\n" . '}' . "\n";
}
}
}
$c = RevSliderCssParser::parseCssToArray($css);
$c_css .= $this->preset_return_array_css($c, $settings, $slide, $handle, $type, $output);
}
return $c_css;
}