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);
    }
    function processShortcodeClass($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Layout = new PBLayout();
        $Validation = new PBValidation();
        if ($Validation->isEmpty($content)) {
            return $html;
        }
        if (!array_key_exists($attribute['layout'], $this->layout)) {
            return $html;
        }
        $option = array();
        $this->currentIndex = 0;
        $this->currentLayout = $attribute['layout'];
        $id = PBHelper::createId('pb_class');
        $class = array(array('pb-class', 'pb-clear-fix', $attribute['css_class']), array('pb-reset-list', $Layout->getLayoutCSSClass($attribute['layout'])));
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . ' id="' . esc_attr($id) . '">
				<ul' . PBHelper::createClassAttribute($class[1]) . '>
					' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
				</ul>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$("#' . $id . '").PBClass(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
    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));
    }
    function processShortcodeAudio($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $option = array();
        $this->track = array();
        $this->trackIndex = 0;
        $Validation = new PBValidation();
        if ($Validation->isEmpty($content)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['volume'], 0, 100)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['muted'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['playlist_enable'])) {
            return $html;
        }
        $attribute['volume'] /= 100;
        $key = array('muted', 'volume', 'playlist_enable');
        foreach ($key as $value) {
            $option[$value] = $attribute[$value];
        }
        $id = PBHelper::createId('audio');
        $idPlayer = PBHelper::createId('audio_player');
        $idPlayerContainer = PBHelper::createId('audio_player_container');
        do_shortcode($content);
        if (!count($this->track)) {
            return $html;
        }
        $html .= $this->createJPlayerTemplate($id, $idPlayer, $idPlayerContainer);
        $html .= '
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$(\'#' . $id . '\').PBAudio(' . json_encode(array('idPlayer' => $idPlayer, 'idPlayerContainer' => $idPlayerContainer)) . ',' . json_encode($option) . ',' . json_encode($this->track) . ');
					});
				</script>
			</div>		
		';
        return PBHelper::formatHTML($html);
    }
    function processShortcodeCounterList($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $option = array();
        $Easing = new PBEasing();
        $Validation = new PBValidation();
        $this->character = array('before' => $attribute['character_before'], 'after' => $attribute['character_after']);
        $content = do_shortcode($content);
        if ($Validation->isEmpty($content)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['waypoint_enable'])) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['waypoint_duration'], 0, 99999)) {
            return $html;
        }
        if (!array_key_exists($attribute['waypoint_easing'], $Easing->easingType)) {
            return $html;
        }
        $key = array('waypoint_enable', 'waypoint_duration', 'waypoint_easing', 'waypoint_offset_trigger', 'character_before', 'character_after');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        $class = array(array('pb-clear-fix', 'pb-counter-list', $attribute['css_class']), array('pb-reset-list'));
        $id = PBHelper::createId('pb_counter_list');
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . ' id="' . $id . '">
				<ul' . PBHelper::createClassAttribute($class[1]) . '>
					' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
				</ul>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($) 
					{
						$("#' . $id . '").PBCounterList(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
    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);
    }
    function processShortcodePreformattedText($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Validation = new PBValidation();
        if ($Validation->isEmpty($content)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['open_default'])) {
            return $html;
        }
        $class = array('pb-preformatted-text');
        if ($attribute['open_default'] == 1) {
            array_push($class, 'pb-preformatted-text-visible');
        }
        array_push($class, $attribute['css_class']);
        $id = PBHelper::createId('pb_preformatted_text');
        $content = nl2br(trim(preg_replace(array('/\\[/', '/\\]/'), array('&#91;', '&#93;'), htmlspecialchars($content))));
        $html = '
			<div id="' . $id . '"' . PBHelper::createClassAttribute($class) . '>
				<a href="#">
					<span class="pb-preformatted-text-label-open">' . esc_html($attribute['label_open']) . '</span>
					<span class="pb-preformatted-text-label-close">' . esc_html($attribute['label_close']) . '</span>
				</a>
				<pre>' . $content . '</pre>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($) 
					{
						$("#' . $id . '").PBPreformattedText();
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html);
    }
    function processShortcodeBox($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $option = array();
        $style = array(array(), array());
        $Border = new PBBorder();
        $Validation = new PBValidation();
        /***/
        if (!$Validation->isBool($attribute['icon_enable'])) {
            return $html;
        }
        if (!array_key_exists($attribute['icon_size'], $this->icon)) {
            return $html;
        }
        if (!array_key_exists($attribute['icon_position'], $this->iconPosition)) {
            return $html;
        }
        /***/
        if ($Validation->isColor($attribute['background_color'])) {
            $style[0]['background-color'] = PBColor::getColor($attribute['background_color']);
        }
        if (array_key_exists($attribute['border_top_style'], $Border->style)) {
            $style[0]['border-top-style'] = $attribute['border_top_style'];
        }
        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));
    }
    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'];
        }
        if ($Validation->isNumber($attribute['border_left_width'], 0, 999)) {
            $style['border-left-width'] = $attribute['border_left_width'] . 'px';
        }
        if ($Validation->isColor($attribute['border_left_color'])) {
            $style['border-left-color'] = PBColor::getColor($attribute['border_left_color']);
        }
        /***/
        $MobileDetect = new Mobile_Detect();
        $mobile = (int) $MobileDetect->isMobile();
        /***/
        $videoHTML = null;
        $video = $Validation->isNotEmpty($attribute['video_format_webm']) || $Validation->isNotEmpty($attribute['video_format_ogg']) || $Validation->isNotEmpty($attribute['video_format_mp4']);
        if ($video && $attribute['video_mobile_enable'] != 1) {
            PBInclude::includeClass(PLUGIN_PAGE_BUILDER_LIBRARY_PATH . 'mobileDetect/Mobile_Detect.php', array('Mobile_Detect'));
            if ($mobile) {
                $video = false;
            }
        }
        if ($video) {
            $sourceHTML = null;
            $videoControlHTML = null;
            $videoAttributeHTML = null;
            if ($Validation->isNotEmpty($attribute['video_format_mp4'])) {
                $sourceHTML .= '<source type="video/mp4" src="' . esc_attr($attribute['video_format_mp4']) . '" />';
            }
            if ($Validation->isNotEmpty($attribute['video_format_webm'])) {
                $sourceHTML .= '<source type="video/webm" src="' . esc_attr($attribute['video_format_webm']) . '" />';
            }
            if ($Validation->isNotEmpty($attribute['video_format_ogg'])) {
                $sourceHTML .= '<source type="video/ogg" src="' . esc_attr($attribute['video_format_ogg']) . '" />';
            }
            if ($attribute['video_loop']) {
                $videoAttributeHTML .= ' loop';
            }
            if ($attribute['video_muted']) {
                $videoAttributeHTML .= ' muted';
            }
            if ($attribute['video_autoplay']) {
                $videoAttributeHTML .= ' autoplay';
            }
            if ($attribute['video_control'] == 1) {
                $videoControlHTML = '
					<div class="pb-line-video-control">
						<a href="#" class="pb-line-video-control-toggle-play pb-line-video-control-toggle-play-' . ($attribute['video_autoplay'] == 1 ? 'on' : 'off') . '"></a>
						<a href="#" class="pb-line-video-control-toggle-sound pb-line-video-control-toggle-sound-' . ($attribute['video_muted'] == 1 ? 'off' : 'on') . '"></a>
					</div>
				';
            }
            $videoHTML = '
				<div class="pb-line-video">
					<video preload="auto"' . $videoAttributeHTML . '>
						' . $sourceHTML . '
					</video>
				</div>
				' . $videoControlHTML . '
			';
        }
        /***/
        $overlay = false;
        $overlayHTML = null;
        if ($Validation->isColor($attribute['overlay_color'])) {
            $overlay = true;
            $overlayHTML = '<div class="pb-line-overlay" style="background-color:' . PBColor::getColor($attribute['overlay_color']) . '"></div>';
        }
        /***/
        $class = array(array('pb-line', 'pb-clear-fix', $attribute['css_class'], $video || $overlay ? 'pb-line-include-video' : null), array('pb-layout', $Layout->getLayoutCSSClass($attribute['layout']), 'pb-reset-list', 'pb-clear-fix'));
        if (in_array($attribute['layout_line'], array('boxed'))) {
            $class[0][] = 'pb-main';
        }
        if (in_array($attribute['layout_line'], array('boxed', 'wide', ''))) {
            $class[1][] = 'pb-main';
        }
        $key = array('bg_parallax_speed', 'bg_parallax_enable', 'bg_parallax_mobile_enable');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        $id = PBHelper::createId('pb_line');
        $css = esc_attr($attribute['css_group']);
        if ($Validation->isNotEmpty($css)) {
            array_push($class[0], 'pb-line-css-group-' . $css);
        }
        PBComponentData::set('layout', 'index', 0);
        PBComponentData::set('layout', 'layout', $attribute['layout']);
        $html = '
			<div id="' . $id . '" ' . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style) . '>
				' . $videoHTML . '
				' . $overlayHTML . '
				<ul' . PBHelper::createClassAttribute($class[1]) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</ul>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$("#' . $id . '").PBLayout(' . json_encode($option) . ',' . $mobile . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
    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');
        $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);
    }
    function processShortcodeMenu($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $Easing = new PBEasing();
        $Validation = new PBValidation();
        if (!array_key_exists($attribute['responsive_mode'], $this->responiveMode)) {
            return;
        }
        if (!$Validation->isBool($attribute['sticky_enable'])) {
            return;
        }
        if (!$Validation->isBool($attribute['hide_scroll_enable'])) {
            return;
        }
        if (!$Validation->isBool($attribute['menu_animation_enable'])) {
            return;
        }
        if (!$Validation->isNumber($attribute['menu_animation_speed_open'], 0, 99999)) {
            return;
        }
        if (!$Validation->isNumber($attribute['menu_animation_speed_close'], 0, 99999)) {
            return;
        }
        if (!$Validation->isNumber($attribute['menu_animation_delay'], 0, 99999)) {
            return;
        }
        if (!$Validation->isBool($attribute['scroll_animation_enable'])) {
            return;
        }
        if (!$Validation->isNumber($attribute['scroll_animation_speed'], 0, 99999)) {
            return;
        }
        if (!array_key_exists($attribute['scroll_animation_easing'], $Easing->easingType)) {
            return;
        }
        $html = null;
        $logoHTML = null;
        $option = array();
        $key = array('responsive_mode', 'sticky_enable', 'hide_scroll_enable', 'menu_animation_enable', 'menu_animation_speed_open', 'menu_animation_speed_close', 'menu_animation_delay', 'scroll_animation_enable', 'scroll_animation_speed', 'scroll_animation_easing');
        foreach ($key as $value) {
            $option[$value] = $attribute[$value];
        }
        $option['responsive_menu_id'] = PBHelper::createId('pb_menu_responsive');
        $option['responsive_menu_label'] = __('Menu');
        $id = PBHelper::createId('pb_menu');
        $classLogo = array('pb-logo');
        $classMenu = array('pb-menu-default');
        $classMenuResponsive = array('pb-menu-responsive');
        $class = array('pb-menu', $attribute['css_class']);
        $menuAttribute = array('menu' => $attribute['menu_id'], 'walker' => new PBMenuWalker(), 'menu_class' => 'sf-menu pb-reset-list pb-clear-fix', 'container' => '', 'container_class' => '', 'echo' => 0);
        $menuResponsiveAttribute = array('id' => $option['responsive_menu_id'], 'menu' => $attribute['menu_id'], 'walker' => new PBMenuResponsiveWalker(), 'menu_class' => 'pb-clear-fix', 'container' => '', 'container_class' => '', 'echo' => 0, 'items_wrap' => '<div id="%1$s" class="%2$s"><div id="' . $option['responsive_menu_id'] . '"><ul>%3$s</ul></div></div>');
        if ($Validation->isURL($attribute['logo_src'])) {
            $logoHTML = '
				<a href="' . get_home_url() . '">
					<img src="' . esc_attr($attribute['logo_src']) . '" alt=""/>
				</a>
			';
        }
        $html = '
			<div' . PBHelper::createClassAttribute($class) . ' id="' . $id . '">
				<div class="pb-main pb-clear-fix">
					<div' . PBHelper::createClassAttribute($classLogo) . '>
						' . $logoHTML . '
					</div>
					<div' . PBHelper::createClassAttribute($classMenu) . '>
						' . wp_nav_menu($menuAttribute) . '
					</div>
					<div' . PBHelper::createClassAttribute($classMenuResponsive) . '>
						' . wp_nav_menu($menuResponsiveAttribute) . '
					</div>	
				</div>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$(\'#' . $id . '\').PBMenu(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatCode($html);
    }
    function processShortcodeNivoSlider($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $option = array();
        $html = null;
        $imageHTML = null;
        $imageBoxHTML = null;
        $paginationHTML = null;
        $Validation = new PBValidation();
        $file = PBFile::getImage(explode(',', $attribute['image']));
        if ($file === false) {
            return $html;
        }
        if (!count($file->posts)) {
            return $html;
        }
        if (!PBFile::isWPImage($attribute['image_size'])) {
            return $html;
        }
        if (!array_key_exists($attribute['transition_effect'], $this->effect)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['count_slice'], 0, 999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['count_column'], 0, 999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['count_row'], 0, 999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['transition_speed'], 0, 99999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['pause_time'], 0, 99999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['start_slide'], 0, 999)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['preloader_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['direction_navigation_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['control_navigation_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['control_navigation_thumbs_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['pause_on_hover'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['manual_advance_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['random_start_enable'])) {
            return $html;
        }
        $key = array('transition_effect', 'count_slice', 'count_column', 'count_row', 'transition_speed', 'pause_time', 'start_slide', 'preloader_enable', 'direction_navigation_enable', 'control_navigation_enable', 'control_navigation_thumbs_enable', 'pause_on_hover', 'manual_advance_enable', 'random_start_enable');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        $class = array(array(), array());
        if ($attribute['preloader_enable'] == 1) {
            array_push($class[0], 'pb-image-box', 'pb-image-preloader');
        }
        array_push($class[1], 'pb-image');
        global $post;
        $bPost = $post;
        while ($file->have_posts()) {
            $file->the_post();
            $src = wp_get_attachment_image_src(get_the_ID(), $attribute['image_size']);
            $url = null;
            $meta = PBMeta::get($post->ID);
            PBHelper::removeUIndex($meta, 'media_library_url');
            if ($Validation->isNotEmpty($attribute['url'])) {
                $url = $attribute['url'];
            } elseif ($Validation->isNotEmpty($meta['media_library_url'])) {
                $url = $meta['media_library_url'];
            }
            if ($Validation->isNotEmpty($url)) {
                $imageHTML = '<a href="' . esc_attr($url) . '"><img src="' . $src[0] . '" alt=""/></a>';
            } else {
                $imageHTML = '<img src="' . $src[0] . '" alt="" data-thumb="' . $src[0] . '"/>';
            }
            $imageBoxHTML .= '
				<div' . PBHelper::createClassAttribute($class[0]) . '>
					<div' . PBHelper::createClassAttribute($class[1]) . '>' . $imageHTML . '</div>
				</div>
			';
        }
        wp_reset_query();
        $post = $bPost;
        $id = PBHelper::createId('pb_nivo_slider');
        $class = array(array(), array());
        array_push($class[0], 'pb-nivo-slider', $attribute['css_class']);
        if ($attribute['preloader_enable'] == 1) {
            array_push($class[1], 'pb-preloader');
        }
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . '>
				<div' . PBHelper::createClassAttribute($class[1]) . ' id="' . $id . '">
					' . $imageBoxHTML . '
					' . $paginationHTML . '
				</div>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$(\'#' . $id . '\').PBNivoSlider(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html);
    }
    function processShortcodeCallToAction($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $style = array(array(), array());
        $class = array(array('pb-call-to-action', 'pb-clear-fix', $attribute['css_class']), array('pb-call-to-action-box', 'pb-clear-fix'));
        $Validation = new PBValidation();
        if ($Validation->isColor($attribute['bg_color'])) {
            $style[0]['background-color'] = PBColor::getColor($attribute['bg_color']);
        }
        if ($Validation->isNumber($attribute['border_top_width'], 0, 9999)) {
            $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_right_width'], 0, 9999)) {
            $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_bottom_width'], 0, 9999)) {
            $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_left_width'], 0, 9999)) {
            $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['padding_top'], 0, 9999)) {
            $style[0]['padding-top'] = $attribute['padding_top'] . 'px';
        }
        if ($Validation->isNumber($attribute['padding_right'], 0, 9999)) {
            $style[0]['padding-right'] = $attribute['padding_right'] . 'px';
        }
        if ($Validation->isNumber($attribute['padding_bottom'], 0, 9999)) {
            $style[0]['padding-bottom'] = $attribute['padding_bottom'] . 'px';
        }
        if ($Validation->isNumber($attribute['padding_left'], 0, 9999)) {
            $style[0]['padding-left'] = $attribute['padding_left'] . 'px';
        }
        $id = PBHelper::createId('pb_call_to_action');
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style[0]) . ' id="' . esc_attr($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 . '").PBCallToAction();
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
 function processColumn($column, $layout)
 {
     $Layout = new PBLayout();
     $html = null;
     $columnCount = $Layout->getLayoutColumnCount($layout);
     for ($i = 0; $i < $columnCount; $i++) {
         $value = array();
         $value['text'] = $this->processComponent($column[$i]['component']);
         $data = array('data' => array('id' => PBHelper::createId('pb_column'), 'componentId' => 'layout_column'), 'value' => $value);
         $html .= $this->buildShortcode($data);
     }
     return $html;
 }
    function processShortcodeRecentPost($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $Layout = new PBLayout();
        $Validation = new PBValidation();
        $ImageHover = new PBImageHover();
        if (!PBFile::isWPImage($attribute['image_size'])) {
            return $html;
        }
        if (!array_key_exists($attribute['layout'], $this->layout)) {
            return $html;
        }
        if (!array_key_exists($attribute['template'], $this->template)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['post_count'], 1, 999)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['preloader_enable'])) {
            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['date_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['image_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['header_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['author_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['excerpt_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['category_enable'])) {
            return $html;
        }
        $option = array();
        $key = array('hover_type', 'hover_enable', 'preloader_enable');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        $data = $this->getPost($attribute);
        if ($data === false) {
            return null;
        }
        if (!count($data->posts)) {
            return null;
        }
        $i = 0;
        global $post;
        $bPost = $post;
        while ($data->have_posts()) {
            $data->the_post();
            $class = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($attribute['layout'], $i));
            $meta = array('date' => null, 'comment_count' => null, 'image' => null, 'header' => null, 'excerpt' => null, 'meta' => null);
            if ($attribute['date_enable']) {
                $meta['date'] = '<div class="pb-recent-post-date">' . get_the_date() . '</div>';
            }
            if ($attribute['image_enable']) {
                if (has_post_thumbnail()) {
                    $commentCountHTML = null;
                    if ($attribute['template'] == 1) {
                        if ($attribute['comment_count_enable'] == 1 && comments_open(get_the_id())) {
                            $commentCount = wp_count_comments(get_the_id());
                            $commentCountHTML = '<div class="pb-recent-post-comment-count"><span class="pb-recent-post-comment-count-value">' . $commentCount->approved . '</span><span class="pb-recent-post-comment-count-arrow"></span></div>';
                        }
                    }
                    $classImage = array(array('pb-recent-post-image', 'pb-image-box'), array('pb-image'));
                    if ($attribute['preloader_enable'] == 1) {
                        array_push($classImage[0], 'pb-image-preloader', 'pb-image-preloader-animation-enable');
                    }
                    if ($attribute['hover_enable'] == 1) {
                        array_push($classImage[0], 'pb-image-hover', 'pb-image-hover-type-' . $attribute['hover_type']);
                    }
                    if ($attribute['hover_enable'] == 1) {
                        $meta['image'] = '<a href="' . get_permalink(get_the_ID()) . '"' . PBHelper::createClassAttribute($classImage[1]) . '>' . get_the_post_thumbnail(get_the_ID(), $attribute['image_size']) . '<span><span><span></span></span></span></a>';
                    } else {
                        $meta['image'] = '<div' . PBHelper::createClassAttribute($classImage[1]) . '>' . get_the_post_thumbnail(get_the_ID(), $attribute['image_size']) . '</div>';
                    }
                    $meta['image'] = '<div' . PBHelper::createClassAttribute($classImage[0]) . '>' . $meta['image'] . $commentCountHTML . '</div>';
                }
            }
            if ($attribute['header_enable']) {
                $meta['header'] = '<h' . PBComponentData::get($this->getComponentId(), 'header_important_default') . ' class="pb-recent-post-header"><a href="' . get_permalink(get_the_ID()) . '">' . get_the_title() . '</a></h' . PBComponentData::get($this->getComponentId(), 'header_important_default') . '>';
            }
            if ($attribute['excerpt_enable']) {
                $meta['excerpt'] = '<div class="pb-recent-post-excerpt">' . get_the_excerpt() . '</div>';
            }
            if ($attribute['author_enable'] || $attribute['category_enable'] || $attribute['template'] == 2 && $attribute['comment_count_enable'] == 1 && comments_open(get_the_id())) {
                $authorHTML = null;
                $categoryHTML = null;
                $commentCountHTML = null;
                if ($attribute['author_enable']) {
                    $authorHTML = '<div class="pb-recent-post-meta-author">' . get_the_author() . '</div>';
                }
                $category = get_the_category(get_the_ID());
                $count = count($category);
                if ($count) {
                    foreach ($category as $index => $value) {
                        $separator = $index == $count - 1 ? '' : ',&nbsp;';
                        $title = $Validation->isEmpty($value->description) ? sprintf(__('View all posts filed under %s', PLUGIN_PAGE_BUILDER_DOMAIN), $value->name) : strip_tags(apply_filters('category_description', $value->description, $value));
                        $categoryHTML .= '<li><a href="' . get_category_link($value->term_id) . '" title="' . esc_attr($title) . '">' . esc_html($value->name) . '</a>' . $separator . '</li>';
                    }
                    $categoryHTML = '<div class="pb-recent-post-meta-category"><ul class="pb-reset-list">' . $categoryHTML . '</ul></div>';
                }
                if ($attribute['template'] == 2) {
                    if ($attribute['comment_count_enable'] == 1 && comments_open(get_the_id())) {
                        $commentCount = wp_count_comments(get_the_id());
                        $commentCountHTML = '<div class="pb-recent-post-meta-comment-count">' . __(sprintf('%d Comments', $commentCount->approved), PLUGIN_PAGE_BUILDER_DOMAIN) . '</div>';
                    }
                }
                $meta['meta'] = '<div class="pb-recent-post-meta pb-clear-fix">' . $authorHTML . $categoryHTML . $commentCountHTML . '</div>';
            }
            $templateHTML = array();
            $templateOrder = array('date', 'image', 'header', 'excerpt', 'meta');
            if ($attribute['template'] == 2) {
                $templateOrder = array('image', 'header', 'date', 'excerpt', 'meta');
            }
            foreach ($templateOrder as $value) {
                if (isset($meta[$value])) {
                    $templateHTML[$value] = $meta[$value];
                }
            }
            $html .= '<li' . PBHelper::createClassAttribute($class) . '><div>' . implode($templateHTML) . '</div></li>';
            $i++;
        }
        wp_reset_query();
        $post = $bPost;
        $id = PBHelper::createId('pb_recent_post');
        $class = array();
        $class[0] = array('pb-recent-post', 'pb-recent-post-template-' . $attribute['template'], $attribute['css_class']);
        $class[1] = array('pb-clear-fix', 'pb-reset-list', $Layout->getLayoutCSSClass($attribute['layout']));
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . ' id="' . $id . '">
				<ul' . PBHelper::createClassAttribute($class[1]) . '>
					' . $html . '
				</ul>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($) 
					{
						$("#' . $id . '").PBRecentPost(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html);
    }
</a>
									</div>
								</td>
							</tr>
<?php 
if (is_array($this->data['option']['team_social'])) {
    foreach ($this->data['option']['team_social'] as $index => $value) {
        ?>
							<tr>
								<td>
									<div class="pb-clear-fix">
										<select name="<?php 
        PBHelper::getFormName('team_social_name[]');
        ?>
" id="<?php 
        PBHelper::getFormName('team_social_name_' . PBHelper::createId(16));
        ?>
">
<?php 
        foreach ($this->data['dictionary']['social'] as $socialIndex => $socialValue) {
            echo '<option value="' . esc_attr($socialIndex) . '" ' . PBHelper::returnIf($value['team_social_name'], $socialIndex, 'selected', false) . '>' . esc_html($socialValue[0]) . '</option>';
        }
        ?>
										</select>
									</div>
								</td>
								<td>
									<div class="pb-clear-fix">
										<input type="text" name="<?php 
        PBHelper::getFormName('team_social_url[]');
        ?>
 function processShortcodeTwitterUserTimeline($attribute, $content, $tag)
 {
     $attribute = $this->processAttribute($tag, $attribute);
     $Easing = new PBEasing();
     $Validation = new PBValidation();
     $CarouFredSel = new PBCarouFredSel();
     if ($Validation->isEmpty($attribute['twitter_username'])) {
         return null;
     }
     if ($Validation->isEmpty($attribute['twitter_consumer_key'])) {
         return null;
     }
     if ($Validation->isEmpty($attribute['twitter_consumer_key_secret'])) {
         return null;
     }
     if ($Validation->isEmpty($attribute['twitter_access_token'])) {
         return null;
     }
     if ($Validation->isEmpty($attribute['twitter_access_token_secret'])) {
         return null;
     }
     if (!$Validation->isNumber($attribute['twitter_tweet_number'], 1, 200)) {
         return null;
     }
     if (!$Validation->isBool($attribute['carousel_enable'])) {
         return null;
     }
     if (!$Validation->isBool($attribute['carousel_autoplay_enable'])) {
         return null;
     }
     if (!$Validation->isBool($attribute['carousel_circular_enable'])) {
         return null;
     }
     if (!$Validation->isBool($attribute['carousel_infinite_enable'])) {
         return null;
     }
     if (!$Validation->isBool($attribute['carousel_scroll_pause_hover'])) {
         return null;
     }
     if (!array_key_exists($attribute['carousel_scroll_fx'], $CarouFredSel->scrollFX)) {
         return null;
     }
     if (!array_key_exists($attribute['carousel_scroll_easing'], $Easing->easingType)) {
         return null;
     }
     if (!$Validation->isNumber($attribute['carousel_scroll_duration'], 1, 99999)) {
         return null;
     }
     $this->includeLibrary('twitteroauth/twitteroauth.php');
     $connection = new TwitterOAuth($attribute['twitter_consumer_key'], $attribute['twitter_consumer_key_secret'], $attribute['twitter_access_token'], $attribute['twitter_access_token_secret']);
     $tweet = $connection->get('https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=' . $attribute['twitter_username'] . '&count=' . $attribute['twitter_tweet_number']);
     if (is_null($tweet)) {
         return null;
     }
     if (is_wp_error($tweet)) {
         return null;
     }
     if (array_key_exists('errors', $tweet)) {
         if (count($tweet['errors'])) {
             return;
         }
     }
     $data = array();
     $data['tweet'] = $tweet;
     $data['attribute'] = $attribute;
     $data['id'] = PBHelper::createId('pb_twitter_user_timeline');
     $data['option'] = PBHelper::getValueFromArray($attribute, 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'));
     $Template = new PBTemplate($data, $this->getTemplateFullPath('template'));
     return $Template->output(true);
 }
    function processShortcodeCounterBox($attribute, $content, $tag)
    {
        $html = null;
        $Layout = new PBLayout();
        $Easing = new PBEasing();
        $Validation = new PBValidation();
        $CarouFredSel = new PBCarouFredSel();
        $attribute = $this->processAttribute($tag, $attribute);
        if (!$Layout->isLayout($attribute['layout'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['carousel_enable'])) {
            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 (!$Validation->isBool($attribute['waypoint_enable'])) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['waypoint_duration'], 0, 99999)) {
            return $html;
        }
        if (!array_key_exists($attribute['waypoint_easing'], $Easing->easingType)) {
            return $html;
        }
        /***/
        $this->layout = $attribute['layout'];
        $this->layoutColumnIndex = 0;
        $option = array('carousel' => array(), 'animation' => 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_enable', 'waypoint_easing', 'waypoint_duration', 'waypoint_offset_trigger');
        foreach ($key as $index) {
            $option['waypoint'][$index] = $attribute[$index];
        }
        /***/
        $class = array(array('pb-clear-fix', 'pb-counter-box', $attribute['css_class']), array('pb-reset-list', $Layout->getLayoutCSSClass($attribute['layout'])));
        $id = PBHelper::createId('pb_counter_box');
        $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>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($) 
					{
						$("#' . $id . '").PBCounterBox(' . json_encode($option) . ');
					});
				</script>
			</div>			
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
    function processShortcodeGoogleMap($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $Validation = new PBValidation();
        if ($Validation->isEmpty($attribute['coordinate_lat'])) {
            return null;
        }
        if ($Validation->isEmpty($attribute['coordinate_lng'])) {
            return null;
        }
        if ($Validation->isEmpty($attribute['coordinate_marker_lat'])) {
            return null;
        }
        if ($Validation->isEmpty($attribute['coordinate_marker_lng'])) {
            return null;
        }
        if (!$Validation->isNumber($attribute['marker_image_origin_x'], -99999, 99999)) {
            return null;
        }
        if (!$Validation->isNumber($attribute['marker_image_origin_y'], -99999, 99999)) {
            return null;
        }
        if (!$Validation->isNumber($attribute['marker_image_anchor_x'], -99999, 99999)) {
            return null;
        }
        if (!$Validation->isNumber($attribute['marker_image_anchor_y'], -99999, 99999)) {
            return null;
        }
        if (!$Validation->isNumber($attribute['width'], 1, 100)) {
            return null;
        }
        if (!$Validation->isNumber($attribute['height'], 1, 9999)) {
            return null;
        }
        if (!$Validation->isBool($attribute['draggable'])) {
            return null;
        }
        if (!$Validation->isBool($attribute['scrollwheel'])) {
            return null;
        }
        if (!array_key_exists($attribute['map_type_id'], $this->mapTypeId)) {
            return null;
        }
        if (!array_key_exists($attribute['map_type_control_position'], $this->position)) {
            return null;
        }
        if (!array_key_exists($attribute['map_type_control_style'], $this->mapTypeControlStyle)) {
            return null;
        }
        if (!$Validation->isBool($attribute['map_type_control_enable'])) {
            return null;
        }
        if (!$Validation->isNumber($attribute['zoom_level'], 1, 21)) {
            return null;
        }
        if (!$Validation->isBool($attribute['zoom_control_enable'])) {
            return null;
        }
        if (!array_key_exists($attribute['zoom_position'], $this->position)) {
            return null;
        }
        if (!array_key_exists($attribute['zoom_control_style'], $this->zoomControlStyle)) {
            return null;
        }
        if (!$Validation->isBool($attribute['pan_control_enable'])) {
            return null;
        }
        if (!array_key_exists($attribute['pan_control_position'], $this->position)) {
            return null;
        }
        if (!$Validation->isBool($attribute['scale_control_enable'])) {
            return null;
        }
        if (!array_key_exists($attribute['scale_control_position'], $this->position)) {
            return null;
        }
        if (!$Validation->isBool($attribute['street_view_enable'])) {
            return null;
        }
        if (!array_key_exists($attribute['street_view_position'], $this->position)) {
            return null;
        }
        $id = PBHelper::createId('google_map');
        $class = array('pb-google-map', $attribute['css_class']);
        $attribute['style'] = '[' . mb_substr(do_shortcode($content), 1) . ']';
        $html = '
			<div id="' . $id . '"' . PBHelper::createClassAttribute($class) . '></div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$(\'#' . $id . '\').PBGoogleMap(' . json_encode($attribute) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html);
    }
 function processShortcodeContactFormField($attribute, $content, $tag)
 {
     $attribute = $this->processAttribute($tag, $attribute);
     $html = null;
     $id = PBHelper::createId('pb_contact_form_field');
     $sessionData = array('id' => $id, 'type' => $attribute['type'], 'name' => $attribute['name'], 'value' => $attribute['value'], 'label' => $attribute['label'], 'notice' => $attribute['notice'], 'mandatory' => $attribute['mandatory']);
     $PBSession = new PBSession();
     $PBSession->setValue($this->getComponentId(), array($this->id, 'field', $id), $sessionData);
     return $html;
 }
Beispiel #21
0
 * @package 	WooCommerce/Templates
 * @version     2.4.0
 */
if (!defined('ABSPATH')) {
    exit;
}
// Exit if accessed directly
/**
 * Filter tabs and allow third parties to add their own
 *
 * Each tab is an array containing title, callback and priority.
 * @see woocommerce_default_product_tabs()
 */
$tabs = apply_filters('woocommerce_product_tabs', array());
if (!empty($tabs)) {
    $id = PBHelper::createId('pb_tab');
    $option = array();
    ?>

	<div class="pb-clear-fix"></div>

	<div class="pb-tab pb-clear-fix" id="<?php 
    echo esc_attr($id);
    ?>
">
		<ul class="pb-reset-list">
			<?php 
    foreach ($tabs as $key => $tab) {
        ?>

				<li class="<?php 
    function processShortcodeZAccordion($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $Image = new PBImage();
        $Easing = new PBEasing();
        $Validation = new PBValidation();
        $html = null;
        $imageHTML = null;
        $imageBoxHTML = null;
        $option = array();
        if (!array_key_exists($attribute['data_source'], $this->dataSource)) {
            return $html;
        }
        if ($attribute['data_source'] == 1) {
            $query = PBFile::getImage(explode(',', $attribute['image']));
            if ($query === false) {
                return $html;
            }
            if (!count($query->posts)) {
                return $html;
            }
        } else {
            $argument = array('meta_query' => array(array('key' => '_thumbnail_id')));
            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;
            }
        }
        if (!PBFile::isWPImage($attribute['image_size'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['preloader_enable'])) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['starting_slide'], 0, 999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['timeout'], 0, 99999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['speed'], 0, 99999)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['auto'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['pause'])) {
            return $html;
        }
        if (!array_key_exists($attribute['easing'], $Easing->easingType)) {
            return $html;
        }
        if (!array_key_exists($attribute['trigger'], $this->tabOpenTriggerEvent)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['display_slide_title'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['display_slide_excerpt'])) {
            return $html;
        }
        $imageSize = $Image->getImageDimension($attribute['image_size']);
        if ($imageSize === false) {
            return $html;
        }
        $key = array('preloader_enable', 'starting_slide', 'timeout', 'speed', 'auto', 'pause', 'easing', 'trigger', 'display_slide_title', 'display_slide_excerpt');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        $option['width'] = $imageSize['width'];
        $option['height'] = $imageSize['height'];
        $class = array(array(), array(), array(), array());
        array_push($class[0], 'pb-zaccordion', $attribute['css_class']);
        array_push($class[1], 'pb-reset-list');
        if ($attribute['preloader_enable'] == 1) {
            array_push($class[1], 'pb-preloader');
            array_push($class[2], 'pb-image-box', 'pb-image-preloader');
        }
        array_push($class[3], 'pb-image');
        global $post;
        $bPost = $post;
        while ($query->have_posts()) {
            $query->the_post();
            $url = null;
            if ($attribute['data_source'] == 1) {
                $meta = PBMeta::get($post->ID);
                PBHelper::removeUIndex($meta, 'media_library_url');
                if ($Validation->isNotEmpty($attribute['url'])) {
                    $url = $attribute['url'];
                } elseif ($Validation->isNotEmpty($meta['media_library_url'])) {
                    $url = $meta['media_library_url'];
                }
                $src = wp_get_attachment_image_src(get_the_ID(), $attribute['image_size']);
            } else {
                $url = get_the_permalink();
                $src = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), $attribute['image_size']);
            }
            $captionHTML = null;
            if ($attribute['display_slide_title'] == 1) {
                $captionHTML .= '<span' . PBHelper::createClassAttribute(array('pb-zaccordion-caption-box-title')) . '>' . ($attribute['data_source'] == 1 ? strip_tags(get_the_excerpt()) : get_the_title()) . '</span>';
            }
            if ($attribute['display_slide_excerpt'] == 1) {
                $captionHTML .= '<span' . PBHelper::createClassAttribute(array('pb-zaccordion-caption-box-excerpt')) . '>' . ($attribute['data_source'] == 1 ? get_the_content() : strip_tags(get_the_excerpt())) . '</span>';
            }
            if ($Validation->isNotEmpty($captionHTML)) {
                $captionHTML = '<span' . PBHelper::createClassAttribute(array('pb-zaccordion-caption-box"')) . '>' . $captionHTML . '</span>';
            }
            $imageHTML = null;
            if ($Validation->isNotEmpty($url)) {
                $imageHTML = '<a href="' . esc_attr($url) . '"' . PBHelper::createClassAttribute($class[3]) . '><img src="' . $src[0] . '" alt=""/>' . $captionHTML . '</a>';
            } else {
                $imageHTML = '<img src="' . $src[0] . '" alt="" data-thumb="' . $src[0] . '"/>' . $captionHTML;
            }
            $imageBoxHTML .= '
				<li>
					<div' . PBHelper::createClassAttribute($class[2]) . '>' . $imageHTML . '</div>
				</li>
			';
        }
        wp_reset_query();
        $post = $bPost;
        $id = PBHelper::createId('accordion');
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . '>
				<ul' . PBHelper::createClassAttribute($class[1]) . ' id="' . $id . '">
					' . $imageBoxHTML . '
				</ul>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$(\'#' . $id . '\').PBZAccordion(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html);
    }
    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>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($) 
					{
						$("#' . $id . '").PBFeature(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false));
    }
    function processShortcodeGallery($attribute, $content, $tag)
    {
        $attribute = $this->processAttribute($tag, $attribute);
        $html = null;
        $elementHTML = null;
        $Layout = new PBLayout();
        $Validation = new PBValidation();
        $ImageHover = new PBImageHover();
        $file = PBFile::getImage(explode(',', $attribute['image']));
        if ($file === false) {
            return $html;
        }
        if (!count($file->posts)) {
            return $html;
        }
        if (!PBFile::isWPImage($attribute['image_size'])) {
            return $html;
        }
        if (!array_key_exists($attribute['layout'], $this->layout)) {
            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['caption_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['preloader_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['description_enable'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['layout_full_width_enable'])) {
            return $html;
        }
        $key = array('hover_type', 'hover_enable', 'preloader_enable', 'layout_full_width_enable');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        $id = PBHelper::createId('pb_gallery');
        global $post;
        $bPost = $post;
        $i = 0;
        while ($file->have_posts()) {
            global $post;
            $file->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']);
            $meta = PBMeta::get($post);
            PBHelper::removeUIndex($meta, 'media_library_video_url', 'media_library_url');
            $class = array();
            $class[0] = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($attribute['layout'], $i));
            $class[1] = array('pb-image-box');
            $class[2] = array('pb-image');
            if ($attribute['preloader_enable'] == 1) {
                array_push($class[1], 'pb-image-preloader', 'pb-image-preloader-animation-enable');
            }
            if ($attribute['hover_enable'] == 1) {
                array_push($class[1], 'pb-image-hover', 'pb-image-hover-type-' . $attribute['hover_type']);
            }
            /****/
            $imageTextHTML = null;
            if ($Validation->isNotEmpty($post->post_excerpt) && $attribute['caption_enable'] == 1) {
                $imageTextHTML .= '<' . PBComponentData::get($this->getComponentId(), 'image_text_caption_header_tag') . ' class="pb-image-text-caption">' . get_the_excerpt() . '</' . PBComponentData::get($this->getComponentId(), 'image_text_caption_header_tag') . '>';
            }
            if ($Validation->isNotEmpty($post->post_content) && $attribute['description_enable'] == 1) {
                $imageTextHTML .= '<div class="pb-image-text-description">' . get_the_content() . '</div>';
            }
            if ($Validation->isNotEmpty($imageTextHTML)) {
                $imageTextHTML = '<div class="pb-image-text">' . $imageTextHTML . '</div>';
            }
            if ($Validation->isNotEmpty($imageTextHTML)) {
                $imageTextHTML .= '<div class="pb-image-text-fancybox"><b>' . get_the_excerpt() . '</b> ' . get_the_content() . '</div>';
            }
            /****/
            $url = null;
            $rel = null;
            if ($Validation->isVideoURL($meta['media_library_video_url'])) {
                $url = $meta['media_library_video_url'];
                array_push($class[1], 'pb-image-type-video');
            } elseif ($Validation->isURL($meta['media_library_url'])) {
                $url = $meta['media_library_url'];
                array_push($class[1], 'pb-image-type-link');
            } else {
                $rel = $id;
                $url = $full[0];
                array_push($class[1], 'pb-image-type-image');
            }
            /****/
            $imageHTML = null;
            if ($attribute['hover_enable'] == 1) {
                $imageHTML = '<a href="' . $url . '"' . PBHelper::createClassAttribute($class[2]) . ($Validation->isEmpty($rel) ? null : ' data-fancybox-group="' . esc_attr($rel) . '"') . '><img src="' . $thumbnail[0] . '" alt=""/><span><span><span></span></span></span></a>';
            } else {
                $imageHTML = '<div' . PBHelper::createClassAttribute($class[2]) . '><img src="' . $thumbnail[0] . '" alt=""/></div>';
            }
            /****/
            if ($Validation->isNotEmpty($imageTextHTML)) {
                array_push($class[1], 'pb-image-text-enable');
            }
            $elementHTML .= '<li' . PBHelper::createClassAttribute($class[0]) . '><div' . PBHelper::createClassAttribute($class[1]) . '>' . $imageHTML . $imageTextHTML . '</div></li>';
            $i++;
        }
        wp_reset_query();
        $post = $bPost;
        $class = array();
        $class[0] = array('pb-gallery', 'pb-clear-fix', $attribute['css_class']);
        $class[1] = array($Layout->getLayoutCSSClass($attribute['layout']), 'pb-reset-list', 'pb-clear-fix');
        if ($attribute['layout_full_width_enable'] == 1) {
            array_push($class[1], 'pb-layout-full-width');
        }
        $html = '
			<div' . PBHelper::createClassAttribute($class[0]) . ' id="' . $id . '">
				<ul' . PBHelper::createClassAttribute($class[1]) . '>
					' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '
				</ul>			
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$(\'#' . $id . '\').PBGallery(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html, $elementHTML);
    }
 function adminCreateMetaBoxSocial()
 {
     global $post;
     $data = array();
     $data['option'] = PBMeta::get($post);
     $data['nonce'] = wp_nonce_field('adminSaveMetaBox', PLUGIN_PAGE_BUILDER_CONTEXT . '_team_noncename', false, false);
     $data['dictionary']['social'] = $this->social;
     $data['tableId'] = PBHelper::createId('team_social_table');
     PBHelper::setDeafultOption($data['option'], 'team_social', '');
     $Template = new PBTemplate($data, $this->getTemplateFullPath('meta_box_social'));
     echo $Template->output();
 }
    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');
        }
        array_push($class, 'pb-reset-list', 'pb-clear-fix', $attribute['css_class']);
        $html = '
			<ul' . PBHelper::createClassAttribute($class) . ' id="' . esc_attr($id) . '">
				' . $html . '
			</ul>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$(\'#' . $id . '\').PBSocialIcon(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html);
    }
    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));
    }
    function createFieldTypeSelect($name, $data)
    {
        $html = null;
        foreach ($data['ui']['element']['dictionary']['source'] as $index => $value) {
            $html .= '
				<option value="' . $index . '" ' . PBHelper::returnIf($data['ui']['element']['value'], $index, 'selected') . '>' . $value . '</option>
			';
        }
        $data['ui']['element']['attribute']['id'] = PBHelper::createId($name);
        $html = '
			<select name="' . $name . '"' . $this->createHTMLAttributes($data['ui']['element']['attribute']) . '>
				' . $html . '
			</select>
		';
        return $html;
    }
    function processShortcodeFlexSlider($attribute, $content, $tag)
    {
        $Easing = new PBEasing();
        $attribute = $this->processAttribute($tag, $attribute);
        $option = array();
        $class = array(array(), array(), array(), array());
        $html = null;
        $imageHTML = null;
        $imageBoxHTML = null;
        $Validation = new PBValidation();
        $file = PBFile::getImage(explode(',', $attribute['image']));
        if ($file === false) {
            return $html;
        }
        if (!count($file->posts)) {
            return $html;
        }
        if (!PBFile::isWPImage($attribute['image_size'])) {
            return $html;
        }
        if (!array_key_exists($attribute['easing'], $Easing->easingType)) {
            return $html;
        }
        if (!array_key_exists($attribute['animation'], $this->animation)) {
            return $html;
        }
        if (!array_key_exists($attribute['direction'], $this->direction)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['preloader_enable'])) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['start_at'], 0, 999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['init_delay'], 0, 99999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['slideshow_speed'], 0, 99999)) {
            return $html;
        }
        if (!$Validation->isNumber($attribute['animation_speed'], 0, 99999)) {
            return $html;
        }
        if (!$Validation->isBool($attribute['touch'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['reverse'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['use_css'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['keyboard'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['slideshow'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['randomize'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['mousewheel'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['control_nav'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['direction_nav'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['smooth_height'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['animation_loop'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['pause_on_hover'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['pause_on_action'])) {
            return $html;
        }
        if (!$Validation->isBool($attribute['multiple_keyboard'])) {
            return $html;
        }
        $key = array('easing', 'animation', 'direction', 'start_at', 'init_delay', 'slideshow_speed', 'animation_speed', 'preloader_enable', 'touch', 'use_css', 'reverse', 'keyboard', 'slideshow', 'randomize', 'mousewheel', 'control_nav', 'direction_nav', 'smooth_height', 'pause_on_hover', 'animation_loop', 'pause_on_action', 'multiple_keyboard');
        foreach ($key as $index) {
            $option[$index] = $attribute[$index];
        }
        if ($attribute['preloader_enable'] == 1) {
            array_push($class[0], 'pb-image-box', 'pb-image-preloader');
        }
        array_push($class[1], 'pb-image');
        global $post;
        $bPost = $post;
        while ($file->have_posts()) {
            $file->the_post();
            $src = wp_get_attachment_image_src(get_the_ID(), $attribute['image_size']);
            $url = null;
            $meta = PBMeta::get($post->ID);
            PBHelper::removeUIndex($meta, 'media_library_url');
            if ($Validation->isNotEmpty($attribute['url'])) {
                $url = $attribute['url'];
            } elseif ($Validation->isNotEmpty($meta['media_library_url'])) {
                $url = $meta['media_library_url'];
            }
            if ($Validation->isNotEmpty($url)) {
                $imageHTML = '<a href="' . esc_attr($url) . '"><img src="' . $src[0] . '" alt=""/></a>';
            } else {
                $imageHTML = '<img src="' . $src[0] . '" alt="" data-thumb="' . $src[0] . '"/>';
            }
            $imageBoxHTML .= '
				<li' . PBHelper::createClassAttribute($class[0]) . '>
					<div' . PBHelper::createClassAttribute($class[1]) . '>' . $imageHTML . '</div>
				</li>
			';
        }
        wp_reset_query();
        $post = $bPost;
        $id = PBHelper::createId('pb_flex_slider');
        array_push($class[2], 'pb-flex-slider', $attribute['css_class']);
        if ($attribute['preloader_enable'] == 1) {
            array_push($class[2], 'pb-preloader');
        }
        array_push($class[3], 'pb-reset-list', 'slides');
        $html = '
			<div' . PBHelper::createClassAttribute($class[2]) . ' id="' . $id . '">
				<ul' . PBHelper::createClassAttribute($class[3]) . '>
					' . $imageBoxHTML . '
				</ul>
			</div>
			<div class="pb-script-tag">
				<script type="text/javascript">
					jQuery(document).ready(function($)
					{
						$(\'#' . $id . '\').PBFlexSlider(' . json_encode($option) . ');
					});
				</script>
			</div>
		';
        return PBHelper::formatHTML($html);
    }