/**
  * 
  * put the kb slider slider on the html page.
  * @param $data - mixed, can be ID ot Alias.
  */
 public static function putSlider($sliderID, $putIn = "")
 {
     if (strtolower($putIn) == "homepage" && is_front_page() == false) {
         return false;
     }
     $output = new RevSliderOutput();
     $output->putSliderBase($sliderID);
     $slider = $output->getSlider();
     return $slider;
 }
Example #2
0
 /**
  * 
  * put the rev slider slider on the html page.
  * @param $data - mixed, can be ID ot Alias.
  */
 public static function putSlider($sliderID, $putIn = "")
 {
     $isPutIn = self::isPutIn($putIn);
     if ($isPutIn == false) {
         return false;
     }
     $output = new RevSliderOutput();
     $output->putSliderBase($sliderID);
     $slider = $output->getSlider();
     return $slider;
 }
 /**
  * 
  * put the rev slider slider on the html page.
  * @param $data - mixed, can be ID ot Alias.
  */
 public static function putSlider($sliderID, $putIn = "")
 {
     $isPutIn = self::isPutIn($putIn);
     if ($isPutIn == false) {
         return false;
     }
     //check if on mobile and if option hide on mobile is set
     $output = new RevSliderOutput();
     $output->putSliderBase($sliderID);
     $slider = $output->getSlider();
     return $slider;
 }
