本文整理汇总了PHP中UniteFunctionsRev::boolToStr方法的典型用法代码示例。如果您正苦于以下问题:PHP UniteFunctionsRev::boolToStr方法的具体用法?PHP UniteFunctionsRev::boolToStr怎么用?PHP UniteFunctionsRev::boolToStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UniteFunctionsRev
的用法示例。
在下文中一共展示了UniteFunctionsRev::boolToStr方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
</div>
</span>
<?php
}
// end permission
?>
<div class="clear"></div>
<?php
if ($showLangs == true) {
?>
<ul class="list_slide_icons">
<?php
foreach ($arrChildLangs as $arrLang) {
$isParent = UniteFunctionsRev::boolToStr($arrLang["isparent"]);
$childSlideID = $arrLang["slideid"];
$lang = $arrLang["lang"];
$urlFlag = UniteWpmlRev::getFlagUrl($lang);
$langTitle = UniteWpmlRev::getLangTitle($lang);
?>
<li>
<img id="icon_lang_<?php
echo $childSlideID;
?>
" class="icon_slide_lang" src="<?php
echo $urlFlag;
?>
" title="<?php
echo $langTitle;
?>
示例2: putCreativeLayer
/**
*
* put creative layer
*/
private function putCreativeLayer(RevSlide $slide, $static_slide = false)
{
$layers = $slide->getLayers();
$customAnimations = RevOperations::getCustomAnimations('customin');
//get all custom animations
$customEndAnimations = RevOperations::getCustomAnimations('customout');
//get all custom animations
$startAnimations = RevOperations::getArrAnimations(false);
//only get the standard animations
$endAnimations = RevOperations::getArrEndAnimations(false);
//only get the standard animations
$lazyLoad = $this->slider->getParam("lazy_load", "off");
$isTemplate = $this->slider->getParam("template", "false");
if (empty($layers)) {
return false;
}
$zIndex = 5;
foreach ($layers as $layer) {
$type = UniteFunctionsRev::getVal($layer, "type", "text");
//set if video full screen
$videoclass = '';
$isFullWidthVideo = false;
if ($type == "video") {
$videoclass = ' tp-videolayer';
$videoData = UniteFunctionsRev::getVal($layer, "video_data");
if (!empty($videoData)) {
$videoData = (array) $videoData;
$isFullWidthVideo = UniteFunctionsRev::getVal($videoData, "fullwidth");
$isFullWidthVideo = UniteFunctionsRev::strToBool($isFullWidthVideo);
} else {
$videoData = array();
}
}
$class = UniteFunctionsRev::getVal($layer, "style");
if (trim($class) !== '') {
$this->class_include['.' . trim($class)] = true;
}
//add classname for style inclusion
$animation = UniteFunctionsRev::getVal($layer, "animation", "tp-fade");
if ($animation == "fade") {
$animation = "tp-fade";
}
$customin = '';
if (!array_key_exists($animation, $startAnimations) && array_key_exists($animation, $customAnimations)) {
//if true, add custom animation
$customin .= 'data-customin="';
$animArr = RevOperations::getCustomAnimationByHandle($customAnimations[$animation]);
if ($animArr !== false) {
$customin .= RevOperations::parseCustomAnimationByArray($animArr);
}
$customin .= '"';
$animation = 'customin';
}
if (strpos($animation, 'customin-') !== false || strpos($animation, 'customout-') !== false) {
$animation = "tp-fade";
}
//set output class:
$layer_2d_rotation = intval(UniteFunctionsRev::getVal($layer, "2d_rotation", '0'));
$layer_2d_origin_x = intval(UniteFunctionsRev::getVal($layer, "2d_origin_x", '50'));
$layer_2d_origin_y = intval(UniteFunctionsRev::getVal($layer, "2d_origin_y", '50'));
if ($layer_2d_rotation == 0) {
$outputClass = "tp-caption " . trim($class);
} else {
$outputClass = "tp-caption ";
}
$outputClass = trim($outputClass) . " ";
$outputClass .= trim($animation);
$left = UniteFunctionsRev::getVal($layer, "left", 0);
$top = UniteFunctionsRev::getVal($layer, "top", 0);
$speed = UniteFunctionsRev::getVal($layer, "speed", 300);
$time = UniteFunctionsRev::getVal($layer, "time", 0);
$easing = UniteFunctionsRev::getVal($layer, "easing", "easeOutExpo");
$randomRotate = UniteFunctionsRev::getVal($layer, "random_rotation", "false");
$randomRotate = UniteFunctionsRev::boolToStr($randomRotate);
$splitin = UniteFunctionsRev::getVal($layer, "split", "none");
$splitout = UniteFunctionsRev::getVal($layer, "endsplit", "none");
$elementdelay = intval(UniteFunctionsRev::getVal($layer, "splitdelay", 0));
$endelementdelay = intval(UniteFunctionsRev::getVal($layer, "endsplitdelay", 0));
if ($elementdelay > 0) {
$elementdelay /= 100;
}
if ($endelementdelay > 0) {
$endelementdelay /= 100;
}
$text = UniteFunctionsRev::getVal($layer, "text");
if (function_exists('qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage')) {
//use qTranslate
$text = qtrans_useCurrentLanguageIfNotFoundUseDefaultLanguage($text);
}
$htmlVideoAutoplay = "";
$htmlVideoAutoplayOnlyFirstTime = "";
$htmlVideoNextSlide = "";
$htmlVideoThumbnail = "";
$htmlMute = '';
$htmlCover = '';
$htmlDotted = '';
//.........这里部分代码省略.........
示例3: putCreativeLayer
/**
*
* put creative layer
*/
private function putCreativeLayer(RevSlide $slide)
{
$layers = $slide->getLayers();
if (empty($layers)) {
return false;
}
?>
<?php
foreach ($layers as $layer) {
$type = UniteFunctionsRev::getVal($layer, "type", "text");
//set if video full screen
$isFullWidthVideo = false;
if ($type == "video") {
$videoData = UniteFunctionsRev::getVal($layer, "video_data");
if (!empty($videoData)) {
$videoData = (array) $videoData;
$isFullWidthVideo = UniteFunctionsRev::getVal($videoData, "fullwidth");
$isFullWidthVideo = UniteFunctionsRev::strToBool($isFullWidthVideo);
} else {
$videoData = array();
}
}
$class = UniteFunctionsRev::getVal($layer, "style");
$animation = UniteFunctionsRev::getVal($layer, "animation", "fade");
//set output class:
$outputClass = "tp-caption " . trim($class);
$outputClass = trim($outputClass) . " ";
$outputClass .= trim($animation);
$left = UniteFunctionsRev::getVal($layer, "left", 0);
$top = UniteFunctionsRev::getVal($layer, "top", 0);
$speed = UniteFunctionsRev::getVal($layer, "speed", 300);
$time = UniteFunctionsRev::getVal($layer, "time", 0);
$easing = UniteFunctionsRev::getVal($layer, "easing", "easeOutExpo");
$randomRotate = UniteFunctionsRev::getVal($layer, "random_rotation", "false");
$randomRotate = UniteFunctionsRev::boolToStr($randomRotate);
$text = UniteFunctionsRev::getVal($layer, "text");
$htmlVideoAutoplay = "";
$htmlVideoNextSlide = "";
//set html:
$html = "";
switch ($type) {
default:
case "text":
$html = $text;
$html = do_shortcode($html);
break;
case "image":
$urlImage = UniteFunctionsRev::getVal($layer, "image_url");
$html = '<img src="' . $urlImage . '" alt="' . $text . '">';
$imageLink = UniteFunctionsRev::getVal($layer, "link", "");
if (!empty($imageLink)) {
$openIn = UniteFunctionsRev::getVal($layer, "link_open_in", "same");
$target = "";
if ($openIn == "new") {
$target = ' target="_blank"';
}
$html = '<a href="' . $imageLink . '"' . $target . '>' . $html . '</a>';
}
break;
case "video":
$videoType = trim(UniteFunctionsRev::getVal($layer, "video_type"));
$videoID = trim(UniteFunctionsRev::getVal($layer, "video_id"));
$videoWidth = trim(UniteFunctionsRev::getVal($layer, "video_width"));
$videoHeight = trim(UniteFunctionsRev::getVal($layer, "video_height"));
$videoArgs = trim(UniteFunctionsRev::getVal($layer, "video_args"));
if ($isFullWidthVideo == true) {
$videoWidth = "100%";
$videoHeight = "100%";
}
switch ($videoType) {
case "youtube":
if (empty($videoArgs)) {
$videoArgs = GlobalsRevSlider::DEFAULT_YOUTUBE_ARGUMENTS;
}
$html = "<iframe src='http://www.youtube.com/embed/{$videoID}?{$videoArgs}' width='{$videoWidth}' height='{$videoHeight}' style='width:{$videoWidth}px;height:{$videoHeight}px;'></iframe>";
break;
case "vimeo":
if (empty($videoArgs)) {
$videoArgs = GlobalsRevSlider::DEFAULT_VIMEO_ARGUMENTS;
}
$html = "<iframe src='http://player.vimeo.com/video/{$videoID}?{$videoArgs}' width='{$videoWidth}' height='{$videoHeight}' style='width:{$videoWidth}px;height:{$videoHeight}px;'></iframe>";
break;
case "html5":
$html = $this->getHtml5LayerHtml($videoData);
break;
default:
UniteFunctionsRev::throwError("wrong video type: {$videoType}");
break;
}
//set video autoplay, with backward compatability
if (array_key_exists("autoplay", $videoData)) {
$videoAutoplay = UniteFunctionsRev::getVal($videoData, "autoplay");
} else {
//backword compatability
$videoAutoplay = UniteFunctionsRev::getVal($layer, "video_autoplay");
}
//.........这里部分代码省略.........
示例4: putCreativeLayer
/**
*
* put creative layer
*/
private function putCreativeLayer(RevSlide $slide)
{
$layers = $slide->getLayers();
$customAnimations = RevOperations::getCustomAnimations('customin');
//get all custom animations
$customEndAnimations = RevOperations::getCustomAnimations('customout');
//get all custom animations
$startAnimations = RevOperations::getArrAnimations(false);
//only get the standard animations
$endAnimations = RevOperations::getArrEndAnimations(false);
//only get the standard animations
$lazyLoad = $this->slider->getParam("lazy_load", "off");
if (empty($layers)) {
return false;
}
$zIndex = 2;
foreach ($layers as $layer) {
$type = UniteFunctionsRev::getVal($layer, "type", "text");
//set if video full screen
$isFullWidthVideo = false;
if ($type == "video") {
$videoData = UniteFunctionsRev::getVal($layer, "video_data");
if (!empty($videoData)) {
$videoData = (array) $videoData;
$isFullWidthVideo = UniteFunctionsRev::getVal($videoData, "fullwidth");
$isFullWidthVideo = UniteFunctionsRev::strToBool($isFullWidthVideo);
} else {
$videoData = array();
}
}
$class = UniteFunctionsRev::getVal($layer, "style");
$animation = UniteFunctionsRev::getVal($layer, "animation", "tp-fade");
if ($animation == "fade") {
$animation = "tp-fade";
}
$customin = '';
if (!array_key_exists($animation, $startAnimations) && array_key_exists($animation, $customAnimations)) {
//if true, add custom animation
$customin .= 'data-customin="';
$animArr = RevOperations::getCustomAnimationByHandle($customAnimations[$animation]);
if ($animArr !== false) {
$customin .= RevOperations::parseCustomAnimationByArray($animArr);
}
$customin .= '"';
$animation = 'customin';
}
if (strpos($animation, 'customin-') !== false || strpos($animation, 'customout-') !== false) {
$animation = "tp-fade";
}
//set output class:
$outputClass = "tp-caption " . trim($class);
$outputClass = trim($outputClass) . " ";
$outputClass .= trim($animation);
$left = UniteFunctionsRev::getVal($layer, "left", 0);
$top = UniteFunctionsRev::getVal($layer, "top", 0);
$speed = UniteFunctionsRev::getVal($layer, "speed", 300);
$time = UniteFunctionsRev::getVal($layer, "time", 0);
$easing = UniteFunctionsRev::getVal($layer, "easing", "easeOutExpo");
$randomRotate = UniteFunctionsRev::getVal($layer, "random_rotation", "false");
$randomRotate = UniteFunctionsRev::boolToStr($randomRotate);
$splitin = UniteFunctionsRev::getVal($layer, "split", "none");
$splitout = UniteFunctionsRev::getVal($layer, "endsplit", "none");
$elementdelay = intval(UniteFunctionsRev::getVal($layer, "splitdelay", 0));
$endelementdelay = intval(UniteFunctionsRev::getVal($layer, "endsplitdelay", 0));
if ($elementdelay > 0) {
$elementdelay /= 100;
}
if ($endelementdelay > 0) {
$endelementdelay /= 100;
}
$text = UniteFunctionsRev::getVal($layer, "text");
$htmlVideoAutoplay = "";
$htmlVideoAutoplayOnlyFirstTime = "";
$htmlVideoNextSlide = "";
$htmlVideoThumbnail = "";
$htmlMute = '';
$htmlCover = '';
$htmlDotted = '';
$htmlRatio = '';
$htmlRewind = '';
$ids = UniteFunctionsRev::getVal($layer, "attrID");
$classes = UniteFunctionsRev::getVal($layer, "attrClasses");
$title = UniteFunctionsRev::getVal($layer, "attrTitle");
$rel = UniteFunctionsRev::getVal($layer, "attrRel");
$ids = $ids != '' ? ' id="' . $ids . '"' : '';
$classes = $classes != '' ? ' ' . $classes : '';
$title = $title != '' ? ' title="' . $title . '"' : '';
$rel = $rel != '' ? ' rel="' . $rel . '"' : '';
$max_width = UniteFunctionsRev::getVal($layer, "max_width", 'auto');
$max_height = UniteFunctionsRev::getVal($layer, "max_height", 'auto');
$white_space = UniteFunctionsRev::getVal($layer, "whitespace", 'nowrap');
$inline_styles = '';
//set html:
$html = "";
switch ($type) {
default:
//.........这里部分代码省略.........
示例5: putCreativeLayer
/**
*
* put creative layer
*/
private function putCreativeLayer($slide)
{
$layers = $slide["layers"];
$layers = UniteFunctionsRev::convertStdClassToArray($layers);
if (empty($layers)) {
return false;
}
?>
<?php
foreach ($layers as $layer) {
$type = UniteFunctionsRev::getVal($layer, "type", "text");
$class = UniteFunctionsRev::getVal($layer, "style");
$animation = UniteFunctionsRev::getVal($layer, "animation", "fade");
//set output class:
$outputClass = "tp-caption " . trim($class);
$outputClass = trim($outputClass) . " ";
$outputClass .= trim($animation);
$left = UniteFunctionsRev::getVal($layer, "left", 0);
$top = UniteFunctionsRev::getVal($layer, "top", 0);
$speed = UniteFunctionsRev::getVal($layer, "speed", 300);
$time = UniteFunctionsRev::getVal($layer, "time", 0);
$easing = UniteFunctionsRev::getVal($layer, "easing", "easeOutExpo");
$randomRotate = UniteFunctionsRev::getVal($layer, "random_rotation", "false");
$randomRotate = UniteFunctionsRev::boolToStr($randomRotate);
$text = UniteFunctionsRev::getVal($layer, "text");
$htmlVideoAutoplay = "";
//set html:
//set html:
$html = "";
switch ($type) {
default:
case "text":
$html = $text;
break;
case "image":
$urlImage = UniteFunctionsRev::getVal($layer, "image_url");
$html = '<img src="' . $urlImage . '" alt="' . $text . '">';
$imageLink = UniteFunctionsRev::getVal($layer, "link", "");
if (!empty($imageLink)) {
$openIn = UniteFunctionsRev::getVal($layer, "link_open_in", "same");
$target = "";
if ($openIn == "new") {
$target = ' target="_blank"';
}
$html = '<a href="' . $imageLink . '"' . $target . '>' . $html . '</a>';
}
break;
case "video":
$videoType = trim(UniteFunctionsRev::getVal($layer, "video_type"));
$videoID = trim(UniteFunctionsRev::getVal($layer, "video_id"));
$videoWidth = trim(UniteFunctionsRev::getVal($layer, "video_width"));
$videoHeight = trim(UniteFunctionsRev::getVal($layer, "video_height"));
$linkYoutube = "http://www.youtube.com";
$linkVimeo = "http://player.vimeo.com";
if (JURI::getInstance()->isSSL() == true) {
$linkYoutube = "https://www.youtube.com";
$linkVimeo = "https://player.vimeo.com";
}
switch ($videoType) {
case "youtube":
$html = "<iframe src='{$linkYoutube}/embed/{$videoID}?hd=1&wmode=opaque&controls=1&showinfo=0;rel=0' width='{$videoWidth}' height='{$videoHeight}' style='width:{$videoWidth}px;height:{$videoHeight}px;'></iframe>";
break;
case "vimeo":
$html = "<iframe src='{$linkVimeo}/video/{$videoID}?title=0&byline=0&portrait=0' width='{$videoWidth}' height='{$videoHeight}' style='width:{$videoWidth}px;height:{$videoHeight}px;'></iframe>";
break;
default:
UniteFunctionsRev::throwError("wrong video type: {$videoType}");
break;
}
$videoAutoplay = UniteFunctionsRev::getVal($layer, "video_autoplay");
if ($videoAutoplay == "true") {
$htmlVideoAutoplay = ' data-autoplay="true"';
}
break;
}
//handle end transitions:
$endTime = trim(UniteFunctionsRev::getVal($layer, "endtime"));
$htmlEnd = "";
if (!empty($endTime)) {
$htmlEnd = "data-end=\"{$endTime}\"";
$endSpeed = trim(UniteFunctionsRev::getVal($layer, "endspeed"));
if (!empty($endSpeed)) {
$htmlEnd .= " data-endspeed=\"{$endSpeed}\"";
}
$endEasing = trim(UniteFunctionsRev::getVal($layer, "endeasing"));
if (!empty($endSpeed) && $endEasing != "nothing") {
$htmlEnd .= " data-endeasing=\"{$endEasing}\"";
}
//add animation to class
$endAnimation = trim(UniteFunctionsRev::getVal($layer, "endanimation"));
if (!empty($endAnimation) && $endAnimation != "auto") {
$outputClass .= " " . $endAnimation;
}
}
//slide link
$htmlLink = "";
//.........这里部分代码省略.........
示例6: putCreativeLayer
/**
*
* put creative layer
*/
public function putCreativeLayer(RevSlide $slide)
{
$layers = $slide->getLayers();
if (empty($layers)) {
return false;
}
?>
<?php
foreach ($layers as $layer) {
$type = UniteFunctionsRev::getVal($layer, "type", "text");
$class = UniteFunctionsRev::getVal($layer, "style");
$animation = UniteFunctionsRev::getVal($layer, "animation", "fade");
//set output class:
$outputClass = "caption " . trim($class);
$outputClass = trim($outputClass) . " ";
$outputClass .= trim($animation);
$left = UniteFunctionsRev::getVal($layer, "left", 0);
$top = UniteFunctionsRev::getVal($layer, "top", 0);
$speed = UniteFunctionsRev::getVal($layer, "speed", 300);
$time = UniteFunctionsRev::getVal($layer, "time", 0);
$easing = UniteFunctionsRev::getVal($layer, "easing", "easeOutExpo");
$randomRotate = UniteFunctionsRev::getVal($layer, "random_rotation", "false");
$randomRotate = UniteFunctionsRev::boolToStr($randomRotate);
$text = UniteFunctionsRev::getVal($layer, "text");
//set html:
$html = "";
switch ($type) {
default:
case "text":
$html = $text;
$html = do_shortcode($html);
break;
case "image":
$urlImage = UniteFunctionsRev::getVal($layer, "image_url");
$html = '<img src="' . $urlImage . '" alt="' . $text . '">';
$imageLink = UniteFunctionsRev::getVal($layer, "link", "");
if (!empty($imageLink)) {
$openIn = UniteFunctionsRev::getVal($layer, "link_open_in", "same");
$target = "";
if ($openIn == "new") {
$target = ' target="_blank"';
}
$html = '<a href="' . $imageLink . '"' . $target . '>' . $html . '</a>';
}
break;
case "video":
$videoType = trim(UniteFunctionsRev::getVal($layer, "video_type"));
$videoID = trim(UniteFunctionsRev::getVal($layer, "video_id"));
$videoWidth = trim(UniteFunctionsRev::getVal($layer, "video_width"));
$videoHeight = trim(UniteFunctionsRev::getVal($layer, "video_height"));
switch ($videoType) {
case "youtube":
$html = "<iframe src='http://www.youtube.com/embed/{$videoID}?hd=1&wmode=opaque&controls=1&showinfo=0' width='{$videoWidth}' height='{$videoHeight}'></iframe>";
break;
case "vimeo":
$html = "<iframe src='http://player.vimeo.com/video/{$videoID}?title=0&byline=0&portrait=0' width='{$videoWidth}' height='{$videoHeight}'></iframe>";
break;
default:
UniteFunctionsRev::throwError("wrong video type: {$videoType}");
break;
}
break;
}
?>
<div class="<?php
echo $outputClass;
?>
"
data-x="<?php
echo $left;
?>
"
data-y="<?php
echo $top;
?>
"
data-speed="<?php
echo $speed;
?>
"
data-start="<?php
echo $time;
?>
"
data-easing="<?php
echo $easing;
?>
"><?php
echo $html;
?>
</div>
<?php
}
?>
<?php
//.........这里部分代码省略.........