</li>
									<li data-content="#general-firstslide" class="dontshowonhero"><?php 
_e('1st Slide', REVSLIDER_TEXTDOMAIN);
?>
</li>
									<li data-content="#general-misc"><?php 
_e('Misc.', REVSLIDER_TEXTDOMAIN);
?>
</li>

								</ul>

								<!-- GENERAL MISC. -->
								<div id="general-misc" style="display:none">
									<?php 
if (RevSliderWpml::isWpmlExists()) {
    ?>
										<!-- MULTI LANGUANGE -->
										<span id="label_use_wpml" class="label" origtitle="<?php 
    _e("Show multi language controls across the slider. Only available when wpml plugin exists.", REVSLIDER_TEXTDOMAIN);
    ?>
"><?php 
    _e("Use Multi Language (WPML)", REVSLIDER_TEXTDOMAIN);
    ?>
 </span>
										<input type="checkbox" class="tp-moderncheckbox withlabel" id="use_wpml" name="use_wpml" data-unchecked="off" <?php 
    checked(RevSliderFunctions::getVal($arrFieldsParams, 'use_wpml', 'off'), "on");
    ?>
>
										<div class="clearfix"></div>
										<?php 
Beispiel #2
0
 /**
  * 
  * add language (add slide that connected to current slide) from data
  */
 private function addLangFromData($data)
 {
     $sliderID = RevSliderFunctions::getVal($data, "sliderid");
     $slideID = RevSliderFunctions::getVal($data, "slideid");
     $lang = RevSliderFunctions::getVal($data, "lang");
     //duplicate slide
     $slider = new RevSlider();
     $slider->initByID($sliderID);
     $newSlideID = $slider->duplicateSlide($slideID);
     //update new slide
     $this->initByID($newSlideID);
     $arrUpdate = array();
     $arrUpdate["lang"] = $lang;
     $arrUpdate["parentid"] = $slideID;
     $this->updateParamsInDB($arrUpdate);
     $urlIcon = RevSliderWpml::getFlagUrl($lang);
     $title = RevSliderWpml::getLangTitle($lang);
     $newSlide = new RevSlide();
     $newSlide->initByID($slideID);
     $arrLangCodes = $newSlide->getArrChildLangCodes();
     $isAll = RevSliderWpml::isAllLangsInArray($arrLangCodes);
     $html = "<li>\r\n\t\t\t\t\t<img id=\"icon_lang_" . $newSlideID . "\" class=\"icon_slide_lang\" src=\"" . $urlIcon . "\" title=\"" . $title . "\" data-slideid=\"" . $newSlideID . "\" data-lang=\"" . $lang . "\">\r\n\t\t\t\t\t<div class=\"icon_lang_loader loader_round\" style=\"display:none\"></div>\t\t\t\t\t\t\t\t\r\n\t\t\t\t</li>";
     $response = array();
     $response["operation"] = "add";
     $response["isAll"] = $isAll;
     $response["html"] = $html;
     return $response;
 }
Beispiel #3
0
    public function previewOutputMarkup($sliderID, $output = null)
    {
        if ($sliderID == "empty_output") {
            $this->loadingMessageOutput();
            exit;
        }
        if ($output == null) {
            $output = new RevSliderOutput();
        }
        $slider = new RevSlider();
        $slider->initByID($sliderID);
        $isWpmlExists = RevSliderWpml::isWpmlExists();
        $useWpml = $slider->getParam("use_wpml", "off");
        $wpmlActive = false;
        if ($isWpmlExists && $useWpml == "on") {
            $wpmlActive = true;
            $arrLanguages = RevSliderWpml::getArrLanguages(false);
            //set current lang to output
            $currentLang = RevSliderFunctions::getPostGetVariable("lang");
            if (empty($currentLang)) {
                $currentLang = RevSliderWpml::getCurrentLang();
            }
            if (empty($currentLang)) {
                $currentLang = $arrLanguages[0];
            }
            $output->setLang($currentLang);
            $selectLangChoose = RevSliderFunctions::getHTMLSelect($arrLanguages, $currentLang, "id='select_langs'", true);
        }
        $output->setPreviewMode();
        //put the output html
        $urlPlugin = "http://yourpluginpath/";
        $urlPreviewPattern = RevSliderBase::$url_ajax_actions . "&client_action=preview_slider&only_markup=true&sliderid=" . $sliderID . "&lang=[lang]&nonce=[nonce]";
        $nonce = wp_create_nonce("revslider_actions");
        $setBase = is_ssl() ? "https://" : "http://";
        $http = is_ssl() ? 'https' : 'http';
        $operations = new RevSliderOperations();
        $arrValues = $operations->getGeneralSettingsValues();
        $set_diff_font = RevSliderFunctions::getVal($arrValues, "change_font_loading", '');
        if ($set_diff_font !== '') {
            $font_url = $set_diff_font;
        } else {
            $font_url = $http . '://fonts.googleapis.com/css?family=';
        }
        ?>
		<html>
		<head>
			<script type='text/javascript' src='<?php 
        echo $setBase;
        ?>
ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'></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;
					});

					jQuery('body').on('click', '#rev_replace_images', function(){
						var from = jQuery('input[name="orig_image_path"]').val();
						var to = jQuery('input[name="replace_image_path"]').val();

						jQuery('#rev_script_content').val(jQuery('#rev_script_content').val().replace(from, to));
						jQuery('#rev_the_content').val(jQuery('#rev_the_content').val().replace(from, to));
						jQuery('#rev_style_content').val(jQuery('#rev_style_content').val().replace(from, to));
						jQuery('#rev_head_content').val(jQuery('#rev_head_content').val().replace(from, to));
					});

				</script>
			<?php 
        }
        ?>
		<?php 
        ob_start();
        ?>