Example #4
0
 /**
  * 
  * a must function. you can not use it, but the function must stay there!
  */
 public static function onAddScripts()
 {
     global $wp_version;
     $slver = apply_filters('revslider_remove_version', RevSliderGlobals::SLIDER_REVISION);
     $style_pre = '';
     $style_post = '';
     if ($wp_version < 3.7) {
         $style_pre = '<style type="text/css">';
         $style_post = '</style>';
     }
     $operations = new RevSliderOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = RevSliderFunctions::getVal($arrValues, "includes_globally", "on");
     $includesFooter = RevSliderFunctions::getVal($arrValues, "js_to_footer", "off");
     $strPutIn = RevSliderFunctions::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 = RevSliderFunctionsWP::hasShortcode("rev_slider");
         if ($isWidgetActive == false && $hasShortcode == false) {
             return false;
         }
     }
     wp_enqueue_style('rs-plugin-settings', RS_PLUGIN_URL . 'public/assets/css/settings.css', array(), $slver);
     $custom_css = RevSliderOperations::getStaticCss();
     $custom_css = RevSliderCssParser::compress_css($custom_css);
     if (trim($custom_css) == '') {
         $custom_css = '#rs-demo-id {}';
     }
     wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
     $setBase = is_ssl() ? "https://" : "http://";
     wp_enqueue_script(array('jquery'));
     //add icon sets
     //wp_register_style('rs-icon-set-fa-icon-', RS_PLUGIN_URL .'public/assets/fonts/font-awesome/css/font-awesome.css', array(), $slver);
     //wp_register_style('rs-icon-set-pe-7s-', RS_PLUGIN_URL .'public/assets/fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css', array(), $slver);
     if ($includesFooter == "off") {
         $waitfor = array('jquery');
         $enable_logs = RevSliderFunctions::getVal($arrValues, "enable_logs", 'off');
         if ($enable_logs == 'on') {
             wp_enqueue_script('enable-logs', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.enablelog.js', $waitfor, $slver);
             $waitfor[] = 'enable-logs';
         }
         wp_enqueue_script('tp-tools', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.tools.min.js', $waitfor, $slver);
         wp_enqueue_script('revmin', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.revolution.min.js', 'tp-tools', $slver);
     } else {
         //put javascript to footer
         add_action('wp_footer', array('RevSliderFront', 'putJavascript'));
     }
     add_action('wp_head', array('RevSliderFront', 'add_meta_generator'));
     add_action("wp_footer", array('RevSliderFront', "load_icon_fonts"));
     // Async JS Loading
     $js_defer = RevSliderBase::getVar($arrValues, 'js_defer', 'off');
     if ($js_defer != 'off') {
         add_filter('clean_url', array('RevSliderFront', 'add_defer_forscript'), 11, 1);
     }
     add_action('wp_before_admin_bar_render', array('RevSliderFront', 'add_admin_menu_nodes'));
     add_action('wp_footer', array('RevSliderFront', 'putAdminBarMenus'));
 }
Example #5
0
 /**
  * 
  * a must function. you can not use it, but the function must stay there!.
  *   
  */
 public static function onAddScripts()
 {
     global $wp_version;
     $style_pre = '';
     $style_post = '';
     if ($wp_version < 3.7) {
         $style_pre = '<style type="text/css">';
         $style_post = '</style>';
     }
     $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");
     $custom_css = RevOperations::getStaticCss();
     $custom_css = UniteCssParserRev::compress_css($custom_css);
     wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
     /*
      */
     /*
     $styles = $db->fetch(GlobalsRevSlider::$table_css);
     $styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
     $styles = UniteCssParserRev::compress_css($styles);
     wp_add_inline_style( 'rs-plugin-settings', $style_pre.$styles.$style_post );
     
     // KRISZTIAN MODIFICATION FOR INNERLAYERS
     $stylesinnerlayers = str_replace('.tp-caption', '',$styles);´
     wp_add_inline_style( 'rs-plugin-settings', $style_pre.$stylesinnerlayers.$style_post );
     // END MODIFICATION
     */
     $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") {
         $waitfor = array('jquery');
         $enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs", 'off');
         if ($enable_logs == 'on') {
             self::addScriptWaitFor("jquery.themepunch.enablelog", "rs-plugin/js", 'enable-logs');
             $waitfor[] = 'enable-logs';
         }
         self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
         self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
     } else {
         //put javascript to footer
         UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     }
 }
 /**
  * 
  * put the kb slider slider on the html page.
  * @param $data - mixed, can be ID ot Alias.
  */
 public static function putSlider($sliderID, $putIn = "")
 {
     $putIn = strtolower($putIn);
     if ($putIn == "homepage") {
         //filter by homepage
         if (is_front_page() == false) {
             return false;
         }
     } else {
         //case filter by pages
         if (!empty($putIn)) {
             $arrPutInPages = array();
             $arrPagesTemp = explode(",", $putIn);
             foreach ($arrPagesTemp as $page) {
                 if (is_numeric($page) || $page == "homepage") {
                     $arrPutInPages[] = $page;
                 }
             }
             if (!empty($arrPutInPages)) {
                 //get current page id
                 $currentPageID = "";
                 if (is_front_page() == true) {
                     $currentPageID = "homepage";
                 } else {
                     global $post;
                     if (isset($post->ID)) {
                         $currentPageID = $post->ID;
                     }
                 }
                 //do the filter by pages
                 if (array_search($currentPageID, $arrPutInPages) === false) {
                     return false;
                 }
             }
         }
     }
     $output = new RevSliderOutput();
     $output->putSliderBase($sliderID);
     $slider = $output->getSlider();
     return $slider;
 }
Example #7
0
 public function renderSlider()
 {
     if (Mage::helper('nwdall')->getCfg('general/enabled', 'nwdrevslider_config')) {
         ob_start();
         $slider = RevSliderOutput::putSlider($this->getData('alias'));
         $content = ob_get_contents();
         ob_clean();
         ob_end_clean();
     } else {
         $content = '';
     }
     return $content;
 }
 /**
  * 
  * widget output
  */
 public function widget($args, $instance)
 {
     $sliderID = UniteFunctionsRev::getVal($instance, "rev_slider");
     $homepageCheck = UniteFunctionsRev::getVal($instance, "rev_slider_homepage");
     $homepage = "";
     if ($homepageCheck == "on") {
         $homepage = "homepage";
     }
     if (empty($sliderID)) {
         return false;
     }
     RevSliderOutput::putSlider($sliderID, $homepage);
 }
Example #9
0
 /**
  * put the rev slider slider on the html page.
  * @param $data - mixed, can be ID ot Alias.
  */
 public static function putSlider($sliderID, $putIn = "", $gal_ids = array(), $settings = array(), $order = array())
 {
     $settings = apply_filters('revslider_modify_slider_settings', $settings, $sliderID);
     $isPutIn = self::isPutIn($putIn);
     if ($isPutIn == false) {
         return false;
     }
     //check if on mobile and if option hide on mobile is set
     $output = new RevSliderOutput();
     $output->putSliderBase($sliderID, $gal_ids, false, $settings, $order);
     $slider = $output->getSlider();
     return $slider;
 }
 /**
  * 
  * widget output
  */
 public function widget($args, $instance)
 {
     $sliderID = $instance["rev_slider"];
     if (empty($sliderID)) {
         return false;
     }
     ?>
                             <div class="sidebar_widget_holder">
                                 <?php 
     RevSliderOutput::putSlider($sliderID);
     ?>
                             </div>	
 <?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);
 }
 public static function onAddScripts()
 {
     global $wp_version;
     $style_pre = '';
     $style_post = '';
     if ($wp_version < 3.7) {
         $style_pre = '<style type="text/css">';
         $style_post = '</style>';
     }
     $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);
     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");
     $custom_css = RevOperations::getStaticCss();
     $custom_css = UniteCssParserRev::compress_css($custom_css);
     wp_add_inline_style('rs-plugin-settings', $style_pre . $custom_css . $style_post);
     $setBase = get_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") {
         $waitfor = array('jquery');
         $enable_logs = UniteFunctionsRev::getVal($arrValues, "enable_logs", 'off');
         if ($enable_logs == 'on') {
             self::addScriptWaitFor("jquery.themepunch.enablelog", "rs-plugin/js", 'enable-logs');
             $waitfor[] = 'enable-logs';
         }
         self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
         self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
     } else {
         UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     }
 }
 /**
  * 
  * 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');
     }
 }
Example #14
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');
     // }
 }
Example #15
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");
 }
Example #16
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");
     $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");
     $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";
     self::addScriptAbsoluteUrl($url_jquery, "jquery");
     if ($includesFooter == "off") {
         $use_hammer = UniteFunctionsRev::getVal($arrValues, "use_hammer_js", 'on');
         $waitfor = array('jquery');
         if ($use_hammer == 'off') {
             self::addScriptWaitFor("jquery.themepunch.disablehammer", "rs-plugin/js", 'disable-hammer');
             $waitfor[] = 'disable-hammer';
         }
         self::addScriptWaitFor("jquery.themepunch.tools.min", "rs-plugin/js", 'tp-tools', $waitfor);
         self::addScriptWaitFor("jquery.themepunch.revolution.min", "rs-plugin/js", 'revmin', 'tp-tools');
     } else {
         //put javascript to footer
         UniteBaseClassRev::addAction('wp_footer', 'putJavascript');
     }
 }
Example #17
0
 /**
  *
  * put rev slider on the page.
  * the data can be slider ID or slider alias.
  */
 function putRevSlider($data, $putIn = "")
 {
     $operations = new RevSliderOperations();
     $arrValues = $operations->getGeneralSettingsValues();
     $includesGlobally = RevSliderFunctions::getVal($arrValues, "includes_globally", "on");
     $strPutIn = RevSliderFunctions::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)", 'revslider');
         $option2Name = __("Pages to include RevSlider libraries", 'revslider');
         $output->putErrorMessage(__("If you want to use the PHP function \"putRevSlider\" in your code please make sure to check \" ", 'revslider') . $option1Name . __(" \" in the backend's \"General Settings\" (top right panel). <br> <br> Or add the current page to the \"", 'revslider') . $option2Name . __("\" option box.", 'revslider'));
         return false;
     }
     ob_start();
     $slider = RevSliderOutput::putSlider($data, $putIn);
     $content = ob_get_contents();
     ob_clean();
     ob_end_clean();
     if (is_object($slider)) {
         $disable_on_mobile = @$slider->getParam("disable_on_mobile", "off");
         // Do not output Slider if we are on mobile
         if ($disable_on_mobile == 'on') {
             $mobile = strstr($_SERVER['HTTP_USER_AGENT'], 'Android') || strstr($_SERVER['HTTP_USER_AGENT'], 'webOS') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPhone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPod') || strstr($_SERVER['HTTP_USER_AGENT'], 'Windows Phone') || strstr($_SERVER['HTTP_USER_AGENT'], 'iPad') || wp_is_mobile() ? true : false;
             if ($mobile) {
                 return false;
             }
         }
     }
     echo $content;
 }
