/** * * put creative layer */ private function putCreativeLayer(RevSlide $slide, $static_slide = false) { $layers = $slide->getLayers(); $customAnimations = RevOperations::getCustomAnimations('customin'); //get all custom animations $customEndAnimations = RevOperations::getCustomAnimations('customout'); //get all custom animations $startAnimations = RevOperations::getArrAnimations(false); //only get the standard animations $endAnimations = RevOperations::getArrEndAnimations(false); //only get the standard animations $lazyLoad = $this->slider->getParam("lazy_load", "off"); $isTemplate = $this->slider->getParam("template", "false"); if (empty($layers)) { return false; } $zIndex = 5; foreach ($layers as $layer) { $type = UniteFunctionsRev::getVal($layer, "type", "text"); //set if video full screen $videoclass = ''; $isFullWidthVideo = false; if ($type == "video") { $videoclass = ' tp-videolayer'; $videoData = UniteFunctionsRev::getVal($layer, "video_data"); if (!empty($videoData)) { $videoData = (array) $videoData; $isFullWidthVideo = UniteFunctionsRev::getVal($videoData, "fullwidth"); $isFullWidthVideo = UniteFunctionsRev::strToBool($isFullWidthVideo); } else { $videoData = array(); } } $class = UniteFunctionsRev::getVal($layer, "style"); if (trim($class) !== '') { $this->class_include['.' . trim($class)] = true; } //add classname for style inclusion $animation = UniteFunctionsRev::getVal($layer, "animation", "tp-fade"); if ($animation == "fade") { $animation = "tp-fade"; } $customin = ''; if (!array_key_exists($animation, $startAnimations) && array_key_exists($animation, $customAnimations)) { //if true, add custom animation $customin .= 'data-customin="'; $animArr = RevOperations::getCustomAnimationByHandle($customAnimations[$animation]); if ($animArr !== false) { $customin .= RevOperations::parseCustomAnimationByArray($animArr); } $customin .= '"'; $animation = 'customin'; } if (strpos($animation, 'customin-') !== false || strpos($animation, 'customout-') !== false) { $animation = "tp-fade"; } //set output class: $layer_2d_rotation = intval(UniteFunctionsRev::getVal($layer, "2d_rotation", '0')); $layer_2d_origin_x = intval(UniteFunctionsRev::getVal($layer, "2d_origin_x", '50')); $layer_2d_origin_y = intval(UniteFunctionsRev::getVal($layer, "2d_origin_y", '50')); if ($layer_2d_rotation == 0) { $outputClass = "tp-caption " . trim($class); } else { $outputClass = "tp-caption "; } $outputClass = trim($outputClass) . " "; $outputClass .= trim($animation); $left = UniteFunctionsRev::getVal($layer, "left", 0); $top = UniteFunctionsRev::getVal($layer, "top", 0); $speed = UniteFunctionsRev::getVal($layer, "speed", 300); $time = UniteFunctionsRev::getVal($layer, "time", 0); $easing = UniteFunctionsRev::getVal($layer, "easing", "easeOutExpo"); $randomRotate = UniteFunctionsRev::getVal($layer, "random_rotation", "false"); $randomRotate = UniteFunctionsRev::boolToStr($randomRotate); $splitin = UniteFunctionsRev::getVal($layer, "split", "none"); $splitout = UniteFunctionsRev::getVal($layer, "endsplit", "none"); $elementdelay = intval(UniteFunctionsRev::getVal($layer, "splitdelay", 0)); $endelementdelay = intval(UniteFunctionsRev::getVal($layer, "endsplitdelay", 0)); if ($elementdelay > 0) { $elementdelay /= 100; } if ($endelementdelay > 0) { $endelementdelay /= 100; } $text = UniteFunctionsRev::getVal($layer, "text"); if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) { //use qTranslate $text = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text); } $htmlVideoAutoplay = ""; $htmlVideoAutoplayOnlyFirstTime = ""; $htmlVideoNextSlide = ""; $htmlVideoThumbnail = ""; $htmlMute = ''; $htmlCover = ''; $htmlDotted = ''; $htmlRatio = ''; $htmlRewind = ''; $htmlDisableOnMobile = ''; $ids = UniteFunctionsRev::getVal($layer, "attrID"); $classes = UniteFunctionsRev::getVal($layer, "attrClasses"); $title = UniteFunctionsRev::getVal($layer, "attrTitle"); $rel = UniteFunctionsRev::getVal($layer, "attrRel"); $ids = $ids != '' ? ' id="' . $ids . '"' : ''; $classes = $classes != '' ? ' ' . $classes : ''; $title = $title != '' ? ' title="' . $title . '"' : ''; $rel = $rel != '' ? ' rel="' . $rel . '"' : ''; $max_width = UniteFunctionsRev::getVal($layer, "max_width", 'auto'); $max_height = UniteFunctionsRev::getVal($layer, "max_height", 'auto'); $white_space = UniteFunctionsRev::getVal($layer, "whitespace", 'nowrap'); $inline_styles = ''; $layer_rotation = ''; $do_rotation = false; $add_data = ''; $videoType = ''; $cover = false; //set html: $html = ""; switch ($type) { default: case "text": $html = $text; $inline_styles .= ' max-width: ' . $max_width . '; max-height: ' . $max_height . '; white-space: ' . $white_space . ';'; if ($layer_2d_rotation !== 0) { $do_rotation = true; } break; case "image": $alt = UniteFunctionsRev::getVal($layer, "alt"); if (isset($slide->ignore_alt)) { $alt = ''; } $urlImage = UniteFunctionsRev::getVal($layer, "image_url"); $additional = ""; $scaleX = UniteFunctionsRev::getVal($layer, "scaleX"); $scaleY = UniteFunctionsRev::getVal($layer, "scaleY"); if ($scaleX != '') { $additional .= ' data-ww="' . $scaleX . '"'; } if ($scaleY != '') { $additional .= ' data-hh="' . $scaleY . '"'; } if (is_ssl()) { $urlImage = str_replace("http://", "https://", $urlImage); } $imageAddParams = ""; if ($lazyLoad == "on") { $imageAddParams .= " data-lazyload=\"{$urlImage}\""; $urlImage = GlobalsRevSlider::$url_media . "assets/images/dummy.png"; } $urlImage = UniteFunctionJoomlaRev::urlToFull($urlImage); $html = '<img src="' . $urlImage . '" alt="' . $alt . '"' . $additional . $imageAddParams . '>'; $imageLink = UniteFunctionsRev::getVal($layer, "link", ""); if (!empty($imageLink)) { $openIn = UniteFunctionsRev::getVal($layer, "link_open_in", "same"); $target = ""; if ($openIn == "new") { $target = ' target="_blank"'; } $linkID = UniteFunctionsRev::getVal($layer, "link_id", ""); $linkClass = UniteFunctionsRev::getVal($layer, "link_class", ""); $linkTitle = UniteFunctionsRev::getVal($layer, "link_title", ""); $linkRel = UniteFunctionsRev::getVal($layer, "link_rel", ""); $linkIDHtml = ""; $linkClassHtml = ""; $linkTitleHtml = ""; $linkRelHtml = ""; if (!empty($linkID)) { $linkIDHtml = ' id="' . $linkID . '"'; } if (!empty($linkClass)) { $linkClassHtml = ' class="' . $linkClass . '"'; } if (!empty($linkTitle)) { $linkTitleHtml = ' title="' . $linkTitle . '"'; } if (!empty($linkRel)) { $linkRelHtml = ' rel="' . $linkRel . '"'; } $html = '<a href="' . $imageLink . '"' . $target . $linkIDHtml . $linkClassHtml . $linkTitleHtml . $linkRelHtml . '>' . $html . '</a>'; } if ($layer_2d_rotation !== 0) { $do_rotation = true; } break; case "video": $videoType = trim(UniteFunctionsRev::getVal($layer, "video_type")); $videoID = trim(UniteFunctionsRev::getVal($layer, "video_id")); $videoWidth = trim(UniteFunctionsRev::getVal($layer, "video_width")); $videoHeight = trim(UniteFunctionsRev::getVal($layer, "video_height")); $videoArgs = trim(UniteFunctionsRev::getVal($layer, "video_args")); $v_controls = UniteFunctionsRev::getVal($videoData, "controls"); $v_controls = UniteFunctionsRev::strToBool($v_controls); $rewind = UniteFunctionsRev::getVal($videoData, "forcerewind"); $rewind = UniteFunctionsRev::strToBool($rewind); $htmlRewind = $rewind == true ? ' data-forcerewind="on"' : ''; $only_poster_on_mobile = UniteFunctionsRev::getVal($layer, "use_poster_on_mobile"); $only_poster_on_mobile = UniteFunctionsRev::strToBool($only_poster_on_mobile); if ($isFullWidthVideo == true) { // || $cover == true $videoWidth = "100%"; $videoHeight = "100%"; } $setBase = is_ssl() ? "https://" : "http://"; $cover = UniteFunctionsRev::getVal($videoData, "cover"); $cover = UniteFunctionsRev::strToBool($cover); switch ($videoType) { case "youtube": if (empty($videoArgs)) { $videoArgs = GlobalsRevSlider::DEFAULT_YOUTUBE_ARGUMENTS; } //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 = UniteFunctionsRev::getVal($videoData, "videospeed", '1'); //$ytBase = 'https://'; //if($v_controls) $videoArgs.='controls=0;'; $videoArgs .= ';origin=' . $setBase . $_SERVER['SERVER_NAME'] . ';'; $add_data = ' data-ytid="' . $videoID . '" data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '" data-videoattributes="version=3&enablejsapi=1&html5=1&' . $videoArgs . '" data-videorate="' . $videospeed . '"'; $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"'; //$html = "<iframe src='".$ytBase."www.youtube.com/embed/".$videoID."?enablejsapi=1&html5=1&".$videoArgs."' allowfullscreen='true' width='".$videoWidth."' height='".$videoHeight."' style='width:".$videoWidth."px;height:".$videoHeight."px;'></iframe>"; break; case "vimeo": if (empty($videoArgs)) { $videoArgs = GlobalsRevSlider::DEFAULT_VIMEO_ARGUMENTS; } //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); } $add_data = ' data-vimeoid="' . $videoID . '" data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '" data-videoattributes="' . $videoArgs . '"'; //no controls for vimeo $add_data .= ($v_controls) ? ' data-videocontrols="none"' : ' data-videocontrols="controls"'; //$html = "<iframe src='".$setBase."player.vimeo.com/video/".$videoID."?".$videoArgs."' width='".$videoWidth."' height='".$videoHeight."' style='width:".$videoWidth."px;height:".$videoHeight."px;'></iframe>"; break; case "html5": $urlPoster = UniteFunctionsRev::getVal($videoData, "urlPoster"); $urlMp4 = UniteFunctionsRev::getVal($videoData, "urlMp4"); $urlWebm = UniteFunctionsRev::getVal($videoData, "urlWebm"); $urlOgv = UniteFunctionsRev::getVal($videoData, "urlOgv"); $videopreload = UniteFunctionsRev::getVal($videoData, "preload"); $videoloop = UniteFunctionsRev::getVal($videoData, "videoloop"); $add_data = ' data-videowidth="' . $videoWidth . '" data-videoheight="' . $videoHeight . '"'; $add_data .= $v_controls ? ' data-videocontrols="none"' : ' data-videocontrols="controls"'; 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"'; } else { $add_data .= ' data-posterOnMObile="off"'; } } if (!empty($videopreload)) { $add_data .= ' data-videopreload="' . $videopreload . '"'; } if (UniteFunctionsRev::strToBool($videoloop) == true) { //fallback $add_data .= ' data-videoloop="loop"'; } else { $add_data .= ' data-videoloop="' . $videoloop . '"'; } break; default: UniteFunctionsRev::throwError("wrong video type: {$videoType}"); break; } if ($cover == true) { $dotted = UniteFunctionsRev::getVal($videoData, "dotted"); if ($dotted !== 'none') { $add_data .= ' data-dottedoverlay="' . $dotted . '"'; } $add_data .= ' data-forceCover="1"'; $ratio = UniteFunctionsRev::getVal($videoData, "ratio"); if (!empty($ratio)) { $add_data .= ' data-aspectratio="' . $ratio . '"'; } } //set video autoplay, with backward compatability if (array_key_exists("autoplay", $videoData)) { $videoAutoplay = UniteFunctionsRev::getVal($videoData, "autoplay"); } else { //backword compatability $videoAutoplay = UniteFunctionsRev::getVal($layer, "video_autoplay"); } //set video autoplayonlyfirsttime, with backward compatability if (array_key_exists("autoplayonlyfirsttime", $videoData)) { $videoAutoplayOnlyFirstTime = UniteFunctionsRev::getVal($videoData, "autoplayonlyfirsttime"); } else { $videoAutoplayOnlyFirstTime = ""; } $videoAutoplay = UniteFunctionsRev::strToBool($videoAutoplay); $videoAutoplayOnlyFirstTime = UniteFunctionsRev::strToBool($videoAutoplayOnlyFirstTime); $mute = UniteFunctionsRev::getVal($videoData, "mute"); $mute = UniteFunctionsRev::strToBool($mute); $htmlMute = $mute ? ' data-volume="mute"' : ''; if ($videoAutoplay == true) { $htmlVideoAutoplay = ' data-autoplay="true"' . "\n"; } else { $htmlVideoAutoplay = ' data-autoplay="false"' . "\n"; } if ($videoAutoplayOnlyFirstTime == true && $videoAutoplay == true) { $htmlVideoAutoplayOnlyFirstTime = ' data-autoplayonlyfirsttime="true"' . "\n"; } else { $htmlVideoAutoplayOnlyFirstTime = ' data-autoplayonlyfirsttime="false"' . "\n"; } $videoNextSlide = UniteFunctionsRev::getVal($videoData, "nextslide"); $videoNextSlide = UniteFunctionsRev::strToBool($videoNextSlide); if ($videoNextSlide == true) { $htmlVideoNextSlide = ' data-nextslideatend="true"' . "\n"; } $videoThumbnail = @$videoData["previewimage"]; if (trim($videoThumbnail) !== '') { $htmlVideoThumbnail = ' data-videoposter="' . $videoThumbnail . '"' . "\n"; } if (!empty($videoThumbnail)) { if ($only_poster_on_mobile === true) { $htmlVideoThumbnail .= ' data-posterOnMObile="on"' . " \n"; } else { $htmlVideoThumbnail .= ' data-posterOnMObile="off"' . " \n"; } } $disable_on_mobile = UniteFunctionsRev::getVal($videoData, "disable_on_mobile"); $disable_on_mobile = UniteFunctionsRev::strToBool($disable_on_mobile); $htmlDisableOnMobile = $disable_on_mobile ? ' data-disablevideoonmobile="1"' . "\n" : ''; break; } if ($do_rotation) { $layer_rotation = ' -moz-transform: rotate(' . $layer_2d_rotation . 'deg); -ms-transform: rotate(' . $layer_2d_rotation . 'deg); -o-transform: rotate(' . $layer_2d_rotation . 'deg); -webkit-transform: rotate(' . $layer_2d_rotation . 'deg); transform: rotate(' . $layer_2d_rotation . 'deg);'; $layer_rotation .= ' -moz-transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%; -ms-transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%; -o-transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%; -webkit-transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%; transform-origin: ' . $layer_2d_origin_x . '% ' . $layer_2d_origin_y . '%;'; } //handle end transitions: $endTime = trim(UniteFunctionsRev::getVal($layer, "endtime")); $realEndTime = trim(UniteFunctionsRev::getVal($layer, "realEndTime")); $endWithSlide = UniteFunctionsRev::getVal($layer, "endWithSlide", false); $endSpeed = trim(UniteFunctionsRev::getVal($layer, "endspeed")); $calcSpeed = !empty($endSpeed) ? $endSpeed : $speed; if (!empty($calcSpeed) && $realEndTime - $calcSpeed !== $endTime) { $endTime = $realEndTime - $calcSpeed; } $htmlEnd = ""; $customout = ''; if (!empty($endTime) && $endWithSlide !== true) { $htmlEnd = " data-end=\"{$endTime}\"" . "\n"; } if (!empty($endSpeed)) { $htmlEnd .= " data-endspeed=\"{$endSpeed}\"" . "\n"; } $endEasing = trim(UniteFunctionsRev::getVal($layer, "endeasing")); if (!empty($endSpeed) && $endEasing != "nothing") { $htmlEnd .= "\t\t\tdata-endeasing=\"{$endEasing}\"" . "\n"; } //add animation to class $endAnimation = trim(UniteFunctionsRev::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 $customout = 'data-customout="'; $animArr = RevOperations::getCustomAnimationByHandle($customEndAnimations[$endAnimation]); if ($animArr !== false) { $customout .= RevOperations::parseCustomAnimationByArray($animArr); } $customout .= '"'; $endAnimation = 'customout'; } if (strpos($endAnimation, 'customin-') !== false || strpos($endAnimation, 'customout-') !== false) { $endAnimation = ""; } if (!empty($endAnimation) && $endAnimation != "auto") { $outputClass .= " " . $endAnimation; } //slide link $htmlLink = ""; $slideLink = UniteFunctionsRev::getVal($layer, "link_slide"); if (!empty($slideLink) && $slideLink != "nothing" && $slideLink != "scroll_under") { //get slide index from id if (is_numeric($slideLink)) { $slideLink = UniteFunctionsRev::getVal($this->slidesNumIndex, $slideLink); } if (!empty($slideLink)) { $htmlLink = "data-linktoslide=\"{$slideLink}\"" . "\n"; } } //scroll under the slider if ($slideLink == "scroll_under") { $outputClass .= " tp-scrollbelowslider"; $scrollUnderOffset = intval(UniteFunctionsRev::getVal($layer, "scrollunder_offset")); $htmlLink .= " data-scrolloffset=\"" . $scrollUnderOffset . "\"" . "\n"; } //hidden under resolution $htmlHidden = ""; $layerHidden = UniteFunctionsRev::getVal($layer, "hiddenunder"); if ($layerHidden == "true" || $layerHidden == "1") { $htmlHidden = ' data-captionhidden="on"' . "\n"; } $htmlParams = $add_data . $htmlEnd . $htmlLink . $htmlVideoAutoplay . $htmlVideoAutoplayOnlyFirstTime . $htmlVideoNextSlide . $htmlVideoThumbnail . $htmlHidden . $htmlMute . $htmlDisableOnMobile . $htmlCover . $htmlDotted . $htmlRatio . $htmlRewind . "\n"; //set positioning options $alignHor = UniteFunctionsRev::getVal($layer, "align_hor", "left"); $alignVert = UniteFunctionsRev::getVal($layer, "align_vert", "top"); $htmlPosX = ""; $htmlPosY = ""; 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; } //set corners $htmlCorners = ""; if ($type == "text") { $cornerLeft = UniteFunctionsRev::getVal($layer, "corner_left"); $cornerRight = UniteFunctionsRev::getVal($layer, "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 $resizeme = UniteFunctionsRev::getVal($layer, "resizeme"); if ($resizeme == "true" || $resizeme == "1") { $outputClass .= ' tp-resizeme'; } } //end text related layer //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", "off"); $parallax_class = ''; if ($use_parallax == 'on') { $slide_level = intval(UniteFunctionsRev::getVal($layer, "parallax_level", '-')); if ($slide_level !== '-') { $parallax_class = ' rs-parallaxlevel-' . $slide_level; } } //check for loop animation here $do_loop = UniteFunctionsRev::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="' . UniteFunctionsRev::getVal($layer, "loop_easing", "Power3.easeInOut") . '"'; $loop_data .= ' data-startdeg="' . UniteFunctionsRev::getVal($layer, "loop_startdeg", "-20") . '"'; $loop_data .= ' data-enddeg="' . UniteFunctionsRev::getVal($layer, "loop_enddeg", "20") . '"'; $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "2") . '"'; $loop_data .= ' data-origin="' . UniteFunctionsRev::getVal($layer, "loop_xorigin", "50") . '% ' . UniteFunctionsRev::getVal($layer, "loop_yorigin", "50") . '%"'; break; case 'rs-rotate': $loop_data .= ' data-easing="' . UniteFunctionsRev::getVal($layer, "loop_easing", "Power3.easeInOut") . '"'; $loop_data .= ' data-startdeg="' . UniteFunctionsRev::getVal($layer, "loop_startdeg", "-20") . '"'; $loop_data .= ' data-enddeg="' . UniteFunctionsRev::getVal($layer, "loop_enddeg", "20") . '"'; $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "2") . '"'; $loop_data .= ' data-origin="' . UniteFunctionsRev::getVal($layer, "loop_xorigin", "50") . '% ' . UniteFunctionsRev::getVal($layer, "loop_yorigin", "50") . '%"'; break; case 'rs-slideloop': $loop_data .= ' data-easing="' . UniteFunctionsRev::getVal($layer, "loop_easing", "Power3.easeInOut") . '"'; $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "1") . '"'; $loop_data .= ' data-xs="' . UniteFunctionsRev::getVal($layer, "loop_xstart", "0") . '"'; $loop_data .= ' data-xe="' . UniteFunctionsRev::getVal($layer, "loop_xend", "0") . '"'; $loop_data .= ' data-ys="' . UniteFunctionsRev::getVal($layer, "loop_ystart", "0") . '"'; $loop_data .= ' data-ye="' . UniteFunctionsRev::getVal($layer, "loop_yend", "0") . '"'; break; case 'rs-pulse': $loop_data .= ' data-easing="' . UniteFunctionsRev::getVal($layer, "loop_easing", "Power3.easeInOut") . '"'; $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "1") . '"'; $loop_data .= ' data-zoomstart="' . UniteFunctionsRev::getVal($layer, "loop_zoomstart", "1") . '"'; $loop_data .= ' data-zoomend="' . UniteFunctionsRev::getVal($layer, "loop_zoomend", "1") . '"'; break; case 'rs-wave': $loop_data .= ' data-speed="' . UniteFunctionsRev::getVal($layer, "loop_speed", "1") . '"'; $loop_data .= ' data-angle="' . UniteFunctionsRev::getVal($layer, "loop_angle", "0") . '"'; $loop_data .= ' data-radius="' . UniteFunctionsRev::getVal($layer, "loop_radius", "10") . '"'; $loop_data .= ' data-origin="' . UniteFunctionsRev::getVal($layer, "loop_xorigin", "50") . '% ' . UniteFunctionsRev::getVal($layer, "loop_yorigin", "50") . '%"'; break; } } echo "\n\t\t<!-- LAYER NR. "; echo $zIndex - 4; echo " -->\n"; echo "\t\t<div class=\"" . $outputClass; echo $classes != '' ? ' ' . $classes : ''; echo $parallax_class; if ($static_slide) { echo ' tp-static-layer'; } echo $videoclass; echo "\"\n"; echo $ids != '' ? ' ' . $ids . "\n" : ''; echo $title != '' ? ' ' . $title . "\n" : ''; echo $rel != '' ? ' ' . $rel . "\n" : ''; if ($htmlPosX != "") { echo "\t\t\t" . $htmlPosX . "\n"; } if ($htmlPosY != "") { echo "\t\t\t" . $htmlPosY . "\n"; } if ($customin != "") { echo "\t\t\t" . $customin . "\n"; } if ($customout != "") { echo "\t\t\t" . $customout . "\n"; } echo "\t\t\tdata-speed=\"" . $speed . "\"\n"; echo "\t\t\tdata-start=\"" . $time . "\"\n"; echo "\t\t\tdata-easing=\"" . $easing . "\"\n"; if ($type == "text") { //only output if we are a text layer echo "\t\t\tdata-splitin=\"" . $splitin . "\"\n"; echo "\t\t\tdata-splitout=\"" . $splitout . "\"\n"; } //check if static layer and if yes, set values for it. if ($static_slide) { if ($isTemplate != "true") { $start_on_slide = intval(UniteFunctionsRev::getVal($layer, "static_start", 1)) - 1; $end_on_slide = intval(UniteFunctionsRev::getVal($layer, "static_end", 2)) - 1; } else { $start_on_slide = '-1'; $end_on_slide = '-1'; } echo ' data-startslide="' . $start_on_slide . '"' . "\n"; echo ' data-endslide="' . $end_on_slide . '"' . "\n"; } echo "\t\t\tdata-elementdelay=\"" . $elementdelay . "\"\n"; echo "\t\t\tdata-endelementdelay=\"" . $endelementdelay . "\"\n"; if ($htmlParams != "") { echo "\t\t\t" . $htmlParams; } echo "\t\t\tstyle=\"z-index: " . $zIndex . ";" . $inline_styles . "\""; echo ">"; if ($do_loop !== 'none') { echo "\n" . ' <div style="' . $layer_rotation . '" class="tp-layer-inner-rotation '; $rotationClass = trim($class); $rotationClass = trim($rotationClass) . " "; echo $rotationClass; echo $loop_class; echo '" '; echo $loop_data; echo '>'; } elseif ($layer_rotation != '') { $rotationClass = trim($class); $rotationClass = trim($rotationClass) . " "; echo '<div class="tp-layer-inner-rotation ' . $rotationClass . '" style="' . $layer_rotation . '">' . "\n"; } echo stripslashes($html) . "\n"; if ($htmlCorners != "") { echo $htmlCorners . "\n"; } if ($do_loop !== 'none' || $layer_rotation != '') { echo "\t\t\t\t</div>\n"; } echo "\t\t</div>\n"; $zIndex++; } }
/** * normalize layers when geting them, convert image url to relative */ private function normalizeGetLayers($arrLayers) { foreach ($arrLayers as $key => $layer) { $layer = (array) $layer; //modify image $urlImage = UniteFunctionsRev::getVal($layer, "image_url"); if (!empty($urlImage)) { $urlImage = UniteFunctionJoomlaRev::urlToFull($urlImage); $arrLayers[$key]["image_url"] = $urlImage; } } return $arrLayers; }