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


PHP PBValidation::isNotEmpty方法代码示例

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


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

示例1: processShortcodeCounterListItem

    function processShortcodeCounterListItem($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Validation = new PBValidation();
        if ($Validation->isEmpty($attribute['name'])) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['value'], 0, 99999, false)) {
            return $html;
        }
        $lineCharacterAfter = null;
        $lineCharacterBefore = null;
        if ($Validation->isNotEmpty($this->character['before'])) {
            $lineCharacterBefore = '<span' . PBHelper::createClassAttribute(array('pb-counter-list-value-character-before')) . '>' . esc_html($this->character['before']) . '</span>';
        }
        if ($Validation->isNotEmpty($this->character['after'])) {
            $lineCharacterAfter = '<span' . PBHelper::createClassAttribute(array('pb-counter-list-value-character-after')) . '>' . esc_html($this->character['after']) . '</span>';
        }
        $html = '
			<li class="pb-value-' . (int) $attribute['value'] . '">
				<span class="pb-counter-list-label">' . esc_html($attribute['name']) . '</span>
				<span class="pb-counter-list-value">
					' . $lineCharacterBefore . '
					<span class="pb-counter-list-value-value">' . (int) $attribute['value'] . '</span>
					' . $lineCharacterAfter . '
				</span>
				<span class="pb-counter-list-foreground"></span>
				<span class="pb-counter-list-background"></span>
			</li>
		';
        return PBHelper::formatHTML($html);
    }
开发者ID:slavai,项目名称:sadick,代码行数:33,代码来源:PB.Component.CounterList.class.php

示例2: processShortcodeAccordion

    function processShortcodeAccordion($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Easing = new PBEasing();
        $Validation = new PBValidation();
        if (!$Validation->isNumber($attribute['active'], 0, 999)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['disabled'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['collapsible'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['close_at_start'])) {
            return $html;
        }
        if (!array_key_exists($attribute['height_style'], $this->heightStyle)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['animation_enable'])) {
            return $html;
        }
        if (!$Validation->isNotEmpty($attribute['animation_duration'], 0, 99999)) {
            return $html;
        }
        if (!array_key_exists($attribute['animation_easing'], $Easing->easingType)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['header_font_size'], 0, 100)) {
            return $html;
        }
        $key = array('active', 'disabled', 'collapsible', 'height_style', 'close_at_start', 'animation_enable', 'animation_duration', 'animation_easing');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        $option['header_important_default'] = PBComponentData::get($this->getComponentId(), 'header_important_default');
        $id = PBHelper::createId('pb_accordion');
        $class = array('pb-accordion', 'pb-clear-fix', $attribute['css_class']);
        PBComponentData::set('accordion', 'header_font_size', $attribute['header_font_size'], true);
        $html = '
			<div' . PBHelper::createClassAttribute($class) . ' id="' . esc_attr($id) . '">
				' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$("#' . $id . '").PBAccordion(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
开发者ID:slavai,项目名称:sadick,代码行数:56,代码来源:PB.Component.Accordion.class.php

