当前位置: 首页>>代码示例>>PHP>>正文


PHP RevSliderWpml::isWpmlExists方法代码示例

本文整理汇总了PHP中RevSliderWpml::isWpmlExists方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderWpml::isWpmlExists方法的具体用法?PHP RevSliderWpml::isWpmlExists怎么用?PHP RevSliderWpml::isWpmlExists使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RevSliderWpml的用法示例。


在下文中一共展示了RevSliderWpml::isWpmlExists方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _e

</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 
开发者ID:johnmanlove,项目名称:Galveston_Island,代码行数:31,代码来源:slider-main-options.php

示例2: previewOutputMarkup

    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;
        ?>
//.........这里部分代码省略.........
开发者ID:hathbanger,项目名称:squab,代码行数:101,代码来源:operations.class.php

示例3:

            $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.
 *
开发者ID:jfbelisle,项目名称:magexpress,代码行数:31,代码来源:slide-editor.php

示例4: getPostsByCategory

 /**
  * 
  * 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;
 }
开发者ID:iq007,项目名称:MadScape,代码行数:87,代码来源:functions-wordpress.class.php

示例5: previewOutput

    /**
     *
     * 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;
//.........这里部分代码省略.........
开发者ID:Sibzsolutions,项目名称:Schiffrinpa,代码行数:101,代码来源:operations.class.php

示例6: putSliderBase

 /**
  *
  * 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;
//.........这里部分代码省略.........
开发者ID:surreal8,项目名称:wptheme,代码行数:101,代码来源:output.class.php

示例7: getSlidesForOutput

 /**
  * 
  * 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;
 }
开发者ID:VLabsInc,项目名称:WordPressPlatforms,代码行数:45,代码来源:slider.class.php

示例8: getSlidesForOutput

 /**
  * 
  * 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;
 }
开发者ID:ksan5835,项目名称:maadithottam,代码行数:56,代码来源:slider.class.php


注:本文中的RevSliderWpml::isWpmlExists方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。