当前位置: 首页>>代码示例>>PHP>>正文


PHP RevSliderOperations::getCaptionsContentArray方法代码示例

本文整理汇总了PHP中RevSliderOperations::getCaptionsContentArray方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderOperations::getCaptionsContentArray方法的具体用法?PHP RevSliderOperations::getCaptionsContentArray怎么用?PHP RevSliderOperations::getCaptionsContentArray使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RevSliderOperations的用法示例。


在下文中一共展示了RevSliderOperations::getCaptionsContentArray方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onAjaxAction


//.........这里部分代码省略.........
                 if ($return == false) {
                     RevSliderFunctions::throwError(__('Could not save Slide as Template', 'revslider'));
                     exit;
                 }
                 //get HTML for template section
                 ob_start();
                 $rs_disable_template_script = true;
                 //disable the script output of template selector file
                 include RS_PLUGIN_PATH . 'admin/views/templates/template-selector.php';
                 $html = ob_get_contents();
                 ob_clean();
                 ob_end_clean();
                 self::ajaxResponseSuccess(__('Slide added to Templates', 'revslider'), array('HTML' => $html));
                 exit;
                 break;
                 break;
             case "get_static_css":
                 $contentCSS = $operations->getStaticCss();
                 self::ajaxResponseData($contentCSS);
                 break;
             case "get_dynamic_css":
                 $contentCSS = $operations->getDynamicCss();
                 self::ajaxResponseData($contentCSS);
                 break;
             case "insert_captions_css":
                 $arrCaptions = $operations->insertCaptionsContentData($data);
                 if ($arrCaptions !== false) {
                     $db = new RevSliderDB();
                     $styles = $db->fetch(RevSliderGlobals::$table_css);
                     $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
                     $styles = RevSliderCssParser::compress_css($styles);
                     $custom_css = RevSliderOperations::getStaticCss();
                     $custom_css = RevSliderCssParser::compress_css($custom_css);
                     $arrCSS = $operations->getCaptionsContentArray();
                     $arrCssStyles = RevSliderFunctions::jsonEncodeForClientSide($arrCSS);
                     $arrCssStyles = $arrCSS;
                     self::ajaxResponseSuccess(__("CSS saved", 'revslider'), array("arrCaptions" => $arrCaptions, 'compressed_css' => $styles . $custom_css, 'initstyles' => $arrCssStyles));
                 }
                 RevSliderFunctions::throwError(__('CSS could not be saved', 'revslider'));
                 exit;
                 break;
             case "update_captions_css":
                 $arrCaptions = $operations->updateCaptionsContentData($data);
                 if ($arrCaptions !== false) {
                     $db = new RevSliderDB();
                     $styles = $db->fetch(RevSliderGlobals::$table_css);
                     $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
                     $styles = RevSliderCssParser::compress_css($styles);
                     $custom_css = RevSliderOperations::getStaticCss();
                     $custom_css = RevSliderCssParser::compress_css($custom_css);
                     $arrCSS = $operations->getCaptionsContentArray();
                     $arrCssStyles = RevSliderFunctions::jsonEncodeForClientSide($arrCSS);
                     $arrCssStyles = $arrCSS;
                     self::ajaxResponseSuccess(__("CSS saved", 'revslider'), array("arrCaptions" => $arrCaptions, 'compressed_css' => $styles . $custom_css, 'initstyles' => $arrCssStyles));
                 }
                 RevSliderFunctions::throwError(__('CSS could not be saved', 'revslider'));
                 exit;
                 break;
             case "update_captions_advanced_css":
                 $arrCaptions = $operations->updateAdvancedCssData($data);
                 if ($arrCaptions !== false) {
                     $db = new RevSliderDB();
                     $styles = $db->fetch(RevSliderGlobals::$table_css);
                     $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
                     $styles = RevSliderCssParser::compress_css($styles);
                     $custom_css = RevSliderOperations::getStaticCss();
开发者ID:zruiz,项目名称:NG,代码行数:67,代码来源:revslider-admin.class.php

示例2: 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;
//.........这里部分代码省略.........
开发者ID:dawnthemes,项目名称:tkb,代码行数:101,代码来源:plugin-update.class.php

示例3: array

//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
 * @since: 5.0
 **/
开发者ID:jfbelisle,项目名称:magexpress,代码行数:31,代码来源:slide-editor.php

示例4: get_slider_speed


//.........这里部分代码省略.........
            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">';
            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;
        ?>
开发者ID:hathbanger,项目名称:squab,代码行数:67,代码来源:operations.class.php

示例5: putCreativeLayer

 /**
  * put creative layer
  */
 private function putCreativeLayer(RevSliderSlide $slide, $static_slide = false)
 {
     $layers = $slide->getLayers();
     $slider_type = $this->slider->getParam('slider-type');
     $icon_sets = RevSliderBase::set_icon_sets(array());
     $ignore_styles = array('font-family', 'color', 'font-weight', 'font-style', 'text-decoration');
     $customAnimations = RevSliderOperations::getCustomAnimations('customin');
     //get all custom animations
     $customEndAnimations = RevSliderOperations::getCustomAnimations('customout');
     //get all custom animations
     $startAnimations = RevSliderOperations::getArrAnimations(false);
     //only get the standard animations
     $endAnimations = RevSliderOperations::getArrEndAnimations(false);
     //only get the standard animations
     $lazyLoad = $this->slider->getParam('lazy_load_type', false);
     if ($lazyLoad === false) {
         //do fallback checks to removed lazy_load value since version 5.0 and replaced with an enhanced version
         $old_ll = $this->slider->getParam('lazy_load', 'off');
         $lazyLoad = $old_ll == 'on' ? 'all' : 'none';
     }
     $isTemplate = $this->slider->getParam('template', 'false');
     $enable_custom_size_notebook = $this->slider->getParam('enable_custom_size_notebook', 'off');
     $enable_custom_size_tablet = $this->slider->getParam('enable_custom_size_tablet', 'off');
     $enable_custom_size_iphone = $this->slider->getParam('enable_custom_size_iphone', 'off');
     $enabled_sizes = array('desktop' => 'on', 'notebook' => $enable_custom_size_notebook, 'tablet' => $enable_custom_size_tablet, 'mobile' => $enable_custom_size_iphone);
     $adv_resp_sizes = $enable_custom_size_notebook == 'on' || $enable_custom_size_tablet == 'on' || $enable_custom_size_iphone == 'on' ? true : false;
     $slider_selectable = $this->slider->getParam('def-layer_selection', 'off');
     $image_source_type = $this->slider->getParam('def-image_source_type', 'full');
     if (empty($layers)) {
         return false;
     }
     $zIndex = 5;
     $slideID = $slide->getID();
     $in_class_usage = array();
     foreach ($layers as $layer) {
         $unique_id = RevSliderFunctions::getVal($layer, 'unique_id');
         if ($unique_id == '') {
             $unique_id = $zIndex - 4;
         }
         //$visible = RevSliderFunctions::getVal($layer, 'visible', true);
         //if($visible == false) continue;
         $type = RevSliderFunctions::getVal($layer, 'type', 'text');
         $svg_val = '';
         //set if video full screen
         $videoclass = '';
         $isFullWidthVideo = false;
         if ($type == 'video') {
             $videoclass = ' tp-videolayer';
             $videoData = RevSliderFunctions::getVal($layer, 'video_data');
             if (!empty($videoData)) {
                 $videoData = (array) $videoData;
                 $isFullWidthVideo = RevSliderFunctions::getVal($videoData, 'fullwidth');
                 $isFullWidthVideo = RevSliderFunctions::strToBool($isFullWidthVideo);
             } else {
                 $videoData = array();
             }
         } elseif ($type == 'audio') {
             $videoclass = ' tp-audiolayer';
             $videoData = RevSliderFunctions::getVal($layer, 'video_data');
             if (!empty($videoData)) {
                 $videoData = (array) $videoData;
             } else {
                 $videoData = array();
             }
         }
         $class = RevSliderFunctions::getVal($layer, 'style');
         if (trim($class) !== '') {
             $this->class_include['.' . trim($class)] = true;
             //add classname for style inclusion
             //get class styles for further compare usage
             if (!isset($in_class_usage[trim($class)])) {
                 $in_class_usage[trim($class)] = RevSliderOperations::getCaptionsContentArray(trim($class));
             }
         }
         //set defaults for stylings
         $dff = '';
         $dta = 'left';
         $dttr = 'none';
         $dfs = 'normal';
         $dtd = 'none';
         $dpa = '0px 0px 0px 0px';
         $dbs = 'none';
         $dbw = '0px';
         $dbr = '0px 0px 0px 0px';
         $dc = 'auto';
         $dfos = false;
         $dlh = false;
         $dfw = false;
         $dco = false;
         $dcot = 1;
         $dbc = 'transparent';
         $dbt = 1;
         $dboc = 'transparent';
         $dbot = 1;
         /**
          * remove this following to get back to 5.0.4.1 in terms of output styling
          **/
//.........这里部分代码省略.........
开发者ID:surreal8,项目名称:wptheme,代码行数:101,代码来源:output.class.php

示例6: exportSlider


//.........这里部分代码省略.........
         							if(isset($layer['image_url']) && $layer['image_url'] != '') $usedImages[$layer['image_url']] = true; //image_url if image caption
         							
         							if(isset($layer['type']) && $layer['type'] == 'video'){
         								
         								$video_data = (isset($layer['video_data'])) ? (array) $layer['video_data'] : array();
         								
         								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 {
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:67,代码来源:slider.class.php

示例7: exportSlider


//.........这里部分代码省略.........
         }
     }
     $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";
     //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);
开发者ID:ksan5835,项目名称:maadithottam,代码行数:67,代码来源:slider.class.php


注:本文中的RevSliderOperations::getCaptionsContentArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。