示例#1
0
 /**
  * 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
          **/
         $do_remove_inline = apply_filters('revslider_remove_inline', true);
         if ($do_remove_inline) {
             if (isset($in_class_usage[trim($class)]) && isset($in_class_usage[trim($class)]['params'])) {
                 //defaults get set here
                 $dfos = isset($in_class_usage[trim($class)]['params']->{'font-size'}) ? $in_class_usage[trim($class)]['params']->{'font-size'} : $dfos;
                 $dlh = isset($in_class_usage[trim($class)]['params']->{'line-height'}) ? $in_class_usage[trim($class)]['params']->{'line-height'} : $dlh;
                 $dfw = isset($in_class_usage[trim($class)]['params']->{'font-weight'}) ? $in_class_usage[trim($class)]['params']->{'font-weight'} : $dfw;
                 $dco = isset($in_class_usage[trim($class)]['params']->{'color'}) ? $in_class_usage[trim($class)]['params']->{'color'} : $dco;
                 $dcot = isset($in_class_usage[trim($class)]['params']->{'color-transparency'}) ? $in_class_usage[trim($class)]['params']->{'color-transparency'} : $dcot;
                 $dbc = isset($in_class_usage[trim($class)]['params']->{'background-color'}) ? $in_class_usage[trim($class)]['params']->{'background-color'} : $dbc;
                 $dbt = isset($in_class_usage[trim($class)]['params']->{'background-transparency'}) ? $in_class_usage[trim($class)]['params']->{'background-transparency'} : $dbt;
                 $dboc = isset($in_class_usage[trim($class)]['params']->{'border-color'}) ? $in_class_usage[trim($class)]['params']->{'border-color'} : $dboc;
                 $dbot = isset($in_class_usage[trim($class)]['params']->{'border-transparency'}) ? $in_class_usage[trim($class)]['params']->{'border-transparency'} : $dbot;
                 $dff = isset($in_class_usage[trim($class)]['params']->{'font-family'}) ? $in_class_usage[trim($class)]['params']->{'font-family'} : $dff;
                 $dta = isset($in_class_usage[trim($class)]['params']->{'text-align'}) ? $in_class_usage[trim($class)]['params']->{'text-align'} : $dta;
                 $dttr = isset($in_class_usage[trim($class)]['params']->{'text-transform'}) ? $in_class_usage[trim($class)]['params']->{'text-transform'} : $dttr;
                 $dfs = isset($in_class_usage[trim($class)]['params']->{'font-styles'}) ? $in_class_usage[trim($class)]['params']->{'font-styles'} : $dfs;
                 $dtd = isset($in_class_usage[trim($class)]['params']->{'text-decoration'}) ? $in_class_usage[trim($class)]['params']->{'text-decoration'} : $dtd;
                 $dpa = isset($in_class_usage[trim($class)]['params']->{'padding'}) ? $in_class_usage[trim($class)]['params']->{'padding'} : $dpa;
                 if (is_array($dpa)) {
                     $dpa = implode(' ', $dpa);
                 }
                 $dbs = isset($in_class_usage[trim($class)]['params']->{'border-style'}) ? $in_class_usage[trim($class)]['params']->{'border-style'} : $dbs;
                 $dbw = isset($in_class_usage[trim($class)]['params']->{'border-width'}) ? $in_class_usage[trim($class)]['params']->{'border-width'} : $dbw;
                 $dbr = isset($in_class_usage[trim($class)]['params']->{'border-radius'}) ? $in_class_usage[trim($class)]['params']->{'border-radius'} : $dbr;
                 if (is_array($dbr)) {
                     $dbr = implode(' ', $dbr);
                 }
                 $dc = isset($in_class_usage[trim($class)]['params']->{'css_cursor'}) ? $in_class_usage[trim($class)]['params']->{'css_cursor'} : $dc;
             }
         }
         $animation = RevSliderFunctions::getVal($layer, 'animation', 'tp-fade');
         //if($animation == "fade") $animation = "tp-fade";
         $customin = '';
         $maskin = '';
         if (!array_key_exists($animation, $startAnimations) && array_key_exists($animation, $customAnimations)) {
             //if true, add custom animation
             //check with custom values, if same, we do not need to write all down and just refer
         }
         $tcin = RevSliderOperations::parseCustomAnimationByArray($layer, 'start');
         if ($tcin !== '') {
             $customin = ' data-transform_in="' . $tcin . '"';
         }
         $do_mask_in = RevSliderFunctions::getVal($layer, 'mask_start', false);
         if ($do_mask_in) {
             $tmask = RevSliderOperations::parseCustomMaskByArray($layer, 'start');
             if ($tmask !== '') {
                 $maskin = ' data-mask_in="' . $tmask . '"';
             }
         }
         //if(strpos($animation, 'customin-') !== false || strpos($animation, 'customout-') !== false) $animation = "tp-fade";
         //set output class:
         $layer_2d_rotation = intval(RevSliderFunctions::getVal($layer, '2d_rotation', '0'));
         $internal_class = RevSliderFunctions::getVal($layer, 'internal_class', '');
         $layer_selectable = RevSliderFunctions::getVal($layer, 'layer-selectable', 'default');
         $outputClass = 'tp-caption ' . trim($class);
         $outputClass = trim($outputClass) . ' ' . $internal_class . ' ';
         if ($layer_selectable !== "default") {
             if ($layer_selectable == 'on') {
                 $outputClass = trim($outputClass) . ' tp-layer-selectable ';
             }
         } else {
             if ($slider_selectable == 'on') {
                 $outputClass = trim($outputClass) . ' tp-layer-selectable ';
             }
         }
         //if($type == 'button') $outputClass .= ' ';
         //$speed = RevSliderFunctions::getVal($layer, "speed",300);
         $time = RevSliderFunctions::getVal($layer, 'time', 0);
         $easing = RevSliderFunctions::getVal($layer, 'easing', 'easeOutExpo');
         $randomRotate = RevSliderFunctions::getVal($layer, 'random_rotation', 'false');
         $randomRotate = RevSliderFunctions::boolToStr($randomRotate);
         $splitin = RevSliderFunctions::getVal($layer, 'split', 'none');
         $splitout = RevSliderFunctions::getVal($layer, 'endsplit', 'none');
         $elementdelay = intval(RevSliderFunctions::getVal($layer, 'splitdelay', 0));
         $endelementdelay = intval(RevSliderFunctions::getVal($layer, 'endsplitdelay', 0));
         $basealign = RevSliderFunctions::getVal($layer, 'basealign', 'grid');
         if ($elementdelay > 0) {
             $elementdelay /= 100;
         }
         if ($endelementdelay > 0) {
             $endelementdelay /= 100;
         }
         $text = RevSliderFunctions::getVal($layer, 'text');
         if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate
             $text = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
         } elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate plus
             $text = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
         } elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate X
             $text = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
         }
         $text_toggle = RevSliderFunctions::getVal($layer, 'texttoggle');
         if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate
             $text_toggle = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
         } elseif (function_exists('ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate plus
             $text_toggle = ppqtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
         } elseif (function_exists('qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
             //use qTranslate X
             $text_toggle = qtranxf_useCurrentLanguageIfNotFoundUseDefaultLanguage($text_toggle);
         }
         $htmlVideoAutoplay = '';
         $htmlVideoAutoplayOnlyFirstTime = '';
         $htmlVideoNextSlide = '';
         $htmlVideoThumbnail = '';
         $htmlMute = '';
         $htmlCover = '';
         $htmlDotted = '';
         $htmlRatio = '';
         $htmlRewind = '';
         $htmlStartAt = '';
         $htmlEndAt = '';
         $htmlCoverPause = '';
         $htmlDisableOnMobile = '';
         $ids = RevSliderFunctions::getVal($layer, 'attrID');
         $classes = RevSliderFunctions::getVal($layer, 'attrClasses');
         $title = RevSliderFunctions::getVal($layer, 'attrTitle');
         $rel = RevSliderFunctions::getVal($layer, 'attrRel');
         if (trim($ids) == '') {
             if ($static_slide) {
                 $ids = 'slider-' . preg_replace("/[^\\w]+/", "", $this->slider->getID()) . '-layer-' . $unique_id;
             } else {
                 $ids = 'slide-' . preg_replace("/[^\\w]+/", "", $slideID) . '-layer-' . $unique_id;
             }
         }
         $ids = $ids != '' ? ' id="' . $ids . '"' : '';
         $classes = $classes != '' ? ' ' . $classes : '';
         $title = $title != '' ? ' title="' . $title . '"' : '';
         $rel = $rel != '' ? ' rel="' . $rel . '"' : '';
         $inline_styles = '';
         $do_rotation = false;
         $add_data = '';
         $videoType = '';
         $cover = false;
         $toggle_allow = RevSliderFunctions::getVal($layer, 'toggle', false);
         //set html:
         $html = '';
         $html_toggle = '';
         switch ($type) {
             case 'shape':
                 break;
             case 'svg':
                 $max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
                 $max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
                 $max_width = is_object($max_width) ? RevSliderFunctions::get_biggest_device_setting($max_width, $enabled_sizes) : $max_width;
                 $max_height = is_object($max_height) ? RevSliderFunctions::get_biggest_device_setting($max_height, $enabled_sizes) : $max_height;
                 if ($max_width !== 'auto') {
                     $max_width = $max_width !== 'none' ? RevSliderFunctions::add_missing_val($max_width) : $max_width;
                     $inline_styles .= ' min-width: ' . $max_width . '; max-width: ' . $max_width . ';';
                 }
                 if ($max_height !== 'auto') {
                     $max_height = $max_height !== 'none' ? RevSliderFunctions::add_missing_val($max_height) : $max_height;
                     $inline_styles .= ' max-width: ' . $max_height . '; max-width: ' . $max_height . ';';
                 }
                 $svg_val = RevSliderFunctions::getVal($layer, 'svg', false);
                 $static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
                 if (!empty($static_styles)) {
                     $static_styles = (array) $static_styles;
                     if (!empty($static_styles['color'])) {
                         if (is_object($static_styles['color'])) {
                             $use_color = RevSliderFunctions::get_biggest_device_setting($static_styles['color'], $enabled_sizes);
                         } else {
                             $use_color = $static_styles['color'];
                         }
                         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
                         $color_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
                         if ($color_trans != $dcot || $use_color != $dco) {
                             if ($color_trans > 0) {
                                 $color_trans *= 100;
                             }
                             $color_trans = intval($color_trans);
                             $use_color = RevSliderFunctions::hex2rgba($use_color, $color_trans);
                             $inline_styles .= ' color: ' . $use_color . ';';
                         }
                     }
                 }
                 break;
             default:
                 //case 'no_edit':
             //case 'no_edit':
             case 'text':
             case 'button':
                 $html = $text;
                 $html = do_shortcode(stripslashes($html));
                 $html_toggle = $text_toggle;
                 $html_toggle = do_shortcode(stripslashes($html_toggle));
                 global $fa_icon_var, $pe_7s_var;
                 foreach ($icon_sets as $is) {
                     if (strpos($html, $is) !== false) {
                         //include default Icon Sets if used
                         $font_var = str_replace("-", "_", $is) . "var";
                         ${$font_var} = true;
                         //wp_enqueue_style('rs-icon-set-'.$is);
                     }
                 }
                 $max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
                 $max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
                 $white_space = RevSliderFunctions::getVal($layer, 'whitespace', 'nowrap');
                 $max_width = is_object($max_width) ? RevSliderFunctions::get_biggest_device_setting($max_width, $enabled_sizes) : $max_width;
                 $max_height = is_object($max_height) ? RevSliderFunctions::get_biggest_device_setting($max_height, $enabled_sizes) : $max_height;
                 $white_space = is_object($white_space) ? RevSliderFunctions::get_biggest_device_setting($white_space, $enabled_sizes) : $white_space;
                 if ($max_width !== 'auto') {
                     $max_width = $max_width !== 'none' ? RevSliderFunctions::add_missing_val($max_width) : $max_width;
                     $inline_styles .= ' min-width: ' . $max_width . '; max-width: ' . $max_width . ';';
                 }
                 if ($max_height !== 'auto') {
                     $max_height = $max_height !== 'none' ? RevSliderFunctions::add_missing_val($max_height) : $max_height;
                     $inline_styles .= ' max-width: ' . $max_height . '; max-width: ' . $max_height . ';';
                 }
                 $inline_styles .= ' white-space: ' . $white_space . ';';
                 //$inline_styles .= ' min-width: '.$max_width.'; min-height: '.$max_height.'; white-space: '.$white_space.';';
                 //$inline_styles .= ' max-width: '.$max_width.'; max-height: '.$max_height.';';
                 //add more inline styling
                 $static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
                 if (!empty($static_styles)) {
                     $static_styles = (array) $static_styles;
                     if (!empty($static_styles['font-size'])) {
                         $static_styles['font-size'] = RevSliderFunctions::add_missing_val($static_styles['font-size'], 'px');
                         if (is_object($static_styles['font-size'])) {
                             $mcfs = RevSliderFunctions::get_biggest_device_setting($static_styles['font-size'], $enabled_sizes);
                         } else {
                             $mcfs = $static_styles['font-size'];
                         }
                         if ($mcfs !== $dfos) {
                             $inline_styles .= ' font-size: ' . $mcfs . ';';
                         }
                     }
                     if (!empty($static_styles['line-height'])) {
                         $static_styles['line-height'] = RevSliderFunctions::add_missing_val($static_styles['line-height'], 'px');
                         if (is_object($static_styles['line-height'])) {
                             $mclh = RevSliderFunctions::get_biggest_device_setting($static_styles['line-height'], $enabled_sizes);
                         } else {
                             $mclh = $static_styles['line-height'];
                         }
                         if ($mclh !== $dlh) {
                             $inline_styles .= ' line-height: ' . $mclh . ';';
                         }
                     }
                     if (!empty($static_styles['font-weight'])) {
                         if (is_object($static_styles['font-weight'])) {
                             $mcfw = RevSliderFunctions::get_biggest_device_setting($static_styles['font-weight'], $enabled_sizes);
                         } else {
                             $mcfw = $static_styles['font-weight'];
                         }
                         if ($mcfw !== $dfw) {
                             $inline_styles .= ' font-weight: ' . $mcfw . ';';
                         }
                     }
                     if (!empty($static_styles['color'])) {
                         if (is_object($static_styles['color'])) {
                             $use_color = RevSliderFunctions::get_biggest_device_setting($static_styles['color'], $enabled_sizes);
                         } else {
                             $use_color = $static_styles['color'];
                         }
                         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
                         $color_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
                         if ($color_trans != $dcot || $use_color != $dco) {
                             if ($color_trans > 0) {
                                 $color_trans *= 100;
                             }
                             $color_trans = intval($color_trans);
                             $use_color = RevSliderFunctions::hex2rgba($use_color, $color_trans);
                             $inline_styles .= ' color: ' . $use_color . ';';
                         }
                     }
                 }
                 if ($layer_2d_rotation !== 0) {
                     $do_rotation = true;
                 }
                 break;
             case 'image':
                 $additional = '';
                 $urlImage = RevSliderFunctions::getVal($layer, 'image_url');
                 $do_image_change = RevSliderFunctions::getVal($layer, 'image-size', 'auto');
                 $img_size = 'full';
                 switch ($do_image_change) {
                     case 'auto':
                         $img_size = $image_source_type;
                         break;
                     default:
                         $img_size = $do_image_change;
                         break;
                 }
                 $cur_img_id = RevSliderFunctionsWP::get_image_id_by_url($urlImage);
                 if ($img_size !== 'full') {
                     if ($cur_img_id !== false) {
                         $urlImage = wp_get_attachment_image_src($cur_img_id, $img_size);
                         $urlImage = $urlImage[0];
                     }
                 }
                 $img_w = '';
                 $img_h = '';
                 if ($cur_img_id !== false) {
                     $img_data = wp_get_attachment_metadata($cur_img_id);
                     if ($img_data !== false && !empty($img_data)) {
                         if ($img_size !== 'full') {
                             if (isset($img_data['sizes']) && isset($img_data['sizes'][$img_size])) {
                                 $img_w = $img_data['sizes'][$img_size]['width'];
                                 $img_h = $img_data['sizes'][$img_size]['height'];
                             }
                         }
                         if ($img_w == '' || $img_h == '') {
                             $img_w = $img_data['width'];
                             $img_h = $img_data['height'];
                         }
                         $additional .= ' width="' . $img_w . '" height="' . $img_h . '"';
                     }
                 }
                 $alt = '';
                 $alt_option = RevSliderFunctions::getVal($layer, 'alt_option', 'media_library');
                 switch ($alt_option) {
                     case 'media_library':
                         if ($cur_img_id !== false) {
                             $alt = get_post_meta($cur_img_id, '_wp_attachment_image_alt', true);
                         }
                         break;
                     case 'file_name':
                         $info = pathinfo($urlImage);
                         $alt = $info['filename'];
                         break;
                     case 'custom':
                         $alt = RevSliderFunctions::getVal($layer, 'alt');
                         break;
                 }
                 if (isset($slide->ignore_alt)) {
                     $alt = '';
                 }
                 $scaleX = RevSliderFunctions::getVal($layer, 'scaleX');
                 $scaleY = RevSliderFunctions::getVal($layer, 'scaleY');
                 $cover_mode = RevSliderFunctions::getVal($layer, 'cover_mode', array());
                 if (is_string($cover_mode)) {
                     $cover_mode = array('desktop' => $cover_mode, 'notebook' => $cover_mode, 'tablet' => $cover_mode, 'mobile' => $cover_mode);
                 } else {
                     //change to array
                     $cover_mode = (array) $cover_mode;
                 }
                 if ($adv_resp_sizes == true) {
                     $y_is_single = true;
                     $x_is_single = true;
                     if ($scaleX !== '') {
                         if (!is_object($scaleX)) {
                             if (trim($scaleX) == '' || $scaleX == 'NaNpx') {
                                 $scaleX = 'auto';
                             }
                             $myScaleX = $scaleX;
                             foreach ($cover_mode as $cvmk => $cvmv) {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $myScaleX = 'full';
                                 }
                                 if ($cvmv == 'cover-proportional') {
                                     $myScaleX = 'full-proportional';
                                 }
                                 break;
                             }
                         } else {
                             foreach ($cover_mode as $cvmk => $cvmv) {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $scaleX->{$cvmk} = 'full';
                                 }
                                 if ($cvmv == 'cover-proportional') {
                                     $scaleX->{$cvmk} = 'full-proportional';
                                 }
                             }
                             $myScaleX = RevSliderFunctions::normalize_device_settings($scaleX, $enabled_sizes, 'html-array', array('NaNpx' => '', 'auto' => ''));
                             if ($myScaleX == "['','','','']") {
                                 $myScaleX = '';
                             }
                             if (strpos($myScaleX, '[') !== false) {
                                 $y_is_single = false;
                             }
                         }
                         if ($y_is_single) {
                             //force to array if voffset is also array
                             if (!isset($myScaleX)) {
                                 $myScaleX = RevSliderFunctions::get_biggest_device_setting($scaleX, $enabled_sizes);
                             }
                             if (trim($myScaleX) == '' || $myScaleX == 'NaNpx' || $myScaleX == 'auto') {
                                 $myScaleX = '';
                             } else {
                                 $myScaleX = "['" . $myScaleX . "','" . $myScaleX . "','" . $myScaleX . "','" . $myScaleX . "']";
                             }
                         }
                     }
                     if ($scaleY !== '') {
                         if (!is_object($scaleY)) {
                             if (trim($scaleY) == '' || $scaleY == 'NaNpx') {
                                 $scaleY = 'auto';
                             }
                             $myScaleY = $scaleY;
                             foreach ($cover_mode as $cvmk => $cvmv) {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $myScaleY = 'full';
                                 }
                                 if ($cvmv == 'cover-proportional') {
                                     $myScaleY = 'full-proportional';
                                 }
                                 break;
                             }
                         } else {
                             foreach ($cover_mode as $cvmk => $cvmv) {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $scaleY->{$cvmk} = 'full';
                                 }
                                 if ($cvmv == 'cover-proportional') {
                                     $scaleY->{$cvmk} = 'full-proportional';
                                 }
                             }
                             $myScaleY = RevSliderFunctions::normalize_device_settings($scaleY, $enabled_sizes, 'html-array', array('NaNpx' => '', 'auto' => ''));
                             if ($myScaleY == "['','','','']") {
                                 $myScaleY = '';
                             }
                             if (strpos($myScaleY, '[') !== false) {
                                 $y_is_single = false;
                             }
                         }
                         if ($y_is_single) {
                             //force to array if voffset is also array
                             if (!isset($myScaleY)) {
                                 $myScaleY = RevSliderFunctions::get_biggest_device_setting($scaleY, $enabled_sizes);
                             }
                             if (trim($myScaleY) == '' || $myScaleY == 'NaNpx' || $myScaleY == 'auto') {
                                 $myScaleY = '';
                             } else {
                                 $myScaleY = "['" . $myScaleY . "','" . $myScaleY . "','" . $myScaleY . "','" . $myScaleY . "']";
                             }
                         }
                     }
                 } else {
                     $myScaleX = is_object($scaleX) ? RevSliderFunctions::get_biggest_device_setting($scaleX, $enabled_sizes) : $scaleX;
                     if (trim($myScaleX) == '' || $myScaleX == 'NaNpx') {
                         $myScaleX = 'auto';
                     }
                     $myScaleY = is_object($scaleY) ? RevSliderFunctions::get_biggest_device_setting($scaleY, $enabled_sizes) : $scaleY;
                     if (trim($myScaleY) == '' || $myScaleY == 'NaNpx') {
                         $myScaleY = 'auto';
                     }
                     foreach ($cover_mode as $cvmk => $cvmv) {
                         if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                             $myScaleX = 'full';
                         }
                         if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                             $myScaleY = 'full';
                         }
                         if ($cvmv == 'cover-proportional') {
                             $myScaleX = 'full-proportional';
                         }
                         if ($cvmv == 'cover-proportional') {
                             $myScaleY = 'full-proportional';
                         }
                         break;
                     }
                 }
                 if ($scaleX != '') {
                     $additional .= ' data-ww="' . $myScaleX . '"';
                 }
                 if ($scaleY != '') {
                     $additional .= ' data-hh="' . $myScaleY . '"';
                 }
                 if (is_ssl()) {
                     $urlImage = str_replace("http://", "https://", $urlImage);
                 }
                 $do_ll = RevSliderFunctions::getVal($layer, "lazy-load", 'auto');
                 $imageAddParams = "";
                 if ($lazyLoad != 'none' || $do_ll == 'force' && $do_ll !== 'ignore') {
                     $seo_opti = RevSliderFunctions::getVal($layer, 'seo-optimized', false);
                     if ($seo_opti === 'false' || $seo_opti === false) {
                         $imageAddParams .= ' data-lazyload="' . $urlImage . '"';
                         $urlImage = RS_PLUGIN_URL . "admin/assets/images/dummy.png";
                     } else {
                         $additional .= ' class="forceseo"';
                     }
                 }
                 $html = '<img src="' . $urlImage . '" alt="' . $alt . '"' . $additional . $imageAddParams . ' data-no-retina>';
                 $imageLink = RevSliderFunctions::getVal($layer, "link", "");
                 //add more inline styling
                 $static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
                 if (!empty($static_styles) && trim($class) !== '') {
                     $static_styles = (array) $static_styles;
                     if (!empty($static_styles['line-height'])) {
                         $static_styles['line-height'] = RevSliderFunctions::add_missing_val($static_styles['line-height'], 'px');
                         if (is_object($static_styles['line-height'])) {
                             $mclh = RevSliderFunctions::get_biggest_device_setting($static_styles['line-height'], $enabled_sizes);
                         } else {
                             $mclh = $static_styles['line-height'];
                         }
                         if ($mclh !== $dlh) {
                             $inline_styles .= ' line-height: ' . $mclh . ';';
                         }
                     }
                 }
                 if ($layer_2d_rotation !== 0) {
                     $do_rotation = true;
                 }
                 break;
             case 'audio':
                 $videoType = trim(RevSliderFunctions::getVal($layer, 'video_type'));
                 $videoWidth = RevSliderFunctions::getVal($layer, 'video_width');
                 $videoHeight = RevSliderFunctions::getVal($layer, 'video_height');
                 $videoArgs = trim(RevSliderFunctions::getVal($videoData, 'args'));
                 $v_controls = RevSliderFunctions::getVal($videoData, 'controls');
                 $v_controls = RevSliderFunctions::strToBool($v_controls);
                 $v_visible = RevSliderFunctions::getVal($videoData, 'video_show_visibility');
                 $v_visible = RevSliderFunctions::strToBool($v_visible);
                 $videopreload = RevSliderFunctions::getVal($videoData, "preload_audio");
                 $videopreloadwait = RevSliderFunctions::getVal($videoData, "preload_wait");
                 $start_at = RevSliderFunctions::getVal($videoData, 'start_at');
                 $htmlStartAt = $start_at !== '' ? ' data-videostartat="' . $start_at . '"' : '';
                 $end_at = RevSliderFunctions::getVal($videoData, 'end_at');
                 $htmlEndAt = $end_at !== '' ? ' data-videoendat="' . $end_at . '"' : '';
                 $rewind = RevSliderFunctions::getVal($videoData, 'forcerewind');
                 $rewind = RevSliderFunctions::strToBool($rewind);
                 $htmlRewind = $rewind == true ? ' data-forcerewind="on"' : '';
                 $volume = RevSliderFunctions::getVal($videoData, "volume", '100');
                 $htmlMute = '			data-volume="' . intval($volume) . '"';
                 if ($v_visible === true) {
                     $videoclass .= ' tp-hiddenaudio';
                 }
                 if ($adv_resp_sizes == true) {
                     if (is_object($videoWidth)) {
                         $videoWidth = RevSliderFunctions::normalize_device_settings($videoWidth, $enabled_sizes, 'html-array');
                     }
                     if (is_object($videoHeight)) {
                         $videoHeight = RevSliderFunctions::normalize_device_settings($videoHeight, $enabled_sizes, 'html-array');
                     }
                 } else {
                     if (is_object($videoWidth)) {
                         $videoWidth = RevSliderFunctions::get_biggest_device_setting($videoWidth, $enabled_sizes);
                     }
                     if (is_object($videoHeight)) {
                         $videoHeight = RevSliderFunctions::get_biggest_device_setting($videoHeight, $enabled_sizes);
                     }
                 }
                 $videoloop = RevSliderFunctions::getVal($videoData, "videoloop");
                 $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                 $add_data .= ' data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                 if (!empty($videopreload)) {
                     $add_data .= ' data-videopreload="' . $videopreload . '"';
                     $add_data .= ' data-videopreloadwait="' . intval($videopreloadwait) . '"';
                 }
                 $add_data .= ' data-audio="html5"';
                 $urlAudio = esc_attr(RevSliderFunctions::getVal($videoData, 'urlAudio'));
                 if (!empty($urlAudio)) {
                     $add_data .= ' data-videomp4="' . $urlAudio . '"';
                 }
                 if (RevSliderFunctions::strToBool($videoloop) == true) {
                     //fallback
                     $add_data .= ' data-videoloop="loop"';
                 } else {
                     $add_data .= ' data-videoloop="' . $videoloop . '"';
                 }
                 $videoAutoplay = false;
                 if (array_key_exists("autoplayonlyfirsttime", $videoData)) {
                     $autoplayonlyfirsttime = RevSliderFunctions::strToBool(RevSliderFunctions::getVal($videoData, "autoplayonlyfirsttime"));
                     if ($autoplayonlyfirsttime == true) {
                         $videoAutoplay = '1sttime';
                     }
                 }
                 if ($videoAutoplay == false) {
                     if (array_key_exists("autoplay", $videoData)) {
                         $videoAutoplay = RevSliderFunctions::getVal($videoData, "autoplay");
                     } else {
                         //backword compatability
                         $videoAutoplay = RevSliderFunctions::getVal($layer, "video_autoplay");
                     }
                 }
                 if ($videoAutoplay !== false && $videoAutoplay !== 'false') {
                     if ($videoAutoplay === true || $videoAutoplay === 'true') {
                         $videoAutoplay = 'on';
                     }
                     $htmlVideoAutoplay = '			data-autoplay="' . $videoAutoplay . '"' . " \n";
                 } else {
                     $htmlVideoAutoplay = '			data-autoplay="off"' . " \n";
                 }
                 $videoNextSlide = RevSliderFunctions::getVal($videoData, "nextslide");
                 $videoNextSlide = RevSliderFunctions::strToBool($videoNextSlide);
                 if ($videoNextSlide == true) {
                     $htmlVideoNextSlide = '			data-nextslideatend="true"' . " \n";
                 }
                 $stopallvideo = RevSliderFunctions::getVal($videoData, "stopallvideo");
                 $stopallvideo = RevSliderFunctions::strToBool($stopallvideo);
                 $htmlDisableOnMobile .= $stopallvideo ? '			data-stopallvideos="true"' . " \n" : '';
                 break;
             case 'video':
                 $videoType = trim(RevSliderFunctions::getVal($layer, 'video_type'));
                 $videoID = trim(RevSliderFunctions::getVal($layer, 'video_id'));
                 $videoWidth = RevSliderFunctions::getVal($layer, 'video_width');
                 $videoHeight = RevSliderFunctions::getVal($layer, 'video_height');
                 $videoArgs = trim(RevSliderFunctions::getVal($layer, 'video_args'));
                 $v_controls = RevSliderFunctions::getVal($videoData, 'controls');
                 $v_controls = RevSliderFunctions::strToBool($v_controls);
                 $start_at = RevSliderFunctions::getVal($videoData, 'start_at');
                 $htmlStartAt = $start_at !== '' ? ' data-videostartat="' . $start_at . '"' : '';
                 $end_at = RevSliderFunctions::getVal($videoData, 'end_at');
                 $htmlEndAt = $end_at !== '' ? ' data-videoendat="' . $end_at . '"' : '';
                 $show_cover_pause = RevSliderFunctions::getVal($videoData, 'show_cover_pause');
                 $show_cover_pause = RevSliderFunctions::strToBool($show_cover_pause);
                 $htmlCoverPause = $show_cover_pause == true ? ' data-showcoveronpause="on"' : '';
                 $rewind = RevSliderFunctions::getVal($videoData, 'forcerewind');
                 $rewind = RevSliderFunctions::strToBool($rewind);
                 $htmlRewind = $rewind == true ? ' data-forcerewind="on"' : '';
                 $only_poster_on_mobile = isset($layer['video_data']->use_poster_on_mobile) ? $layer['video_data']->use_poster_on_mobile : '';
                 $only_poster_on_mobile = RevSliderFunctions::strToBool($only_poster_on_mobile);
                 if ($isFullWidthVideo == true) {
                     // || $cover == true
                     $videoWidth = '100%';
                     $videoHeight = '100%';
                 }
                 if ($adv_resp_sizes == true) {
                     if (is_object($videoWidth)) {
                         $videoWidth = RevSliderFunctions::normalize_device_settings($videoWidth, $enabled_sizes, 'html-array');
                     }
                     if (is_object($videoHeight)) {
                         $videoHeight = RevSliderFunctions::normalize_device_settings($videoHeight, $enabled_sizes, 'html-array');
                     }
                 } else {
                     if (is_object($videoWidth)) {
                         $videoWidth = RevSliderFunctions::get_biggest_device_setting($videoWidth, $enabled_sizes);
                     }
                     if (is_object($videoHeight)) {
                         $videoHeight = RevSliderFunctions::get_biggest_device_setting($videoHeight, $enabled_sizes);
                     }
                 }
                 $setBase = is_ssl() ? 'https://' : 'http://';
                 $cover = RevSliderFunctions::getVal($videoData, 'cover');
                 $cover = RevSliderFunctions::strToBool($cover);
                 $videoloop = RevSliderFunctions::getVal($videoData, "videoloop");
                 $mute = RevSliderFunctions::getVal($videoData, "mute");
                 $mute = RevSliderFunctions::strToBool($mute);
                 $htmlMute = $mute ? '			data-volume="mute"' : '';
                 switch ($videoType) {
                     case 'streamyoutube':
                     case 'streamyoutubeboth':
                     case 'youtube':
                         if ($videoType == 'streamyoutube' || $videoType == 'streamyoutubeboth') {
                             //change $videoID to the stream!
                             $videoID = $slide->getParam('slide_bg_youtube', '');
                         }
                         if (empty($videoArgs)) {
                             $videoArgs = RevSliderGlobals::DEFAULT_YOUTUBE_ARGUMENTS;
                         }
                         if (!$mute) {
                             $volume = RevSliderFunctions::getVal($videoData, "volume", '100');
                             $htmlMute = '			data-volume="' . intval($volume) . '"';
                             $videoArgs = 'volume=' . intval($volume) . '&' . $videoArgs;
                         }
                         if ($start_at !== '') {
                             $start_raw = explode(':', $start_at);
                             if (count($start_raw) == 2) {
                                 if (intval($start_raw[0]) > 0) {
                                     $start_at = $start_raw[0] * 60 + $start_raw[1];
                                 } else {
                                     $start_at = $start_raw[1];
                                 }
                             }
                             $videoArgs .= $start_at !== '' ? '&start=' . $start_at : '';
                         }
                         if ($end_at !== '') {
                             $end_raw = explode(':', $end_at);
                             if (count($end_raw) == 2) {
                                 if (intval($end_raw[0]) > 0) {
                                     $end_at = $end_raw[0] * 60 + $end_raw[1];
                                 } else {
                                     $end_at = $end_raw[1];
                                 }
                             }
                             $videoArgs .= $end_at !== '' ? '&end=' . $end_at : '';
                         }
                         //check if full URL
                         if (strpos($videoID, 'http') !== false) {
                             //we have full URL, split it to ID
                             parse_str(parse_url($videoID, PHP_URL_QUERY), $my_v_ret);
                             $videoID = $my_v_ret['v'];
                         }
                         $videospeed = RevSliderFunctions::getVal($videoData, 'videospeed', '1');
                         $videoArgs .= ';origin=' . $setBase . $_SERVER['SERVER_NAME'] . ';';
                         $add_data = ' data-ytid="' . $videoID . '" data-videoattributes="version=3&amp;enablejsapi=1&amp;html5=1&amp;' . $videoArgs . '" data-videorate="' . $videospeed . '" data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                         $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                         break;
                     case 'streamvimeo':
                     case 'streamvimeoboth':
                     case 'vimeo':
                         if ($videoType == 'streamvimeo' || $videoType == 'streamvimeoboth') {
                             //change $videoID
                             $videoID = $slide->getParam('slide_bg_vimeo', '');
                         }
                         if (empty($videoArgs)) {
                             $videoArgs = RevSliderGlobals::DEFAULT_VIMEO_ARGUMENTS;
                         }
                         if ($v_controls) {
                             $videoArgs = 'background=1&' . $videoArgs;
                         }
                         //check if full URL
                         if (strpos($videoID, 'http') !== false) {
                             //we have full URL, split it to ID
                             $videoID = (int) substr(parse_url($videoID, PHP_URL_PATH), 1);
                         }
                         if (!$mute) {
                             $volume = RevSliderFunctions::getVal($videoData, "volume", '100');
                             $htmlMute = '			data-volume="' . intval($volume) . '"';
                         }
                         $add_data = ' data-vimeoid="' . $videoID . '" data-videoattributes="' . $videoArgs . '" data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                         break;
                     case 'streaminstagram':
                     case 'streaminstagramboth':
                     case 'html5':
                         $urlPoster = RevSliderFunctions::getVal($videoData, "urlPoster");
                         $urlMp4 = RevSliderFunctions::getVal($videoData, "urlMp4");
                         $urlWebm = RevSliderFunctions::getVal($videoData, "urlWebm");
                         $urlOgv = RevSliderFunctions::getVal($videoData, "urlOgv");
                         $videopreload = RevSliderFunctions::getVal($videoData, "preload");
                         $leave_on_pause = RevSliderFunctions::getVal($videoData, "leave_on_pause");
                         $leave_on_pause = RevSliderFunctions::strToBool($leave_on_pause);
                         if (!$leave_on_pause) {
                             $add_data .= ' data-exitfullscreenonpause="off"';
                             //nur wenn off, standard on
                         }
                         if ($videoType == 'streaminstagram' || $videoType == 'streaminstagramboth') {
                             //change $videoID
                             $urlMp4 = $slide->getParam('slide_bg_instagram', '');
                             $urlWebm = '';
                             $urlOgv = '';
                         }
                         $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"';
                         $add_data .= ' data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"';
                         if (is_ssl()) {
                             $urlPoster = str_replace("http://", "https://", $urlPoster);
                         }
                         if (!empty($urlPoster)) {
                             $add_data .= ' data-videoposter="' . $urlPoster . '"';
                         }
                         if (!empty($urlOgv)) {
                             $add_data .= ' data-videoogv="' . $urlOgv . '"';
                         }
                         if (!empty($urlWebm)) {
                             $add_data .= ' data-videowebm="' . $urlWebm . '"';
                         }
                         if (!empty($urlMp4)) {
                             $add_data .= ' data-videomp4="' . $urlMp4 . '"';
                         }
                         if (!empty($urlPoster)) {
                             if ($only_poster_on_mobile === true) {
                                 //$add_data .= ' data-posterOnMobile="on"';
                                 $add_data .= ' data-noposteronmobile="on"';
                             } else {
                                 //$add_data .= ' data-posterOnMobile="off"';
                                 $add_data .= ' data-noposteronmobile="off"';
                             }
                         }
                         if (!empty($videopreload)) {
                             $add_data .= ' data-videopreload="' . $videopreload . '"';
                         }
                         break;
                     default:
                         RevSliderFunctions::throwError("wrong video type: {$videoType}");
                         break;
                 }
                 if (RevSliderFunctions::strToBool($videoloop) == true) {
                     //fallback
                     $add_data .= ' data-videoloop="loop"';
                 } else {
                     $add_data .= ' data-videoloop="' . $videoloop . '"';
                 }
                 if ($cover == true) {
                     $dotted = RevSliderFunctions::getVal($videoData, "dotted");
                     if ($dotted !== 'none') {
                         $add_data .= ' data-dottedoverlay="' . $dotted . '"';
                     }
                     $add_data .= ' data-forceCover="1"';
                     $ratio = RevSliderFunctions::getVal($videoData, "ratio");
                     if (!empty($ratio)) {
                         $add_data .= ' data-aspectratio="' . $ratio . '"';
                     }
                 }
                 $videoAutoplay = false;
                 if (array_key_exists("autoplayonlyfirsttime", $videoData)) {
                     $autoplayonlyfirsttime = RevSliderFunctions::strToBool(RevSliderFunctions::getVal($videoData, "autoplayonlyfirsttime"));
                     if ($autoplayonlyfirsttime == true) {
                         $videoAutoplay = '1sttime';
                     }
                 }
                 if ($videoAutoplay == false) {
                     if (array_key_exists("autoplay", $videoData)) {
                         $videoAutoplay = RevSliderFunctions::getVal($videoData, "autoplay");
                     } else {
                         //backword compatability
                         $videoAutoplay = RevSliderFunctions::getVal($layer, "video_autoplay");
                     }
                 }
                 if ($videoAutoplay !== false && $videoAutoplay !== 'false') {
                     if ($videoAutoplay === true || $videoAutoplay === 'true') {
                         $videoAutoplay = 'on';
                     }
                     $htmlVideoAutoplay = '			data-autoplay="' . $videoAutoplay . '"' . " \n";
                 } else {
                     $htmlVideoAutoplay = '			data-autoplay="off"' . " \n";
                 }
                 $large_controls = RevSliderFunctions::strToBool(RevSliderFunctions::getVal($videoData, "large_controls"));
                 if (!$large_controls) {
                     $add_data .= ' data-viodelargecontrols="off"';
                 }
                 $videoNextSlide = RevSliderFunctions::getVal($videoData, "nextslide");
                 $videoNextSlide = RevSliderFunctions::strToBool($videoNextSlide);
                 if ($videoNextSlide == true) {
                     $htmlVideoNextSlide = '			data-nextslideatend="true"' . " \n";
                 }
                 $videoThumbnail = isset($videoData["previewimage"]) ? $videoData["previewimage"] : '';
                 if (is_ssl()) {
                     $videoThumbnail = str_replace("http://", "https://", $videoThumbnail);
                 } else {
                     $videoThumbnail = str_replace("https://", "http://", $videoThumbnail);
                 }
                 if (trim($videoThumbnail) !== '') {
                     $htmlVideoThumbnail = '			data-videoposter="' . $videoThumbnail . '"' . " \n";
                 }
                 if (!empty($videoThumbnail)) {
                     if ($only_poster_on_mobile === true) {
                         //$htmlVideoThumbnail .= '			data-posterOnMobile="on"'." \n";
                         $htmlVideoThumbnail .= '			data-noposteronmobile="on"' . " \n";
                     } else {
                         //$htmlVideoThumbnail .= '			data-posterOnMobile="off"'." \n";
                         $htmlVideoThumbnail .= '			data-noposteronmobile="off"' . " \n";
                     }
                 }
                 $disable_on_mobile = RevSliderFunctions::getVal($videoData, "disable_on_mobile");
                 $disable_on_mobile = RevSliderFunctions::strToBool($disable_on_mobile);
                 $htmlDisableOnMobile = $disable_on_mobile ? '			data-disablevideoonmobile="1"' . " \n" : '';
                 $stopallvideo = RevSliderFunctions::getVal($videoData, "stopallvideo");
                 $stopallvideo = RevSliderFunctions::strToBool($stopallvideo);
                 $allowfullscreenvideo = RevSliderFunctions::getVal($videoData, "allowfullscreen");
                 $allowfullscreenvideo = RevSliderFunctions::strToBool($allowfullscreenvideo);
                 $htmlDisableOnMobile .= $stopallvideo ? '			data-stopallvideos="true"' . " \n" : '';
                 $htmlDisableOnMobile .= $allowfullscreenvideo ? '			data-allowfullscreenvideo="true"' . " \n" : '';
                 break;
         }
         $has_trigger = false;
         foreach ($layers as $cl) {
             if ($has_trigger) {
                 break;
             }
             $all_actions = RevSliderFunctions::getVal($cl, 'layer_action', array());
             if (!empty($all_actions)) {
                 $a_action = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'action', array()));
                 $a_layer_target = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'layer_target', array()));
                 foreach ($a_action as $ak => $aa) {
                     switch ($aa) {
                         case 'start_in':
                         case 'start_out':
                         case 'toggle_layer':
                             /*case 'stop_video':
                             		case 'start_video':
                             		case 'toggle_video':*/
                             if ($unique_id == $a_layer_target[$ak]) {
                                 $has_trigger = true;
                                 break;
                             }
                             break;
                     }
                 }
             }
         }
         $last_trigger_state = '';
         $animation_overwrite = 'default';
         $trigger_memory = 'keep';
         if ($has_trigger) {
             $animation_overwrite = RevSliderFunctions::getVal($layer, 'animation_overwrite', 'wait');
             $trigger_memory = RevSliderFunctions::getVal($layer, 'trigger_memory', 'keep');
             $last_trigger_state = '			data-lasttriggerstate="' . esc_attr($trigger_memory) . '"';
         }
         if ($animation_overwrite == 'waitin' || $animation_overwrite == 'wait') {
             $time = 'bytrigger';
         }
         if ($animation_overwrite == 'waitout' || $animation_overwrite == 'wait') {
             $htmlEnd = ' data-end="bytrigger"' . "\n";
         } else {
             //handle end transitions:
             $endTime = trim(RevSliderFunctions::getVal($layer, 'endtime', 0));
             $endWithSlide = RevSliderFunctions::getVal($layer, 'endWithSlide', false);
             //backwards compatibility
             $realEndTime = UniteFunctionsRev::getVal($layer, "realEndTime", false);
             if ($realEndTime !== false) {
                 $endSpeed = trim(UniteFunctionsRev::getVal($layer, "endspeed"));
                 $speed = UniteFunctionsRev::getVal($layer, "speed", 300);
                 $calcSpeed = !empty($endSpeed) ? $endSpeed : $speed;
                 if (!empty($calcSpeed) && $realEndTime - $calcSpeed !== $endTime) {
                     $endTime = $realEndTime - $calcSpeed;
                 }
             }
             //backwards compatibility end
             $htmlEnd = '';
             //endtime - endspeed
             $es = RevSliderFunctions::getVal($layer, 'endspeed', 0);
             if (!empty($endTime) && $endTime - $es < 0) {
                 $endTime = 0;
             } else {
                 $endTime = $endTime - $es;
             }
         }
         $show_on_hover = RevSliderFunctions::getVal($layer, 'show-on-hover', false);
         if ($show_on_hover === 'show-on-hover' || is_array($show_on_hover) && $show_on_hover[0] == 'show-on-hover') {
             $show_on_hover = false;
         }
         //fix for layers that occured in version 5.2.2 and 5.2.3
         if ($show_on_hover == true) {
             $time = 'sliderenter';
             $htmlEnd = ' data-end="sliderleave"' . " \n";
         } else {
             if (!empty($endTime) && $endWithSlide !== true) {
                 $htmlEnd = ' data-end="' . $endTime . '"' . " \n";
             }
         }
         $customout = '';
         $maskout = '';
         //add animation to class
         $endAnimation = trim(RevSliderFunctions::getVal($layer, "endanimation"));
         if ($endAnimation == "fade") {
             $endAnimation = "tp-fade";
         }
         if (!array_key_exists($endAnimation, $endAnimations) && array_key_exists($endAnimation, $customEndAnimations)) {
             //if true, add custom animation
             //check with custom values, if same, we do not need to write all down and just refer
         }
         $tcout = '';
         if ($endAnimation !== 'auto') {
             $tcout = RevSliderOperations::parseCustomAnimationByArray($layer, 'end');
         } else {
             //automatic reverse
             $tcout .= 'auto:auto;';
         }
         if ($endAnimation == 'auto') {
             $es = RevSliderFunctions::getVal($layer, 'endspeed');
             $ee = trim(RevSliderFunctions::getVal($layer, 'endeasing'));
             if (!empty($es)) {
                 $tcout .= 's:' . $es . ';';
             }
             if (!empty($ee) && $ee !== 'nothing') {
                 $tcout .= 'e:' . $ee . ';';
             }
         }
         if ($tcout !== '') {
             $customout = ' data-transform_out="' . $tcout . '"';
         }
         $do_mask_out = RevSliderFunctions::getVal($layer, 'mask_end', false);
         if ($do_mask_out) {
             $tmask = RevSliderOperations::parseCustomMaskByArray($layer, 'end');
             if ($tmask !== '') {
                 $maskout = ' data-mask_out="' . $tmask . '"';
             }
         }
         //slide link
         $html_simple_link = '';
         //hidden under resolution
         $htmlHidden = '';
         $layerHidden = RevSliderFunctions::getVal($layer, 'hiddenunder');
         if ($layerHidden == 'true' || $layerHidden == '1') {
             $htmlHidden = '			data-captionhidden="on"' . " \n";
         }
         $htmlParams = $add_data . $htmlEnd . $last_trigger_state . $htmlVideoAutoplay . $htmlVideoNextSlide . $htmlVideoThumbnail . $htmlHidden . $htmlMute . $htmlDisableOnMobile . $htmlCover . $htmlDotted . $htmlRatio . $htmlRewind . $htmlStartAt . $htmlEndAt . $htmlCoverPause . "\n";
         //.$htmlVideoAutoplayOnlyFirstTime
         //set positioning options
         $alignHor = RevSliderFunctions::getVal($layer, 'align_hor', 'left');
         $alignVert = RevSliderFunctions::getVal($layer, 'align_vert', 'top');
         $left = RevSliderFunctions::getVal($layer, 'left', 0);
         $top = RevSliderFunctions::getVal($layer, 'top', 0);
         $htmlPosX = '';
         $htmlPosY = '';
         $static_data = '';
         $extra_data = '';
         if ($adv_resp_sizes == true) {
             $do_x_full = false;
             $do_y_full = false;
             $x_is_single = true;
             $y_is_single = true;
             if (!is_object($left)) {
                 $myLeft = $left;
                 $myLeft = "['" . $myLeft . "','" . $myLeft . "','" . $myLeft . "','" . $myLeft . "']";
             } else {
                 $myLeft = RevSliderFunctions::normalize_device_settings($left, $enabled_sizes, 'html-array');
                 if (strpos($myLeft, '[') !== false) {
                     $do_x_full = true;
                 } else {
                     $myLeft = "['" . $myLeft . "','" . $myLeft . "','" . $myLeft . "','" . $myLeft . "']";
                 }
             }
             if (!is_object($top)) {
                 $myTop = $top;
                 $myTop = "['" . $myTop . "','" . $myTop . "','" . $myTop . "','" . $myTop . "']";
             } else {
                 $myTop = RevSliderFunctions::normalize_device_settings($top, $enabled_sizes, 'html-array');
                 if (strpos($myTop, '[') !== false) {
                     $do_y_full = true;
                 } else {
                     $myTop = "['" . $myTop . "','" . $myTop . "','" . $myTop . "','" . $myTop . "']";
                 }
             }
             if (!is_object($alignHor)) {
                 $myHor = $alignHor;
                 $myHor = "['" . $myHor . "','" . $myHor . "','" . $myHor . "','" . $myHor . "']";
             } else {
                 $myHor = RevSliderFunctions::normalize_device_settings($alignHor, $enabled_sizes, 'html-array');
                 if (strpos($myHor, '[') !== false) {
                     $x_is_single = false;
                 } else {
                     $myHor = "['" . $myHor . "','" . $myHor . "','" . $myHor . "','" . $myHor . "']";
                 }
             }
             if (!is_object($alignVert)) {
                 $myVer = $alignVert;
                 $myVer = "['" . $myVer . "','" . $myVer . "','" . $myVer . "','" . $myVer . "']";
             } else {
                 $myVer = RevSliderFunctions::normalize_device_settings($alignVert, $enabled_sizes, 'html-array');
                 if (strpos($myVer, '[') !== false) {
                     $y_is_single = false;
                 } else {
                     $myVer = "['" . $myVer . "','" . $myVer . "','" . $myVer . "','" . $myVer . "']";
                 }
             }
             $htmlPosX = ' data-x="' . $myHor . '" data-hoffset="' . $myLeft . '"';
             $htmlPosY = ' data-y="' . $myVer . '" data-voffset="' . $myTop . '"';
             $static_styles = RevSliderFunctions::getVal($layer, 'static_styles', array());
             if (!empty($static_styles)) {
                 $static_styles = (array) $static_styles;
                 if (!empty($static_styles['font-size'])) {
                     if (is_object($static_styles['font-size'])) {
                         $ss_fs = RevSliderFunctions::normalize_device_settings($static_styles['font-size'], $enabled_sizes, 'html-array');
                         if (strpos($ss_fs, '[') !== false) {
                             $static_data .= str_replace('px', '', '			data-fontsize="' . $ss_fs . '"') . "\n";
                         }
                     }
                 }
                 if (!empty($static_styles['line-height'])) {
                     if (is_object($static_styles['line-height'])) {
                         $ss_lh = RevSliderFunctions::normalize_device_settings($static_styles['line-height'], $enabled_sizes, 'html-array');
                         if (strpos($ss_lh, '[') !== false) {
                             $static_data .= str_replace('px', '', '			data-lineheight="' . $ss_lh . '"') . "\n";
                         }
                     }
                 }
                 if (!empty($static_styles['font-weight'])) {
                     if (is_object($static_styles['font-weight'])) {
                         $ss_fw = RevSliderFunctions::normalize_device_settings($static_styles['font-weight'], $enabled_sizes, 'html-array');
                         if (strpos($ss_fw, '[') !== false) {
                             $static_data .= str_replace('px', '', '			data-fontweight="' . $ss_fw . '"') . "\n";
                         }
                     }
                 }
                 if (!empty($static_styles['color'])) {
                     if (is_object($static_styles['color'])) {
                         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
                         foreach ($static_styles['color'] as $sk => $sv) {
                             if (strpos($sv, 'rgb') !== false) {
                                 $static_styles['color']->{$sk} = RevSliderFunctions::rgba2hex($sv);
                             }
                             $color_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
                             if ($color_trans > 0) {
                                 $color_trans *= 100;
                             }
                             $color_trans = intval($color_trans);
                             $static_styles['color']->{$sk} = RevSliderFunctions::hex2rgba($static_styles['color']->{$sk}, $color_trans);
                         }
                         $ss_c = RevSliderFunctions::normalize_device_settings($static_styles['color'], $enabled_sizes, 'html-array');
                         if (strpos($ss_c, '[') !== false) {
                             $static_data .= '			data-color="' . $ss_c . '"' . "\n";
                         }
                     }
                 }
             }
             $max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
             $max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
             $white_space = RevSliderFunctions::getVal($layer, 'whitespace', 'nowrap');
             $cover_mode = RevSliderFunctions::getVal($layer, 'cover_mode', array());
             if (is_string($cover_mode)) {
                 $cover_mode = array('desktop' => $cover_mode, 'notebook' => $cover_mode, 'tablet' => $cover_mode, 'mobile' => $cover_mode);
             } else {
                 //change to array
                 $cover_mode = (array) $cover_mode;
             }
             if (is_object($max_width)) {
                 $max_width = RevSliderFunctions::normalize_device_settings($max_width, $enabled_sizes);
                 if ($max_width->desktop == 'auto') {
                     $max_width->desktop = 'none';
                 }
                 if ($max_width->notebook == 'auto') {
                     $max_width->notebook = 'none';
                 }
                 if ($max_width->tablet == 'auto') {
                     $max_width->tablet = 'none';
                 }
                 if ($max_width->mobile == 'auto') {
                     $max_width->mobile = 'none';
                 }
                 if ($max_width->desktop == $max_width->notebook && $max_width->desktop == $max_width->tablet && $max_width->desktop == $max_width->mobile) {
                     $max_width = $max_width->desktop;
                 }
             }
             if (is_object($max_height)) {
                 $max_height = RevSliderFunctions::normalize_device_settings($max_height, $enabled_sizes);
                 if ($max_height->desktop == 'auto') {
                     $max_height->desktop = 'none';
                 }
                 if ($max_height->notebook == 'auto') {
                     $max_height->notebook = 'none';
                 }
                 if ($max_height->tablet == 'auto') {
                     $max_height->tablet = 'none';
                 }
                 if ($max_height->mobile == 'auto') {
                     $max_height->mobile = 'none';
                 }
                 if ($max_height->desktop == $max_height->notebook && $max_height->desktop == $max_height->tablet && $max_height->desktop == $max_height->mobile) {
                     $max_height = $max_height->desktop;
                 }
             }
             if (is_object($white_space)) {
                 $white_space = RevSliderFunctions::normalize_device_settings($white_space, $enabled_sizes);
                 if ($white_space->desktop == $white_space->notebook && $white_space->desktop == $white_space->tablet && $white_space->desktop == $white_space->mobile) {
                     $white_space = $white_space->desktop;
                 }
             }
             switch ($type) {
                 case 'shape':
                 case 'image':
                     if (is_object($max_width)) {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                 $max_width->{$cvmk} = 'full';
                             } elseif ($cvmv == 'cover-proportional') {
                                 $max_width->{$cvmk} = 'full-proportional';
                             } else {
                                 if ($type == 'image') {
                                     $max_width->{$cvmk} = 'none';
                                 }
                             }
                         }
                     } else {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($type == 'image') {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $max_width = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_width = 'full-proportional';
                                 } else {
                                     $max_width = 'none';
                                 }
                             } else {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $max_width = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_width = 'full-proportional';
                                 }
                             }
                             break;
                         }
                     }
                     if (is_object($max_height)) {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                 $max_height->{$cvmk} = 'full';
                             } elseif ($cvmv == 'cover-proportional') {
                                 $max_height->{$cvmk} = 'full-proportional';
                             } else {
                                 if ($type == 'image') {
                                     $max_height->{$cvmk} = 'none';
                                 }
                             }
                         }
                     } else {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($type == 'image') {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $max_height = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_height = 'full-proportional';
                                 } else {
                                     $max_height = 'none';
                                 }
                             } else {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $max_height = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_height = 'full-proportional';
                                 }
                             }
                             break;
                         }
                     }
                     break;
                 case 'svg':
                     break;
             }
             if ($type !== 'video') {
                 //$static_data .= (is_object($max_width)) ? str_replace('px', '', "			data-minwidth=\"['".implode("','", (array)$max_width)."']\"")."\n" : str_replace('px', '', '			data-minwidth="'.$max_width.'"')."\n";
                 $static_data .= is_object($max_width) ? str_replace('px', '', "\t\t\tdata-width=\"['" . implode("','", (array) $max_width) . "']\"") . "\n" : str_replace('px', '', '			data-width="' . $max_width . '"') . "\n";
                 //$static_data .= (is_object($max_height)) ? str_replace('px', '', "			data-minheight=\"['".implode("','", (array)$max_height)."']\"")."\n" : str_replace('px', '', '			data-minheight="'.$max_height.'"')."\n";
                 $static_data .= is_object($max_height) ? str_replace('px', '', "\t\t\tdata-height=\"['" . implode("','", (array) $max_height) . "']\"") . "\n" : str_replace('px', '', '			data-height="' . $max_height . '"') . "\n";
             }
             $static_data .= is_object($white_space) ? str_replace('px', '', "\t\t\tdata-whitespace=\"['" . implode("','", (array) $white_space) . "']\"") . "\n" : str_replace('px', '', '			data-whitespace="' . $white_space . '"') . "\n";
         } else {
             if (is_object($alignHor)) {
                 $alignHor = RevSliderFunctions::get_biggest_device_setting($alignHor, $enabled_sizes);
             }
             if (is_object($alignVert)) {
                 $alignVert = RevSliderFunctions::get_biggest_device_setting($alignVert, $enabled_sizes);
             }
             if (is_object($left)) {
                 $left = RevSliderFunctions::get_biggest_device_setting($left, $enabled_sizes);
             }
             if (is_object($top)) {
                 $top = RevSliderFunctions::get_biggest_device_setting($top, $enabled_sizes);
             }
             switch ($alignHor) {
                 default:
                 case 'left':
                     $htmlPosX = ' data-x="' . $left . '"';
                     break;
                 case 'center':
                     $htmlPosX = ' data-x="center" data-hoffset="' . $left . '"';
                     break;
                 case 'right':
                     //$left = (int)$left*-1;
                     $htmlPosX = ' data-x="right" data-hoffset="' . $left . '"';
                     break;
             }
             switch ($alignVert) {
                 default:
                 case 'top':
                     $htmlPosY = ' data-y="' . $top . '"';
                     break;
                 case 'middle':
                     $htmlPosY = ' data-y="center" data-voffset="' . $top . '"';
                     break;
                 case 'bottom':
                     //$top = (int)$top*-1;
                     $htmlPosY = ' data-y="bottom" data-voffset="' . $top . '"';
                     break;
             }
             $max_width = RevSliderFunctions::getVal($layer, 'max_width', 'auto');
             $max_height = RevSliderFunctions::getVal($layer, 'max_height', 'auto');
             $cover_mode = RevSliderFunctions::getVal($layer, 'cover_mode', array());
             if (is_string($cover_mode)) {
                 $cover_mode = array('desktop' => $cover_mode, 'notebook' => $cover_mode, 'tablet' => $cover_mode, 'mobile' => $cover_mode);
             } else {
                 //change to array
                 $cover_mode = (array) $cover_mode;
             }
             switch ($type) {
                 case 'shape':
                 case 'image':
                     if (is_object($max_width)) {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                 $max_width->{$cvmk} = 'full';
                             } elseif ($cvmv == 'cover-proportional') {
                                 $max_width->{$cvmk} = 'full-proportional';
                             } else {
                                 if ($type == 'image') {
                                     $max_width->{$cvmk} = 'none';
                                 }
                             }
                         }
                     } else {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($type == 'image') {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $max_width = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_width = 'full-proportional';
                                 } else {
                                     $max_width = 'none';
                                 }
                             } else {
                                 if ($cvmv == 'fullwidth' || $cvmv == 'cover') {
                                     $max_width = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_width = 'full-proportional';
                                 }
                             }
                             break;
                         }
                     }
                     if (is_object($max_height)) {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                 $max_height->{$cvmk} = 'full';
                             } elseif ($cvmv == 'cover-proportional') {
                                 $max_height->{$cvmk} = 'full-proportional';
                             } else {
                                 if ($type == 'image') {
                                     $max_height->{$cvmk} = 'none';
                                 }
                             }
                         }
                     } else {
                         foreach ($cover_mode as $cvmk => $cvmv) {
                             if ($type == 'image') {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $max_height = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_height = 'full-proportional';
                                 } else {
                                     $max_height = 'none';
                                 }
                             } else {
                                 if ($cvmv == 'fullheight' || $cvmv == 'cover') {
                                     $max_height = 'full';
                                 } elseif ($cvmv == 'cover-proportional') {
                                     $max_height = 'full-proportional';
                                 }
                             }
                             break;
                         }
                     }
                     break;
                 case 'svg':
                     break;
             }
             if ($type !== 'video') {
                 $static_data .= is_object($max_width) ? str_replace('px', '', "\t\t\tdata-width=\"['" . implode("','", (array) $max_width) . "']\"") . "\n" : str_replace('px', '', '			data-width="' . $max_width . '"') . "\n";
                 $static_data .= is_object($max_height) ? str_replace('px', '', "\t\t\tdata-height=\"['" . implode("','", (array) $max_height) . "']\"") . "\n" : str_replace('px', '', '			data-height="' . $max_height . '"') . "\n";
             }
         }
         $style_string = '';
         $vis_desktop = RevSliderFunctions::getVal($layer, 'visible-desktop', true);
         $vis_notebook = RevSliderFunctions::getVal($layer, 'visible-notebook', true);
         $vis_tablet = RevSliderFunctions::getVal($layer, 'visible-tablet', true);
         $vis_mobile = RevSliderFunctions::getVal($layer, 'visible-mobile', true);
         $vis_notebook = $vis_notebook === true ? 'on' : 'off';
         $vis_desktop = $vis_desktop === true ? 'on' : 'off';
         $vis_tablet = $vis_tablet === true ? 'on' : 'off';
         $vis_mobile = $vis_mobile === true ? 'on' : 'off';
         if ($vis_notebook == 'off' || $vis_desktop == 'off' || $vis_tablet == 'off' || $vis_mobile == 'off') {
             $static_data .= "\t\t\tdata-visibility=\"['" . $vis_desktop . "','" . $vis_notebook . "','" . $vis_tablet . "','" . $vis_mobile . "']\"\n";
         }
         $il_style = (array) RevSliderFunctions::getVal($layer, 'inline', array());
         $adv_style = (array) RevSliderFunctions::getVal($layer, 'advanced', array());
         //add deformation and hover deformation to the layers
         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation', array());
         $def = array();
         $st_idle = array();
         $def['o'] = array(RevSliderFunctions::getVal($def_val, 'opacity', '0'), '0');
         $def['sX'] = array(RevSliderFunctions::getVal($def_val, 'scalex', '1'), '1');
         $def['sY'] = array(RevSliderFunctions::getVal($def_val, 'scaley', '1'), '1');
         $def['skX'] = array(RevSliderFunctions::getVal($def_val, 'skewx', '0'), '0');
         $def['skY'] = array(RevSliderFunctions::getVal($def_val, 'skewy', '0'), '0');
         $def['rX'] = array(RevSliderFunctions::getVal($def_val, 'xrotate', '0'), '0');
         $def['rY'] = array(RevSliderFunctions::getVal($def_val, 'yrotate', '0'), '0');
         $def['rZ'] = array(RevSliderFunctions::getVal($layer, '2d_rotation', '0'), '0');
         $orix = RevSliderFunctions::getVal($def_val, '2d_origin_x', '50%');
         if (strpos($orix, '%') === false) {
             $orix .= '%';
         }
         $oriy = RevSliderFunctions::getVal($def_val, '2d_origin_y', '50%');
         if (strpos($oriy, '%') === false) {
             $oriy .= '%';
         }
         $def['tO'] = array($orix . ' ' . $oriy, '50% 50%');
         $def['tP'] = array(RevSliderFunctions::getVal($def_val, 'pers', '600'), '600');
         $def['z'] = array(RevSliderFunctions::getVal($def_val, 'z', '0'), '0');
         $st_idle['font-family'] = array(str_replace('"', "'", RevSliderFunctions::getVal($def_val, 'font-family', '')), str_replace('"', "'", $dff));
         $st_idle['text-align'] = array(RevSliderFunctions::getVal($def_val, 'text-align', 'left'), $dta);
         $st_idle['text-transform'] = array(RevSliderFunctions::getVal($def_val, 'text-transform', 'left'), $dttr);
         //styling
         $mfs = RevSliderFunctions::getVal($def_val, 'font-style', 'off');
         $font_style = $mfs == 'on' || $mfs == 'italic' ? 'italic' : 'normal';
         $st_idle['font-style'] = array($font_style, $dfs);
         $st_idle['text-decoration'] = array(RevSliderFunctions::getVal($def_val, 'text-decoration', 'none'), $dtd);
         $bg_color = RevSliderFunctions::getVal($def_val, 'background-color', $dbc);
         if ($bg_color !== 'transparent') {
             $bg_trans = RevSliderFunctions::getVal($def_val, 'background-transparency', $dbt);
             if ($bg_trans > 0) {
                 $bg_trans *= 100;
             }
             if ($dbt > 0) {
                 $dbt *= 100;
             }
             $bg_trans = intval($bg_trans);
             $dbt = intval($dbt);
             $st_idle['background-color'] = array(RevSliderFunctions::hex2rgba($bg_color, $bg_trans), RevSliderFunctions::hex2rgba($dbc, $dbt));
             //'ALWAYS'
         }
         $my_padding = RevSliderFunctions::getVal($def_val, 'padding', array('0px', '0px', '0px', '0px'));
         if (!empty($my_padding)) {
             if (is_array($my_padding)) {
                 $my_padding = implode(' ', $my_padding);
             }
             if (trim($my_padding) != '') {
                 $st_idle['padding'] = array($my_padding, $dpa);
             }
         }
         $border_color = RevSliderFunctions::getVal($def_val, 'border-color', $dboc);
         if ($border_color !== 'transparent') {
             $border_trans = RevSliderFunctions::getVal($def_val, 'border-transparency', $dbot);
             if ($border_trans > 0) {
                 $border_trans *= 100;
             }
             if ($dbot > 0) {
                 $dbot *= 100;
             }
             $border_trans = intval($border_trans);
             $dbot = intval($dbot);
             $st_idle['border-color'] = array(RevSliderFunctions::hex2rgba($border_color, $border_trans), RevSliderFunctions::hex2rgba($dboc, $dbot));
             //'ALWAYS'
         }
         $st_idle['border-style'] = array(RevSliderFunctions::getVal($def_val, 'border-style', 'none'), $dbs);
         $bdw = RevSliderFunctions::getVal($def_val, 'border-width', '0px');
         $bdw = RevSliderFunctions::add_missing_val($bdw, 'px');
         if ($bdw == '0px') {
             unset($st_idle['border-style']);
         }
         $st_idle['border-width'] = array($bdw, $dbw);
         $my_border = RevSliderFunctions::getVal($def_val, 'border-radius', array('0px', '0px', '0px', '0px'));
         if (!empty($my_border)) {
             $my_border = implode(' ', $my_border);
             if (trim($my_border) != '') {
                 $st_idle['border-radius'] = array($my_border, $dbr);
             }
         }
         //Advanced Styles here:
         if (isset($adv_style['idle'])) {
             $adv_style['idle'] = (array) $adv_style['idle'];
             if (!empty($adv_style['idle'])) {
                 foreach ($adv_style['idle'] as $n => $v) {
                     $st_idle[$n] = array($v, 'ALWAYS');
                 }
             }
         }
         //Advanced Styles here:
         if (isset($il_style['idle'])) {
             $il_style['idle'] = (array) $il_style['idle'];
             if (!empty($il_style['idle'])) {
                 foreach ($il_style['idle'] as $n => $v) {
                     $st_idle[$n] = array($v, 'ALWAYS');
                 }
             }
         }
         //get hover stuff, because of css_cursor
         $def_val = (array) RevSliderFunctions::getVal($layer, 'deformation-hover', array());
         //add the css_cursor to the idle styles
         $css_cursor = RevSliderFunctions::getVal($def_val, 'css_cursor', 'auto');
         if (trim($css_cursor) !== '' && $css_cursor !== 'auto') {
             if ($css_cursor == 'zoom-in') {
                 $css_cursor = '-webkit-zoom-in; cursor: -moz-zoom-in';
             }
             if ($css_cursor == 'zoom-out') {
                 $css_cursor = '-webkit-zoom-out; cursor: -moz-zoom-out';
             }
             $st_idle['cursor'] = array($css_cursor, 'auto');
         }
         $def_string = '';
         foreach ($def as $key => $value) {
             if (trim($value[0]) == '' || $value[0] == $value[1]) {
                 continue;
             }
             if (str_replace('px', '', $value[0]) == str_replace('px', '', $value[1])) {
                 continue;
             }
             $def_string .= $key . ':' . $value[0] . ';';
         }
         foreach ($st_idle as $key => $value) {
             if ($type == 'image' || $type == 'video') {
                 //do not print unneeded styles
                 if (in_array($key, $ignore_styles)) {
                     continue;
                 }
             }
             if (trim($value[0]) == '' || $value[0] == $value[1]) {
                 continue;
             }
             if (str_replace('px', '', $value[0]) == str_replace('px', '', $value[1])) {
                 continue;
             }
             $style_string .= $key . ':' . $value[0] . ';';
         }
         $deform = '			data-transform_idle="' . str_replace('"', "'", $def_string) . '"' . "\n";
         $idle_style = $style_string;
         //check if hover is active for the layer
         $is_hover_active = RevSliderFunctions::getVal($layer, 'hover', '0');
         $deform_hover = '';
         $style_hover = '';
         $def = array();
         $st_h_string = '';
         if ($is_hover_active) {
             $def['o'] = array(RevSliderFunctions::getVal($def_val, 'opacity', '0'), '0');
             $def['sX'] = array(RevSliderFunctions::getVal($def_val, 'scalex', '1'), '1');
             $def['sY'] = array(RevSliderFunctions::getVal($def_val, 'scaley', '1'), '1');
             $def['skX'] = array(RevSliderFunctions::getVal($def_val, 'skewx', '0'), '0');
             $def['skY'] = array(RevSliderFunctions::getVal($def_val, 'skewy', '0'), '0');
             $def['rX'] = array(RevSliderFunctions::getVal($def_val, 'xrotate', '0'), '0');
             $def['rY'] = array(RevSliderFunctions::getVal($def_val, 'yrotate', '0'), '0');
             $def['rZ'] = array(RevSliderFunctions::getVal($def_val, '2d_rotation', '0'), 'inherit');
             $def['z'] = array(RevSliderFunctions::getVal($def_val, 'z', '0'), '0');
             $def['s'] = array(RevSliderFunctions::getVal($def_val, 'speed', '300'), 'ALWAYS');
             $def['e'] = array(RevSliderFunctions::getVal($def_val, 'easing', 'easeOutExpo'), 'ALWAYS');
             //style
             $st_hover = array();
             $font_color = RevSliderFunctions::getVal($def_val, 'color', '#000');
             if ($font_color !== 'transparent') {
                 $font_trans = RevSliderFunctions::getVal($def_val, 'color-transparency', 1);
                 if ($font_trans > 0) {
                     $font_trans *= 100;
                 }
                 $font_trans = intval($font_trans);
                 $st_hover['c'] = array(RevSliderFunctions::hex2rgba($font_color, $font_trans), 'ALWAYS');
             } else {
                 $st_hover['c'] = array($font_color, 'ALWAYS');
             }
             $mfs = RevSliderFunctions::getVal($def_val, 'font-style', 'off');
             $font_style = $mfs == 'on' || $mfs == 'italic' ? 'italic' : 'normal';
             $st_hover['fs'] = array($font_style, 'normal');
             $st_hover['td'] = array(RevSliderFunctions::getVal($def_val, 'text-decoration', 'none'), 'none');
             $bg_color = RevSliderFunctions::getVal($def_val, 'background-color', 'transparent');
             if ($bg_color !== 'transparent') {
                 $bg_trans = RevSliderFunctions::getVal($def_val, 'background-transparency', 1);
                 if ($bg_trans > 0) {
                     $bg_trans *= 100;
                 }
                 $bg_trans = intval($bg_trans);
                 $st_hover['bg'] = array(RevSliderFunctions::hex2rgba($bg_color, $bg_trans), 'ALWAYS');
             }
             $my_padding = RevSliderFunctions::getVal($def_val, 'padding', array('0px', '0px', '0px', '0px'));
             if (!empty($my_padding)) {
                 $my_padding = implode(' ', $my_padding);
                 if (trim($my_padding) != '') {
                     $st_hover['p'] = array($my_padding, '0px 0px 0px 0px');
                 }
             }
             $border_color = RevSliderFunctions::getVal($def_val, 'border-color', 'transparent');
             if ($border_color !== 'transparent') {
                 $border_trans = RevSliderFunctions::getVal($def_val, 'border-transparency', 1);
                 if ($border_trans > 0) {
                     $border_trans *= 100;
                 }
                 $border_trans = intval($border_trans);
                 $st_hover['bc'] = array(RevSliderFunctions::hex2rgba($border_color, $border_trans), 'ALWAYS');
             }
             $st_hover['bs'] = array(RevSliderFunctions::getVal($def_val, 'border-style', 'none'), 'none');
             $st_hover['bw'] = array(RevSliderFunctions::add_missing_val(RevSliderFunctions::getVal($def_val, 'border-width', '0px'), 'px'), '0px');
             if ($st_hover['bw'][0] == '0px') {
                 unset($st_hover['bs']);
             }
             $my_border = RevSliderFunctions::getVal($def_val, 'border-radius', array('0px', '0px', '0px', '0px'));
             if (!empty($my_border)) {
                 $my_border = implode(' ', $my_border);
                 if (trim($my_border) != '') {
                     $brsthoverdw = isset($st_idle['border-radius']) && $st_idle['border-radius'] !== '0px 0px 0px 0px' ? 'ALWAYS' : '0px 0px 0px 0px';
                     $st_hover['br'] = array($my_border, $brsthoverdw);
                 }
             }
             $st_trans = array('c' => 'color', 'fs' => 'font-style', 'td' => 'text-decoration', 'bg' => 'background-color', 'p' => 'padding', 'bc' => 'border-color', 'bs' => 'border-style', 'bw' => 'border-width', 'br' => 'border-radius');
             foreach ($st_hover as $sk => $sv) {
                 //do not write values for hover if idle is the same value
                 if (isset($st_idle[$st_trans[$sk]]) && $st_idle[$st_trans[$sk]][0] == $sv[0]) {
                     unset($st_hover[$sk]);
                 }
             }
             //Advanced Styles here:
             if (isset($adv_style['hover'])) {
                 $adv_style['hover'] = (array) $adv_style['hover'];
                 if (!empty($adv_style['hover'])) {
                     foreach ($adv_style['hover'] as $n => $v) {
                         $st_hover[$n] = array($v, 'ALWAYS');
                     }
                 }
             }
             //Advanced Styles here:
             if (isset($il_style['hover'])) {
                 $il_style['hover'] = (array) $il_style['hover'];
                 if (!empty($il_style['hover'])) {
                     foreach ($il_style['hover'] as $n => $v) {
                         $st_hover[$n] = array($v, 'ALWAYS');
                     }
                 }
             }
             $def_string = '';
             foreach ($def as $key => $value) {
                 if (trim($value[0]) == '' || $value[0] === $value[1]) {
                     continue;
                 }
                 $def_string .= $key . ':' . $value[0] . ';';
             }
             foreach ($st_hover as $key => $value) {
                 if (trim($value[0]) == '' || $value[0] === $value[1]) {
                     continue;
                 }
                 $st_h_string .= $key . ':' . $value[0] . ';';
             }
             $deform_hover = '				data-transform_hover="' . $def_string . '"' . "\n";
         }
         if ($st_h_string !== '') {
             $style_hover = '				data-style_hover="' . $st_h_string . '"' . "\n";
         }
         $static_data .= $deform . $deform_hover . $style_hover;
         //set corners
         $htmlCorners = "";
         //if($type == "no_edit"){}
         if ($type == "text" || $type == "button") {
             $cornerdef = RevSliderFunctions::getVal($layer, "deformation");
             $cornerLeft = RevSliderFunctions::getVal($cornerdef, "corner_left");
             $cornerRight = RevSliderFunctions::getVal($cornerdef, "corner_right");
             switch ($cornerLeft) {
                 case "curved":
                     $htmlCorners .= "<div class='frontcorner'></div>";
                     break;
                 case "reverced":
                     $htmlCorners .= "<div class='frontcornertop'></div>";
                     break;
             }
             switch ($cornerRight) {
                 case "curved":
                     $htmlCorners .= "<div class='backcorner'></div>";
                     break;
                 case "reverced":
                     $htmlCorners .= "<div class='backcornertop'></div>";
                     break;
             }
         }
         //add resizeme class
         $resize_full = RevSliderFunctions::getVal($layer, "resize-full", true);
         if ($resize_full === true || $resize_full == 'true' || $resize_full == '1') {
             $resizeme = RevSliderFunctions::getVal($layer, "resizeme", true);
             if ($resizeme == "true" || $resizeme == "1") {
                 $outputClass .= ' tp-resizeme';
             }
         } else {
             //end text related layer
             $extra_data .= '			data-responsive="off"';
         }
         //make some modifications for the full screen video
         if ($isFullWidthVideo == true) {
             $htmlPosX = ' data-x="0"';
             $htmlPosY = ' data-y="0"';
             $outputClass .= ' fullscreenvideo';
         }
         //parallax part
         $use_parallax = $this->slider->getParam('use_parallax', $this->slider->getParam('use_parallax', 'off'));
         $parallax_class = '';
         if ($use_parallax == 'on') {
             $ldef = RevSliderFunctions::getVal($layer, 'deformation', array());
             $slide_level = RevSliderFunctions::getVal($ldef, 'parallax', '-');
             $parallax_ddd = $this->slider->getParam("ddd_parallax", "off");
             $parallax_ddd_bgfreeze = $this->slider->getParam("ddd_parallax_bgfreeze", "off");
             $ddd_z = RevSliderFunctions::getVal($layer, 'parallax_layer_ddd_zlevel', '');
             //bg , layers
             if ($parallax_ddd == "on" && $slide_level == "-" && $ddd_z === "bg") {
                 $slide_level = "tobggroup";
             }
             if ($slide_level !== '-') {
                 $parallax_class = ' rs-parallaxlevel-' . $slide_level;
             }
         }
         //check for actions
         $all_actions = RevSliderFunctions::getVal($layer, 'layer_action', array());
         $a_tooltip_event = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'tooltip_event', array()));
         $a_action = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'action', array()));
         $a_image_link = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'image_link', array()));
         $a_link_open_in = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'link_open_in', array()));
         $a_jump_to_slide = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'jump_to_slide', array()));
         $a_scrolloffset = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'scrollunder_offset', array()));
         $a_actioncallback = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'actioncallback', array()));
         $a_target = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'layer_target', array()));
         $a_action_delay = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'action_delay', array()));
         $a_link_type = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'link_type', array()));
         $a_toggle_layer_type = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'toggle_layer_type', array()));
         $a_toggle_class = RevSliderFunctions::cleanStdClassToArray(RevSliderFunctions::getVal($all_actions, 'toggle_class', array()));
         $a_html = '';
         $a_events = array();
         if (!empty($a_action)) {
             $a_html .= "\t\t\tdata-actions='";
             foreach ($a_action as $num => $action) {
                 $layer_attrID = '';
                 switch ($action) {
                     case 'start_in':
                     case 'start_out':
                     case 'start_video':
                     case 'stop_video':
                     case 'toggle_layer':
                     case 'toggle_video':
                     case 'simulate_click':
                     case 'toggle_class':
                     case 'toggle_mute_video':
                     case 'mute_video':
                     case 'unmute_video':
                         //get the ID of the layer with the unique_id that is $a_target[$num]
                         $layer_attrID = $slide->getLayerID_by_unique_id($a_target[$num], $this->static_slide);
                         if ($a_target[$num] == 'backgroundvideo' || $a_target[$num] == 'firstvideo') {
                             $layer_attrID = $a_target[$num];
                         } elseif (trim($layer_attrID) == '') {
                             if (strpos($a_target[$num], 'static-') !== false || $static_slide) {
                                 $layer_attrID = 'slider-' . preg_replace("/[^\\w]+/", "", $this->slider->getID()) . '-layer-' . str_replace('static-', '', $a_target[$num]);
                             } else {
                                 $layer_attrID = 'slide-' . preg_replace("/[^\\w]+/", "", $slideID) . '-layer-' . $a_target[$num];
                             }
                         }
                         break;
                 }
                 switch ($action) {
                     case 'none':
                         continue;
                         break;
                     case 'link':
                         //if post based, replace {{}} with correct info
                         //a_image_link
                         if (isset($a_image_link[$num])) {
                             $a_image_link[$num] = do_shortcode($a_image_link[$num]);
                         }
                         if (isset($a_link_type[$num]) && $a_link_type[$num] == 'jquery') {
                             /*
                             $setBase = (is_ssl()) ? "https://" : "http://";
                             if(strpos($a_image_link[$num], 'http') === false)
                             	$a_image_link[$num] = $setBase .$a_image_link[$num];
                             */
                             $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                             $a_link_open_in[$num] = isset($a_link_open_in[$num]) ? $a_link_open_in[$num] : '';
                             $a_image_link[$num] = isset($a_image_link[$num]) ? $a_image_link[$num] : '';
                             $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'simplelink', 'target' => $a_link_open_in[$num], 'url' => $a_image_link[$num]);
                         } else {
                             if ($html_simple_link == '') {
                                 //adds the link to the layer
                                 /*
                                 $setBase = (is_ssl()) ? "https://" : "http://";
                                 if(strpos($a_image_link[$num], 'http') === false)
                                 	$a_image_link[$num] = $setBase .$a_image_link[$num];
                                 */
                                 $a_image_link[$num] = isset($a_image_link[$num]) ? $a_image_link[$num] : '';
                                 $a_link_open_in[$num] = isset($a_link_open_in[$num]) ? $a_link_open_in[$num] : '';
                                 $html_simple_link = ' href="' . $a_image_link[$num] . '"';
                                 $html_simple_link .= ' target="' . $a_link_open_in[$num] . '"';
                             }
                         }
                         break;
                     case 'jumpto':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_jump_to_slide[$num] = isset($a_jump_to_slide[$num]) ? $a_jump_to_slide[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'jumptoslide', 'slide' => 'rs-' . $a_jump_to_slide[$num], 'delay' => $a_action_delay[$num]);
                         break;
                     case 'next':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'jumptoslide', 'slide' => 'next', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'gofullscreen':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'gofullscreen', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_global_mute_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'toggle_global_mute_video', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'exitfullscreen':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'exitfullscreen', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'togglefullscreen':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'togglefullscreen', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'prev':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'jumptoslide', 'slide' => 'previous', 'delay' => $a_action_delay[$num]);
                         break;
                     case 'pause':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'pauseslider');
                         break;
                     case 'resume':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'playslider');
                         break;
                     case 'toggle_slider':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'toggleslider');
                         break;
                     case 'callback':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_actioncallback[$num] = isset($a_actioncallback[$num]) ? $a_actioncallback[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'callback', 'callback' => $a_actioncallback[$num]);
                         break;
                     case 'scroll_under':
                         //ok
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_scrolloffset[$num] = isset($a_scrolloffset[$num]) ? $a_scrolloffset[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'scrollbelow', 'offset' => RevSliderFunctions::add_missing_val($a_scrolloffset[$num], 'px'));
                         break;
                     case 'start_in':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'startlayer', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'start_out':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'stoplayer', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_layer':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_toggle_layer_type[$num] = isset($a_toggle_layer_type[$num]) ? $a_toggle_layer_type[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'togglelayer', 'layerstatus' => $a_toggle_layer_type[$num], 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'start_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'playvideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'stop_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'stopvideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'mute_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'mutevideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'unmute_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'unmutevideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'togglevideo', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_mute_video':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'toggle_mute_video', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'simulate_click':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'simulateclick', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num]);
                         break;
                     case 'toggle_class':
                         $a_tooltip_event[$num] = isset($a_tooltip_event[$num]) ? $a_tooltip_event[$num] : '';
                         $a_action_delay[$num] = isset($a_action_delay[$num]) ? $a_action_delay[$num] : '';
                         $a_toggle_class[$num] = isset($a_toggle_class[$num]) ? $a_toggle_class[$num] : '';
                         $a_events[] = array('event' => $a_tooltip_event[$num], 'action' => 'toggleclass', 'layer' => $layer_attrID, 'delay' => $a_action_delay[$num], 'classname' => $a_toggle_class[$num]);
                         break;
                 }
             }
             if (!empty($a_events)) {
                 $a_html .= json_encode($a_events);
             }
             $a_html .= "'\n";
         }
         //check for loop animation here
         $do_loop = RevSliderFunctions::getVal($layer, 'loop_animation', 'none');
         $loop_data = '';
         $loop_class = '';
         if ($do_loop !== 'none') {
             $loop_class = ' ' . $do_loop;
             switch ($do_loop) {
                 case 'rs-pendulum':
                     $loop_data .= ' data-easing="' . RevSliderFunctions::getVal($layer, 'loop_easing', 'Power3.easeInOut') . '"';
                     $loop_data .= ' data-startdeg="' . RevSliderFunctions::getVal($layer, 'loop_startdeg', '-20') . '"';
                     $loop_data .= ' data-enddeg="' . RevSliderFunctions::getVal($layer, 'loop_enddeg', '20') . '"';
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '2') . '"';
                     $loop_data .= ' data-origin="' . RevSliderFunctions::getVal($layer, 'loop_xorigin', '50') . '% ' . RevSliderFunctions::getVal($layer, 'loop_yorigin', '50') . '%"';
                     break;
                 case 'rs-rotate':
                     $loop_data .= ' data-easing="' . RevSliderFunctions::getVal($layer, 'loop_easing', 'Power3.easeInOut') . '"';
                     $loop_data .= ' data-startdeg="' . RevSliderFunctions::getVal($layer, 'loop_startdeg', '-20') . '"';
                     $loop_data .= ' data-enddeg="' . RevSliderFunctions::getVal($layer, 'loop_enddeg', '20') . '"';
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '2') . '"';
                     $loop_data .= ' data-origin="' . RevSliderFunctions::getVal($layer, 'loop_xorigin', '50') . '% ' . RevSliderFunctions::getVal($layer, 'loop_yorigin', '50') . '%"';
                     break;
                 case 'rs-slideloop':
                     $loop_data .= ' data-easing="' . RevSliderFunctions::getVal($layer, 'loop_easing', 'Power3.easeInOut') . '"';
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '1') . '"';
                     $loop_data .= ' data-xs="' . RevSliderFunctions::getVal($layer, 'loop_xstart', '0') . '"';
                     $loop_data .= ' data-xe="' . RevSliderFunctions::getVal($layer, 'loop_xend', '0') . '"';
                     $loop_data .= ' data-ys="' . RevSliderFunctions::getVal($layer, 'loop_ystart', '0') . '"';
                     $loop_data .= ' data-ye="' . RevSliderFunctions::getVal($layer, 'loop_yend', '0') . '"';
                     break;
                 case 'rs-pulse':
                     $loop_data .= ' data-easing="' . RevSliderFunctions::getVal($layer, 'loop_easing', 'Power3.easeInOut') . '"';
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '1') . '"';
                     $loop_data .= ' data-zoomstart="' . RevSliderFunctions::getVal($layer, 'loop_zoomstart', '1') . '"';
                     $loop_data .= ' data-zoomend="' . RevSliderFunctions::getVal($layer, 'loop_zoomend', '1') . '"';
                     break;
                 case 'rs-wave':
                     $loop_data .= ' data-speed="' . RevSliderFunctions::getVal($layer, 'loop_speed', '1') . '"';
                     $loop_data .= ' data-angle="' . RevSliderFunctions::getVal($layer, 'loop_angle', '0') . '"';
                     $loop_data .= ' data-radius="' . RevSliderFunctions::getVal($layer, 'loop_radius', '10') . '"';
                     $loop_data .= ' data-origin="' . RevSliderFunctions::getVal($layer, 'loop_xorigin', '50') . '% ' . RevSliderFunctions::getVal($layer, 'loop_yorigin', '50') . '%"';
                     break;
             }
         }
         if (!empty($svg_val) && sizeof($svg_val) > 0) {
             $outputClass .= ' tp-svg-layer';
         }
         $layer_id = $zIndex - 4;
         $use_tag = RevSliderFunctions::getVal($layer, 'html_tag', 'div');
         if ($html_simple_link !== '') {
             $use_tag = 'a';
         }
         echo "\n\t\t<!-- LAYER NR. ";
         echo $layer_id;
         echo " -->\n";
         echo '		<' . $use_tag . ' class="' . $outputClass;
         echo $classes != '' ? ' ' . $classes : '';
         echo $parallax_class;
         if ($static_slide) {
             echo ' tp-static-layer';
         }
         echo $videoclass;
         echo "\" \n";
         echo $html_simple_link;
         echo $ids != '' ? '			' . $ids . " \n" : '';
         echo $title != '' ? '			' . $title . " \n" : '';
         echo $rel != '' ? '			' . $rel . " \n" : '';
         if ($htmlPosX != '') {
             echo '			' . $htmlPosX . " \n";
         }
         if ($htmlPosY != '') {
             echo '			' . $htmlPosY . " \n";
         }
         if ($static_data != '') {
             echo '			' . $static_data . " \n";
         }
         if ($customin != '') {
             echo '			' . $customin . " \n";
         }
         if ($customout != '') {
             echo '			' . $customout . " \n";
         }
         if ($maskin != '') {
             echo '			' . $maskin . " \n";
         }
         if ($maskout != '') {
             echo '			' . $maskout . " \n";
         }
         echo '			data-start="' . $time . '"' . " \n";
         //if($type == 'no_edit'){}
         if ($type == 'text' || $type == 'button') {
             //only output if we are a text layer
             echo '			data-splitin="' . $splitin . '"' . " \n";
             echo '			data-splitout="' . $splitout . '"' . " \n";
         }
         do_action('revslider_add_layer_attributes', $layer, $slide, $this->slider);
         echo $a_html;
         // SVG OUTPUT
         if (!empty($svg_val) && sizeof($svg_val) > 0) {
             echo '			data-svg_src="' . $svg_val->{'src'} . '"' . " \n";
             echo '			data-svg_idle="sc:' . $svg_val->{'svgstroke-color'} . ';sw:' . $svg_val->{'svgstroke-width'} . ';sda:' . $svg_val->{'svgstroke-dasharray'} . ';sdo:' . $svg_val->{'svgstroke-dashoffset'} . ';"' . " \n";
             if ($is_hover_active) {
                 echo '			data-svg_hover="sc:' . $svg_val->{'svgstroke-hover-color'} . ';sw:' . $svg_val->{'svgstroke-hover-width'} . ';sda:' . $svg_val->{'svgstroke-hover-dasharray'} . ';sdo:' . $svg_val->{'svgstroke-hover-dashoffset'} . ';"' . " \n";
             }
         }
         if ($basealign !== 'grid') {
             echo '			data-basealign="' . $basealign . '"' . " \n";
         }
         $ro = RevSliderFunctions::getVal($layer, 'responsive_offset', true);
         if ($ro != 1) {
             echo '			data-responsive_offset="off"' . " \n";
         } else {
             echo '			data-responsive_offset="on"' . " \n";
         }
         echo $extra_data . "\n";
         //check if static layer and if yes, set values for it.
         if ($static_slide) {
             if ($isTemplate != "true" && $slider_type !== 'hero') {
                 $start_on_slide = intval(RevSliderFunctions::getVal($layer, "static_start", 1)) - 1;
                 $end_on_slide = RevSliderFunctions::getVal($layer, "static_end", 2);
                 if ($end_on_slide !== 'last') {
                     $end_on_slide = intval($end_on_slide) - 1;
                 } else {
                     //change number to the last slide number
                     $end_on_slide = count($this->slider->getArrSlideNames()) - 1;
                 }
             } else {
                 $start_on_slide = '-1';
                 $end_on_slide = '-1';
             }
             echo '			data-startslide="' . $start_on_slide . '"' . " \n";
             echo '			data-endslide="' . $end_on_slide . '"' . " \n";
         }
         if ($splitin !== 'none') {
             echo '			data-elementdelay="' . $elementdelay . '"' . " \n";
         }
         if ($splitout !== 'none') {
             echo '			data-endelementdelay="' . $endelementdelay . '"' . " \n";
         }
         if ($htmlParams != "") {
             echo "\t\t\t" . $htmlParams;
         }
         echo '			style="z-index: ' . $zIndex . ';' . $inline_styles . $idle_style . '"';
         //
         echo '>';
         if ($do_loop !== 'none') {
             echo "\n" . '<div class="rs-looped ' . trim($loop_class) . '" ' . $loop_data . '>';
         }
         if ($toggle_allow != false) {
             echo '<div class="rs-untoggled-content">';
         }
         echo apply_filters('revslider_layer_content', stripslashes($html), $html, $this->slider->getID(), $slide, $layer) . " ";
         if ($toggle_allow != false) {
             echo '</div>';
             echo '<div class="rs-toggled-content">' . stripslashes($html_toggle) . '</div>';
         }
         if ($htmlCorners != "") {
             echo $htmlCorners . " ";
         }
         if ($do_loop !== 'none') {
             echo "</div>";
         }
         echo '</' . $use_tag . '>' . "\n";
         $zIndex++;
     }
 }