Example #18
0
 /**
  * onAjax action handler
  */
 public static function onFrontAjaxAction()
 {
     $db = new RevSliderDB();
     $slider = new RevSlider();
     $slide = new RevSlide();
     $operations = new RevSliderOperations();
     $token = self::getPostVar("token", false);
     //verify the token
     $isVerified = wp_verify_nonce($token, 'RevSlider_Front');
     $error = false;
     if ($isVerified) {
         $data = self::getPostVar('data', false);
         switch (self::getPostVar('client_action', false)) {
             case 'get_slider_html':
                 $id = intval(self::getPostVar('id', 0));
                 if ($id > 0) {
                     $html = '';
                     add_filter('revslider_add_js_delay', array('RevSliderAdmin', 'rev_set_js_delay'));
                     ob_start();
                     $slider_class = RevSliderOutput::putSlider($id);
                     $html = ob_get_contents();
                     //add styling
                     $custom_css = RevSliderOperations::getStaticCss();
                     $custom_css = RevSliderCssParser::compress_css($custom_css);
                     $styles = $db->fetch(RevSliderGlobals::$table_css);
                     $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
                     $styles = RevSliderCssParser::compress_css($styles);
                     $html .= '<style type="text/css">' . $custom_css . '</style>';
                     $html .= '<style type="text/css">' . $styles . '</style>';
                     ob_clean();
                     ob_end_clean();
                     $result = !empty($slider_class) && $html !== '' ? true : false;
                     if (!$result) {
                         $error = __('Slider not found', 'revslider');
                     } else {
                         if ($html !== false) {
                             self::ajaxResponseData($html);
                         } else {
                             $error = __('Slider not found', 'revslider');
                         }
                     }
                 } else {
                     $error = __('No Data Received', 'revslider');
                 }
                 break;
         }
     } else {
         $error = true;
     }
     if ($error !== false) {
         $showError = __('Loading Error', 'revslider');
         if ($error !== true) {
             $showError = __('Loading Error: ', 'revslider') . $error;
         }
         self::ajaxResponseError($showError, false);
     }
     exit;
 }
