本文整理汇总了PHP中PBValidation::isColor方法的典型用法代码示例。如果您正苦于以下问题:PHP PBValidation::isColor方法的具体用法?PHP PBValidation::isColor怎么用?PHP PBValidation::isColor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PBValidation
的用法示例。
在下文中一共展示了PBValidation::isColor方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processShortcodeDivider
function processShortcodeDivider($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Align = new PBAlign();
$Border = new PBBorder();
$Validation = new PBValidation();
$style = array();
$class = array('pb-divider', 'pb-clear-fix');
if ($Validation->isNumber($attribute['line_width'], 0, 9999)) {
$style['width'] = $attribute['line_width'] . 'px';
}
if ($Validation->isNumber($attribute['line_height'], 0, 9999)) {
$style['border-bottom-width'] = $attribute['line_height'] . 'px';
}
if (array_key_exists($attribute['line_style'], $Border->style)) {
$style['border-style'] = $attribute['line_style'];
}
if ($Validation->isColor($attribute['line_color'])) {
$style['border-color'] = PBColor::getColor($attribute['line_color']);
}
if (array_key_exists($attribute['align'], $Align->align)) {
array_push($class, $Align->getCSSClass($attribute['align']));
}
if ($Validation->isNumber($attribute['margin_top'], 0, 9999)) {
$style['margin-top'] = $attribute['margin_top'] . 'px';
}
if ($Validation->isNumber($attribute['margin_bottom'], 0, 9999)) {
$style['margin-bottom'] = $attribute['margin_bottom'] . 'px';
}
array_push($class, $attribute['css_class']);
$html = '
<div' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '></div>
';
return PBHelper::formatHTML($html);
}
示例2: processShortcodeScreenPreloader
function processShortcodeScreenPreloader($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$Validation = new PBValidation();
if (!$Validation->isColor($attribute['bg_color'])) {
return $html;
}
if (!$Validation->isNumber($attribute['z_index'], 0, 999999)) {
return $html;
}
$style = array();
$class = array('pb-screen-preloader', $attribute['css_class']);
$style['z-index'] = $attribute['z_index'];
$style['background-color'] = PBColor::getColor($attribute['bg_color']);
$id = PBHelper::createId('pb_screen_preloader');
$html = '
<div' . PBHelper::createStyleAttribute($style) . PBHelper::createClassAttribute($class) . ' id="' . esc_attr($id) . '"></div>
<div class="pb-script-tag">
<script type="text/javascript">
jQuery(document).ready(function($)
{
$(\'#' . $id . '\').PBScreenPreloader();
});
</script>
</div>
';
return PBHelper::formatHTML($html);
}
示例3: processShortcodeVerticalGrid
function processShortcodeVerticalGrid($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$Validation = new PBValidation();
$this->lineNumber = 0;
$this->lineStyle = array('even' => array('name' => null, 'value' => null), 'odd' => array('name' => null, 'value' => null));
if ($Validation->isEmpty($content)) {
return $html;
}
$style = array();
if ($Validation->isNumber($attribute['column_name_width'], 1, 100)) {
$style['odd']['name']['width'] = $attribute['column_name_width'] . '%';
$style['even']['name']['width'] = $attribute['column_name_width'] . '%';
}
if ($Validation->isNumber($attribute['column_value_width'], 1, 100)) {
$style['odd']['value']['width'] = $attribute['column_value_width'] . '%';
$style['even']['value']['width'] = $attribute['column_value_width'] . '%';
}
if ($Validation->isColor($attribute['line_even_column_name_text_color'])) {
$style['even']['name']['color'] = PBColor::getColor($attribute['line_even_column_name_text_color']);
}
if ($Validation->isColor($attribute['line_even_column_value_text_color'])) {
$style['even']['value']['color'] = PBColor::getColor($attribute['line_even_column_value_text_color']);
}
if ($Validation->isColor($attribute['line_even_column_name_bg_color'])) {
$style['even']['name']['background-color'] = PBColor::getColor($attribute['line_even_column_name_bg_color']);
}
if ($Validation->isColor($attribute['line_even_column_value_bg_color'])) {
$style['even']['value']['background-color'] = PBColor::getColor($attribute['line_even_column_value_bg_color']);
}
if ($Validation->isColor($attribute['line_odd_column_name_text_color'])) {
$style['odd']['name']['color'] = PBColor::getColor($attribute['line_odd_column_name_text_color']);
}
if ($Validation->isColor($attribute['line_odd_column_value_text_color'])) {
$style['odd']['value']['color'] = PBColor::getColor($attribute['line_odd_column_value_text_color']);
}
if ($Validation->isColor($attribute['line_odd_column_name_bg_color'])) {
$style['odd']['name']['background-color'] = PBColor::getColor($attribute['line_odd_column_name_bg_color']);
}
if ($Validation->isColor($attribute['line_odd_column_value_bg_color'])) {
$style['odd']['value']['background-color'] = PBColor::getColor($attribute['line_odd_column_value_bg_color']);
}
$this->lineStyle['even']['name'] = PBHelper::createStyleAttribute($style['even']['name']);
$this->lineStyle['even']['value'] = PBHelper::createStyleAttribute($style['even']['value']);
$this->lineStyle['odd']['name'] = PBHelper::createStyleAttribute($style['odd']['name']);
$this->lineStyle['odd']['value'] = PBHelper::createStyleAttribute($style['odd']['value']);
$class = array('pb-vertical-grid', 'pb-clear-fix', $attribute['css_class']);
$html = '
<div' . PBHelper::createClassAttribute($class) . '>
<ul' . PBHelper::createClassAttribute(array('pb-reset-list')) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</ul>
</div>
';
return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
}
示例4: processShortcodeHeader
function processShortcodeHeader($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$style = array();
$Font = new PBFont();
$Header = new PBHeader();
$Validation = new PBValidation();
if ($Validation->isEmpty($content)) {
return $html;
}
if (!array_key_exists($attribute['important'], $Header->important)) {
return $html;
}
if (!$Validation->isBool($attribute['underline_enable'])) {
return $html;
}
if ($Validation->isNumber($attribute['font_size'], 1, 200, true)) {
$style['font-size'] = $attribute['font_size'] . 'px';
}
if (array_key_exists($attribute['font_weight'], $Font->weight)) {
$style['font-weight'] = $attribute['font_weight'];
}
if (array_key_exists($attribute['font_style'], $Font->style)) {
$style['font-style'] = $attribute['font_style'];
}
if ($Validation->isColor($attribute['font_color'])) {
$style['color'] = PBColor::getColor($attribute['font_color']);
}
if ($Validation->isColor($attribute['background_color'])) {
$style['background-color'] = PBColor::getColor($attribute['background_color']);
}
if ($Validation->isNotEmpty($attribute['line_height'])) {
$style['line-height'] = $attribute['line_height'];
}
if ($Validation->isNumber($attribute['text_indent'], 0, 999)) {
$style['text-indent'] = $attribute['text_indent'] . 'px';
}
$class = array(array('pb-header', $attribute['css_class']), array('pb-header-content'), array('pb-header-underline'));
$html = '<h' . (int) $attribute['important'] . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style) . '><span' . PBHelper::createClassAttribute($class[1]) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</span>' . ($attribute['underline_enable'] == 1 ? '<span' . PBHelper::createClassAttribute($class[2]) . '></span>' : null) . '</h' . (int) $attribute['important'] . '>';
return PBHelper::formatHTML($html, $content);
}
示例5: processShortcodeDropcap
function processShortcodeDropcap($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Validation = new PBValidation();
$style = array();
$class = array('pb-dropcap', 'pb-clear-fix', $attribute['css_class']);
if ($Validation->isNumber($attribute['font_size'], 1, 100)) {
$style['font-size'] = $attribute['font_size'] . 'px';
}
if ($Validation->isColor($attribute['font_color'])) {
$style['color'] = PBColor::getColor($attribute['font_color']);
}
if ($Validation->isColor($attribute['bg_color'])) {
$style['background-color'] = PBColor::getColor($attribute['bg_color']);
}
$letter = mb_substr($content, 0, 1);
$content = mb_substr($content, 1);
$html = '
<p' . PBHelper::createClassAttribute($class) . '>
<span class="pb-dropcap-first-letter" ' . PBHelper::createStyleAttribute($style) . '>' . $letter . '</span>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
</p>
';
return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
}
示例6: getColor
static function getColor($color)
{
$Validation = new PBValidation();
if (!$Validation->isColor($color, false)) {
return false;
}
if ($color === 'transparent') {
return $color;
}
$length = strlen($color);
if ($length == 6) {
return '#' . $color;
}
if ($length == 8) {
return self::HEX2RGBA($color);
}
return false;
}
示例7: processShortcodeList
function processShortcodeList($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Validation = new PBValidation();
if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
$classBullet = null;
if ($Validation->isNotEmpty($attribute['bullet'])) {
$classBullet = 'pb-list-icon-name-' . PBHelper::createHash($attribute['bullet']);
}
$class = array('pb-list', 'pb-list-icon-type-gr', $classBullet, $attribute['css_class']);
} else {
$class = array('pb-list', 'pb-list-icon-type-fa', $attribute['css_class']);
}
$id = PBHelper::createId('pb_list');
$html = '<div' . PBHelper::createClassAttribute($class) . ' id="' . esc_attr($id) . '">' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>';
if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'fa' && $Validation->isNotEmpty($attribute['font_icon_name'])) {
$option = array();
$option['icon_type'] = 'fa';
if ($Validation->isNotEmpty($attribute['font_icon_name'])) {
$option['font_icon_name'] = $attribute['font_icon_name'];
}
if ($Validation->isColor($attribute['font_icon_color'])) {
$option['font_icon_color'] = $attribute['font_icon_color'];
}
if ($Validation->isNumber($attribute['font_icon_size'], 1, 200)) {
$option['font_icon_size'] = $attribute['font_icon_size'];
}
$html .= '
<div class="pb-script-tag">
<script type="text/javascript">
jQuery(document).ready(function($)
{
$(\'#' . $id . '\').PBList(' . json_encode($option) . ');
});
</script>
</div>
';
}
return PBHelper::formatHTML($html, $content);
}
示例8: processShortcodeSocialIcon
function processShortcodeSocialIcon($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$style = array();
$social = array();
$Window = new PBWindow();
$Validation = new PBValidation();
if (!array_key_exists($attribute['target'], $Window->linkTarget)) {
return $html;
}
if (!$Validation->isBool($attribute['native_color_enable'])) {
return $html;
}
foreach ($this->social as $index => $value) {
$url = 'profile_' . $index . '_url';
$order = 'profile_' . $index . '_order';
PBHelper::removeUIndex($attribute, $url, $order);
if (!$Validation->isURL($attribute[$url])) {
continue;
}
$orderValue = (int) $attribute[$order];
$socialData = array('id' => $index, 'url' => $attribute[$url]);
if ($Validation->isNumber($attribute[$order], 0, 99)) {
if (isset($social[$orderValue])) {
array_push($social, $socialData);
} else {
$social[$orderValue] = $socialData;
}
} else {
array_push($social, $socialData);
}
}
ksort($social);
if (!count($social)) {
return;
}
$option = array('in' => array(), 'out' => array());
if ($Validation->isNumber($attribute['width'], 0, 999)) {
$style['width'] = $attribute['width'] . 'px';
}
if ($Validation->isNumber($attribute['height'], 0, 999)) {
$style['height'] = $attribute['height'] . 'px';
}
$borderRadius = null;
if ($Validation->isNumber($attribute['border_radius_top_left'], 0, 999)) {
$borderRadius .= ' ' . $attribute['border_radius_top_left'] . 'px';
} else {
$borderRadius .= ' 0px';
}
if ($Validation->isNumber($attribute['border_radius_top_right'], 0, 999)) {
$borderRadius .= ' ' . $attribute['border_radius_top_right'] . 'px';
} else {
$borderRadius .= ' 0px';
}
if ($Validation->isNumber($attribute['border_radius_bottom_right'], 0, 999)) {
$borderRadius .= ' ' . $attribute['border_radius_bottom_right'] . 'px';
} else {
$borderRadius .= ' 0px';
}
if ($Validation->isNumber($attribute['border_radius_bottom_left'], 0, 999)) {
$borderRadius .= ' ' . $attribute['border_radius_bottom_left'] . 'px';
} else {
$borderRadius .= ' 0px';
}
$borderRadius = trim($borderRadius);
$style['-webkit-border-radius'] = $borderRadius;
$style['-moz-border-radius'] = $borderRadius;
$style['border-radius'] = $borderRadius;
if ($Validation->isNumber($attribute['border_width'], 0, 999)) {
$style['border-width'] = $attribute['border_width'] . 'px';
$option['out']['border-width'] = $style['border-width'];
}
if ($Validation->isColor($attribute['bg_color'])) {
$style['background-color'] = PBColor::getColor($attribute['bg_color']);
$option['out']['background-color'] = $style['background-color'];
}
if ($Validation->isColor($attribute['border_color'])) {
$style['border-color'] = PBColor::getColor($attribute['border_color']);
$option['out']['border-color'] = $style['border-color'];
}
if ($Validation->isNumber($attribute['border_width_hover'], 0, 999)) {
$option['in']['border-width'] = $attribute['border_width_hover'] . 'px';
}
if ($Validation->isColor($attribute['bg_color_hover'])) {
$option['in']['background-color'] = PBColor::getColor($attribute['bg_color_hover']);
}
if ($Validation->isColor($attribute['border_color_hover'])) {
$option['in']['border-color'] = PBColor::getColor($attribute['border_color_hover']);
}
foreach ($social as $index => $value) {
$class = array('pb-social-icon-' . $value['id'], $Window->getTargetCSSClass($attribute['target']));
$html .= '
<li><a href="' . esc_attr($value['url']) . '"' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '></a></li>
';
}
$id = PBHelper::createId('pb_social_icon');
$class = array('pb-social-icon');
if ($attribute['native_color_enable'] == 1) {
array_push($class, 'pb-social-icon-color-native');
//.........这里部分代码省略.........
示例9: processShortcodeCallToActionButton
function processShortcodeCallToActionButton($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$style = array();
$option = array();
$Window = new PBWindow();
$Validation = new PBValidation();
$src = !$Validation->isEmpty($attribute['src']) ? $attribute['src'] : '#';
$class = array($Window->getTargetCSSClass($attribute['src_target']));
if ($Validation->isColor($attribute['text_color'])) {
$style['color'] = PBColor::getColor($attribute['text_color']);
$option['out']['color'] = $style['color'];
}
if ($Validation->isColor($attribute['bg_color'])) {
$style['background-color'] = PBColor::getColor($attribute['bg_color']);
$option['out']['background-color'] = $style['background-color'];
}
if ($Validation->isColor($attribute['border_color'])) {
$style['border-color'] = PBColor::getColor($attribute['border_color']);
$option['out']['border-color'] = $style['border-color'];
}
if ($Validation->isColor($attribute['text_color_hover'])) {
$option['in']['color'] = PBColor::getColor($attribute['text_color_hover']);
}
if ($Validation->isColor($attribute['bg_color_hover'])) {
$option['in']['background-color'] = PBColor::getColor($attribute['bg_color_hover']);
}
if ($Validation->isColor($attribute['border_color_hover'])) {
$option['in']['border-color'] = PBColor::getColor($attribute['border_color_hover']);
}
if ($Validation->isNumber($attribute['padding_top'], 0, 9999)) {
$style['padding-top'] = $attribute['padding_top'] . 'px';
}
if ($Validation->isNumber($attribute['padding_right'], 0, 9999)) {
$style['padding-right'] = $attribute['padding_right'] . 'px';
}
if ($Validation->isNumber($attribute['padding_bottom'], 0, 9999)) {
$style['padding-bottom'] = $attribute['padding_bottom'] . 'px';
}
if ($Validation->isNumber($attribute['padding_left'], 0, 9999)) {
$style['padding-left'] = $attribute['padding_left'] . 'px';
}
if ($Validation->isNumber($attribute['margin_top'], -9999, 9999)) {
$style['margin-top'] = $attribute['margin_top'] . 'px';
}
if ($Validation->isNumber($attribute['margin_bottom'], -9999, 9999)) {
$style['margin-bottom'] = $attribute['margin_bottom'] . 'px';
}
$html = '
<div>
<a href="' . $src . '"' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '<i class="pb-button-arrow pb-button-arrow-right"></i></a>
<input type="hidden" value="' . esc_attr(json_encode($option)) . '"/>
</div>
';
return PBHelper::formatHTML($html, $content);
}
示例10: processShortcodeBoxHeader
function processShortcodeBoxHeader($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$style = array();
$Align = new PBAlign();
$Header = new PBHeader();
$Validation = new PBValidation();
if ($Validation->isEmpty($content)) {
return $html;
}
if (!array_key_exists($attribute['align'], $Align->align)) {
return $html;
}
if (!array_key_exists($attribute['important'], $Header->important)) {
return $html;
}
if ($Validation->isColor($attribute['text_color'])) {
$style['color'] = PBColor::getColor($attribute['text_color']);
}
$class = array('pb-box-header', 'pb-clear-fix', $Align->getCSSClass($attribute['align']));
$html = '
<h' . $attribute['important'] . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</h' . $attribute['important'] . '>
';
return PBHelper::formatHTML($html, $content);
}
示例11: processShortcodeButton
function processShortcodeButton($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$option = array();
$class = array_fill(0, 4, array());
$style = array_fill(0, 4, array());
$Font = new PBFont();
$Window = new PBWindow();
$Border = new PBBorder();
$Validation = new PBValidation();
if ($Validation->isEmpty($content)) {
return $html;
}
if ($Validation->isEmpty($attribute['src'])) {
return $html;
}
if (!$Validation->isBool($attribute['arrow_enable'])) {
return $html;
}
if (!$Validation->isBool($attribute['icon_enable'])) {
return $html;
}
if (!array_key_exists($attribute['size'], $this->buttonSize)) {
return $html;
}
if (!array_key_exists($attribute['src_target'], $Window->linkTarget)) {
return $html;
}
if ($attribute['icon_enable'] == 1) {
if ($Validation->isEmpty($attribute['icon'])) {
return $html;
}
if (!in_array($attribute['icon_position'], array_keys($this->buttonIconPosition))) {
return $html;
}
}
/***/
if ($Validation->isColor($attribute['text_color'])) {
$style[1]['color'] = PBColor::getColor($attribute['text_color']);
$option['out']['color'] = $style[1]['color'];
}
if ($Validation->isColor($attribute['bg_color'])) {
$style[1]['background-color'] = PBColor::getColor($attribute['bg_color']);
$option['out']['background-color'] = $style[1]['background-color'];
}
if ($attribute['border_style'] != -1) {
if (array_key_exists($attribute['border_style'], $Border->style)) {
$style[1]['border-style'] = $attribute['border_style'];
$option['out']['border-style'] = $style[1]['border-style'];
}
}
if ($Validation->isColor($attribute['border_color'])) {
$style[1]['border-color'] = PBColor::getColor($attribute['border_color']);
$option['out']['border-color'] = $style[1]['border-color'];
}
if ($Validation->isNumber($attribute['border_width'], 0, 999)) {
$style[1]['border-width'] = $attribute['border_width'] . 'px';
$option['out']['border-width'] = $style[1]['border-width'];
}
if ($Validation->isNumber($attribute['border_radius'], 0, 999)) {
$style[1]['border-radius'] = $attribute['border_radius'] . 'px';
$option['out']['border-radius'] = $style[1]['border-radius'];
}
if ($attribute['font_weight'] != -1) {
if (array_key_exists($attribute['font_weight'], $Font->weight)) {
$style[1]['font-weight'] = $attribute['font_weight'];
$option['out']['font-weight'] = $style[1]['font-weight'];
}
}
/***/
if ($Validation->isColor($attribute['text_color_hover'])) {
$option['in']['color'] = PBColor::getColor($attribute['text_color_hover']);
}
if ($Validation->isColor($attribute['bg_color_hover'])) {
$option['in']['background-color'] = PBColor::getColor($attribute['bg_color_hover']);
}
if ($attribute['border_style_hover'] != -1) {
if (array_key_exists($attribute['border_style_hover'], $Border->style)) {
$option['in']['border-style'] = $attribute['border_style_hover'];
}
}
if ($Validation->isColor($attribute['border_color_hover'])) {
$option['in']['border-color'] = PBColor::getColor($attribute['border_color_hover']);
}
if ($Validation->isNumber($attribute['border_width_hover'], 0, 999)) {
$option['in']['border-width'] = $attribute['border_width_hover'] . 'px';
}
if ($Validation->isNumber($attribute['border_radius_hover'], 0, 999)) {
$option['in']['border-radius'] = $attribute['border_radius_hover'] . 'px';
}
if ($attribute['font_weight'] != -1) {
if (array_key_exists($attribute['font_weight_hover'], $Font->weight)) {
$option['in']['font-weight'] = $attribute['font_weight_hover'];
}
}
/***/
$class[0] = array('pb-button');
$class[1] = array($Window->getTargetCSSClass($attribute['src_target']));
$class[2] = array('pb-button-icon');
//.........这里部分代码省略.........
示例12: processShortcodeFeature
function processShortcodeFeature($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$html = null;
$Border = new PBBorder();
$Layout = new PBLayout();
$Easing = new PBEasing();
$Validation = new PBValidation();
$CarouFredSel = new PBCarouFredSel();
/***/
if (!array_key_exists($attribute['layout'], $this->layout)) {
return $html;
}
if (!array_key_exists($attribute['icon_position'], $this->iconPosition)) {
return $html;
}
if (!$Validation->isBool($attribute['carousel_autoplay_enable'])) {
return $html;
}
if (!$Validation->isBool($attribute['carousel_circular_enable'])) {
return $html;
}
if (!$Validation->isBool($attribute['carousel_infinite_enable'])) {
return $html;
}
if (!$Validation->isBool($attribute['carousel_scroll_pause_hover'])) {
return $html;
}
if (!array_key_exists($attribute['carousel_scroll_fx'], $CarouFredSel->scrollFX)) {
return $html;
}
if (!array_key_exists($attribute['carousel_scroll_easing'], $Easing->easingType)) {
return $html;
}
if (!$Validation->isNumber($attribute['carousel_scroll_duration'], 0, 99999)) {
return $html;
}
if (!array_key_exists($attribute['waypoint_type'], $this->waypointType)) {
return $html;
}
if (!$Validation->isNumber($attribute['waypoint_duration'], 0, 99999)) {
return $html;
}
if (!$Validation->isNumber($attribute['waypoint_opacity_initial'], 0, 100)) {
return $html;
}
if (!array_key_exists($attribute['icon_size'], $this->icon)) {
return $html;
}
/***/
$this->attrLayout = $attribute['layout'];
$this->attrLayoutColumnIndex = 0;
$option = array();
$key = array('carousel_enable', 'carousel_autoplay_enable', 'carousel_circular_enable', 'carousel_infinite_enable', 'carousel_scroll_pause_hover', 'carousel_scroll_fx', 'carousel_scroll_easing', 'carousel_scroll_duration');
foreach ($key as $index) {
$option['carousel'][$index] = $attribute[$index];
}
$key = array('waypoint_type', 'waypoint_easing', 'waypoint_duration', 'waypoint_offset_trigger', 'waypoint_opacity_initial');
foreach ($key as $index) {
$option['waypoint'][$index] = $attribute[$index];
}
/**/
$this->style = array('odd' => array(), 'even' => array());
foreach ($this->style as $index => $value) {
if (PBComponentData::get($this->getComponentId(), 'icon_type') !== 'gr') {
if ($Validation->isColor($attribute['element_' . $index . '_icon_color'])) {
$this->style[$index]['color'] = PBColor::getColor($attribute['element_' . $index . '_icon_color']);
}
}
if ($Validation->isColor($attribute['element_' . $index . '_icon_bg_color'])) {
$this->style[$index]['background-color'] = PBColor::getColor($attribute['element_' . $index . '_icon_bg_color']);
}
if (array_key_exists($attribute['element_' . $index . '_icon_border_style'], $Border->style)) {
$this->style[$index]['border-style'] = $attribute['element_' . $index . '_icon_border_style'];
}
if ($Validation->isColor($attribute['element_' . $index . '_icon_border_color'])) {
$this->style[$index]['border-color'] = PBColor::getColor($attribute['element_' . $index . '_icon_border_color']);
}
if ($Validation->isNumber($attribute['element_' . $index . '_icon_border_width'], 0, 999)) {
$this->style[$index]['border-width'] = $attribute['element_' . $index . '_icon_border_width'] . 'px';
}
if ($Validation->isNumber($attribute['element_' . $index . '_icon_border_radius'], 0, 100)) {
$this->style[$index]['border-radius'] = $attribute['element_' . $index . '_icon_border_radius'] . '%';
}
}
/**/
$this->attrIconSize = $attribute['icon_size'];
$this->attrIconPosition = $attribute['icon_position'];
$id = PBHelper::createId('pb_feature');
$class = array(array('pb-feature', 'pb-feature-icon-size-' . $attribute['icon_size'], 'pb-feature-icon-position-' . $attribute['icon_position'], 'pb-clear-fix'), array($Layout->getLayoutCSSClass($attribute['layout']), 'pb-reset-list', 'pb-clear-fix'));
if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
array_push($class[0], 'pb-feature-icon-type-gr');
} else {
array_push($class[0], 'pb-feature-icon-type-fa');
}
array_push($class[0], $attribute['css_class']);
$html = '
<div' . PBHelper::createClassAttribute($class[0]) . ' id="' . $id . '">
<ul' . PBHelper::createClassAttribute($class[1]) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</ul>
<div class="pb-slider-pagination"></div>
//.........这里部分代码省略.........
示例13: processShortcodeGoogleMapMapTypeStyle
function processShortcodeGoogleMapMapTypeStyle($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Validation = new PBValidation();
$data = array();
$style = array();
if (array_key_exists($attribute['feature_type'], $this->mapTypeStyleFeatureType)) {
if ($attribute['feature_type'] != 'all') {
$data['featureType'] = $attribute['feature_type'];
}
}
if (array_key_exists($attribute['element_type'], $this->mapTypeStyleElementType)) {
if ($attribute['element_type'] != 'all') {
$data['elementType'] = $attribute['element_type'];
}
}
if ($Validation->isColor($attribute['hue'], false)) {
$style[]['hue'] = PBColor::getColor($attribute['hue']);
}
if ($Validation->isNumber($attribute['lightness'], -100, 100, false)) {
$style[]['lightness'] = $attribute['lightness'];
}
if ($Validation->isNumber($attribute['saturation'], -100, 100, false)) {
$style[]['saturation'] = $attribute['saturation'];
}
if ($Validation->isFloat($attribute['gamma'], 0, 10, false)) {
$style[]['gamma'] = $attribute['gamma'];
}
if ($Validation->isBool($attribute['inverse_lightness'])) {
$style[]['inverse_lightness'] = $attribute['inverse_lightness'];
}
if (array_key_exists($attribute['visibility'], $this->mapTypeStyleVisibility)) {
$style[]['visibility'] = $attribute['visibility'];
}
if ($Validation->isColor($attribute['color'], false)) {
$style[]['color'] = PBColor::getColor($attribute['color']);
}
if ($Validation->isNumber($attribute['weight'], 1, 999, false)) {
$style[]['weight'] = $attribute['weight'];
}
$data['stylers'] = $style;
return ',' . json_encode($data);
}
示例14: processShortcodeNoticeSecondLine
function processShortcodeNoticeSecondLine($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$style = array();
$Validation = new PBValidation();
if ($Validation->isColor($attribute['text_color'])) {
$style['color'] = PBColor::getColor($attribute['text_color']);
}
$class = array('pb-notice-second-line');
$html = '
<p' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</p>
';
return PBHelper::formatHTML($html, $content);
}
示例15: processShortcodeLayout
function processShortcodeLayout($attribute, $content, $tag)
{
$attribute = $this->processAttribute($tag, $attribute);
$Border = new PBBorder();
$Layout = new PBLayout();
$Background = new PBBackground();
$Validation = new PBValidation();
$style = array();
$option = array();
if (!$Layout->isLayout($attribute['layout'])) {
return;
}
if (!$Layout->isLayoutLine($attribute['layout_line'])) {
return;
}
if (!$Validation->isBool($attribute['bg_parallax_enable'])) {
return;
}
if (!$Validation->isBool($attribute['bg_parallax_mobile_enable'])) {
return;
}
if (!$Validation->isNumber($attribute['bg_parallax_speed'], 0, 100)) {
return;
}
if ($Validation->isColor($attribute['bg_color'])) {
$style['background-color'] = PBColor::getColor($attribute['bg_color']);
}
if ($Validation->isNotEmpty($attribute['bg_position'])) {
$style['background-position'] = $attribute['bg_position'];
}
if ($Validation->isNotEmpty($attribute['bg_repeat'])) {
$style['background-repeat'] = $attribute['bg_repeat'];
}
if ($Validation->isNotEmpty($attribute['bg_image'])) {
$style['background-image'] = 'url(\'' . $attribute['bg_image'] . '\')';
}
if ($Validation->isNotEmpty($attribute['bg_size_a'])) {
if (array_key_exists($attribute['bg_size_a'], $Background->backgroundSize)) {
if (in_array($attribute['bg_size_a'], array('length', 'percentage'))) {
if ($Validation->isNotEmpty($attribute['bg_size_b'])) {
$style['background-size'] = $attribute['bg_size_b'];
}
} else {
$style['background-size'] = $attribute['bg_size_a'];
}
}
}
if (!$Validation->isBool($attribute['video_loop'])) {
return;
}
if (!$Validation->isBool($attribute['video_muted'])) {
return;
}
if (!$Validation->isBool($attribute['video_autoplay'])) {
return;
}
if (!$Validation->isBool($attribute['video_control'])) {
return;
}
if ($Validation->isNotEmpty($attribute['padding_top'])) {
$style['padding-top'] = (int) $attribute['padding_top'] . 'px';
}
if ($Validation->isNotEmpty($attribute['padding_right'])) {
$style['padding-right'] = (int) $attribute['padding_right'] . 'px';
}
if ($Validation->isNotEmpty($attribute['padding_bottom'])) {
$style['padding-bottom'] = (int) $attribute['padding_bottom'] . 'px';
}
if ($Validation->isNotEmpty($attribute['padding_left'])) {
$style['padding-left'] = (int) $attribute['padding_left'] . 'px';
}
if (array_key_exists($attribute['border_top_style'], $Border->style)) {
$style['border-top-style'] = $attribute['border_top_style'];
}
if ($Validation->isNumber($attribute['border_top_width'], 0, 999)) {
$style['border-top-width'] = $attribute['border_top_width'] . 'px';
}
if ($Validation->isColor($attribute['border_top_color'])) {
$style['border-top-color'] = PBColor::getColor($attribute['border_top_color']);
}
if (array_key_exists($attribute['border_right_style'], $Border->style)) {
$style['border-right-style'] = $attribute['border_right_style'];
}
if ($Validation->isNumber($attribute['border_right_width'], 0, 999)) {
$style['border-right-width'] = $attribute['border_right_width'] . 'px';
}
if ($Validation->isColor($attribute['border_right_color'])) {
$style['border-right-color'] = PBColor::getColor($attribute['border_right_color']);
}
if (array_key_exists($attribute['border_bottom_style'], $Border->style)) {
$style['border-bottom-style'] = $attribute['border_bottom_style'];
}
if ($Validation->isNumber($attribute['border_bottom_width'], 0, 999)) {
$style['border-bottom-width'] = $attribute['border_bottom_width'] . 'px';
}
if ($Validation->isColor($attribute['border_bottom_color'])) {
$style['border-bottom-color'] = PBColor::getColor($attribute['border_bottom_color']);
}
if (array_key_exists($attribute['border_left_style'], $Border->style)) {
$style['border-left-style'] = $attribute['border_left_style'];
//.........这里部分代码省略.........