示例3: processShortcodeSitemap

    function processShortcodeSitemap($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Validation = new PBValidation();
        $argument = array();
        if ($Validation->isNotEmpty($attribute['post_type'])) {
            $argument['post_type'] = explode(',', $attribute['post_type']);
        }
        if ($Validation->isNotEmpty($attribute['post_status'])) {
            $argument['post_status'] = explode(',', $attribute['post_status']);
        }
        if ($Validation->isNotEmpty($attribute['post__in'])) {
            $argument['post__in'] = explode(',', $attribute['post__in']);
        }
        if ($Validation->isNotEmpty($attribute['post__not_in'])) {
            $argument['post__not_in'] = explode(',', $attribute['post__not_in']);
        }
        if ($Validation->isNotEmpty($attribute['posts_per_page'])) {
            $argument['posts_per_page'] = $attribute['posts_per_page'] == -2 ? -1 : $attribute['posts_per_page'];
        }
        if ($Validation->isNotEmpty($attribute['orderby'])) {
            $argument['orderby'] = $attribute['orderby'];
        }
        if ($Validation->isNotEmpty($attribute['order'])) {
            $argument['order'] = $attribute['order'];
        }
        $query = new WP_Query($argument);
        if ($query === false) {
            return $html;
        }
        if ($query->post_count == 0) {
            return $html;
        }
        $class = array(array('pb-sitemap'), array('pb-reset-list'));
        if (array_key_exists($attribute['bullet'], $this->bullet['file'])) {
            array_push($class[0], 'pb-sitemap-bullet-list', 'pb-sitemap-bullet-list-' . PBHelper::createHash($attribute['bullet']));
        }
        global $post;
        $bPost = $post;
        while ($query->have_posts()) {
            $query->the_post();
            $html .= '
				<li id="post-' . get_the_ID() . '" class="' . implode(' ', get_post_class()) . '">
					<a href="' . get_the_permalink() . '">' . get_the_title() . '</a>
				</li>
			';
        }
        $post = $bPost;
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . '>
				<ul' . PBHelper::createClassAttribute($class[1]) . '>' . $html . '</ul>
			</div>
		';
        return PBHelper::formatHTML($html);
    }
开发者ID:annguyenit,项目名称:HawaiiEducation,代码行数:56,代码来源:PB.Component.Sitemap.class.php

示例4: processShortcodeList

 function processShortcodeList($attribute, $content, $tag)
 {
     $attribute = $this->processAttribute($tag, $attribute);
     $Validation = new PBValidation();
     $classBullet = null;
     if ($Validation->isNotEmpty($attribute['bullet'])) {
         $classBullet = 'pb-list-' . PBHelper::createHash($attribute['bullet']);
     }
     $class = array('pb-list', $classBullet, $attribute['css_class']);
     $html = '<div' . PBHelper::createClassAttribute($class) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>';
     return PBHelper::formatHTML($html, $content);
 }
开发者ID:annguyenit,项目名称:HawaiiEducation,代码行数:12,代码来源:PB.Component.List.class.php

示例5: 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);
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:40,代码来源:PB.Component.List.class.php

示例6: processShortcodeClassItem

    function processShortcodeClassItem($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Layout = new PBLayout();
        $Background = new PBBackground();
        $Validation = new PBValidation();
        if ($Validation->isEmpty($content)) {
            return $html;
        }
        $class = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($this->currentLayout, $this->currentIndex));
        $style = array();
        if ($Validation->isNotEmpty($attribute['image_url'])) {
            $style['background-image'] = 'url(\'' . $attribute['image_url'] . '\')';
        }
        if ($Validation->isNotEmpty($attribute['image_position'])) {
            $style['background-position'] = $attribute['image_position'];
        }
        if (array_key_exists($attribute['image_repeat'], $Background->backgroundRepeat)) {
            $style['background-repeat'] = $attribute['image_repeat'];
        }
        if (array_key_exists($attribute['image_size_a'], $Background->backgroundSize)) {
            if (in_array($attribute['image_size_a'], array('length', 'percentage'))) {
                if ($Validation->isNotEmpty($attribute['image_size_b'])) {
                    $style['background-size'] = $attribute['image_size_b'];
                }
            } else {
                $style['background-size'] = $attribute['image_size_a'];
            }
        }
        $html = '
			<li' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '>
				<div>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>
			</li>
		';
        $this->currentIndex++;
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
开发者ID:slavai,项目名称:sadick,代码行数:38,代码来源:PB.Component.Class.class.php

