Exemple #1
0
function yit_revslider_slider()
{
    $operations = new RevOperations();
    $arrValues = $operations->getGeneralSettingsValues();

    $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");

    $isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
    $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");

    if ( yit_slider_get_setting('slider_type',yit_slider_name()) != 'revolution-slider' || $includesGlobally == "on" || $isWidgetActive || $hasShortcode ) {
        return;
    }

    wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL .'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION);

    $custom_css = RevOperations::getStaticCss();
    $custom_css = UniteCssParserRev::compress_css($custom_css);
    wp_add_inline_style('rs-plugin-settings', $custom_css);

    $setBase = (is_ssl()) ? "https://" : "http://";

    $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
    wp_enqueue_script("jquery", $url_jquery);

    // put javascript to footer
    add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
    /**
     * 
     * javascript output to footer
     */
    public function putJavascript()
    {
        $urlPlugin = UniteBaseClassRev::$url_plugin . "rs-plugin/";
        $operations = new RevOperations();
        $arrValues = $operations->getGeneralSettingsValues();
        $use_hammer = UniteFunctionsRev::getVal($arrValues, "use_hammer_js", 'on');
        if ($use_hammer == 'off') {
            ?>
				<script type='text/javascript' src='<?php 
            echo $urlPlugin;
            ?>
js/jquery.themepunch.disablehammer.js?rev=<?php 
            echo GlobalsRevSlider::SLIDER_REVISION;
            ?>
'></script>
				<?php 
        }
        ?>
			<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.tools.min.js?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
'></script>
			<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.revolution.min.js?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
'></script>
			<?php 
    }
 /**
  * 
  * put rev slider on the page.
  * the data can be slider ID or slider alias.
  */
 function putRevSlider($data, $putIn = "")
 {
     $operations = new RevOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
     $strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
     $isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
     if ($isPutIn == false && $includesGlobally == "off") {
         $output = new RevSliderOutput();
         $option1Name = "Include RevSlider libraries globally (all pages/posts)";
         $option2Name = "Pages to include RevSlider libraries";
         $output->putErrorMessage(__("If you want to use the PHP function \"putRevSlider\" in your code please make sure to check \" ", REVSLIDER_TEXTDOMAIN) . $option1Name . __(" \" in the backend's \"General Settings\" (top right panel). <br> <br> Or add the current page to the \"", REVSLIDER_TEXTDOMAIN) . $option2Name . __("\" option box."));
         return false;
     }
     RevSliderOutput::putSlider($data, $putIn);
 }
 /**
  * 
  * a must function. you can not use it, but the function must stay there!.
  *   
  */
 public static function onAddScripts()
 {
     $operations = new RevOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
     $includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
     $strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
     $isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
     //put the includes only on pages with active widget or shortcode
     // if the put in match, then include them always (ignore this if)
     if ($isPutIn == false && $includesGlobally == "off") {
         $isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
         $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
         if ($isWidgetActive == false && $hasShortcode == false) {
             return false;
         }
     }
     self::addStyle("settings", "rs-plugin-settings", "rs-plugin/css");
     //check if dynamic-captions.css exists. If not, include captions.php
     if (file_exists(self::$path_plugin . "rs-plugin/css/dynamic-captions.css") == false) {
         self::addDynamicStyle("captions", "rs-plugin-captions", "rs-plugin/css");
     } else {
         $db = new UniteDBRev();
         $styles = $db->fetch(GlobalsRevSlider::$table_css);
         $styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
         wp_add_inline_style('rs-plugin-settings', $styles);
         //self::addStyle("dynamic-captions","rs-captions","rs-plugin/css");
     }
     $custom_css = RevOperations::getStaticCss();
     wp_add_inline_style('rs-plugin-settings', $custom_css);
     //self::addStyle("static-captions","rs-plugin-static","rs-plugin/css");
     $setBase = is_ssl() ? "https://" : "http://";
     $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
     self::addScriptAbsoluteUrl($url_jquery, "jquery");
     if ($includesFooter == "off") {
         self::addScriptWaitFor("jquery.themepunch.plugins.min", "rs-plugin/js", 'themepunchtools', 'jquery');
         self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'jquery');
     } else {
         //put javascript to footer
         UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     }
 }