Example #19
0
}
$loadType = $params->get("js_load_type", "head");
$isJSInBody = $loadType == "body" ? true : false;
$noConflictMode = $params->get("no_conflict_mode") == "true" ? true : false;
//css includes
$document->addStyleSheet(GlobalsRevSlider::$url_item_plugin . "css/settings.css");
if (file_exists(GlobalsRevSlider::$filepath_dynamic_captions) == true) {
    $document->addStyleSheet(GlobalsRevSlider::$urlDynamicCaptionsCSS);
} else {
    $document->addStyleSheet(GlobalsRevSlider::$urlCaptionsCSS);
}
//add inline styles
/*
$db = new UniteDBRev();
$styles = $db->fetch(GlobalsRevSlider::$table_css);
$styles = UniteCssParserRev::parseDbArrayToCss($styles, "\n");
$document->addStyleDeclaration( $styles );
*/
//dmp($styles);exit();
$document->addStyleSheet(GlobalsRevSlider::$urlStaticCaptionsCSS);
//include js:
if ($isJSInBody == false) {
    $document->addScript(GlobalsRevSlider::$url_item_plugin . "js/jquery.themepunch.tools.min.js");
    $document->addScript(GlobalsRevSlider::$url_item_plugin . "js/jquery.themepunch.revolution.min.js");
}
$output = new RevSliderOutput();
$output->jsToBody = $isJSInBody;
$output->noConflictMode = $noConflictMode;
$output->putSliderBase($sliderID);
?>
	
 protected function index($setting)
 {
     $this->language->load('module/revslideropencart');
     if (!defined('rs_plugin_url')) {
         define('rs_plugin_url', REV_DIR_CONFIG . 'revslider/');
     }
     if (!defined('rs_admin_css')) {
         define('rs_admin_css', rs_plugin_url . 'css/');
     }
     if (!defined('rs_admin_js')) {
         define('rs_admin_js', rs_plugin_url . 'js/');
     }
     if (!defined('rs_admin_img')) {
         define('rs_admin_img', rs_plugin_url . 'images/');
     }
     if (!defined('rs_rs_plugin')) {
         define('rs_rs_plugin', rs_plugin_url . 'rs-plugin/');
     }
     static $module = 0;
     // start load external file
     // $this->config->load('revslider/revslider_front');
     // end load external file
     // start add font
     $font = new ThemePunch_Fonts();
     $fonts = $font->get_all_fonts();
     if (!empty($fonts)) {
         $http = get_http();
         foreach ($fonts as $font) {
             if ($font !== '') {
                 $url = $http . "fonts.googleapis.com/css?family=" . strip_tags($font['url']);
                 $this->document->addStyle($url);
             }
         }
     }
     // end add font
     // start load media file
     $this->document->addScript(rs_rs_plugin . 'js/jquery.themepunch.tools.min.js');
     $this->document->addScript(rs_rs_plugin . 'js/jquery.themepunch.revolution.min.js');
     $this->document->addStyle(rs_rs_plugin . 'css/settings.css');
     $this->document->addStyle(rs_rs_plugin . 'css/static-captions.css');
     $this->document->addStyle(rs_rs_plugin . 'css/dynamic-captions.css');
     $this->document->addStyle(rs_rs_plugin . 'css/captions.css');
     // end load media file
     // start revsliderfront setting
     $sliders = $this->hookCommonCb($setting['slider_id']);
     $content = '';
     $g_fonts = '';
     if (!empty($sliders)) {
         ob_start();
         foreach ($sliders as $slider) {
             $slider = (object) $slider;
             $params = json_decode($slider->params);
             $params->jquery_noconflict = 'off';
             if (isset($params->google_font) && is_array($params->google_font)) {
                 foreach ($params->google_font as $google_font) {
                     $g_fonts .= html_entity_decode($google_font);
                 }
             }
             RevSliderOutput::putSlider($setting['slider_id'], '');
         }
         $content = ob_get_contents();
         ob_end_clean();
     }
     $content .= $g_fonts;
     $this->data['rev_content'] = $content;
     // end revsliderfront setting
     if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/revslideropencart.tpl')) {
         $this->template = $this->config->get('config_template') . '/template/module/revslideropencart.tpl';
     } else {
         $this->template = 'default/template/module/revslideropencart.tpl';
     }
     $this->render();
 }