示例7: array

    function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
    {
        $this->iconClass = null;
        $Validation = new PBValidation();
        if ($depth == 0) {
            $this->icon = $object->icon;
            $this->mega_menu_layout_column_index = 0;
            $this->mega_menu_enable = $object->mega_menu_enable;
            $this->mega_menu_layout = $object->mega_menu_layout;
            if ($object->icon != '-1') {
                $this->iconClass = 'pb-menu-icon pb-menu-icon-' . PBHelper::createHash($object->icon);
            }
        }
        $linkClass = array();
        if ($Validation->isNotEmpty($object->target)) {
            array_push($linkClass, 'pb-window-target-blank');
        }
        if ($this->mega_menu_enable == 1) {
            if ($depth == 0 || $depth == 2) {
                $output .= '<li class="' . join(' ', (array) $object->classes) . ($depth == 0 ? ' sf-mega-enable-1' : null) . ' ' . $this->iconClass . ' ' . '">';
            }
            if ($depth == 1) {
                $Layout = new PBLayout();
                $class = array('sf-mega-section', 'pb-layout-' . $Layout->getLayoutColumnCSSClass($this->mega_menu_layout, $this->mega_menu_layout_column_index));
                $output .= '
					<div' . PBHelper::createClassAttribute($class) . '>
				';
                $this->mega_menu_layout_column_index++;
            }
            if ($depth == 1) {
                $output .= '
					<span class="sf-mega-header">' . esc_html($object->title) . '</span>
				';
            } else {
                $output .= '
					<a href="' . esc_attr($object->url) . '"' . PBHelper::createClassAttribute($linkClass) . '><span></span>' . $object->title . '</a>
				';
            }
        } else {
            $output .= '
				<li class="' . join(' ', (array) $object->classes) . ($depth == 0 ? ' sf-mega-enable-0' : null) . ' ' . $this->iconClass . ' ' . '">
					<a href="' . esc_attr($object->url) . '"' . PBHelper::createClassAttribute($linkClass) . '><span></span>' . $object->title . '</a>
			';
        }
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:45,代码来源:PB.MenuWalker.class.php

示例8: 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);
 }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:42,代码来源:PB.Component.Header.class.php

示例9: array

    function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0)
    {
        $level = null;
        $Validation = new PBValidation();
        for ($i = 0; $i < $depth; $i++) {
            $level .= '--';
        }
        if (!is_null($level)) {
            $level .= ' ';
        }
        $linkClass = array();
        if ($Validation->isNotEmpty($object->target)) {
            array_push($linkClass, 'pb-window-target-blank');
        }
        $output .= '
			<li class="' . join(' ', (array) $object->classes) . '">
				<a href="' . esc_attr($object->url) . '"' . PBHelper::createClassAttribute($linkClass) . '>' . $level . $object->title . '</a>
			</li>
		';
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:20,代码来源:PB.MenuWalkerResponsive.class.php

示例10: processShortcodeBlockquote

    function processShortcodeBlockquote($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Validation = new PBValidation();
        if ($Validation->isEmpty($content)) {
            return $html;
        }
        $class = array('pb-blockquote', $attribute['css_class']);
        if ($Validation->isNotEmpty($attribute['author'])) {
            $html = '<div class="pb-blockquote-author">&mdash; ' . $attribute['author'] . '</div>';
        }
        $html = '
			<div' . PBHelper::createClassAttribute($class) . '>
				<blockquote>
					' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
				</blockquote>
				' . $html . '
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content));
    }
开发者ID:annguyenit,项目名称:HawaiiEducation,代码行数:22,代码来源:PB.Component.Blockquote.class.php

示例11: processShortcodeBox