Exemple #5
0
function yit_revslider_slider()
{
    if ( ! class_exists('RevOperations') ) {
        return;
    }

    $operations = new RevOperations();
    $arrValues = $operations->getGeneralSettingsValues();

    $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally","on");

    $isWidgetActive = is_active_widget( false, false, "rev-slider-widget", true );
    $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");

    if ( YIT_Layout()->slider_name===false 
    	|| (YIT_Layout()->slider_name != 'none' && YIT_Slider::get_slider( YIT_Layout()->slider_name )->config->layout != 'revolution-slider') 
    	|| $includesGlobally == "on" 
    	|| $isWidgetActive 
    	|| $hasShortcode ) {
        return;
    }

    if ( defined( 'RS_PLUGIN_URL' ) ) {
        wp_enqueue_style( 'rs-plugin-settings', RS_PLUGIN_URL . 'public/assets/css/settings.css', array(), RevSliderGlobals::SLIDER_REVISION );
    }
    else {
        wp_enqueue_style( "rs-plugin-settings", UniteBaseClassRev::$url_plugin . "rs-plugin/css/settings.css", array(), GlobalsRevSlider::SLIDER_REVISION );
    }

    $custom_css = RevOperations::getStaticCss();
    $custom_css = UniteCssParserRev::compress_css($custom_css);
    wp_add_inline_style('rs-plugin-settings', $custom_css);

    $setBase = (is_ssl()) ? "https://" : "http://";

    $url_jquery = $setBase . "ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
    wp_enqueue_script("jquery", $url_jquery);

    // put javascript to footer
    add_action('wp_footer', array($GLOBALS['productFront'], 'putJavascript'));
}
Exemple #6
0
 public static function onAddScripts()
 {
     $operations = new RevOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
     $includesFooter = UniteFunctionsRev::getVal($arrValues, "js_to_footer", "off");
     $strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
     $isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
     //put the includes only on pages with active widget or shortcode
     // if the put in match, then include them always (ignore this if)
     if ($isPutIn == false && $includesGlobally == "off") {
         $isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
         $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
         if ($isWidgetActive == false && $hasShortcode == false) {
             return false;
         }
     }
     //self::addStyle("settings","rs-settings","rs-plugin/css");
     //check if dynamic-captions.css exists. If not, include captions.php
     //if(file_exists(self::$path_plugin."rs-plugin/css/dynamic-captions.css") == false){
     //self::addDynamicStyle("captions","rs-plugin-captions","rs-plugin/css");
     //                                $captionsAction =  Context::getContext()->link->getAdminLink('Revolutionslider_ajax').'&revControllerAction=captions';
     //
     //                                wp_enqueue_style ('captions', $captionsAction);
     //  }
     //else
     //self::addStyle("dynamic-captions","rs-captions","rs-plugin/css");
     //self::addStyle("static-captions","rs-plugin-static","rs-plugin/css");
     // $setBase = (is_ssl()) ? "https://" : "http://";
     // $url_jquery = $setBase."ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
     // self::addScriptAbsoluteUrl($url_jquery, "jquery");
     // if($includesFooter == "off"){
     // 	self::addScript("jquery.themepunch.tools.min","rs-plugin/js",'themepunchtools');
     // 	self::addScript("jquery.themepunch.revolution.min","rs-plugin/js");
     //self::addScriptWaitFor("jquery.themepunch.tools.min","rs-plugin/js",'themepunchtools', array('jquery'));
     //self::addScriptWaitFor("jquery.themepunch.revolution.min","rs-plugin/js", null, array('jquery'));
     // }else{
     //put javascript to footer
     // 	UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     // }
 }
    public function putJavascript()
    {
        $urlPlugin = UniteBaseClassRev::$url_plugin . "rs-plugin/";
        $operations = new RevOperations();
        $arrValues = $operations->getGeneralSettingsValues();
        ?>
			<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.tools.min.js?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
'></script>
			<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.revolution.min.js?rev=<?php 
        echo GlobalsRevSlider::SLIDER_REVISION;
        ?>
'></script>
			<?php 
    }