<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
css/settings.css?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
		<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.tools.min.js?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
'></script>
		<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.revolution.min.js?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
'></script>
		<?php 
        $head_content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        ob_start();
        $custom_css = RevSliderOperations::getStaticCss();
        echo $custom_css . "\n\n";
        echo '/*****************' . "\n";
        echo ' ** ' . __('CAPTIONS CSS', REVSLIDER_TEXTDOMAIN) . "\n";
        echo ' ****************/' . "\n\n";
        $db = new RevSliderDB();
        $styles = $db->fetch(RevSliderGlobals::$table_css);
        echo RevSliderCssParser::parseDbArrayToCss($styles, "\n");
        $style_content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        ob_start();
        $output->putSliderBase($sliderID);
        $content = ob_get_contents();
        ob_clean();
        ob_end_clean();
        $script_content = substr($content, strpos($content, '<script type="text/javascript">'), strpos($content, '</script>') + 9 - strpos($content, '<script type="text/javascript">'));
        $content = htmlentities(str_replace($script_content, '', $content));
        $script_content = str_replace('				', '', $script_content);
        $script_content = str_replace(array('<script type="text/javascript">', '</script>'), '', $script_content);
        ?>
		<style>
			body 	 { font-family:sans-serif; font-size:12px;}
			textarea { background:#f1f1f1; border:#ddd; font-size:10px; line-height:16px; margin-bottom:40px; padding:10px;}
			.rev_cont_title { color:#000; text-decoration:none;font-size:14px; line-height:24px; font-weight:800;background: #D5D5D5;padding: 10px;}
			.rev_cont_title a, .rev_cont_title a:visited { margin-left:25px;font-size:12px;line-height:12px;float:right;background-color:#8e44ad; color:#fff; padding:8px 10px;text-decoration:none;}
			.rev_cont_title a:hover	  { background-color:#9b59b6;}
		</style>
		<p><?php 
        $dir = wp_upload_dir();
        if (!isset($dir['baseurl'])) {
            $dir['baseurl'] = '';
        }
        ?>
			<?php 
        _e('Replace image path:', REVSLIDER_TEXTDOMAIN);
        ?>
 <?php 
        _e('From:', REVSLIDER_TEXTDOMAIN);
        ?>
 <input type="text" name="orig_image_path" value="<?php 
        echo $dir['baseurl'];
        ?>
" /> <?php 
        _e('To:', REVSLIDER_TEXTDOMAIN);
        ?>
 <input type="text" name="replace_image_path" value="" /> <input id="rev_replace_images" type="button" name="replace_images" value="<?php 
        _e('Replace', REVSLIDER_TEXTDOMAIN);
        ?>
" />
		</p>

		<div class="rev_cont_title"><?php 
        _e('Header', REVSLIDER_TEXTDOMAIN);
        ?>
 <a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_head_content"  href="javascript:void(0);" original-title=""><?php 
        _e('Mark to Copy', REVSLIDER_TEXTDOMAIN);
        ?>
</a><div style="clear:both"></div></div>
		<textarea id="rev_head_content" readonly="true" style="width: 100%; height: 100px; color:#3498db"><?php 
        echo $head_content;
        ?>
</textarea>
		<div class="rev_cont_title"><?php 
        _e('CSS', REVSLIDER_TEXTDOMAIN);
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_style_content"  href="javascript:void(0);" original-title=""><?php 
        _e('Mark to Copy', REVSLIDER_TEXTDOMAIN);
        ?>
</a></div>
		<textarea id="rev_style_content" readonly="true" style="width: 100%; height: 100px;"><?php 
        echo $style_content;
        ?>
</textarea>
		<div class="rev_cont_title"><?php 
        _e('Body', REVSLIDER_TEXTDOMAIN);
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_the_content"  href="javascript:void(0);" original-title=""><?php 
        _e('Mark to Copy', REVSLIDER_TEXTDOMAIN);
        ?>
</a></div>
		<textarea id="rev_the_content" readonly="true" style="width: 100%; height: 100px;"><?php 
        echo $content;
        ?>
</textarea>
		<div class="rev_cont_title"><?php 
        _e('Script', REVSLIDER_TEXTDOMAIN);
        ?>
<a class="button-primary revpurple export_slider_standalone copytoclip" data-idt="rev_script_content"  href="javascript:void(0);" original-title=""><?php 
        _e('Mark to Copy', REVSLIDER_TEXTDOMAIN);
        ?>
</a></div>
		<textarea id="rev_script_content" readonly="true" style="width: 100%; height: 100px;"><?php 
        echo $script_content;
        ?>
</textarea>

		<script>
			jQuery('body').on('click','.copytoclip',function() {
				jQuery("#"+jQuery(this).data('idt')).select();
			});
		</script>
		</body>
		</html>
		<?php 
        exit;
    }
Beispiel #4
0
            $style_wrapper .= "background-size: " . $bgFitX . '% ' . $bgFitY . '%;';
        } else {
            $style_wrapper .= "background-size: " . $bgFit . ";";
        }
        if ($bgPosition == 'percentage') {
            $style_wrapper .= "background-position: " . $bgPositionX . '% ' . $bgPositionY . '%;';
        } else {
            $style_wrapper .= "background-position: " . $bgPosition . ";";
        }
        $style_wrapper .= "background-repeat: " . $bgRepeat . ";";
        break;
}
$slideTitle = $slide->getParam("title", "Slide");
$slideOrder = $slide->getOrder();
//treat multilanguage
$isWpmlExists = RevSliderWpml::isWpmlExists();
$useWpml = $slider->getParam("use_wpml", "off");
$wpmlActive = false;
if (!$slide->isStaticSlide()) {
    if ($isWpmlExists && $useWpml == "on") {
        $wpmlActive = true;
        $parentSlide = $slide->getParentSlide();
        $arrChildLangs = $parentSlide->getArrChildrenLangs();
    }
}
?>
<script type="text/javascript">
	
/*
 * Copyright 2015 Small Batch, Inc.
 *
Beispiel #5
0
							<div class="col-handle-inside">
								<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
							</div>
						</span>
						<div class="clear"></div>
						<?php 
    if ($showLangs == true) {
        ?>
							<ul class="list_slide_icons">
								<?php 
        foreach ($arrChildLangs as $arrLang) {
            $isParent = RevSliderFunctions::boolToStr($arrLang["isparent"]);
            $childSlideID = $arrLang["slideid"];
            $lang = $arrLang["lang"];
            $urlFlag = RevSliderWpml::getFlagUrl($lang);
            $langTitle = RevSliderWpml::getLangTitle($lang);
            ?>
									<li>
										<img id="icon_lang_<?php 
            echo $childSlideID;
            ?>
" class="icon_slide_lang" src="<?php 
            echo $urlFlag;
            ?>
" title="<?php 
            echo $langTitle;
            ?>
" data-slideid="<?php 
            echo $childSlideID;
            ?>
" data-lang="<?php 
 /**
  * 
  * get posts by some category
  * could be multiple
  */
 public static function getPostsByCategory($slider_id, $catID, $sortBy = self::SORTBY_ID, $direction = self::ORDER_DIRECTION_DESC, $numPosts = -1, $postTypes = "any", $taxonomies = "category", $arrAddition = array())
 {
     //get post types
     if (strpos($postTypes, ",") !== false) {
         $postTypes = explode(",", $postTypes);
         if (array_search("any", $postTypes) !== false) {
             $postTypes = "any";
         }
     }
     if (empty($postTypes)) {
         $postTypes = "any";
     }
     if (strpos($catID, ",") !== false) {
         $catID = explode(",", $catID);
     } else {
         $catID = array($catID);
     }
     if (RevSliderWpml::isWpmlExists()) {
         //translate categories to languages
         $newcat = array();
         foreach ($catID as $id) {
             $newcat[] = icl_object_id($id, 'category', true);
         }
         $catID = $newcat;
     }
     $query = array('order' => $direction, 'ignore_sticky_posts' => 1, 'posts_per_page' => $numPosts, 'showposts' => $numPosts, 'post_type' => $postTypes);
     //add sort by (could be by meta)
     if (strpos($sortBy, "meta_num_") === 0) {
         $metaKey = str_replace("meta_num_", "", $sortBy);
         $query["orderby"] = "meta_value_num";
         $query["meta_key"] = $metaKey;
     } else {
         if (strpos($sortBy, "meta_") === 0) {
             $metaKey = str_replace("meta_", "", $sortBy);
             $query["orderby"] = "meta_value";
             $query["meta_key"] = $metaKey;
         } else {
             $query["orderby"] = $sortBy;
         }
     }
     //get taxonomies array
     $arrTax = array();
     if (!empty($taxonomies)) {
         $arrTax = explode(",", $taxonomies);
     }
     if (!empty($taxonomies)) {
         $taxQuery = array();
         //add taxomonies to the query
         if (strpos($taxonomies, ",") !== false) {
             //multiple taxomonies
             $taxonomies = explode(",", $taxonomies);
             foreach ($taxonomies as $taxomony) {
                 $taxArray = array('taxonomy' => $taxomony, 'field' => 'id', 'terms' => $catID);
                 $taxQuery[] = $taxArray;
             }
         } else {
             //single taxomony
             $taxArray = array('taxonomy' => $taxonomies, 'field' => 'id', 'terms' => $catID);
             $taxQuery[] = $taxArray;
         }
         $taxQuery['relation'] = 'OR';
         $query['tax_query'] = $taxQuery;
     }
     //if exists taxanomies
     if (!empty($arrAddition)) {
         $query = array_merge($query, $arrAddition);
     }
     $query = apply_filters('revslider_get_posts', $query, $slider_id);
     $objQuery = new WP_Query($query);
     $arrPosts = $objQuery->posts;
     foreach ($arrPosts as $key => $post) {
         if (method_exists($post, "to_array")) {
             $arrPost = $post->to_array();
         } else {
             $arrPost = (array) $post;
         }
         $arrPostCats = self::getPostCategories($post, $arrTax);
         $arrPost["categories"] = $arrPostCats;
         $arrPosts[$key] = $arrPost;
     }
     return $arrPosts;
 }
    /**
     *
     * 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 = RevSliderWpml::isWpmlExists();
        $useWpml = $slider->getParam("use_wpml", "off");
        $wpmlActive = false;
        if ($isWpmlExists && $useWpml == "on") {
            $wpmlActive = true;
            $arrLanguages = RevSliderWpml::getArrLanguages(false);
            //set current lang to output
            $currentLang = RevSliderFunctions::getPostGetVariable("lang");
            if (empty($currentLang)) {
                $currentLang = RevSliderWpml::getCurrentLang();
            }
            if (empty($currentLang)) {
                $currentLang = $arrLanguages[0];
            }
            $output->setLang($currentLang);
            $selectLangChoose = RevSliderFunctions::getHTMLSelect($arrLanguages, $currentLang, "id='select_langs'", true);
        }
        $output->setPreviewMode();
        //put the output html
        $urlPlugin = RS_PLUGIN_URL . 'public/assets/';
        $urlPreviewPattern = RevSliderBase::$url_ajax_actions . "&client_action=preview_slider&sliderid=" . $sliderID . "&lang=[lang]&nonce=[nonce]";
        $nonce = wp_create_nonce("revslider_actions");
        $setBase = is_ssl() ? "https://" : "http://";
        ?>
			<html>
				<head>
					<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
css/settings.css?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
					<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
fonts/font-awesome/css/font-awesome.css?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
					<link rel='stylesheet' href='<?php 
        echo $urlPlugin;
        ?>
fonts/pe-icon-7-stroke/css/pe-icon-7-stroke.css?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
' type='text/css' media='all' />
					<?php 
        $db = new RevSliderDB();
        $styles = $db->fetch(RevSliderGlobals::$table_css);
        $styles = RevSliderCssParser::parseDbArrayToCss($styles, "\n");
        $styles = RevSliderCssParser::compress_css($styles);
        echo '<style type="text/css">' . $styles . '</style>';
        //.$stylesinnerlayers
        $http = is_ssl() ? 'https' : 'http';
        $operations = new RevSliderOperations();
        $arrValues = $operations->getGeneralSettingsValues();
        $set_diff_font = RevSliderFunctions::getVal($arrValues, "change_font_loading", '');
        if ($set_diff_font !== '') {
            $font_url = $set_diff_font;
        } else {
            $font_url = $http . '://fonts.googleapis.com/css?family=';
        }
        $custom_css = RevSliderOperations::getStaticCss();
        echo '<style type="text/css">' . RevSliderCssParser::compress_css($custom_css) . '</style>';
        ?>

					<script type='text/javascript' src='<?php 
        echo $setBase;
        ?>
code.jquery.com/jquery-latest.min.js'></script>

					<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.tools.min.js?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
'></script>
					<script type='text/javascript' src='<?php 
        echo $urlPlugin;
        ?>
js/jquery.themepunch.revolution.min.js?rev=<?php 
        echo RevSliderGlobals::SLIDER_REVISION;
        ?>
'></script>
					
				</head>
				<body style="padding:0px;margin:0px;width:100%;height:100%;position:relative;">
					<?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;
    }
Beispiel #8
0
 /**
  *
  * put html slider on the html page.
  * @param $data - mixed, can be ID ot Alias.
  */
 public function putSliderBase($sliderID, $gal_ids = array(), $markup_export = false, $settings = array(), $order = array())
 {
     $this->markup_export = $markup_export;
     try {
         $slver = apply_filters('revslider_remove_version', RevSliderGlobals::SLIDER_REVISION);
         self::$sliderSerial++;
         $this->slider = new RevSlider();
         if ($sliderID !== '-99') {
             $this->slider->initByMixed($sliderID);
         } else {
             //do default
             $this->slider->initByMixed($sliderID);
         }
         //modify settings if there are any special settings given through the shortcode
         if (!empty($settings)) {
             $this->modify_settings($settings);
         }
         //modify settings for admin preview mode
         if ($this->previewMode == true) {
             $this->modifyPreviewModeSettings();
         }
         //set slider language
         $isWpmlExists = RevSliderWpml::isWpmlExists();
         $useWpml = $this->slider->getParam("use_wpml", "off");
         if ($isWpmlExists && $useWpml == "on") {
             if ($this->previewMode == false) {
                 $this->sliderLang = RevSliderFunctionsWP::getCurrentLangCode();
             }
         }
         //edit html before slider
         $htmlBeforeSlider = "";
         if ($markup_export === true) {
             $htmlBeforeSlider .= '<!-- FONT -->';
         }
         if ($this->slider->getParam("load_googlefont", "false") == "true") {
             $googleFont = $this->slider->getParam("google_font");
             if (is_array($googleFont)) {
                 foreach ($googleFont as $key => $font) {
                 }
             } else {
                 $htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($googleFont);
             }
         }
         $gfonts = $this->slider->getParam("google_font", array());
         if (!empty($gfonts) && is_array($gfonts)) {
             foreach ($gfonts as $gf) {
                 $gf = str_replace(array('"', '+'), array('', ' '), $gf);
                 $htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($gf);
             }
         }
         //add all google fonts of layers
         $gfsubsets = $this->slider->getParam("subsets", array());
         $gf = $this->slider->getUsedFonts(false);
         foreach ($gf as $gfk => $gfv) {
             $tcf = $gfk . ':';
             if (!empty($gfv['variants'])) {
                 $mgfirst = true;
                 foreach ($gfv['variants'] as $mgvk => $mgvv) {
                     if (!$mgfirst) {
                         $tcf .= ',';
                     }
                     $tcf .= $mgvk;
                     $mgfirst = false;
                 }
             }
             if (!empty($gfv['subsets'])) {
                 $mgfirst = true;
                 foreach ($gfv['subsets'] as $ssk => $ssv) {
                     if (array_search(esc_attr($gfk . '+' . $ssv), $gfsubsets) !== false) {
                         if ($mgfirst) {
                             $tcf .= '&subset=';
                         }
                         if (!$mgfirst) {
                             $tcf .= ',';
                         }
                         $tcf .= $ssv;
                         $mgfirst = false;
                     }
                 }
             }
             $htmlBeforeSlider .= RevSliderOperations::getCleanFontImport($tcf);
         }
         if ($markup_export === true) {
             $htmlBeforeSlider .= '<!-- /FONT -->';
         }
         //pub js to body handle
         if ($this->slider->getParam("js_to_body", "false") == "true") {
             $operations = new RevSliderOperations();
             $arrValues = $operations->getGeneralSettingsValues();
             $enable_logs = RevSliderFunctions::getVal($arrValues, "enable_logs", 'off');
             if ($markup_export === true) {
                 $htmlBeforeSlider .= '<!-- SCRIPTINCLUDE -->';
             }
             if ($enable_logs == 'on') {
                 $urlIncludeJS = RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.enablelog.js?rev=' . $slver;
                 $htmlBeforeSlider .= '<script type="text/javascript" src="' . $urlIncludeJS . '"></script>';
             }
             $urlIncludeJS = RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.tools.min.js?rev=' . $slver;
             $htmlBeforeSlider .= '<script type="text/javascript" src="' . $urlIncludeJS . '"></script>';
             $urlIncludeJS = RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.revolution.min.js?rev=' . $slver;
             $htmlBeforeSlider .= '<script type="text/javascript" src="' . $urlIncludeJS . '"></script>';
             if ($markup_export === true) {
                 $htmlBeforeSlider .= '<!-- /SCRIPTINCLUDE -->';
             }
         }
         //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");
         $slider_type = $this->slider->getParam("slider-type");
         //set wrapper height
         $wrapperHeigh = 0;
         $wrapperHeigh += $this->slider->getParam("height");
         //add thumb height
         if ($this->slider->getParam('enable_thumbnails', 'off') == 'on') {
             $wrapperHeigh += $this->slider->getParam('thumb_height');
         }
         $slider_id = $this->slider->getParam('slider_id', '');
         if (trim($slider_id) !== '') {
             $this->sliderHtmlID = $slider_id;
         } else {
             $this->sliderHtmlID = 'rev_slider_' . $sliderID . '_' . self::$sliderSerial;
         }
         $this->sliderHtmlID_wrapper = $this->sliderHtmlID . '_wrapper';
         $containerStyle = "";
         $sliderPosition = $this->slider->getParam("position", "center");
         $do_overflow = '';
         //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;
             }
             if ($this->slider->getParam('main_overflow_hidden', 'on') == 'on') {
                 $do_overflow = ' tp-overflow-hidden';
             }
         }
         //add background color
         $backgroundColor = esc_attr(trim($this->slider->getParam('background_color')));
         if (!empty($backgroundColor)) {
             $containerStyle .= 'background-color:' . $backgroundColor . ';';
         }
         //set padding
         $containerStyle .= 'padding:' . esc_attr($this->slider->getParam('padding', '0')) . 'px;';
         //set margin:
         if ($sliderType != 'fullscreen') {
             if ($sliderPosition != 'center') {
                 $containerStyle .= 'margin-left:' . esc_attr($this->slider->getParam('margin_left', '0', RevSlider::FORCE_NUMERIC)) . 'px;';
                 $containerStyle .= 'margin-right:' . esc_attr($this->slider->getParam('margin_right', '0', RevSlider::FORCE_NUMERIC)) . 'px;';
             }
             $containerStyle .= 'margin-top:' . esc_attr($this->slider->getParam('margin_top', '0', RevSlider::FORCE_NUMERIC)) . 'px;';
             $containerStyle .= 'margin-bottom:' . esc_attr($this->slider->getParam('margin_bottom', '0', RevSlider::FORCE_NUMERIC)) . 'px;';
         }
         //set height and width:
         $bannerStyle = 'display:none;';
         //add background image (to banner style)
         $showBackgroundImage = $this->slider->getParam('show_background_image', 'off');
         if ($showBackgroundImage == 'true' || $showBackgroundImage == 'on') {
             $backgroundImage = esc_attr($this->slider->getParam('background_image'));
             $backgroundFit = esc_attr($this->slider->getParam('bg_fit', $this->slider->getParam('def-background_fit', 'cover')));
             $backgroundRepeat = esc_attr($this->slider->getParam('bg_repeat', $this->slider->getParam('def-bg_repeat', 'no-repeat')));
             $backgroundPosition = esc_attr($this->slider->getParam('bg_position', $this->slider->getParam('def-bg_position', 'center center')));
             if (!empty($backgroundImage)) {
                 $containerStyle .= "background-image:url(" . $backgroundImage . ");background-repeat:" . $backgroundRepeat . ";background-size:" . $backgroundFit . ";background-position:" . $backgroundPosition . ";";
             }
         }
         //set wrapper and slider class:
         $sliderWrapperClass = "rev_slider_wrapper";
         $sliderClass = "rev_slider";
         switch ($sliderType) {
             case "responsitive":
                 //@since 5.0: obsolete now, was custom
             //@since 5.0: obsolete now, was custom
             case "fixed":
                 //@since 5.0: obsolete now
             //@since 5.0: obsolete now
             case 'auto':
             case 'fullwidth':
                 $sliderWrapperClass .= " fullwidthbanner-container";
                 $sliderClass .= " fullwidthabanner";
                 // KRISZTIAN REMOVED SOME LINE
                 //$bannerStyle .= "max-height:".$bannerHeight."px;height:".$bannerHeight."px;";
                 //$containerStyle .= "max-height:".$bannerHeight."px;";
                 break;
             case 'fullscreen':
                 $sliderWrapperClass .= " fullscreen-container";
                 $sliderClass .= " fullscreenbanner";
                 break;
             default:
                 $bannerStyle .= "height:" . $bannerHeight . "px;width:" . $bannerWidth . "px;";
                 $containerStyle .= "height:" . $bannerHeight . "px;width:" . $bannerWidth . "px;";
                 break;
         }
         $maxWidth = $this->slider->getParam('max_width', '0', RevSlider::FORCE_NUMERIC);
         if ($maxWidth > 0 && $this->slider->getParam('slider_type') == 'auto') {
             $containerStyle .= 'max-width:' . $maxWidth . 'px;';
         }
         $htmlTimerBar = "";
         $enable_progressbar = $this->slider->getParam('enable_progressbar', 'on');
         $timerBar = $this->slider->getParam('show_timerbar', 'top');
         $progress_height = $this->slider->getParam('progress_height', '5');
         $progress_opa = $this->slider->getParam('progress_opa', '15');
         $progressbar_color = $this->slider->getParam('progressbar_color', '#000000');
         if ($enable_progressbar !== 'on' || $slider_type == 'hero') {
             $timerBar = 'hide';
         }
         $progress_style = ' style="height: ' . esc_attr($progress_height) . 'px; background-color: ' . RevSliderFunctions::hex2rgba($progressbar_color, $progress_opa) . ';"';
         switch ($timerBar) {
             case "top":
                 $htmlTimerBar = '<div class="tp-bannertimer"' . $progress_style . '></div>';
                 break;
             case "bottom":
                 $htmlTimerBar = '<div class="tp-bannertimer tp-bottom"' . $progress_style . '></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", "outer");
         if ($paddingType == "inner") {
             $sliderWrapperClass .= " tp_inner_padding";
         }
         global $revSliderVersion;
         $add_alias = '';
         if (is_super_admin() || is_admin_bar_showing()) {
             if (current_user_can('edit_theme_options')) {
                 $add_alias = ' data-alias="' . esc_attr($this->slider->getAlias()) . '"';
             }
         }
         echo $htmlBeforeSlider . "\n";
         echo '<div id="' . $this->sliderHtmlID_wrapper . '" class="' . $sliderWrapperClass . '"' . $add_alias;
         $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 '	<div id="' . $this->sliderHtmlID . '"';
         echo ' class="' . $sliderClass . $do_overflow . '"';
         echo ' style="' . $bannerStyle . '"';
         echo ' data-version="' . $revSliderVersion . '">' . "\n";
         echo $this->putSlides($gal_ids, $order);
         echo $htmlTimerBar;
         echo '	</div>' . "\n";
         $this->putJS($markup_export);
         echo '</div>';
         echo '<!-- END REVOLUTION SLIDER -->';
     } catch (Exception $e) {
         $message = $e->getMessage();
         $this->putErrorMessage($message);
     }
 }