//.........这里部分代码省略.........
        if ($Validation->isNumber($attribute['border_top_width'], 0, 999)) {
            $style[0]['border-top-width'] = $attribute['border_top_width'] . 'px';
        }
        if ($Validation->isColor($attribute['border_top_color'])) {
            $style[0]['border-top-color'] = PBColor::getColor($attribute['border_top_color']);
        }
        if ($Validation->isNumber($attribute['border_top_radius'], 0, 999)) {
            $style[0]['-webkit-border-top-left-radius'] = $attribute['border_top_radius'] . 'px';
            $style[0]['-moz-border-radius-topleft'] = $attribute['border_top_radius'] . 'px';
            $style[0]['border-top-left-radius'] = $attribute['border_top_radius'] . 'px';
        }
        if (array_key_exists($attribute['border_right_style'], $Border->style)) {
            $style[0]['border-right-style'] = $attribute['border_right_style'];
        }
        if ($Validation->isNumber($attribute['border_right_width'], 0, 999)) {
            $style[0]['border-right-width'] = $attribute['border_right_width'] . 'px';
        }
        if ($Validation->isColor($attribute['border_right_color'])) {
            $style[0]['border-right-color'] = PBColor::getColor($attribute['border_right_color']);
        }
        if ($Validation->isNumber($attribute['border_right_radius'], 0, 999)) {
            $style[0]['-webkit-border-top-right-radius'] = $attribute['border_right_radius'] . 'px';
            $style[0]['-moz-border-radius-topright'] = $attribute['border_right_radius'] . 'px';
            $style[0]['border-top-right-radius'] = $attribute['border_right_radius'] . 'px';
        }
        if (array_key_exists($attribute['border_bottom_style'], $Border->style)) {
            $style[0]['border-bottom-style'] = $attribute['border_bottom_style'];
        }
        if ($Validation->isNumber($attribute['border_bottom_width'], 0, 999)) {
            $style[0]['border-bottom-width'] = $attribute['border_bottom_width'] . 'px';
        }
        if ($Validation->isColor($attribute['border_bottom_color'])) {
            $style[0]['border-bottom-color'] = PBColor::getColor($attribute['border_bottom_color']);
        }
        if ($Validation->isNumber($attribute['border_bottom_radius'], 0, 999)) {
            $style[0]['-webkit-border-bottom-right-radius'] = $attribute['border_bottom_radius'] . 'px';
            $style[0]['-moz-border-radius-bottomright'] = $attribute['border_bottom_radius'] . 'px';
            $style[0]['border-bottom-right-radius'] = $attribute['border_bottom_radius'] . 'px';
        }
        if (array_key_exists($attribute['border_left_style'], $Border->style)) {
            $style[0]['border-left-style'] = $attribute['border_left_style'];
        }
        if ($Validation->isNumber($attribute['border_left_width'], 0, 999)) {
            $style[0]['border-left-width'] = $attribute['border_left_width'] . 'px';
        }
        if ($Validation->isColor($attribute['border_left_color'])) {
            $style[0]['border-left-color'] = PBColor::getColor($attribute['border_left_color']);
        }
        if ($Validation->isNumber($attribute['border_left_radius'], 0, 999)) {
            $style[0]['-webkit-border-bottom-left-radius'] = $attribute['border_left_radius'] . 'px';
            $style[0]['-moz-border-radius-bottomleft'] = $attribute['border_left_radius'] . 'px';
            $style[0]['border-bottom-left-radius'] = $attribute['border_left_radius'] . 'px';
        }
        if ($Validation->isNumber($attribute['padding_top'], 0, 999)) {
            $style[0]['padding-top'] = $attribute['padding_top'] . 'px';
        }
        if ($Validation->isNumber($attribute['padding_right'], 0, 999)) {
            $style[0]['padding-right'] = $attribute['padding_right'] . 'px';
        }
        if ($Validation->isNumber($attribute['padding_bottom'], 0, 999)) {
            $style[0]['padding-bottom'] = $attribute['padding_bottom'] . 'px';
        }
        if ($Validation->isNumber($attribute['padding_left'], 0, 999)) {
            $style[0]['padding-left'] = $attribute['padding_left'] . 'px';
        }
        if ($Validation->isColor($attribute['text_color_link'])) {
            $option['out']['color'] = PBColor::getColor($attribute['text_color_link']);
        }
        if ($Validation->isColor($attribute['text_color_link_hover'])) {
            $option['in']['color'] = PBColor::getColor($attribute['text_color_link_hover']);
        }
        $id = PBHelper::createId('pb_box');
        $class[0] = array('pb-box', 'pb-clear-fix', $attribute['css_class']);
        if ($attribute['icon_enable'] == 1) {
            array_push($class[0], 'pb-box-icon');
            array_push($class[0], 'pb-box-icon-size-' . $attribute['icon_size']);
            array_push($class[0], 'pb-box-icon-position-' . $attribute['icon_position']);
            array_push($class[0], 'pb-box-icon-' . PBHelper::createHash($attribute['icon']));
            if ($Validation->isNotEmpty($attribute['icon_background_position'])) {
                $style[1]['background-position'] = $attribute['icon_background_position'];
            }
        }
        $class[1] = array('pb-box-inner');
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style[0]) . ' id="' . $id . '">
				<div' . PBHelper::createClassAttribute($class[1]) . PBHelper::createStyleAttribute($style[1]) . '>
				' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
				</div>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($) 
					{
						$(\'#' . $id . '\').PBBox(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:101,代码来源:PB.Component.Box.class.php

示例12: processShortcodeSitemap

    function processShortcodeSitemap($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Validation = new PBValidation();
        $argument = array();
        if ($Validation->isNotEmpty($attribute['post_type'])) {
            $argument['post_type'] = explode(',', $attribute['post_type']);
        }
        if ($Validation->isNotEmpty($attribute['post_status'])) {
            $argument['post_status'] = explode(',', $attribute['post_status']);
        }
        if ($Validation->isNotEmpty($attribute['post__in'])) {
            $argument['post__in'] = explode(',', $attribute['post__in']);
        }
        if ($Validation->isNotEmpty($attribute['post__not_in'])) {
            $argument['post__not_in'] = explode(',', $attribute['post__not_in']);
        }
        if ($Validation->isNotEmpty($attribute['posts_per_page'])) {
            $argument['posts_per_page'] = $attribute['posts_per_page'] == -2 ? -1 : $attribute['posts_per_page'];
        }
        if ($Validation->isNotEmpty($attribute['orderby'])) {
            $argument['orderby'] = $attribute['orderby'];
        }
        if ($Validation->isNotEmpty($attribute['order'])) {
            $argument['order'] = $attribute['order'];
        }
        $query = new WP_Query($argument);
        if ($query === false) {
            return $html;
        }
        if ($query->post_count == 0) {
            return $html;
        }
        $class = array(array('pb-sitemap'), array('pb-reset-list'));
        if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
            if (array_key_exists($attribute['bullet'], $this->bullet['file'])) {
                array_push($class[0], 'pb-sitemap-icon-type-gr', 'pb-sitemap-icon-name-' . PBHelper::createHash($attribute['bullet']));
            }
        }
        $iconHTML = null;
        if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'fa') {
            if ($Validation->isNotEmpty($attribute['font_icon_name'])) {
                $style = array();
                if ($Validation->isColor($attribute['font_icon_color'])) {
                    $style['color'] = PBColor::getColor($attribute['font_icon_color']);
                }
                if ($Validation->isNumber($attribute['font_icon_size'], 1, 200)) {
                    $style['font-size'] = $attribute['font_icon_size'] . 'px';
                }
                array_push($class[0], 'pb-sitemap-icon-type-fa');
                $iconHTML = '<i class="fa fa-' . esc_attr($attribute['font_icon_name']) . '"' . PBHelper::createStyleAttribute($style) . '></i>';
            }
        }
        global $post;
        $bPost = $post;
        while ($query->have_posts()) {
            $query->the_post();
            $html .= '
				<li id="post-' . get_the_ID() . '" class="' . implode(' ', get_post_class()) . '">
					' . $iconHTML . '
					<a href="' . get_the_permalink() . '">' . preg_replace('/\\<br\\/\\>/', ' ', get_the_title()) . '</a>
				</li>
			';
        }
        $post = $bPost;
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . '>
				<ul' . PBHelper::createClassAttribute($class[1]) . '>' . $html . '</ul>
			</div>
		';
        return PBHelper::formatHTML($html);
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:73,代码来源:PB.Component.Sitemap.class.php

示例13: 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], 'name' => $value[1]);
            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';
        }
        if (PBComponentData::get($this->getComponentId(), 'icon_type') !== 'gr') {
            if ($Validation->isNumber($attribute['font_icon_size'], 1, 200)) {
                $style['font-size'] = $attribute['font_icon_size'] . 'px';
            }
        }
        $borderRadius = null;
        if ($Validation->isNumber($attribute['border_radius_top_left'], 0, 999)) {
            $borderRadius .= ' ' . $attribute['border_radius_top_left'] . 'px';
        }
        if ($Validation->isNumber($attribute['border_radius_top_right'], 0, 999)) {
            $borderRadius .= ' ' . $attribute['border_radius_top_right'] . 'px';
        }
        if ($Validation->isNumber($attribute['border_radius_bottom_right'], 0, 999)) {
            $borderRadius .= ' ' . $attribute['border_radius_bottom_right'] . 'px';
        }
        if ($Validation->isNumber($attribute['border_radius_bottom_left'], 0, 999)) {
            $borderRadius .= ' ' . $attribute['border_radius_bottom_left'] . 'px';
        }
        if ($Validation->isNotEmpty($borderRadius)) {
            $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-style'] = 'solid';
            $style['border-width'] = $attribute['border_width'] . 'px';
            $option['out']['border-width'] = $style['border-width'];
            $option['out']['border-style'] = 'solid';
        }
        if ($Validation->isColor($attribute['bg_color'])) {
            $style['background-color'] = PBColor::getColor($attribute['bg_color']);
            $option['out']['background-color'] = $style['background-color'];
        }
        if (PBComponentData::get($this->getComponentId(), 'icon_type') == 'fa') {
            if ($Validation->isColor($attribute['icon_color'])) {
                $style['color'] = PBColor::getColor($attribute['icon_color']);
                $option['out']['color'] = $style['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';
            $option['in']['border-style'] = 'solid';
        }
        if ($Validation->isColor($attribute['bg_color_hover'])) {
            $option['in']['background-color'] = PBColor::getColor($attribute['bg_color_hover']);
        }
        if (PBComponentData::get($this->getComponentId(), 'icon_type') == 'fa') {
            if ($Validation->isColor($attribute['font_icon_color_hover'])) {
                $option['in']['color'] = PBColor::getColor($attribute['font_icon_color_hover']);
            }
        }
//.........这里部分代码省略.........
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:101,代码来源:PB.Component.SocialIcon.class.php

示例14: processShortcodeTeam

    function processShortcodeTeam($attribute, $content, $tag)
    {
        $html = null;
        $teamHTML = null;
        $option = array();
        $attribute = $this->processAttribute($tag, $attribute);
        $Window = new PBWindow();
        $Easing = new PBEasing();
        $Layout = new PBLayout();
        $Validation = new PBValidation();
        $ImageHover = new PBImageHover();
        $data = $this->getTeam($attribute);
        if ($data === false) {
            return;
        }
        if (!count($data->posts)) {
            return;
        }
        if (!array_key_exists($attribute['template'], $this->template)) {
            return $html;
        }
        if (!array_key_exists($attribute['layout'], $this->layout)) {
            return $html;
        }
        if (!PBFile::isWPImage($attribute['image_size'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['hover_enable'])) {
            return $html;
        }
        if (!array_key_exists($attribute['hover_type'], $ImageHover->type)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['preloader_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['skill_list_waypoint_enable'])) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['skill_list_waypoint_duration'], 0, 99999)) {
            return $html;
        }
        if (!array_key_exists($attribute['skill_list_waypoint_easing'], $Easing->easingType)) {
            return $html;
        }
        $key = array('hover_type', 'hover_enable', 'preloader_enable', 'skill_list_waypoint_enable', 'skill_list_waypoint_easing', 'skill_list_waypoint_duration', 'skill_list_waypoint_offset_trigger');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        $layoutCurrent = '100';
        if ($attribute['template'] == 2) {
            $layoutCurrent = '50x50';
        } elseif ($attribute['template'] == 3) {
            $layoutCurrent = $attribute['layout'];
        }
        global $post;
        $bPost = $post;
        $i = 0;
        while ($data->have_posts()) {
            global $post;
            $data->the_post();
            $full = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
            $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), $attribute['image_size']);
            if ($full == false || $thumbnail == false) {
                continue;
            }
            $meta = PBMeta::get($post);
            PBHelper::removeUIndex($meta, 'team_social', 'team_skill');
            /***/
            $class = array(array(), array());
            $class[0] = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($layoutCurrent, $i));
            $class[1] = array('pb-image-box', 'pb-image-preloader-animation-enable');
            $class[2] = array('pb-image');
            if ($attribute['preloader_enable'] == 1) {
                array_push($class[1], 'pb-image-preloader');
            }
            if ($attribute['hover_enable'] == 1) {
                array_push($class[1], 'pb-image-hover', 'pb-image-hover-type-' . $attribute['hover_type'], 'pb-image-type-image');
            }
            /***/
            $textHTML = null;
            if ($Validation->isNotEmpty($meta['team_first_name']) || $Validation->isNotEmpty($meta['team_second_name'])) {
                $textHTML .= '<h3 class="pb-team-text-box-member-name">' . trim($meta['team_first_name'] . ' ' . $meta['team_second_name']) . '</h3>';
            }
            if ($Validation->isNotEmpty($meta['team_position'])) {
                $textHTML .= '<div class="pb-team-text-box-member-position">' . $meta['team_position'] . '</div>';
            }
            /***/
            $socialHTML = null;
            if (is_array($meta['team_social'])) {
                $social = PBHelper::orderArrayByElement($meta['team_social'], 'team_social_order');
                foreach ($social as $index => $value) {
                    if (!array_key_exists($value['team_social_name'], $this->social)) {
                        continue;
                    }
                    $socialHTML .= '
						<li>
							<a href="' . esc_attr($value['team_social_url']) . '" class="pb-team-social-icon-' . $value['team_social_name'] . ' ' . $Window->getTargetCSSClass('_blank') . '"></a>
						</li>
					';
//.........这里部分代码省略.........
开发者ID:slavai,项目名称:sadick,代码行数:101,代码来源:PB.Component.Team.class.php

示例15: processShortcodeFeatureItemHeader

 function processShortcodeFeatureItemHeader($attribute, $content, $tag)
 {
     $attribute = $this->processAttribute($tag, $attribute);
     $html = null;
     $Window = new PBWindow();
     $Validation = new PBValidation();
     if ($Validation->isEmpty($content)) {
         return $html;
     }
     if (!array_key_exists($this->attrItemURLTarget, $Window->linkTarget)) {
         return $html;
     }
     $content = do_shortcode($content);
     if ($Validation->isNotEmpty($this->attrItemURL)) {
         $class = array($Window->getTargetCSSClass($this->attrItemURLTarget));
         $content = '<a href="' . esc_attr($this->attrItemURL) . '"' . PBHelper::createClassAttribute($class) . '>' . $content . '</a>';
     }
     $class = array('pb-feature-header');
     $html = '<h' . PBComponentData::get($this->getComponentId(), 'header_important_default') . PBHelper::createClassAttribute($class) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</h' . PBComponentData::get($this->getComponentId(), 'header_important_default') . '>';
     return PBHelper::formatHTML($html, $content);
 }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:21,代码来源:PB.Component.Feature.class.php


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