/** * * preview slider output * if output object is null - create object */ public function previewOutput($sliderID, $output = null) { if ($sliderID == "empty_output") { $this->loadingMessageOutput(); exit; } if ($output == null) { $output = new RevSliderOutput(); } $slider = new RevSlider(); $slider->initByID($sliderID); $isWpmlExists = UniteWpmlRev::isWpmlExists(); $useWpml = $slider->getParam("use_wpml", "off"); $wpmlActive = false; if ($isWpmlExists && $useWpml == "on") { $wpmlActive = true; $arrLanguages = UniteWpmlRev::getArrLanguages(false); //set current lang to output $currentLang = UniteFunctionsRev::getPostGetVariable("lang"); if (empty($currentLang)) { $currentLang = UniteWpmlRev::getCurrentLang(); } if (empty($currentLang)) { $currentLang = $arrLanguages[0]; } $output->setLang($currentLang); $selectLangChoose = UniteFunctionsRev::getHTMLSelect($arrLanguages, $currentLang, "id='select_langs'", true); } $output->setPreviewMode(); //put the output html $urlPlugin = RevSliderAdmin::$url_plugin . "rs-plugin/"; $urlPreviewPattern = UniteBaseClassRev::$url_ajax_actions . "&client_action=preview_slider&sliderid=" . $sliderID . "&lang=[lang]&nonce=[nonce]"; $nonce = ''; $csscontent = sdsconfig::getgeneratecss(); $cache_filename = RevSliderAdmin::$path_plugin . 'rs-plugin/css/captions.css'; @file_put_contents($cache_filename, $csscontent); @chmod($cache_filename, 0755); $setBase = get_http(); ?> <html> <head> <?php // start add font $font = new ThemePunch_Fonts(); $fonts = $font->get_all_fonts(); if (!empty($fonts)) { $http = get_http(); foreach ($fonts as $font) { if ($font !== '') { $csurl = $http . "fonts.googleapis.com/css?family=" . strip_tags($font['url']); ?> <link rel='stylesheet' href='<?php echo $csurl; ?> ' type='text/css' media='all' /> <?php } } } // end add font ?> <link rel='stylesheet' href='<?php echo $urlPlugin; ?> css/settings.css?rev=<?php echo GlobalsRevSlider::SLIDER_REVISION; ?> ' type='text/css' media='all' /> <?php ?> <link rel='stylesheet' href='<?php echo $urlPlugin; ?> css/captions.css?rev=<?php echo GlobalsRevSlider::SLIDER_REVISION; ?> ' type='text/css' media='all' /> <?php //} /*else{ ?> <link rel='stylesheet' href='<?php echo $urlPlugin?>css/dynamic-captions.css?rev=<?php echo GlobalsRevSlider::SLIDER_REVISION; ?>' type='text/css' media='all' /> <?php }*/ ?> <link rel='stylesheet' href='<?php echo $urlPlugin; ?> css/static-captions.css?rev=<?php echo GlobalsRevSlider::SLIDER_REVISION; ?> ' type='text/css' media='all' /> <script type='text/javascript' src='<?php echo $setBase; ?> ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></script> <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> </head> <body style="padding:0px;margin:0px;"> <?php if ($wpmlActive == true) { ?> <div style="margin-bottom:10px;text-align:center;"> <?php _e("Choose language", REVSLIDER_TEXTDOMAIN); ?> : <?php echo $selectLangChoose; ?> </div> <script type="text/javascript"> var g_previewPattern = '<?php echo $urlPreviewPattern; ?> '; jQuery("#select_langs").change(function(){ var lang = this.value; var nonce = "<?php echo $nonce; ?> "; var pattern = g_previewPattern; var urlPreview = pattern.replace("[lang]",lang).replace("[nonce]",nonce); location.href = urlPreview; }); </script> <?php } ?> <?php $output->putSliderBase($sliderID); ?> </body> </html> <?php exit; }
public static function getgeneratecssfile() { $csscontent = sdsconfig::getgeneratecss(); $cache_filename = RevSliderAdmin::$path_plugin . 'rs-plugin/css/captions.css'; file_put_contents($cache_filename, $csscontent); chmod($cache_filename, 0777); }
public function getcaptionscss() { header("Content-Type: text/css; charset=utf-8"); $styles = sdsconfig::getgeneratecss(); echo $styles; }
<?php header("Content-Type: text/css; charset=utf-8"); include_once '../../../../../config.php'; include_once '../../../../startup.php'; require_once '../../revslideropencart_loader.php'; require_once '../../inc_php/framework/include_framework.php'; // $styles = sdsconfig::getcaptioncss(GlobalsRevSlider::TABLE_CSS_NAME); $styles = sdsconfig::getgeneratecss(); echo $styles; // echo UniteCssParserRev::parseDbArrayToCss($styles, "\n");