本文整理汇总了PHP中RevSliderFunctions::getHTMLSelect方法的典型用法代码示例。如果您正苦于以下问题:PHP RevSliderFunctions::getHTMLSelect方法的具体用法?PHP RevSliderFunctions::getHTMLSelect怎么用?PHP RevSliderFunctions::getHTMLSelect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RevSliderFunctions
的用法示例。
在下文中一共展示了RevSliderFunctions::getHTMLSelect方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form
/**
*
* the form
*/
public function form($instance)
{
try {
$slider = new RevSlider();
$arrSliders = $slider->getArrSlidersShort();
} catch (Exception $e) {
}
if (empty($arrSliders)) {
echo __("No sliders found, Please create a slider", REVSLIDER_TEXTDOMAIN);
} else {
$field = "rev_slider";
$fieldPages = "rev_slider_pages";
$fieldCheck = "rev_slider_homepage";
$fieldTitle = "rev_slider_title";
$sliderID = RevSliderFunctions::getVal($instance, $field);
$homepage = RevSliderFunctions::getVal($instance, $fieldCheck);
$pagesValue = RevSliderFunctions::getVal($instance, $fieldPages);
$title = RevSliderFunctions::getVal($instance, $fieldTitle);
$fieldID = $this->get_field_id($field);
$fieldName = $this->get_field_name($field);
$select = RevSliderFunctions::getHTMLSelect($arrSliders, $sliderID, 'name="' . $fieldName . '" id="' . $fieldID . '"', true);
$fieldID_check = $this->get_field_id($fieldCheck);
$fieldName_check = $this->get_field_name($fieldCheck);
$checked = "";
if ($homepage == "on") {
$checked = "checked='checked'";
}
$fieldPages_ID = $this->get_field_id($fieldPages);
$fieldPages_Name = $this->get_field_name($fieldPages);
$fieldTitle_ID = $this->get_field_id($fieldTitle);
$fieldTitle_Name = $this->get_field_name($fieldTitle);
?>
<label for="<?php
echo $fieldTitle_ID;
?>
"><?php
_e("Title", REVSLIDER_TEXTDOMAIN);
?>
:</label>
<input type="text" name="<?php
echo $fieldTitle_Name;
?>
" id="<?php
echo $fieldTitle_ID;
?>
" value="<?php
echo $title;
?>
" class="widefat">
<br><br>
<?php
_e("Choose Slider", REVSLIDER_TEXTDOMAIN);
?>
: <?php
echo $select;
?>
<div style="padding-top:10px;"></div>
<label for="<?php
echo $fieldID_check;
?>
"><?php
_e("Home Page Only", REVSLIDER_TEXTDOMAIN);
?>
:</label>
<input type="checkbox" name="<?php
echo $fieldName_check;
?>
" id="<?php
echo $fieldID_check;
?>
" <?php
echo $checked;
?>
>
<br><br>
<label for="<?php
echo $fieldPages_ID;
?>
"><?php
_e("Pages: (example: 2,10)", REVSLIDER_TEXTDOMAIN);
?>
</label>
<input type="text" name="<?php
echo $fieldPages_Name;
?>
" id="<?php
echo $fieldPages_ID;
?>
" value="<?php
echo $pagesValue;
?>
">
//.........这里部分代码省略.........
示例2: RevSlide
$patternViewSlide = self::getViewUrl("slide", "id=[slideid]");
//init slide object
$slide = new RevSlide();
$slide->initByID($slideID);
$slideParams = $slide->getParams();
$operations = new RevSliderOperations();
//init slider object
$sliderID = $slide->getSliderID();
$slider = new RevSlider();
$slider->initByID($sliderID);
$sliderParams = $slider->getParams();
$arrSlideNames = $slider->getArrSlideNames();
$arrSlides = $slider->getSlides(false);
$arrSlidesWPML = $slider->getSlidesWPML(false, $slide);
$arrSliders = $slider->getArrSlidersShort($sliderID);
$selectSliders = RevSliderFunctions::getHTMLSelect($arrSliders, "", "id='selectSliders'", true);
//check if slider is template
$sliderTemplate = $slider->getParam("template", "false");
//set slide delay
$sliderDelay = $slider->getParam("delay", "9000");
$slideDelay = $slide->getParam("delay", "");
if (empty($slideDelay)) {
$slideDelay = $sliderDelay;
}
//add tools.min.js
wp_enqueue_script('tp-tools', RS_PLUGIN_URL . 'public/assets/js/jquery.themepunch.tools.min.js', array(), RevSliderGlobals::SLIDER_REVISION);
$arrLayers = $slide->getLayers();
//set Layer settings
$cssContent = $operations->getCaptionsContent();
$arrCaptionClasses = $operations->getArrCaptionClasses($cssContent);
//$arrCaptionClassesSorted = $operations->getArrCaptionClasses($cssContent);
示例3: 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;
//.........这里部分代码省略.........
示例4: 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;
?>
//.........这里部分代码省略.........
示例5: count
$numSlides = count($arrSlides);
$linksSliderSettings = self::getViewUrl(RevSliderAdmin::VIEW_SLIDER, 'id=' . $sliderID);
//treat in case of slides from gallery
if ($slider->isSlidesFromPosts() == false) {
//removed in 5.0
} else {
//slides from posts
$sourceType = $slider->getParam('source_type', 'posts');
$showSortBy = $sourceType == 'posts' ? true : false;
//get button links
$urlNewPost = RevSliderFunctionsWP::getUrlNewPost();
$linkNewPost = RevSliderFunctions::getHtmlLink($urlNewPost, '<i class="revicon-pencil-1"></i>' . __('New Post', REVSLIDER_TEXTDOMAIN), 'button_new_post', 'button-primary revblue', true);
//get ordering
$arrSortBy = RevSliderFunctionsWP::getArrSortBy();
$sortBy = $slider->getParam('post_sortby', RevSlider::DEFAULT_POST_SORTBY);
$selectSortBy = RevSliderFunctions::getHTMLSelect($arrSortBy, $sortBy, "id='select_sortby'", true);
?>
<div class="wrap settings_wrap">
<div class="title_line">
<div id="icon-options-general" class="icon32"></div>
<div class="view_title"><?php
_e('Edit Posts', REVSLIDER_TEXTDOMAIN);
?>
: <?php
echo $slider->getTitle();
?>
</div>
</div>
<div class="vert_sap"></div>