_e("Unpublished", 'revslider');
?>
</option>
					</select>
					<span class="description"><?php 
_e("The state of the slide. The unpublished slide will be excluded from the slider.", 'revslider');
?>
</span>
				</p>
				<!-- SLIDE LANGUAGE SELECTOR -->
				<?php 
if (isset($slider) && $slider->isInited()) {
    $isWpmlExists = RevSliderWpml::isWpmlExists();
    $useWpml = $slider->getParam("use_wpml", "off");
    if ($isWpmlExists && $useWpml == "on") {
        $arrLangs = RevSliderWpml::getArrLanguages();
        $curset_lang = RevSliderFunctions::getVal($slideParams, "lang", "all");
        ?>
						<p>
							<label><?php 
        _e("Language", 'revslider');
        ?>
</label>
							<select name="lang">
								<?php 
        if (!empty($arrLangs) && is_array($arrLangs)) {
            foreach ($arrLangs as $lang_handle => $lang_name) {
                $sel = $lang_handle === $curset_lang ? ' selected="selected"' : '';
                echo '<option value="' . $lang_handle . '"' . $sel . '>' . $lang_name . '</option>';
            }
        }
 /**
  * 
  * get slides for output
  * one level only without children
  */
 public function getSlidesForOutput($publishedOnly = false, $lang = 'all')
 {
     $isSlidesFromPosts = $this->isSlidesFromPosts();
     $isSlidesFromStream = $this->isSlidesFromStream();
     if (RevSliderWpml::isWpmlExists()) {
         global $sitepress;
         $sitepress->switch_lang($lang);
     }
     if ($isSlidesFromPosts) {
         $arrParentSlides = $this->getSlidesFromPosts($publishedOnly);
     } elseif ($isSlidesFromStream !== false) {
         $arrParentSlides = $this->getSlidesFromStream($publishedOnly);
     } else {
         $arrParentSlides = $this->getSlides($publishedOnly);
     }
     if ($lang == 'all' || $isSlidesFromPosts || $isSlidesFromStream) {
         return $arrParentSlides;
     }
     $arrSlides = array();
     foreach ($arrParentSlides as $parentSlide) {
         $parentLang = $parentSlide->getLang();
         if ($parentLang == $lang) {
             $arrSlides[] = $parentSlide;
         }
         $childAdded = false;
         $arrChildren = $parentSlide->getArrChildren();
         foreach ($arrChildren as $child) {
             $childLang = $child->getLang();
             if ($childLang == $lang) {
                 $arrSlides[] = $child;
                 $childAdded = true;
                 break;
             }
         }
         if ($childAdded == false && $parentLang == "all") {
             $arrSlides[] = $parentSlide;
         }
     }
     return $arrSlides;
 }
Beispiel #11
0
 /**
  * 
  * get slides for output
  * one level only without children
  */
 public function getSlidesForOutput($publishedOnly = false, $lang = 'all', $gal_ids = array())
 {
     $isSlidesFromPosts = $this->isSlidesFromPosts();
     $isSlidesFromStream = $this->isSlidesFromStream();
     if (RevSliderWpml::isWpmlExists() && $this->getParam('use_wpml', 'off') == 'on') {
         global $sitepress;
         $cur_lang = ICL_LANGUAGE_CODE;
         $sitepress->switch_lang($lang);
         /* NEW: 
         			$wpml_current_language = apply_filters( 'wpml_current_language', null );
         			do_action( 'wpml_switch_language', $lang );
         			*/
     }
     if ($isSlidesFromPosts) {
         $arrParentSlides = $this->getSlidesFromPosts($publishedOnly, $gal_ids);
     } elseif ($isSlidesFromStream !== false) {
         $arrParentSlides = $this->getSlidesFromStream($publishedOnly);
     } else {
         $arrParentSlides = $this->getSlides($publishedOnly);
     }
     if (RevSliderWpml::isWpmlExists() && $this->getParam('use_wpml', 'off') == 'on') {
         //switch language back
         global $sitepress;
         $sitepress->switch_lang($cur_lang);
         // NEW: do_action( 'wpml_switch_language', $wpml_current_language );
     }
     if ($lang == 'all' || $isSlidesFromPosts || $isSlidesFromStream) {
         return $arrParentSlides;
     }
     $arrSlides = array();
     foreach ($arrParentSlides as $parentSlide) {
         $parentLang = $parentSlide->getLang();
         if ($parentLang == $lang) {
             $arrSlides[] = $parentSlide;
         }
         $childAdded = false;
         $arrChildren = $parentSlide->getArrChildren();
         foreach ($arrChildren as $child) {
             $childLang = $child->getLang();
             if ($childLang == $lang) {
                 $arrSlides[] = $child;
                 $childAdded = true;
                 break;
             }
         }
         if ($childAdded == false && $parentLang == "all") {
             $arrSlides[] = $parentSlide;
         }
     }
     return $arrSlides;
 }