Example #21
0
        $video = ob_get_clean();
        echo str_replace('<video class="', '<video class="video-js vjs-default-skin manual', $video);
        ?>

</div>
<?php 
    } else {
        ?>

<div class="slider-container <?php 
        echo $options['rev_slider_skin'];
        ?>
">
    <?php 
        ob_start();
        RevSliderOutput::putSlider($options['rev_slider'], '');
        $video = ob_get_clean();
        echo str_replace('<video class="', '<video class="video-js vjs-default-skin manual', $video);
        ?>

</div>
<?php 
    }
} elseif (isset($options['slider']) && 'nivo' == $options['slider']) {
    ?>

<div class="container">
	<div class="row">
		<div class="col-md-12">
            <?php 
    echo do_shortcode('[slider id=' . $options['nivo_slider'] . ']');
 /**
  * 
  * put the kb slider slider on the html page.
  * @param $data - mixed, can be ID ot Alias.
  */
 public static function putSlider($sliderID)
 {
     $output = new RevSliderOutput();
     $output->putSliderBase($sliderID);
 }
function rev_slider_shortcode($args)
{
    $sliderAlias = UniteFunctionsRev::getVal($args, 0);
    ob_start();
    $slider = RevSliderOutput::putSlider($sliderAlias);
    $content = ob_get_contents();
    ob_clean();
    ob_end_clean();
    //handle slider output types
    if (!empty($slider)) {
        $outputType = $slider->getParam("output_type", "");
        switch ($outputType) {
            case "compress":
                $content = str_replace("\n", "", $content);
                $content = str_replace("\r", "", $content);
                return $content;
                break;
            case "echo":
                echo $content;
                //bypass the filters
                break;
            default:
                return $content;
                break;
        }
    } else {
        return $content;
    }
    //normal output
}
Example #24
0
 /**
  * 
  * put kb slider on the page.
  * the data can be slider ID or slider alias.
  */
 function putRevSlider($data, $putIn = "")
 {
     RevSliderOutput::putSlider($data, $putIn);
 }
Example #25
0
 /**
  * 
  * put kb slider on the page.
  * the data can be slider ID or slider alias.
  */
 function putRevSlider($data)
 {
     RevSliderOutput::putSlider($data);
 }
Example #26
0
File: main.php Project: booklein/wp
 function show_page_slider()
 {
     global $page_datas;
     $revolution_exists = class_exists('RevSlider') && class_exists('UniteFunctionsRev');
     switch ($page_datas['page_slider']) {
         case 'revolution':
             if ($revolution_exists) {
                 RevSliderOutput::putSlider($page_datas['page_revolution'], "");
             }
             break;
         case 'layerslider':
             echo do_shortcode('[layerslider id="' . $page_datas['page_layerslider'] . '"]');
             break;
         case 'none':
             break;
         default:
             break;
     }
 }
Example #27
0
 function show_page_slider()
 {
     global $page_datas;
     $revolution_exists = class_exists('RevSlider') && class_exists('UniteFunctionsRev');
     switch ($page_datas['page_slider']) {
         case 'revolution':
             if ($revolution_exists) {
                 RevSliderOutput::putSlider($page_datas['page_revolution'], "");
             }
             break;
         case 'flex':
             show_flex_slider($page_datas['page_flex']);
             break;
         case 'nivo':
             show_nivo_slider($page_datas['page_nivo']);
             break;
         case 'product':
             show_prod_slider($page_datas['product_tag']);
             break;
         case 'none':
             break;
         default:
             break;
     }
 }
 /**
  *
  * put slide preview by data
  */
 public function putSlidePreviewByData($data)
 {
     if ($data == "empty_output") {
         $this->loadingMessageOutput();
         exit;
     }
     $data = UniteFunctionsRev::jsonDecodeFromClientSide($data);
     $slideID = $data["slideid"];
     $slide = new RevSlide();
     $slide->initByID($slideID);
     $sliderID = $slide->getSliderID();
     $output = new RevSliderOutput();
     $output->setOneSlideMode($data);
     $this->previewOutput($sliderID, $output);
 }
 /**
  * 
  * widget output
  */
 public function widget($args, $instance)
 {
     $sliderID = UniteFunctionsRev::getVal($instance, "rev_slider");
     $title = UniteFunctionsRev::getVal($instance, "rev_slider_title");
     $homepageCheck = UniteFunctionsRev::getVal($instance, "rev_slider_homepage");
     $homepage = "";
     if ($homepageCheck == "on") {
         $homepage = "homepage";
     }
     $pages = UniteFunctionsRev::getVal($instance, "rev_slider_pages");
     if (!empty($pages)) {
         if (!empty($homepage)) {
             $homepage .= ",";
         }
         $homepage .= $pages;
     }
     if (empty($sliderID)) {
         return false;
     }
     //widget output
     $beforeWidget = UniteFunctionsRev::getVal($args, "before_widget");
     $afterWidget = UniteFunctionsRev::getVal($args, "after_widget");
     $beforeTitle = UniteFunctionsRev::getVal($args, "before_title");
     $afterTitle = UniteFunctionsRev::getVal($args, "after_title");
     echo $beforeWidget;
     if (!empty($title)) {
         echo $beforeTitle . $title . $afterTitle;
     }
     RevSliderOutput::putSlider($sliderID, $homepage);
     echo $afterWidget;
 }
Example #30
0
 public function generateSliderById($id = 1)
 {
     $content = '';
     if (empty($id)) {
         return 'no id found';
     }
     ob_start();
     RevSliderOutput::putSlider($id, '');
     $content = ob_get_contents();
     ob_end_clean();
     $this->smarty->assign('revhome', $content);
     return $this->display(__FILE__, 'views/templates/front/revolution_slider.tpl');
 }