本文整理汇总了PHP中RevSliderCssParser::parseArrayToCss方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderCssParser::parseArrayToCss方法的具体用法?PHP RevSliderCssParser::parseArrayToCss怎么用?PHP RevSliderCssParser::parseArrayToCss使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderCssParser
的用法示例。
在下文中一共展示了RevSliderCssParser::parseArrayToCss方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exportSlider
//.........这里部分代码省略.........
if(!empty($video_data) && isset($video_data['video_type']) && $video_data['video_type'] == 'html5'){
if(isset($video_data['urlPoster']) && $video_data['urlPoster'] != '') $usedImages[$video_data['urlPoster']] = true;
if(isset($video_data['urlMp4']) && $video_data['urlMp4'] != '') $usedVideos[$video_data['urlMp4']] = true;
if(isset($video_data['urlWebm']) && $video_data['urlWebm'] != '') $usedVideos[$video_data['urlWebm']] = true;
if(isset($video_data['urlOgv']) && $video_data['urlOgv'] != '') $usedVideos[$video_data['urlOgv']] = true;
}elseif(!empty($video_data) && isset($video_data['video_type']) && $video_data['video_type'] != 'html5'){ //video cover image
if(isset($video_data['previewimage']) && $video_data['previewimage'] != '') $usedImages[$video_data['previewimage']] = true;
}
}
}
}
}
}*/
$arrSliderExport = array("params" => $sliderParams, "slides" => $arrSlides);
if (!empty($arrStaticSlide)) {
$arrSliderExport['static_slides'] = $arrStaticSlide;
}
$strExport = serialize($arrSliderExport);
//$strExportAnim = serialize(RevSliderOperations::getFullCustomAnimations());
$exportname = !empty($this->alias) ? $this->alias . '.zip' : "slider_export.zip";
$styles = '';
if (!empty($usedCaptions)) {
$captions = array();
foreach ($usedCaptions as $class => $val) {
$cap = RevSliderOperations::getCaptionsContentArray($class);
//set also advanced styles here...
if (!empty($cap)) {
$captions[] = $cap;
}
}
$styles = RevSliderCssParser::parseArrayToCss($captions, "\n", true);
}
$animations = '';
if (!empty($usedAnimations)) {
$animation = array();
foreach ($usedAnimations as $anim => $val) {
$anima = RevSliderOperations::getFullCustomAnimationByID($anim);
if ($anima !== false) {
$animation[] = RevSliderOperations::getFullCustomAnimationByID($anim);
}
}
if (!empty($animation)) {
$animations = serialize($animation);
}
}
$usedImages = array_merge($usedImages, $usedVideos);
//add images to zip
if (!empty($usedImages)) {
$upload_dir = RevSliderFunctionsWP::getPathUploads();
$upload_dir_multisiteless = wp_upload_dir();
$cont_url = $upload_dir_multisiteless['baseurl'];
$cont_url_no_www = str_replace('www.', '', $upload_dir_multisiteless['baseurl']);
$upload_dir_multisiteless = $upload_dir_multisiteless['basedir'] . '/';
foreach ($usedImages as $file => $val) {
if ($useDummy == "true") {
//only use dummy images
} else {
//use the real images
if (strpos($file, 'http') !== false) {
$remove = false;
$checkpath = str_replace(array($cont_url, $cont_url_no_www), '', $file);
if (is_file($upload_dir . $checkpath)) {
$zip->addFile($upload_dir . $checkpath, 'images/' . $checkpath);
示例2: get_slider_speed
//.........这里部分代码省略.........
$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">';
if (strlen($styles) < 50000) {
$_li .= '<span class="tp-monitor-good"></span>';
} else {
if (strlen($styles) < 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($styles), 0) . '</span>';
$_li .= '<span class="tp-monitor-file">';
$_li .= __('Dynamic Styles', REVSLIDER_TEXTDOMAIN);
$_li .= '</span>';
$_li .= '</li>';
if (strlen($styles) > 49999) {
$issues .= $_li;
}
echo $_li;
$total_size += strlen($styles);
$css_size += strlen($styles);
}
echo '</ul>';
echo ' <span style="display:none" id="css-size-hidden">' . size_format($css_size, 2) . '</span>';
$js_size = 0;
?>
<span class="tp-clearfix" style="height:15px"></span>
<hr>
<span class="tp-clearfix" style="height:25px"></span>
<!-- THE jQuery PERFORMANCE MESSING -->
示例3: exportSlider
//.........这里部分代码省略.........
$strExport = serialize($arrSliderExport);
//$strExportAnim = serialize(RevSliderOperations::getFullCustomAnimations());
$exportname = !empty($this->alias) ? $this->alias . '.zip' : "slider_export.zip";
//add navigations if not default animation
if (isset($sliderParams['navigation_arrow_style'])) {
$usedNavigations[$sliderParams['navigation_arrow_style']] = true;
}
if (isset($sliderParams['navigation_bullets_style'])) {
$usedNavigations[$sliderParams['navigation_bullets_style']] = true;
}
if (isset($sliderParams['thumbnails_style'])) {
$usedNavigations[$sliderParams['thumbnails_style']] = true;
}
if (isset($sliderParams['tabs_style'])) {
$usedNavigations[$sliderParams['tabs_style']] = true;
}
$navs = false;
if (!empty($usedNavigations)) {
$navs = RevSliderNavigation::export_navigation($usedNavigations);
if ($navs !== false) {
$navs = serialize($navs);
}
}
$styles = '';
if (!empty($usedCaptions)) {
$captions = array();
foreach ($usedCaptions as $class => $val) {
$cap = RevSliderOperations::getCaptionsContentArray($class);
//set also advanced styles here...
if (!empty($cap)) {
$captions[] = $cap;
}
}
$styles = RevSliderCssParser::parseArrayToCss($captions, "\n", true);
}
$animations = '';
if (!empty($usedAnimations)) {
$animation = array();
foreach ($usedAnimations as $anim => $val) {
$anima = RevSliderOperations::getFullCustomAnimationByID($anim);
if ($anima !== false) {
$animation[] = $anima;
}
}
if (!empty($animation)) {
$animations = serialize($animation);
}
}
$usedImages = array_merge($usedImages, $usedVideos);
$usepcl = false;
if (class_exists('ZipArchive')) {
$zip = new ZipArchive();
$success = $zip->open(RevSliderGlobals::$uploadsUrlExportZip, ZIPARCHIVE::CREATE | ZipArchive::OVERWRITE);
if ($success !== true) {
throwError("Can't create zip file: " . RevSliderGlobals::$uploadsUrlExportZip);
}
} else {
//fallback to pclzip
require_once ABSPATH . 'wp-admin/includes/class-pclzip.php';
$pclzip = new PclZip(RevSliderGlobals::$uploadsUrlExportZip);
//either the function uses die() or all is cool
$usepcl = true;
}
//add svg to the zip
if (!empty($usedSVG)) {
$content_url = content_url();