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


PHP RevSliderFunctions::isrgb方法代码示例

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


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

示例1: 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


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