Exemple #8
0
 /**
  * 
  * a must function. you can not use it, but the function must stay there!.
  *   
  */
 public static function onAddScripts()
 {
     $operations = new RevOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = UniteFunctionsRev::getVal($arrValues, "includes_globally", "on");
     $strPutIn = UniteFunctionsRev::getVal($arrValues, "pages_for_includes");
     $isPutIn = RevSliderOutput::isPutIn($strPutIn, true);
     //put the includes only on pages with active widget or shortcode
     // if the put in match, then include them always (ignore this if)
     if ($isPutIn == false && $includesGlobally == "off") {
         $isWidgetActive = is_active_widget(false, false, "rev-slider-widget", true);
         $hasShortcode = UniteFunctionsWPRev::hasShortcode("rev_slider");
         if ($isWidgetActive == false && $hasShortcode == false) {
             return false;
         }
     }
     self::addStyle("settings", "rs-settings", "rs-plugin/css");
     self::addStyle("captions", "rs-captions", "rs-plugin/css");
     $url_jquery = "http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js?app=revolution";
     self::addScriptAbsoluteUrl($url_jquery, "jquery");
     self::addScript("jquery.themepunch.revolution.min", "rs-plugin/js");
 }
    /**
     * 
     * put slider javascript
     */
    private function putJS()
    {
        $params = $this->slider->getParams();
        $sliderType = $this->slider->getParam("slider_type");
        $optFullWidth = $sliderType == "fullwidth" ? "on" : "off";
        $optFullScreen = "off";
        if ($sliderType == "fullscreen") {
            $optFullWidth = "off";
            $optFullScreen = "on";
        }
        $use_spinner = $this->slider->getParam("use_spinner", "0");
        $spinner_color = $this->slider->getParam("spinner_color", "#FFFFFF");
        $noConflict = $this->slider->getParam("jquery_noconflict", "on");
        //set thumb amount
        $numSlides = $this->slider->getNumSlides(true);
        $thumbAmount = (int) $this->slider->getParam("thumb_amount", "5");
        if ($thumbAmount > $numSlides) {
            $thumbAmount = $numSlides;
        }
        //get stop slider options
        $stopSlider = $this->slider->getParam("stop_slider", "off");
        $stopAfterLoops = $this->slider->getParam("stop_after_loops", "0");
        $stopAtSlide = $this->slider->getParam("stop_at_slide", "2");
        if ($stopSlider == "off") {
            $stopAfterLoops = "-1";
            $stopAtSlide = "-1";
        }
        $oneSlideLoop = $this->slider->getParam("loop_slide", "loop");
        if ($oneSlideLoop == 'noloop' && $this->hasOnlyOneSlide == true) {
            $stopAfterLoops = '0';
            $stopAtSlide = '1';
        }
        // set hide navigation after
        $hideThumbs = $this->slider->getParam("hide_thumbs", "200");
        if (is_numeric($hideThumbs) == false) {
            $hideThumbs = "0";
        } else {
            $hideThumbs = (int) $hideThumbs;
            if ($hideThumbs < 10) {
                $hideThumbs = 10;
            }
        }
        $alwaysOn = $this->slider->getParam("navigaion_always_on", "false");
        if ($alwaysOn == "true") {
            $hideThumbs = "0";
        }
        $sliderID = $this->slider->getID();
        //treat hide slider at limit
        $hideSliderAtLimit = $this->slider->getParam("hide_slider_under", "0", RevSlider::VALIDATE_NUMERIC);
        if (!empty($hideSliderAtLimit)) {
            $hideSliderAtLimit++;
        }
        $hideCaptionAtLimit = $this->slider->getParam("hide_defined_layers_under", "0", RevSlider::VALIDATE_NUMERIC);
        if (!empty($hideCaptionAtLimit)) {
            $hideCaptionAtLimit++;
        }
        $hideAllCaptionAtLimit = $this->slider->getParam("hide_all_layers_under", "0", RevSlider::VALIDATE_NUMERIC);
        if (!empty($hideAllCaptionAtLimit)) {
            $hideAllCaptionAtLimit++;
        }
        //start_with_slide
        $startWithSlide = $this->slider->getStartWithSlideSetting();
        //modify navigation type (backward compatability)
        $arrowsType = $this->slider->getParam("navigation_arrows", "nexttobullets");
        switch ($arrowsType) {
            case "verticalcentered":
                $arrowsType = "solo";
                break;
        }
        //More Mobile Options
        $hideThumbsOnMobile = $this->slider->getParam("hide_thumbs_on_mobile", "off");
        $hideThumbsDelayMobile = $this->slider->getParam("hide_thumbs_delay_mobile", "1500");
        $hideBulletsOnMobile = $this->slider->getParam("hide_bullets_on_mobile", "off");
        $hideArrowsOnMobile = $this->slider->getParam("hide_arrows_on_mobile", "off");
        $hideThumbsUnderResolution = $this->slider->getParam("hide_thumbs_under_resolution", "0", RevSlider::VALIDATE_NUMERIC);
        $timerBar = $this->slider->getParam("show_timerbar", "top");
        $disableKenBurnOnMobile = $this->slider->getParam("disable_kenburns_on_mobile", "off");
        $swipe_velocity = $this->slider->getParam("swipe_velocity", "0.7", RevSlider::VALIDATE_NUMERIC);
        $swipe_min_touches = $this->slider->getParam("swipe_min_touches", "1", RevSlider::VALIDATE_NUMERIC);
        $swipe_max_touches = $this->slider->getParam("swipe_max_touches", "1", RevSlider::VALIDATE_NUMERIC);
        $drag_block_vertical = $this->slider->getParam("drag_block_vertical", "false");
        $use_parallax = $this->slider->getParam("use_parallax", "off");
        $disable_parallax_mobile = $this->slider->getParam("disable_parallax_mobile", "off");
        if ($use_parallax == 'on') {
            $parallax_type = $this->slider->getParam("parallax_type", "mouse");
            $parallax_bg_freeze = $this->slider->getParam("parallax_bg_freeze", "off");
            $parallax_level[] = intval($this->slider->getParam("parallax_level_1", "5"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_2", "10"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_3", "15"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_4", "20"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_5", "25"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_6", "30"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_7", "35"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_8", "40"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_9", "45"));
            $parallax_level[] = intval($this->slider->getParam("parallax_level_10", "50"));
            $parallax_level = implode(',', $parallax_level);
        }
        $operations = new RevOperations();
        $arrValues = $operations->getGeneralSettingsValues();
        ?>
			
			<script type="text/javascript">

					
				/******************************************
					-	PREPARE PLACEHOLDER FOR SLIDER	-
				******************************************/
				<?php 
        /*var setREVStartSize = function() {
        		
        							var	tpopt = new Object(); 
        								tpopt.startwidth = <?php echo $this->slider->getParam("width","900")?>;
        								tpopt.startheight = <?php echo $this->slider->getParam("height","300")?>;
        								tpopt.container = jQuery('#<?php echo $this->sliderHtmlID?>');
        								tpopt.fullScreen = "<?php echo $optFullScreen?>";
        								tpopt.forceFullWidth="<?php echo $this->slider->getParam("force_full_width", 'off'); ?>";
        							
        
        							
        								
        							tpopt.container.closest('.rev_slider_wrapper').css({'height':tpopt.container.height()});
        			
        							tpopt.width=parseInt(tpopt.container.width(),0);
        							tpopt.height=parseInt(tpopt.container.height(),0);
        			
        			
        							tpopt.bw= (tpopt.width / tpopt.startwidth);
        							tpopt.bh = (tpopt.height / tpopt.startheight);
        			
        							if (tpopt.bh>tpopt.bw) tpopt.bh=tpopt.bw;
        							if (tpopt.bh<tpopt.bw) tpopt.bw = tpopt.bh;
        							if (tpopt.bw<tpopt.bh) tpopt.bh = tpopt.bw;
        							if (tpopt.bh>1) { tpopt.bw=1; tpopt.bh=1; }
        							if (tpopt.bw>1) {tpopt.bw=1; tpopt.bh=1; }							
        							tpopt.height = Math.round(tpopt.startheight * (tpopt.width/tpopt.startwidth));	
        							if (tpopt.height>tpopt.startheight && tpopt.autoHeight!="on") tpopt.height=tpopt.startheight;
        							
        							
        
        									
        							if (tpopt.fullScreen=="on") {
        									tpopt.height = tpopt.bw * tpopt.startheight;
        									var cow = tpopt.container.parent().width();
        									var coh = jQuery(window).height();
        									if (tpopt.fullScreenOffsetContainer!=undefined) {
        										try{
        											var offcontainers = tpopt.fullScreenOffsetContainer.split(",");
        											jQuery.each(offcontainers,function(index,searchedcont) {
        												coh = coh - jQuery(searchedcont).outerHeight(true);
        												if (coh<tpopt.minFullScreenHeight) coh=tpopt.minFullScreenHeight;
        											});
        										} catch(e) {}
        									}
        
        									tpopt.container.parent().height(coh);
        									tpopt.container.height(coh);
        									tpopt.container.closest('.rev_slider_wrapper').height(coh);
        									tpopt.container.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').height(coh);
        									tpopt.container.css({'height':'100%'});
        			
        									tpopt.height=coh;
        			
        							} else {
        								tpopt.container.height(tpopt.height);
        								tpopt.container.closest('.rev_slider_wrapper').height(tpopt.height);
        								tpopt.container.closest('.forcefullwidth_wrapper_tp_banner').find('.tp-fullwidth-forcer').height(tpopt.height);
        							}
        										
        						}				*/
        ?>
				
				 
						var setREVStartSize = function() {
							var	tpopt = new Object(); 
								tpopt.startwidth = <?php 
        echo $this->slider->getParam("width", "900");
        ?>
;
								tpopt.startheight = <?php 
        echo $this->slider->getParam("height", "300");
        ?>
;
								tpopt.container = jQuery('#<?php 
        echo $this->sliderHtmlID;
        ?>
');
								tpopt.fullScreen = "<?php 
        echo $optFullScreen;
        ?>
";
								tpopt.forceFullWidth="<?php 
        echo $this->slider->getParam("force_full_width", 'off');
        ?>
";

							tpopt.container.closest(".rev_slider_wrapper").css({height:tpopt.container.height()});tpopt.width=parseInt(tpopt.container.width(),0);tpopt.height=parseInt(tpopt.container.height(),0);tpopt.bw=tpopt.width/tpopt.startwidth;tpopt.bh=tpopt.height/tpopt.startheight;if(tpopt.bh>tpopt.bw)tpopt.bh=tpopt.bw;if(tpopt.bh<tpopt.bw)tpopt.bw=tpopt.bh;if(tpopt.bw<tpopt.bh)tpopt.bh=tpopt.bw;if(tpopt.bh>1){tpopt.bw=1;tpopt.bh=1}if(tpopt.bw>1){tpopt.bw=1;tpopt.bh=1}tpopt.height=Math.round(tpopt.startheight*(tpopt.width/tpopt.startwidth));if(tpopt.height>tpopt.startheight&&tpopt.autoHeight!="on")tpopt.height=tpopt.startheight;if(tpopt.fullScreen=="on"){tpopt.height=tpopt.bw*tpopt.startheight;var cow=tpopt.container.parent().width();var coh=jQuery(window).height();if(tpopt.fullScreenOffsetContainer!=undefined){try{var offcontainers=tpopt.fullScreenOffsetContainer.split(",");jQuery.each(offcontainers,function(e,t){coh=coh-jQuery(t).outerHeight(true);if(coh<tpopt.minFullScreenHeight)coh=tpopt.minFullScreenHeight})}catch(e){}}tpopt.container.parent().height(coh);tpopt.container.height(coh);tpopt.container.closest(".rev_slider_wrapper").height(coh);tpopt.container.closest(".forcefullwidth_wrapper_tp_banner").find(".tp-fullwidth-forcer").height(coh);tpopt.container.css({height:"100%"});tpopt.height=coh;}else{tpopt.container.height(tpopt.height);tpopt.container.closest(".rev_slider_wrapper").height(tpopt.height);tpopt.container.closest(".forcefullwidth_wrapper_tp_banner").find(".tp-fullwidth-forcer").height(tpopt.height);}
						};
						
						/* CALL PLACEHOLDER */
						setREVStartSize();
								
				
				var tpj=jQuery;				
				<?php 
        if ($noConflict == "on") {
            ?>
tpj.noConflict();<?php 
        }
        ?>
				
				var revapi<?php 
        echo $sliderID;
        ?>
;
				
				
				
				tpj(document).ready(function() {
				
					
								
				if(tpj('#<?php 
        echo $this->sliderHtmlID;
        ?>
').revolution == undefined)
					revslider_showDoubleJqueryError('#<?php 
        echo $this->sliderHtmlID;
        ?>
');
				else
				   revapi<?php 
        echo $sliderID;
        ?>
 = tpj('#<?php 
        echo $this->sliderHtmlID;
        ?>
').show().revolution(
					{
						dottedOverlay:"<?php 
        echo $this->slider->getParam("background_dotted_overlay", "none");
        ?>
",
						delay:<?php 
        echo $this->slider->getParam("delay", "9000", RevSlider::FORCE_NUMERIC);
        ?>
,
						startwidth:<?php 
        echo $this->slider->getParam("width", "900");
        ?>
,
						startheight:<?php 
        echo $this->slider->getParam("height", "300");
        ?>
,
						hideThumbs:<?php 
        echo $hideThumbs;
        ?>
,
						
						thumbWidth:<?php 
        echo $this->slider->getParam("thumb_width", "100", RevSlider::FORCE_NUMERIC);
        ?>
,
						thumbHeight:<?php 
        echo $this->slider->getParam("thumb_height", "50", RevSlider::FORCE_NUMERIC);
        ?>
,
						thumbAmount:<?php 
        echo $thumbAmount;
        ?>
,
						<?php 
        $minHeight = $this->slider->getParam("min_height", "0", RevSlider::FORCE_NUMERIC);
        if ($minHeight > 0) {
            ?>
minHeight:<?php 
            echo $minHeight;
            ?>
,
								<?php 
        }
        ?>
							
						simplifyAll:"<?php 
        echo $this->slider->getParam("simplify_ie8_ios4", "off");
        ?>
",						
						navigationType:"<?php 
        echo $this->slider->getParam("navigaion_type", "none");
        ?>
",
						navigationArrows:"<?php 
        echo $arrowsType;
        ?>
",
						navigationStyle:"<?php 
        echo $this->slider->getParam("navigation_style", "round");
        ?>
",						
						touchenabled:"<?php 
        echo $this->slider->getParam("touchenabled", "on");
        ?>
",
						onHoverStop:"<?php 
        echo $this->slider->getParam("stop_on_hover", "on");
        ?>
",						
						nextSlideOnWindowFocus:"<?php 
        echo $this->slider->getParam("next_slide_on_window_focus", "off");
        ?>
",
						
						<?php 
        if ($this->slider->getParam("touchenabled", "on") == 'on') {
            ?>
swipe_threshold: <?php 
            echo $swipe_velocity;
            ?>
,
						swipe_min_touches: <?php 
            echo $swipe_min_touches;
            ?>
,
						drag_block_vertical: <?php 
            echo $drag_block_vertical == 'true' ? 'true' : 'false';
            ?>
,
						<?php 
        }
        ?>
												
						<?php 
        if ($use_parallax == 'on') {
            ?>
						parallax:"<?php 
            echo $parallax_type;
            ?>
",
						parallaxBgFreeze:"<?php 
            echo $parallax_bg_freeze;
            ?>
",
						parallaxLevels:[<?php 
            echo $parallax_level;
            ?>
],
						<?php 
            if ($disable_parallax_mobile == 'on') {
                ?>
						parallaxDisableOnMobile:"on",
						<?php 
            }
        }
        ?>
						<?php 
        if ($disableKenBurnOnMobile == 'on') {
            ?>
							panZoomDisableOnMobile:"on",
							<?php 
        }
        ?>
						
						keyboardNavigation:"<?php 
        echo $this->slider->getParam("keyboard_navigation", "off");
        ?>
",
						
						navigationHAlign:"<?php 
        echo $this->slider->getParam("navigaion_align_hor", "center");
        ?>
",
						navigationVAlign:"<?php 
        echo $this->slider->getParam("navigaion_align_vert", "bottom");
        ?>
",
						navigationHOffset:<?php 
        echo $this->slider->getParam("navigaion_offset_hor", "0", RevSlider::FORCE_NUMERIC);
        ?>
,
						navigationVOffset:<?php 
        echo $this->slider->getParam("navigaion_offset_vert", "20", RevSlider::FORCE_NUMERIC);
        ?>
,

						soloArrowLeftHalign:"<?php 
        echo $this->slider->getParam("leftarrow_align_hor", "left");
        ?>
",
						soloArrowLeftValign:"<?php 
        echo $this->slider->getParam("leftarrow_align_vert", "center");
        ?>
",
						soloArrowLeftHOffset:<?php 
        echo $this->slider->getParam("leftarrow_offset_hor", "20", RevSlider::FORCE_NUMERIC);
        ?>
,
						soloArrowLeftVOffset:<?php 
        echo $this->slider->getParam("leftarrow_offset_vert", "0", RevSlider::FORCE_NUMERIC);
        ?>
,

						soloArrowRightHalign:"<?php 
        echo $this->slider->getParam("rightarrow_align_hor", "right");
        ?>
",
						soloArrowRightValign:"<?php 
        echo $this->slider->getParam("rightarrow_align_vert", "center");
        ?>
",
						soloArrowRightHOffset:<?php 
        echo $this->slider->getParam("rightarrow_offset_hor", "20", RevSlider::FORCE_NUMERIC);
        ?>
,
						soloArrowRightVOffset:<?php 
        echo $this->slider->getParam("rightarrow_offset_vert", "0", RevSlider::FORCE_NUMERIC);
        ?>
,
								
						shadow:<?php 
        echo $this->slider->getParam("shadow_type", "2");
        ?>
,
						fullWidth:"<?php 
        echo $optFullWidth;
        ?>
",
						fullScreen:"<?php 
        echo $optFullScreen;
        ?>
",

						spinner:"spinner<?php 
        echo $use_spinner;
        ?>
",
						
						stopLoop:"<?php 
        echo $stopSlider;
        ?>
",
						stopAfterLoops:<?php 
        echo $stopAfterLoops;
        ?>
,
						stopAtSlide:<?php 
        echo $stopAtSlide;
        ?>
,

						shuffle:"<?php 
        echo $this->slider->getParam("shuffle", "off");
        ?>
",
						
						<?php 
        if ($this->slider->getParam("slider_type") == "fullwidth") {
            ?>
autoHeight:"<?php 
            echo $this->slider->getParam("auto_height", 'off');
            ?>
",<?php 
        }
        ?>
						
						<?php 
        if ($this->slider->getParam("slider_type") == "fullwidth" || $this->slider->getParam("slider_type") == "fullscreen") {
            ?>
forceFullWidth:"<?php 
            echo $this->slider->getParam("force_full_width", 'off');
            ?>
",<?php 
        }
        ?>
						
						<?php 
        if ($this->slider->getParam("slider_type") == "fullscreen") {
            ?>
fullScreenAlignForce:"<?php 
            echo $this->slider->getParam("full_screen_align_force", "off");
            ?>
",<?php 
        }
        ?>
						
						<?php 
        if ($this->slider->getParam("slider_type") == "fullscreen") {
            ?>
minFullScreenHeight:"<?php 
            echo $this->slider->getParam("fullscreen_min_height", "0");
            ?>
",<?php 
        }
        ?>
						
						<?php 
        if ($timerBar == "hide") {
            ?>
hideTimerBar:"on",<?php 
        }
        ?>
						
						hideThumbsOnMobile:"<?php 
        echo $hideThumbsOnMobile;
        ?>
",
						<?php 
        if ($hideThumbsOnMobile == 'off') {
            ?>
hideNavDelayOnMobile:<?php 
            echo $hideThumbsDelayMobile;
            ?>
,
						<?php 
        }
        ?>
hideBulletsOnMobile:"<?php 
        echo $hideBulletsOnMobile;
        ?>
",
						hideArrowsOnMobile:"<?php 
        echo $hideArrowsOnMobile;
        ?>
",
						hideThumbsUnderResolution:<?php 
        echo $hideThumbsUnderResolution;
        ?>
,
						
						<?php 
        if ($this->slider->getParam("slider_type") == 'fullscreen') {
            ?>
						fullScreenOffsetContainer: "<?php 
            echo $this->slider->getParam("fullscreen_offset_container", "");
            ?>
",
						fullScreenOffset: "<?php 
            echo $this->slider->getParam("fullscreen_offset_size", "");
            ?>
",
						<?php 
        }
        ?>
						hideSliderAtLimit:<?php 
        echo $hideSliderAtLimit;
        ?>
,
						hideCaptionAtLimit:<?php 
        echo $hideCaptionAtLimit;
        ?>
,
						hideAllCaptionAtLilmit:<?php 
        echo $hideAllCaptionAtLimit;
        ?>
,
						startWithSlide:<?php 
        echo $startWithSlide;
        ?>
,
						isJoomla: true
					});
					
					
					
					<?php 
        if ($this->slider->getParam("custom_javascript", '') !== '') {
            echo stripslashes($this->slider->getParam("custom_javascript", ''));
        }
        ?>
				
				});	/*ready*/
									
			</script>
			
			<?php 
        switch ($use_spinner) {
            case '1':
            case '2':
                echo '<style type="text/css">' . "\n";
                echo '	#' . $this->sliderHtmlID_wrapper . ' .tp-loader.spinner' . $use_spinner . '{ background-color: ' . $spinner_color . ' !important; }' . "\n";
                echo '</style>' . "\n";
                break;
            case '3':
            case '4':
                echo '<style type="text/css">' . "\n";
                echo '	#' . $this->sliderHtmlID_wrapper . ' .tp-loader.spinner' . $use_spinner . ' div { background-color: ' . $spinner_color . ' !important; }' . "\n";
                echo '</style>' . "\n";
                break;
            case '0':
            case '5':
            default:
                break;
        }
        if ($this->slider->getParam("custom_css", '') !== '') {
            ?>
				<style type="text/css">
					<?php 
            echo stripslashes($this->slider->getParam("custom_css", ''));
            ?>
				</style>
				<?php 
        }
    }
 public function putSliderBase($sliderID)
 {
     try {
         self::$sliderSerial++;
         $this->slider = new RevSlider();
         $this->slider->initByMixed($sliderID);
         $doWrapFromTemplate = false;
         if ($this->slider->isSlidesFromPosts() && $this->slider->getParam("slider_template_id", false) !== false) {
             //need to use general settings from the Template Slider
             $this->slider->initByMixed($this->slider->getParam("slider_template_id", false));
             $doWrapFromTemplate = $sliderID;
         }
         //modify settings for admin preview mode
         if ($this->previewMode == true) {
             $this->modifyPreviewModeSettings();
         }
         //edit html before slider
         $htmlBeforeSlider = "";
         // add fonts
         $_usedStyles = array();
         $_slides = $this->slider->getSlides();
         foreach ($_slides as $_slide) {
             $_layers = $_slide->getLayers();
             foreach ($_layers as $_layer) {
                 $_style = isset($_layer['style']) ? $_layer['style'] : '';
                 if ($_style && !in_array($_style, $_usedStyles)) {
                     $_usedStyles[] = $_style;
                 }
             }
         }
         $htmlBeforeSlider .= Mage::helper('nwdrevslider')->inlcudeStyleFonts($_usedStyles);
         //pub js to body handle
         if ($this->slider->getParam("js_to_body", "false") == "true") {
             $operations = new RevOperations();
             $arrValues = $operations->getGeneralSettingsValues();
             $enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs", 'off');
             if ($enable_logs == 'on') {
                 $urlIncludeJS = UniteBaseClassRev::$url_plugin . "rs-plugin/js/jquery.themepunch.enablelog.js?rev=" . GlobalsRevSlider::SLIDER_REVISION;
                 $htmlBeforeSlider .= "<script type='text/javascript' src='{$urlIncludeJS}'></script>";
             }
             $urlIncludeJS = UniteBaseClassRev::$url_plugin . "rs-plugin/js/jquery.themepunch.tools.min.js?rev=" . GlobalsRevSlider::SLIDER_REVISION;
             $htmlBeforeSlider .= "<script type='text/javascript' src='{$urlIncludeJS}'></script>";
             $urlIncludeJS = UniteBaseClassRev::$url_plugin . "rs-plugin/js/jquery.themepunch.revolution.min.js?rev=" . GlobalsRevSlider::SLIDER_REVISION;
             $htmlBeforeSlider .= "<script type='text/javascript' src='{$urlIncludeJS}'></script>";
         }
         //the initial id can be alias
         $sliderID = $this->slider->getID();
         $bannerWidth = $this->slider->getParam("width", null, RevSlider::VALIDATE_NUMERIC, "Slider Width");
         $bannerHeight = $this->slider->getParam("height", null, RevSlider::VALIDATE_NUMERIC, "Slider Height");
         $sliderType = $this->slider->getParam("slider_type");
         //set wrapper height
         $wrapperHeigh = 0;
         $wrapperHeigh += $this->slider->getParam("height");
         //add thumb height
         if ($this->slider->getParam("navigaion_type") == "thumb") {
             $wrapperHeigh += $this->slider->getParam("thumb_height");
         }
         $this->sliderHtmlID = "rev_slider_" . $sliderID . "_" . self::$sliderSerial;
         $this->sliderHtmlID_wrapper = $this->sliderHtmlID . "_wrapper";
         $containerStyle = "";
         $sliderPosition = $this->slider->getParam("position", "center");
         //set position:
         if ($sliderType != "fullscreen") {
             switch ($sliderPosition) {
                 case "center":
                 default:
                     $containerStyle .= "margin:0px auto;";
                     break;
                 case "left":
                     $containerStyle .= "float:left;";
                     break;
                 case "right":
                     $containerStyle .= "float:right;";
                     break;
             }
         }
         //add background color
         $backgrondColor = trim($this->slider->getParam("background_color"));
         if (!empty($backgrondColor)) {
             $containerStyle .= "background-color:{$backgrondColor};";
         }
         //set padding
         $containerStyle .= "padding:" . $this->slider->getParam("padding", "0") . "px;";
         //set margin:
         if ($sliderType != "fullscreen") {
             if ($sliderPosition != "center") {
                 $containerStyle .= "margin-left:" . $this->slider->getParam("margin_left", "0") . "px;";
                 $containerStyle .= "margin-right:" . $this->slider->getParam("margin_right", "0") . "px;";
             }
             $containerStyle .= "margin-top:" . $this->slider->getParam("margin_top", "0") . "px;";
             $containerStyle .= "margin-bottom:" . $this->slider->getParam("margin_bottom", "0") . "px;";
         }
         //set height and width:
         $bannerStyle = "display:none;";
         //add background image (to banner style)
         $showBackgroundImage = $this->slider->getParam("show_background_image", "false");
         if ($showBackgroundImage == "true") {
             $backgroundImage = $this->slider->getParam("background_image");
             $backgroundFit = $this->slider->getParam("bg_fit", "cover");
             $backgroundRepeat = $this->slider->getParam("bg_repeat", "no-repeat");
             $backgroundPosition = $this->slider->getParam("bg_position", "center top");
             if (!empty($backgroundImage)) {
                 $bannerStyle .= "background-image:url({$backgroundImage});background-repeat:" . $backgroundRepeat . ";background-fit:" . $backgroundFit . ";background-position:" . $backgroundPosition . ";";
             }
         }
         //set wrapper and slider class:
         $sliderWrapperClass = "rev_slider_wrapper";
         $sliderClass = "rev_slider";
         $putResponsiveStyles = false;
         switch ($sliderType) {
             case "responsitive":
                 //$containerStyle .= "height:".$bannerHeight."px;";
                 $putResponsiveStyles = true;
                 break;
             case "fullwidth":
                 $sliderWrapperClass .= " fullwidthbanner-container";
                 $sliderClass .= " fullwidthabanner";
                 $bannerStyle .= "max-height:" . $bannerHeight . "px;height:" . $bannerHeight . "px;";
                 $containerStyle .= "max-height:" . $bannerHeight . "px;";
                 break;
             case "fullscreen":
                 //$containerStyle .= "height:".$bannerHeight."px;";
                 $sliderWrapperClass .= " fullscreen-container";
                 $sliderClass .= " fullscreenbanner";
                 break;
             case "fixed":
             default:
                 $bannerStyle .= "height:" . $bannerHeight . "px;width:" . $bannerWidth . "px;";
                 $containerStyle .= "height:" . $bannerHeight . "px;width:" . $bannerWidth . "px;";
                 break;
         }
         $htmlTimerBar = "";
         $timerBar = $this->slider->getParam("show_timerbar", "top");
         if ($timerBar == "true") {
             $timerBar = $this->slider->getParam("timebar_position", "top");
         }
         switch ($timerBar) {
             case "top":
                 $htmlTimerBar = '<div class="tp-bannertimer"></div>';
                 break;
             case "bottom":
                 $htmlTimerBar = '<div class="tp-bannertimer tp-bottom"></div>';
                 break;
             case "hide":
                 $htmlTimerBar = '<div class="tp-bannertimer tp-bottom" style="visibility: hidden !important;"></div>';
                 break;
         }
         //check inner / outer border
         $paddingType = $this->slider->getParam("padding_type", "outter");
         if ($paddingType == "inner") {
             $sliderWrapperClass .= " tp_inner_padding";
         }
         global $revSliderVersion;
         if ($putResponsiveStyles == true) {
             $this->putResponsitiveStyles();
         }
         echo $htmlBeforeSlider . "\n";
         echo "<div id=\"";
         echo $this->sliderHtmlID_wrapper;
         echo "\" ";
         echo "class=\"" . $sliderWrapperClass . "\"";
         $show_alternate = $this->slider->getParam("show_alternative_type", "off");
         if ($show_alternate !== 'off') {
             $show_alternate_image = $this->slider->getParam("show_alternate_image", "");
             echo ' data-aimg="' . $show_alternate_image . '" ';
             if ($show_alternate == 'mobile' || $show_alternate == 'mobile-ie8') {
                 echo ' data-amobile="enabled" ';
             } else {
                 echo ' data-amobile="disabled" ';
             }
             if ($show_alternate == 'mobile-ie8' || $show_alternate == 'ie8') {
                 echo ' data-aie8="enabled" ';
             } else {
                 echo ' data-aie8="disabled" ';
             }
         }
         echo " style=\"" . $containerStyle . "\">\n";
         echo "<!-- START REVOLUTION SLIDER " . $revSliderVersion . " " . $sliderType . " mode -->\n";
         echo "\t<div id=\"";
         echo $this->sliderHtmlID;
         echo "\" ";
         echo "class=\"" . $sliderClass . "\"";
         echo " style=\"" . $bannerStyle . "\">\n";
         echo $this->putSlides($doWrapFromTemplate);
         echo $htmlTimerBar;
         echo "\t</div>\n";
         $this->putJS();
         echo "</div>";
         echo "<!-- END REVOLUTION SLIDER -->";
     } catch (Exception $e) {
         $message = $e->getMessage();
         $this->putErrorMessage($message);
     }
 }
Exemple #11
0
<?php

$generalSettings = new UniteSettingsRev();
$generalSettings->addSelect("role", array(UniteBaseAdminClassRev::ROLE_ADMIN => __("To Admin", REVSLIDER_TEXTDOMAIN), UniteBaseAdminClassRev::ROLE_EDITOR => __("To Editor, Admin", REVSLIDER_TEXTDOMAIN), UniteBaseAdminClassRev::ROLE_AUTHOR => __("Author, Editor, Admin", REVSLIDER_TEXTDOMAIN)), __("View Plugin Permission", REVSLIDER_TEXTDOMAIN), UniteBaseAdminClassRev::ROLE_ADMIN, array("description" => "<br>" . __("The role of user that can view and edit the plugin", REVSLIDER_TEXTDOMAIN)));
$generalSettings->addRadio("includes_globally", array("on" => __("On", REVSLIDER_TEXTDOMAIN), "off" => __("Off", REVSLIDER_TEXTDOMAIN)), __("Include RevSlider libraries globally", REVSLIDER_TEXTDOMAIN), "on", array("description" => "<br>" . __("Add css and js includes only on all pages. Id turned to off they will added to pages where the rev_slider shortcode exists only. This will work only when the slider added by a shortcode.", REVSLIDER_TEXTDOMAIN)));
$generalSettings->addTextBox("pages_for_includes", "", __("Pages to include RevSlider libraries", REVSLIDER_TEXTDOMAIN), array("description" => "<br>" . __("Specify the page id's that the front end includes will be included in. Example: 2,3,5 also: homepage,3,4", REVSLIDER_TEXTDOMAIN)));
//--------------------------
//get stored values
$operations = new RevOperations();
$arrValues = $operations->getGeneralSettingsValues();
$generalSettings->setStoredValues($arrValues);
self::storeSettings("general", $generalSettings);