/**
     * 
     * draw imaeg input:
     * @param $setting
     */
    protected function drawImageInput($setting)
    {
        $class = UniteFunctionsRev::getVal($setting, "class");
        if (!empty($class)) {
            $class = "class='{$class}'";
        }
        $settingsID = $setting["id"];
        $buttonID = $settingsID . "_button";
        $spanPreviewID = $buttonID . "_preview";
        $img = "";
        $value = UniteFunctionsRev::getVal($setting, "value");
        if (!empty($value)) {
            $urlImage = $value;
            $imagePath = UniteFunctionsWPRev::getImageRealPathFromUrl($urlImage);
            if (file_exists($realPath)) {
                $filepath = UniteFunctionsWPRev::getImagePathFromURL($urlImage);
                $urlImage = UniteBaseClassRev::getImageUrl($filepath, 100, 70, true);
            }
            $img = "<img width='100' height='70' src='{$urlImage}'></img>";
        }
        ?>

				<span id='<?php 
        echo $spanPreviewID;
        ?>
' class='setting-image-preview'><?php 
        echo $img;
        ?>
</span>
				
				<input type="hidden" id="<?php 
        echo $setting["id"];
        ?>
" name="<?php 
        echo $setting["name"];
        ?>
" value="<?php 
        echo $setting["value"];
        ?>
" />
				
				<input type="button" id="<?php 
        echo $buttonID;
        ?>
" class='button-image-select <?php 
        echo $class;
        ?>
' value="Choose Image"></input>
			<?php 
    }
 /**
  * 
  * get thumb url
  */
 public function getUrlImageThumb()
 {
     //get image url by thumb
     if (!empty($this->imageID)) {
         $urlImage = UniteFunctionsWPRev::getUrlAttachmentImage($this->imageID, UniteFunctionsWPRev::THUMB_MEDIUM);
     } else {
         //get from cache
         if (!empty($this->imageFilepath)) {
             $urlImage = UniteBaseClassRev::getImageUrl($this->imageFilepath, 200, 100, true);
         } else {
             $urlImage = $this->imageUrl;
         }
     }
     if (empty($urlImage)) {
         $urlImage = $this->imageUrl;
     }
     return $urlImage;
 }
    /**
     * 
     * put the slider slides
     */
    private function putSlides()
    {
        $sliderType = $this->slider->getParam("slider_type");
        $publishedOnly = true;
        if ($this->previewMode == true && $this->oneSlideMode == true) {
            $previewSlideID = UniteFunctionsRev::getVal($this->oneSlideData, "slideid");
            $previewSlide = new RevSlide();
            $previewSlide->initByID($previewSlideID);
            $slides = array($previewSlide);
        } else {
            $slides = $this->slider->getSlidesForOutput($publishedOnly, $this->sliderLang);
        }
        $this->slidesNumIndex = $this->slider->getSlidesNumbersByIDs(true);
        if (empty($slides)) {
            ?>
				<div class="no-slides-text">
					No slides found, please add some slides
				</div>
				<?php 
        }
        $thumbWidth = $this->slider->getParam("thumb_width", 100);
        $thumbHeight = $this->slider->getParam("thumb_height", 50);
        $slideWidth = $this->slider->getParam("width", 900);
        $slideHeight = $this->slider->getParam("height", 300);
        $navigationType = $this->slider->getParam("navigaion_type", "none");
        $isThumbsActive = $navigationType == "thumb" ? true : false;
        //for one slide preview
        if ($this->oneSlideMode == true) {
            $slides = $this->filterOneSlide($slides);
        }
        ?>
				<ul>
			<?php 
        foreach ($slides as $index => $slide) {
            $params = $slide->getParams();
            //check if date is set
            $date_from = $slide->getParam("date_from", "");
            $date_to = $slide->getParam("date_to", "");
            if ($date_from != "") {
                $date_from = strtotime($date_from);
                if (time() < $date_from) {
                    continue;
                }
            }
            if ($date_to != "") {
                $date_to = strtotime($date_to);
                if (time() > $date_to) {
                    continue;
                }
            }
            $transition = $slide->getParam("slide_transition", "random");
            $slotAmount = $slide->getParam("slot_amount", "7");
            $urlSlideImage = $slide->getImageUrl();
            //get image alt
            $imageFilename = $slide->getImageFilename();
            $info = pathinfo($imageFilename);
            $alt = $info["filename"];
            //get thumb url
            $htmlThumb = "";
            if ($isThumbsActive == true) {
                $urlThumb = $slide->getParam("slide_thumb", "");
                if (empty($urlThumb)) {
                    //try to get resized thumb
                    $pathThumb = $slide->getImageFilepath();
                    if (!empty($pathThumb)) {
                        $urlThumb = UniteBaseClassRev::getImageUrl($pathThumb, $thumbWidth, $thumbHeight, true);
                    }
                }
                //if not - put regular image:
                if (empty($urlThumb)) {
                    $urlThumb = $slide->getImageUrl();
                }
                $htmlThumb = 'data-thumb="' . $urlThumb . '" ';
            }
            //get link
            $htmlLink = "";
            $enableLink = $slide->getParam("enable_link", "false");
            if ($enableLink == "true") {
                $linkType = $slide->getParam("link_type", "regular");
                switch ($linkType) {
                    //---- normal link
                    default:
                    case "regular":
                        $link = $slide->getParam("link", "");
                        $linkOpenIn = $slide->getParam("link_open_in", "same");
                        $htmlTarget = "";
                        if ($linkOpenIn == "new") {
                            $htmlTarget = ' data-target="_blank"';
                        }
                        $htmlLink = "data-link=\"{$link}\" {$htmlTarget} ";
                        break;
                        //---- link to slide
                    //---- link to slide
                    case "slide":
                        $slideLink = UniteFunctionsRev::getVal($params, "slide_link");
                        if (!empty($slideLink) && $slideLink != "nothing") {
                            //get slide index from id
                            if (is_numeric($slideLink)) {
                                $slideLink = UniteFunctionsRev::getVal($this->slidesNumIndex, $slideLink);
                            }
                            if (!empty($slideLink)) {
                                $htmlLink = "data-link=\"slide\" data-linktoslide=\"{$slideLink}\" ";
                            }
                        }
                        break;
                }
                //set link position:
                $linkPos = UniteFunctionsRev::getVal($params, "link_pos", "front");
                if ($linkPos == "back") {
                    $htmlLink .= ' data-slideindex="back"';
                }
            }
            //set delay
            $htmlDelay = "";
            $delay = $slide->getParam("delay", "");
            if (!empty($delay) && is_numeric($delay)) {
                $htmlDelay = "data-delay=\"{$delay}\" ";
            }
            //get duration
            $htmlDuration = "";
            $duration = $slide->getParam("transition_duration", "");
            if (!empty($duration) && is_numeric($duration)) {
                $htmlDuration = "data-masterspeed=\"{$duration}\" ";
            }
            //get rotation
            $htmlRotation = "";
            $rotation = $slide->getParam("transition_rotation", "");
            if (!empty($rotation)) {
                $rotation = (int) $rotation;
                if ($rotation != 0) {
                    if ($rotation > 720 && $rotation != 999) {
                        $rotation = 720;
                    }
                    if ($rotation < -720) {
                        $rotation = -720;
                    }
                }
                $htmlRotation = "data-rotate=\"{$rotation}\" ";
            }
            $fullWidthVideoData = $this->getSlideFullWidthVideoData($slide);
            //set full width centering.
            $htmlImageCentering = "";
            $fullWidthCentering = $slide->getParam("fullwidth_centering", "false");
            if ($sliderType == "fullwidth" && $fullWidthCentering == "true") {
                $htmlImageCentering = ' data-fullwidthcentering="on"';
            }
            //set first slide transition
            $htmlFirstTrans = "";
            $startWithSlide = $this->slider->getStartWithSlideSetting();
            if ($index == $startWithSlide) {
                $firstTransActive = $this->slider->getParam("first_transition_active", "false");
                if ($firstTransActive == "true") {
                    $firstTransition = $this->slider->getParam("first_transition_type", "fade");
                    $htmlFirstTrans .= " data-fstransition=\"{$firstTransition}\"";
                    $firstDuration = $this->slider->getParam("first_transition_duration", "300");
                    if (!empty($firstDuration) && is_numeric($firstDuration)) {
                        $htmlFirstTrans .= " data-fsmasterspeed=\"{$firstDuration}\"";
                    }
                    $firstSlotAmount = $this->slider->getParam("first_transition_slot_amount", "7");
                    if (!empty($firstSlotAmount) && is_numeric($firstSlotAmount)) {
                        $htmlFirstTrans .= " data-fsslotamount=\"{$firstSlotAmount}\"";
                    }
                }
            }
            //first trans
            $htmlParams = $htmlDuration . $htmlLink . $htmlThumb . $htmlDelay . $htmlRotation . $htmlFirstTrans;
            $bgType = $slide->getParam("background_type", "image");
            $styleImage = "";
            $urlImageTransparent = UniteBaseClassRev::$url_plugin . "images/transparent.png";
            switch ($bgType) {
                case "trans":
                    $urlSlideImage = $urlImageTransparent;
                    break;
                case "solid":
                    $urlSlideImage = $urlImageTransparent;
                    $slideBGColor = $slide->getParam("slide_bg_color", "#d0d0d0");
                    $styleImage = "style='background-color:{$slideBGColor}'";
                    break;
            }
            //additional params
            $imageAddParams = "";
            $lazyLoad = $this->slider->getParam("lazy_load", "off");
            if ($lazyLoad == "on") {
                $imageAddParams .= "data-lazyload=\"{$urlSlideImage}\"";
                $urlSlideImage = UniteBaseClassRev::$url_plugin . "images/dummy.png";
            }
            $imageAddParams .= $htmlImageCentering;
            //Html
            ?>
					<li data-transition="<?php 
            echo $transition;
            ?>
" data-slotamount="<?php 
            echo $slotAmount;
            ?>
" <?php 
            echo $htmlParams;
            ?>
>
						<img src="<?php 
            echo $urlSlideImage;
            ?>
" <?php 
            echo $styleImage;
            ?>
 alt="<?php 
            echo $alt;
            ?>
" <?php 
            echo $imageAddParams;
            ?>
>
						<?php 
            //put video:
            if ($fullWidthVideoData["found"] == true) {
                //backward compatability
                $this->putFullWidthVideoLayer($fullWidthVideoData);
            }
            $this->putCreativeLayer($slide);
            ?>
					</li>
				<?php 
        }
        //get foreach
        ?>
				</ul>
			<?php 
    }
    /**
     * 
     * put the slider slides
     */
    private function putSlides($doWrapFromTemplate)
    {
        //go to template slider if post template
        if ($doWrapFromTemplate !== false) {
            $this->slider->initByMixed($doWrapFromTemplate);
        }
        //back to original Slider
        $sliderType = $this->slider->getParam("slider_type");
        $publishedOnly = true;
        if ($this->previewMode == true && $this->oneSlideMode == true) {
            $previewSlideID = UniteFunctionsRev::getVal($this->oneSlideData, "slideid");
            $previewSlide = new RevSlide();
            $previewSlide->initByID($previewSlideID);
            $slides = array($previewSlide);
        } else {
            $slides = $this->slider->getSlidesForOutput($publishedOnly, $this->sliderLang);
        }
        $this->slidesNumIndex = $this->slider->getSlidesNumbersByIDs(true);
        if (empty($slides)) {
            ?>
				<div class="no-slides-text">
					No slides found, please add some slides
				</div>
				<?php 
        }
        //go back to normal slider if post template
        if ($doWrapFromTemplate) {
            $this->slider->initByMixed($this->slider->getParam("slider_template_id", false));
        }
        //back to template for JS
        $thumbWidth = $this->slider->getParam("thumb_width", 100);
        $thumbHeight = $this->slider->getParam("thumb_height", 50);
        $slideWidth = $this->slider->getParam("width", 900);
        $slideHeight = $this->slider->getParam("height", 300);
        $navigationType = $this->slider->getParam("navigaion_type", "none");
        $isThumbsActive = $navigationType == "thumb" ? true : false;
        $lazyLoad = $this->slider->getParam("lazy_load", "off");
        //for one slide preview
        if ($this->oneSlideMode == true) {
            $slides = $this->filterOneSlide($slides);
        }
        echo "<ul>";
        $htmlFirstTransWrap = "";
        $startWithSlide = $this->slider->getStartWithSlideSetting();
        $firstTransActive = $this->slider->getParam("first_transition_active", "false");
        if ($firstTransActive == "true") {
            $firstTransition = $this->slider->getParam("first_transition_type", "fade");
            $htmlFirstTransWrap .= " data-fstransition=\"{$firstTransition}\"";
            $firstDuration = $this->slider->getParam("first_transition_duration", "300");
            if (!empty($firstDuration) && is_numeric($firstDuration)) {
                $htmlFirstTransWrap .= " data-fsmasterspeed=\"{$firstDuration}\"";
            }
            $firstSlotAmount = $this->slider->getParam("first_transition_slot_amount", "7");
            if (!empty($firstSlotAmount) && is_numeric($firstSlotAmount)) {
                $htmlFirstTransWrap .= " data-fsslotamount=\"{$firstSlotAmount}\"";
            }
        }
        if (count($slides) == 1 && $this->oneSlideMode == false) {
            $slides[] = $slides[0];
            $this->hasOnlyOneSlide = true;
        }
        foreach ($slides as $index => $slide) {
            $params = $slide->getParams();
            //check if date is set
            $date_from = $slide->getParam("date_from", "");
            $date_to = $slide->getParam("date_to", "");
            if ($date_from != "") {
                $date_from = strtotime($date_from);
                if (time() < $date_from) {
                    continue;
                }
            }
            if ($date_to != "") {
                $date_to = strtotime($date_to);
                if (time() > $date_to) {
                    continue;
                }
            }
            $transition = $slide->getParam("slide_transition", "random");
            //if($transition == "fade") $transition = "tp-fade";
            //$transitionPremium = $slide->getParam("slide_transition_premium","random");
            //if(trim($transition) == '')
            //	$transition = $transitionPremium;
            //else
            //	if(trim($transitionPremium) != '') $transition .= ','.$transitionPremium;
            $slotAmount = $slide->getParam("slot_amount", "7");
            $isExternal = $slide->getParam("background_type", "image");
            if ($isExternal != "external") {
                $urlSlideImage = $slide->getImageUrl();
                //get image alt
                $imageFilename = $slide->getImageFilename();
                $info = pathinfo($imageFilename);
                $alt = $info["filename"];
            } else {
                $urlSlideImage = $slide->getParam("slide_bg_external", "");
                $info = '';
                $alt = '';
            }
            $bgType = $slide->getParam("background_type", "image");
            //get thumb url
            $htmlThumb = "";
            if ($isThumbsActive == true) {
                $urlThumb = null;
                //check if post slider, if yes, get thumb from featured image
                //if($this->slider->isSlidesFromPosts())
                //	$urlThumb = '';
                if (empty($urlThumb)) {
                    $urlThumb = $slide->getParam("slide_thumb", "");
                }
                if ($bgType == 'image') {
                    if (empty($urlThumb)) {
                        //try to get resized thumb
                        $pathThumb = $slide->getImageFilepath();
                        if (!empty($pathThumb)) {
                            $urlThumb = UniteBaseClassRev::getImageUrl($pathThumb, $thumbWidth, $thumbHeight, true);
                        }
                    }
                    //if not - put regular image:
                    if (empty($urlThumb)) {
                        $urlThumb = $slide->getImageUrl();
                    }
                }
                $htmlThumb = 'data-thumb="' . $urlThumb . '" ';
            }
            //get link
            $htmlLink = "";
            $enableLink = $slide->getParam("enable_link", "false");
            if ($enableLink == "true") {
                $linkType = $slide->getParam("link_type", "regular");
                switch ($linkType) {
                    //---- normal link
                    default:
                    case "regular":
                        $link = $slide->getParam("link", "");
                        $linkOpenIn = $slide->getParam("link_open_in", "same");
                        $htmlTarget = "";
                        if ($linkOpenIn == "new") {
                            $htmlTarget = ' data-target="_blank"';
                        }
                        $htmlLink = "data-link=\"{$link}\" {$htmlTarget} ";
                        break;
                        //---- link to slide
                    //---- link to slide
                    case "slide":
                        $slideLink = UniteFunctionsRev::getVal($params, "slide_link");
                        if (!empty($slideLink) && $slideLink != "nothing") {
                            //get slide index from id
                            if (is_numeric($slideLink)) {
                                $slideLink = UniteFunctionsRev::getVal($this->slidesNumIndex, $slideLink);
                            }
                            if (!empty($slideLink)) {
                                $htmlLink = "data-link=\"slide\" data-linktoslide=\"{$slideLink}\" ";
                            }
                        }
                        break;
                }
                //set link position:
                $linkPos = UniteFunctionsRev::getVal($params, "link_pos", "front");
                if ($linkPos == "back") {
                    $htmlLink .= ' data-slideindex="back"';
                }
            }
            //set delay
            $htmlDelay = "";
            $delay = $slide->getParam("delay", "");
            if (!empty($delay) && is_numeric($delay)) {
                $htmlDelay = "data-delay=\"{$delay}\" ";
            }
            //get duration
            $htmlDuration = "";
            $duration = $slide->getParam("transition_duration", "");
            if (!empty($duration) && is_numeric($duration)) {
                $htmlDuration = "data-masterspeed=\"{$duration}\" ";
            }
            //get rotation
            $htmlRotation = "";
            $rotation = $slide->getParam("transition_rotation", "");
            if (!empty($rotation)) {
                $rotation = (int) $rotation;
                if ($rotation != 0) {
                    if ($rotation > 720 && $rotation != 999) {
                        $rotation = 720;
                    }
                    if ($rotation < -720) {
                        $rotation = -720;
                    }
                }
                $htmlRotation = "data-rotate=\"{$rotation}\" ";
            }
            $fullWidthVideoData = $this->getSlideFullWidthVideoData($slide);
            //set full width centering.
            /*$htmlImageCentering = "";
            		$fullWidthCentering = $slide->getParam("fullwidth_centering","false");
            		if($sliderType == "fullwidth" && $fullWidthCentering == "true")
            			$htmlImageCentering = ' data-fullwidthcentering="on"';
            		*/
            //set first slide transition
            $htmlFirstTrans = "";
            if ($index == $startWithSlide) {
                $htmlFirstTrans = $htmlFirstTransWrap;
            }
            //first trans
            $htmlParams = $htmlDuration . $htmlLink . $htmlThumb . $htmlDelay . $htmlRotation . $htmlFirstTrans;
            $styleImage = "";
            $urlImageTransparent = UniteBaseClassRev::$url_plugin . "images/transparent.png";
            switch ($bgType) {
                case "trans":
                    $urlSlideImage = $urlImageTransparent;
                    break;
                case "solid":
                    $urlSlideImage = $urlImageTransparent;
                    $slideBGColor = $slide->getParam("slide_bg_color", "#d0d0d0");
                    $styleImage = "style='background-color:" . $slideBGColor . "'";
                    break;
            }
            //additional params
            $imageAddParams = "";
            if ($lazyLoad == "on") {
                $imageAddParams .= "data-lazyload=\"{$urlSlideImage}\"";
                $urlSlideImage = UniteBaseClassRev::$url_plugin . "images/dummy.png";
            }
            //$imageAddParams .= $htmlImageCentering;
            //additional background params
            $bgFit = $slide->getParam("bg_fit", "cover");
            $bgFitX = intval($slide->getParam("bg_fit_x", "100"));
            $bgFitY = intval($slide->getParam("bg_fit_y", "100"));
            $bgPosition = $slide->getParam("bg_position", "center top");
            $bgPositionX = intval($slide->getParam("bg_position_x", "0"));
            $bgPositionY = intval($slide->getParam("bg_position_y", "0"));
            $bgRepeat = $slide->getParam("bg_repeat", "no-repeat");
            if ($bgPosition == 'percentage') {
                $imageAddParams .= ' data-bgposition="' . $bgPositionX . '% ' . $bgPositionY . '%"';
            } else {
                $imageAddParams .= ' data-bgposition="' . $bgPosition . '"';
            }
            //check for kenburn & pan zoom
            $kenburn_effect = $slide->getParam("kenburn_effect", "off");
            //$kb_rotation_start = intval($slide->getParam("kb_rotation_start","0"));
            //$kb_rotation_end = intval($slide->getParam("kb_rotation_end","0"));
            $kb_duration = intval($slide->getParam("kb_duration", $this->slider->getParam("delay", 9000)));
            $kb_ease = $slide->getParam("kb_easing", "Linear.easeNone");
            $kb_start_fit = $slide->getParam("kb_start_fit", "100");
            $kb_end_fit = $slide->getParam("kb_end_fit", "100");
            $kb_pz = '';
            if ($kenburn_effect == "on" && ($bgType == 'image' || $bgType == 'external')) {
                $kb_pz .= ' data-kenburns="on"';
                //$kb_pz.= ' data-rotationstart="'.$kb_rotation_start.'"';
                //$kb_pz.= ' data-rotationend="'.$kb_rotation_end.'"';
                $kb_pz .= ' data-duration="' . $kb_duration . '"';
                $kb_pz .= ' data-ease="' . $kb_ease . '"';
                $kb_pz .= ' data-bgfit="' . $kb_start_fit . '"';
                $kb_pz .= ' data-bgfitend="' . $kb_end_fit . '"';
                $bgEndPosition = $slide->getParam("bg_end_position", "center top");
                $bgEndPositionX = intval($slide->getParam("bg_end_position_x", "0"));
                $bgEndPositionY = intval($slide->getParam("bg_end_position_y", "0"));
                if ($bgEndPosition == 'percentage') {
                    $kb_pz .= ' data-bgpositionend="' . $bgEndPositionX . '% ' . $bgEndPositionY . '%"';
                } else {
                    $kb_pz .= ' data-bgpositionend="' . $bgEndPosition . '"';
                }
                //set image original width and height
                //$imgSize = @getimagesize($urlSlideImage);
                //if(is_array($imgSize) && !empty($imgSize)){
                //	$kb_pz.= ' data-owidth="'.$imgSize[0].'"';
                //	$kb_pz.= ' data-oheight="'.$imgSize[1].'"';
                //}
            } else {
                //only set if kenburner is off
                if ($bgFit == 'percentage') {
                    $imageAddParams .= ' data-bgfit="' . $bgFitX . '% ' . $bgFitY . '%"';
                } else {
                    $imageAddParams .= ' data-bgfit="' . $bgFit . '"';
                }
                $imageAddParams .= ' data-bgrepeat="' . $bgRepeat . '"';
            }
            //Html
            echo "\t<!-- SLIDE  -->\n";
            echo "\t<li data-transition=\"" . $transition . "\" data-slotamount=\"" . $slotAmount . "\" " . $htmlParams . ">\n";
            echo "\t\t<!-- MAIN IMAGE -->\n";
            echo "\t\t<img src=\"" . $urlSlideImage . "\" " . $styleImage . " alt=\"" . $alt . "\" " . $imageAddParams . $kb_pz . ">\n";
            echo "\t\t<!-- LAYERS -->\n";
            //put video:
            if ($fullWidthVideoData["found"] == true) {
                //backward compatability
                $this->putFullWidthVideoLayer($fullWidthVideoData);
            }
            $this->putCreativeLayer($slide);
            echo "\t</li>\n";
        }
        //get foreach
        echo "</ul>\n";
    }
    /**
     * 
     * put the slider slides
     */
    private function putSlides()
    {
        $sliderType = $this->slider->getParam("slider_type");
        $slides = $this->slider->getSlides();
        $this->slidesNumIndex = $this->slider->getSlidesNumbersByIDs();
        if (empty($slides)) {
            ?>
				<div class="no-slides-text">
					No slides found, please add some slides
				</div>
				<?php 
        }
        $thumbWidth = $this->slider->getParam("thumb_width", 100);
        $thumbHeight = $this->slider->getParam("thumb_height", 50);
        $slideWidth = $this->slider->getParam("width", 900);
        $slideHeight = $this->slider->getParam("height", 300);
        $navigationType = $this->slider->getParam("navigaion_type", "none");
        $isThumbsActive = $navigationType == "thumb" ? true : false;
        //for one slide preview
        if ($this->oneSlideMode == true) {
            $slides = $this->filterOneSlide($slides);
        }
        ?>
				<ul>
			<?php 
        foreach ($slides as $slide) {
            $params = $slide->getParams();
            $transition = $slide->getParam("slide_transition", "random");
            $slotAmount = $slide->getParam("slot_amount", "7");
            $urlSlideImage = $slide->getImageUrl();
            //get image alt
            $imageFilename = $slide->getImageFilename();
            $info = pathinfo($imageFilename);
            $alt = $info["filename"];
            //get thumb url
            $htmlThumb = "";
            if ($isThumbsActive == true) {
                $urlThumb = $slide->getParam("slide_thumb", "");
                if (empty($urlThumb)) {
                    //try to get resized thumb
                    $pathThumb = $slide->getImageFilepath();
                    if (!empty($pathThumb)) {
                        $urlThumb = UniteBaseClassRev::getImageUrl($pathThumb, $thumbWidth, $thumbHeight, true);
                    }
                }
                //if not - put regular image:
                if (empty($urlThumb)) {
                    $urlThumb = $slide->getImageUrl();
                }
                $htmlThumb = 'data-thumb="' . $urlThumb . '" ';
            }
            //get link
            $htmlLink = "";
            $enableLink = $slide->getParam("enable_link", "false");
            if ($enableLink == "true") {
                $linkType = $slide->getParam("link_type", "regular");
                switch ($linkType) {
                    //---- normal link
                    default:
                    case "regular":
                        $link = $slide->getParam("link", "");
                        $linkOpenIn = $slide->getParam("link_open_in", "same");
                        $htmlTarget = "";
                        if ($linkOpenIn == "new") {
                            $htmlTarget = ' data-target="_blank"';
                        }
                        $htmlLink = "data-link=\"{$link}\" {$htmlTarget} ";
                        break;
                        //---- link to slide
                    //---- link to slide
                    case "slide":
                        $slideLink = UniteFunctionsRev::getVal($params, "slide_link");
                        if (!empty($slideLink) && $slideLink != "nothing") {
                            //get slide index from id
                            if (is_numeric($slideLink)) {
                                $slideLink = UniteFunctionsRev::getVal($this->slidesNumIndex, $slideLink);
                            }
                            if (!empty($slideLink)) {
                                $htmlLink = "data-link=\"slide\" data-linktoslide=\"{$slideLink}\" ";
                            }
                        }
                        break;
                }
                //set link position:
                $linkPos = UniteFunctionsRev::getVal($params, "link_pos", "front");
                if ($linkPos == "back") {
                    $htmlLink .= ' data-slideindex="back"';
                }
            }
            //set delay
            $htmlDelay = "";
            $delay = $slide->getParam("delay", "");
            if (!empty($delay) && is_numeric($delay)) {
                $htmlDelay = "data-delay=\"{$delay}\" ";
            }
            //get duration
            $htmlDuration = "";
            $duration = $slide->getParam("transition_duration", "");
            if (!empty($duration) && is_numeric($duration)) {
                $htmlDuration = "data-masterspeed=\"{$duration}\" ";
            }
            //get rotation
            $htmlRotation = "";
            $rotation = $slide->getParam("transition_rotation", "");
            if (!empty($rotation)) {
                $rotation = (int) $rotation;
                if ($rotation != 0) {
                    if ($rotation > 720 && $rotation != 999) {
                        $rotation = 720;
                    }
                    if ($rotation < -720) {
                        $rotation = -720;
                    }
                }
                $htmlRotation = "data-rotate=\"{$rotation}\" ";
            }
            $videoData = $this->getSlideFullWidthVideoData($slide);
            //set full width centering.
            $htmlImageCentering = "";
            $fullWidthCentering = $slide->getParam("fullwidth_centering", "false");
            if ($sliderType == "fullwidth" && $fullWidthCentering == "true") {
                $htmlImageCentering = 'data-fullwidthcentering="true"';
            }
            $htmlParams = $htmlDuration . $htmlLink . $htmlThumb . $htmlDelay . $htmlRotation;
            //Html
            ?>
					<li data-transition="<?php 
            echo $transition;
            ?>
" data-slotamount="<?php 
            echo $slotAmount;
            ?>
" <?php 
            echo $htmlParams;
            ?>
>
						<img src="<?php 
            echo $urlSlideImage;
            ?>
" alt="<?php 
            echo $alt;
            ?>
" <?php 
            echo $htmlImageCentering;
            ?>
>
						<?php 
            //put video:
            if ($videoData["found"] == true) {
                $this->putFullWidthVideoLayer($videoData);
            }
            $this->putCreativeLayer($slide);
            ?>
					</li>
				<?php 
        }
        //get foreach
        ?>
				</ul>
			<?php 
    }
    /**
     * 
     * put the slider slides
     */
    private function putSlides()
    {
        $slides = $this->slider->getSlides();
        if (empty($slides)) {
            ?>
				<div class="no-slides-text">
					No slides found, please add some slides
				</div>
				<?php 
        }
        $thumbWidth = $this->slider->getParam("thumb_width", 100);
        $thumbHeight = $this->slider->getParam("thumb_height", 50);
        $slideWidth = $this->slider->getParam("width", 900);
        $slideHeight = $this->slider->getParam("height", 300);
        $navigationType = $this->slider->getParam("navigaion_type", "none");
        $isThumbsActive = $navigationType == "thumb" ? true : false;
        $flagReize = $this->slider->getParam("php_resize", "none");
        $flagReize = $flagReize == "on" ? true : false;
        ?>
				<ul>
			<?php 
        foreach ($slides as $slide) {
            $params = $slide->getParams();
            $transition = $slide->getParam("slide_transition", "random");
            $slotAmount = $slide->getParam("slot_amount", "7");
            $urlSlideImage = $slide->getImageUrl();
            if ($flagReize == true) {
                $pathSlideImage = $slide->getImageFilepath();
                if (!empty($pathSlideImage)) {
                    $urlSlideImage = UniteBaseClassRev::getImageUrl($pathSlideImage, $slideWidth, $slideHeight, true);
                }
            }
            //get thumb url
            $htmlThumb = "";
            if ($isThumbsActive == true) {
                $urlThumb = $slide->getParam("slide_thumb", "");
                if (empty($urlThumb)) {
                    //try to get resized thumb
                    $pathThumb = $slide->getImageFilepath();
                    if (!empty($pathThumb)) {
                        $urlThumb = UniteBaseClassRev::getImageUrl($pathThumb, $thumbWidth, $thumbHeight, true);
                    }
                }
                //if not - put regular image:
                if (empty($urlThumb)) {
                    $urlThumb = $slide->getImageUrl();
                }
                $htmlThumb = 'data-thumb="' . $urlThumb . '" ';
            }
            //get link
            $htmlLink = "";
            $enableLink = $slide->getParam("enable_link", "false");
            if ($enableLink == "true") {
                $link = $slide->getParam("link", "");
                $linkOpenIn = $slide->getParam("link_open_in", "same");
                $htmlTarget = "";
                if ($linkOpenIn == "new") {
                    $htmlTarget = ' data-target="_blank"';
                }
                $htmlLink = "data-link=\"{$link}\" {$htmlTarget} ";
            }
            //set delay
            $htmlDelay = "";
            $delay = $slide->getParam("delay", "");
            if (!empty($delay) && is_numeric($delay)) {
                $htmlDelay = "data-delay=\"{$delay}\" ";
            }
            //get duration
            $htmlDuration = "";
            $duration = $slide->getParam("transition_duration", "");
            if (!empty($duration) && is_numeric($duration)) {
                $htmlDuration = "data-masterspeed=\"{$duration}\" ";
            }
            //get rotation
            $htmlRotation = "";
            $rotation = $slide->getParam("transition_rotation", "");
            if (!empty($rotation)) {
                $rotation = (int) $rotation;
                if ($rotation != 0) {
                    if ($rotation > 720 && $rotation != 999) {
                        $rotation = 720;
                    }
                    if ($rotation < -720) {
                        $rotation = -720;
                    }
                }
                $htmlRotation = "data-rotate=\"{$rotation}\" ";
            }
            $videoData = $this->getSlideFullWidthVideoData($slide);
            $htmlParams = $htmlDuration . $htmlLink . $htmlThumb . $htmlDelay . $htmlRotation;
            //Html
            ?>
					<li data-transition="<?php 
            echo $transition;
            ?>
" data-slotamount="<?php 
            echo $slotAmount;
            ?>
" <?php 
            echo $htmlParams;
            ?>
>
						<img src="<?php 
            echo $urlSlideImage;
            ?>
" alt="alt" />
						<?php 
            //put video:
            if ($videoData["found"] == true) {
                $this->putFullWidthVideoLayer($videoData);
            }
            $this->putCreativeLayer($slide);
            ?>
					</li>
				<?php 
        }
        //get foreach
        ?>
				</ul>
			<?php 
    }