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


PHP PBHelper::createHash方法代码示例

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


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

示例1: 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

示例2: 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

示例3: start_el

    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

示例4: createCSS

 function createCSS($code = null, $retina = false)
 {
     $CSS = new PBCSS();
     $url = $retina ? $this->icon_url_retina : $this->icon_url;
     $codeCurrent = null;
     foreach ($this->icon_file as $value) {
         $codeCurrent .= $CSS->create(array('selector' => array('.pb-menu .pb-menu-default>ul>li.pb-menu-icon.pb-menu-icon-' . PBHelper::createHash($value) . '>a>span'), 'property' => array('background-image' => $url . $value)));
     }
     if ($retina) {
         $codeCurrent = $CSS->getRetinaMediaQuery($codeCurrent);
     }
     $code .= $codeCurrent;
     if (PBData::get('retina_ready') == 1 && !$retina) {
         $this->createCSS($code, true);
         return;
     }
     PBComponentData::set($this->getComponentId(), 'css', $code);
 }
开发者ID:slavai,项目名称:sadick,代码行数:18,代码来源:PB.Component.Menu.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: 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

示例7: processShortcodeButton


//.........这里部分代码省略.........
        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');
        $class[3] = array('pb-button-content');
        array_push($class[0], 'pb-button-size-' . $attribute['size']);
        if ($attribute['icon_enable'] == 1) {
            array_push($class[0], 'pb-button-icon');
            array_push($class[0], 'pb-button-icon-position-' . $attribute['icon_position']);
            array_push($class[2], 'pb-button-icon-' . PBHelper::createHash($attribute['icon']));
        }
        $class[0][] = $attribute['css_class'];
        $id = PBHelper::createId('pb_button');
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . ' id="' . $id . '">
				<a href="' . esc_attr($attribute['src']) . '"' . PBHelper::createClassAttribute($class[1]) . PBHelper::createStyleAttribute($style[1]) . '>
					<span class="pb-button-box">
						<span' . PBHelper::createClassAttribute($class[2]) . PBHelper::createStyleAttribute($style[2]) . '></span>
						<span' . PBHelper::createClassAttribute($class[3]) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . ($attribute['arrow_enable'] == 1 ? '<i class="pb-button-arrow pb-button-arrow-right"></i>' : null) . '</span>
					</span>
				</a>
				<div class="pb-script-tag">
					<script type="text/javascript">
						jQuery(document).ready(function($) 
						{
							$(\'#' . $id . '\').PBButton(' . json_encode($option) . ');
						});
					</script>
				</div>
			</div>
		';
        return PBHelper::formatHTML($html, $content);
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:101,代码来源:PB.Component.Button.class.php

示例8: processShortcodePricingPlanItemFeature

    function processShortcodePricingPlanItemFeature($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Validation = new PBValidation();
        if ($Validation->isEmpty($content)) {
            return $html;
        }
        $item = explode("\n", $content);
        $content = null;
        foreach ($item as $value) {
            $content .= '<li>' . do_shortcode($value) . '</li>';
        }
        $class = array('pb-reset-list');
        $html = '
			<ul' . PBHelper::createClassAttribute($class) . '>
				' . $content . '
			</ul>
		';
        if (array_key_exists($attribute['bullet'], $this->bullet['file'])) {
            $class = array('pb-pricing-plan-item-feature-list', 'pb-pricing-plan-item-feature-list-' . PBHelper::createHash($attribute['bullet']));
            $html = '
				<div' . PBHelper::createClassAttribute($class) . '>
					' . $html . '
				</div>
			';
        }
        return PBHelper::formatHTML($html);
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:29,代码来源:PB.Component.PricingPlan.class.php

示例9: processShortcodeFeatureItem

    function processShortcodeFeatureItem($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Layout = new PBLayout();
        $this->attrItemURL = $attribute['item_url'];
        $this->attrItemURLTarget = $attribute['item_url_target'];
        if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
            if (!array_key_exists($attribute['item_icon'], $this->icon[$this->attrIconSize]['file'])) {
                return $html;
            }
        }
        $position = $this->attrLayoutColumnIndex % 2 == 0 ? 'even' : 'odd';
        $class = array(array('pb-layout-' . $Layout->getLayoutColumnCSSClass($this->attrLayout, $this->attrLayoutColumnIndex), 'pb-feature-element-' . $position), array('pb-feature-icon'));
        if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'gr') {
            array_push($class[1], 'pb-feature-icon-' . PBHelper::createHash($attribute['item_icon']));
        }
        $style = $this->style[$position];
        $element = array(null, null, null);
        $element[0] = '<div' . PBHelper::createClassAttribute($class[1]) . PBHelper::createStyleAttribute($style) . '>';
        if (PBComponentData::get($this->getComponentId(), 'icon_type') === 'fa') {
            $styleFontIcon = array();
            if (array_key_exists('color', $style)) {
                $styleFontIcon['color'] = $style['color'];
            }
            $element[1] = '<i class="fa fa-' . esc_attr($attribute['item_icon']) . '"' . PBHelper::createStyleAttribute($styleFontIcon) . '></i>';
        }
        $element[2] = '</div>';
        $html = '
			<li' . PBHelper::createClassAttribute($class[0]) . '>
				<div>
					' . ($this->attrIconPosition != 'bottom' ? join('', $element) : '') . '
					' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
					' . ($this->attrIconPosition == 'bottom' ? join('', $element) : '') . '
				</div>
			</li>
		';
        $this->attrLayoutColumnIndex++;
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:40,代码来源:PB.Component.Feature.class.php

示例10: processShortcodeNotice

    function processShortcodeNotice($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Validation = new PBValidation();
        $style = array(array(), array());
        if ($Validation->isColor($attribute['box_bg_color'])) {
            $style[1]['background-color'] = PBColor::getColor($attribute['box_bg_color']);
        }
        if ($Validation->isNumber($attribute['box_border_top_width'], 0, 9999)) {
            $style[1]['border-top-width'] = $attribute['box_border_top_width'] . 'px';
        }
        if ($Validation->isColor($attribute['box_border_top_color'])) {
            $style[1]['border-top-color'] = PBColor::getColor($attribute['box_border_top_color']);
        }
        if ($Validation->isNumber($attribute['box_border_right_width'], 0, 9999)) {
            $style[1]['border-right-width'] = $attribute['box_border_right_width'] . 'px';
        }
        if ($Validation->isColor($attribute['box_border_right_color'])) {
            $style[1]['border-right-color'] = PBColor::getColor($attribute['box_border_right_color']);
        }
        if ($Validation->isNumber($attribute['box_border_bottom_width'], 0, 9999)) {
            $style[1]['border-bottom-width'] = $attribute['box_border_bottom_width'] . 'px';
        }
        if ($Validation->isColor($attribute['box_border_bottom_color'])) {
            $style[1]['border-bottom-color'] = PBColor::getColor($attribute['box_border_bottom_color']);
        }
        if ($Validation->isNumber($attribute['box_border_left_width'], 0, 9999)) {
            $style[1]['border-left-width'] = $attribute['box_border_left_width'] . 'px';
        }
        if ($Validation->isColor($attribute['box_border_left_color'])) {
            $style[1]['border-left-color'] = PBColor::getColor($attribute['box_border_left_color']);
        }
        $class = array('pb-notice', $attribute['css_class']);
        $id = PBHelper::createId('pb_notice');
        $timelineHTML = null;
        $closeButtonHTML = null;
        /***/
        if ($Validation->isNotEmpty($attribute['icon'])) {
            array_push($class, 'pb-notice-icon', 'pb-notice-icon-' . PBHelper::createHash($attribute['icon']));
            if ($Validation->isColor($attribute['icon_bg_color'])) {
                $style[0]['background-color'] = PBColor::getColor($attribute['icon_bg_color']);
            }
        }
        /***/
        if ($attribute['timeline_enable'] == 1 && $attribute['timeline_time_to_close'] > 0) {
            $tStyle = array(array(), array());
            $tClass = array('pb-notice-timeline');
            if ($Validation->isNumber($attribute['timeline_height'], 0, 9999)) {
                $tStyle[0]['height'] = $attribute['timeline_height'] . 'px';
            }
            if ($Validation->isColor($attribute['timeline_bg_color'])) {
                $tStyle[1]['background-color'] = PBColor::getColor($attribute['timeline_bg_color']);
            }
            array_push($class, 'pb-notice-time-to-close-' . (int) $attribute['timeline_time_to_close']);
            $timelineHTML = '
				<div' . PBHelper::createClassAttribute($tClass) . PBHelper::createStyleAttribute($tStyle[0]) . '>
					<div' . PBHelper::createStyleAttribute($tStyle[1]) . '></div>
				</div>
			';
        }
        /***/
        $tStyle = array();
        $tClass = array('pb-notice-close-button');
        if ($Validation->isColor($attribute['close_button_text_color'])) {
            $tStyle['color'] = PBColor::getColor($attribute['close_button_text_color']);
        }
        $label = $Validation->isNotEmpty($timelineHTML) ? sprintf(__('Close within <span>%s</span> seconds', PLUGIN_PAGE_BUILDER_DOMAIN), $attribute['timeline_time_to_close']) : __('Close', PLUGIN_PAGE_BUILDER_DOMAIN);
        if ($attribute['close_button_enable'] != 1) {
            $tStyle['display'] = 'none';
        }
        $closeButtonHTML = '
			<div><a href="#"' . PBHelper::createClassAttribute($tClass) . PBHelper::createStyleAttribute($tStyle) . '>' . $label . '</a></div>
		';
        /***/
        $html = '
			<div' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style[0]) . ' id="' . esc_attr($id) . '">
				<div class="pb-notice-content"' . PBHelper::createStyleAttribute($style[1]) . '>
					' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
					' . $timelineHTML . '
					' . $closeButtonHTML . '
				</div>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($) 
					{
						$("#' . $id . '").PBNotice();
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
开发者ID:phanhoanglong2610,项目名称:anc_gvn,代码行数:94,代码来源:PB.Component.Notice.class.php

示例11: processShortcodeFeatureItem

    function processShortcodeFeatureItem($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Layout = new PBLayout();
        $this->attrItemURL = $attribute['item_url'];
        $this->attrItemURLTarget = $attribute['item_url_target'];
        if (!array_key_exists($attribute['item_icon'], $this->icon[$this->attrIconSize]['file'])) {
            return $html;
        }
        $position = $this->layoutAttrColumnIndex % 2 == 0 ? 'even' : 'odd';
        $class = array(array('pb-layout-' . $Layout->getLayoutColumnCSSClass($this->layoutAttr, $this->layoutAttrColumnIndex), 'pb-feature-element-' . $position), array('pb-feature-icon', 'pb-feature-icon-' . PBHelper::createHash($attribute['item_icon'])));
        $style = $this->style[$position];
        $html = '
			<li' . PBHelper::createClassAttribute($class[0]) . '>
				<div>
					' . ($this->attrIconPosition != 'bottom' ? '<div' . PBHelper::createClassAttribute($class[1]) . PBHelper::createStyleAttribute($style) . '></div>' : '') . '
					' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
					' . ($this->attrIconPosition == 'bottom' ? '<div' . PBHelper::createClassAttribute($class[1]) . PBHelper::createStyleAttribute($style) . '></div>' : '') . '
				</div>
			</li>
		';
        $this->layoutAttrColumnIndex++;
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
开发者ID:slavai,项目名称:sadick,代码行数:25,代码来源:PB.Component.Feature.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


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