function processShortcodeDivider($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $Align = new PBAlign(); $Border = new PBBorder(); $Validation = new PBValidation(); $style = array(); $class = array('pb-divider', 'pb-clear-fix'); if ($Validation->isNumber($attribute['line_width'], 0, 9999)) { $style['width'] = $attribute['line_width'] . 'px'; } if ($Validation->isNumber($attribute['line_height'], 0, 9999)) { $style['border-bottom-width'] = $attribute['line_height'] . 'px'; } if (array_key_exists($attribute['line_style'], $Border->style)) { $style['border-style'] = $attribute['line_style']; } if ($Validation->isColor($attribute['line_color'])) { $style['border-color'] = PBColor::getColor($attribute['line_color']); } if (array_key_exists($attribute['align'], $Align->align)) { array_push($class, $Align->getCSSClass($attribute['align'])); } if ($Validation->isNumber($attribute['margin_top'], 0, 9999)) { $style['margin-top'] = $attribute['margin_top'] . 'px'; } if ($Validation->isNumber($attribute['margin_bottom'], 0, 9999)) { $style['margin-bottom'] = $attribute['margin_bottom'] . 'px'; } array_push($class, $attribute['css_class']); $html = ' <div' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '></div> '; return PBHelper::formatHTML($html); }
function processShortcodeCounterListItem($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $Validation = new PBValidation(); if ($Validation->isEmpty($attribute['name'])) { return $html; } if (!$Validation->isNumber($attribute['value'], 0, 99999, false)) { return $html; } $lineCharacterAfter = null; $lineCharacterBefore = null; if ($Validation->isNotEmpty($this->character['before'])) { $lineCharacterBefore = '<span' . PBHelper::createClassAttribute(array('pb-counter-list-value-character-before')) . '>' . esc_html($this->character['before']) . '</span>'; } if ($Validation->isNotEmpty($this->character['after'])) { $lineCharacterAfter = '<span' . PBHelper::createClassAttribute(array('pb-counter-list-value-character-after')) . '>' . esc_html($this->character['after']) . '</span>'; } $html = ' <li class="pb-value-' . (int) $attribute['value'] . '"> <span class="pb-counter-list-label">' . esc_html($attribute['name']) . '</span> <span class="pb-counter-list-value"> ' . $lineCharacterBefore . ' <span class="pb-counter-list-value-value">' . (int) $attribute['value'] . '</span> ' . $lineCharacterAfter . ' </span> <span class="pb-counter-list-foreground"></span> <span class="pb-counter-list-background"></span> </li> '; return PBHelper::formatHTML($html); }
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 processShortcodeText($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $class = array('pb-text', $attribute['css_class']); $html = '<div' . PBHelper::createClassAttribute($class) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>'; return PBHelper::formatHTML($html, PBHelper::formatContent($content)); }
function processShortcodeIframe($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $Validation = new PBValidation(); if ($Validation->isEmpty($attribute['src'])) { return null; } $style = array(array(), array()); if ((int) $attribute['width'] > 0) { $style[0]['width'] = (int) $attribute['width'] . 'px'; } if ((int) $attribute['height'] > 0) { $style[1]['height'] = (int) $attribute['height'] . 'px'; $style[1]['padding-bottom'] = '0px'; } $class = array(array('pb-iframe', $attribute['css_class']), array('pb-iframe-content')); $html = ' <div' . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style[0]) . '> <div' . PBHelper::createClassAttribute($class[1]) . PBHelper::createStyleAttribute($style[1]) . '> <iframe src="' . esc_attr($attribute['src']) . '"></iframe> </div> </div> '; return PBHelper::formatCode($html); }
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 processShortcodeList($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $Validation = new PBValidation(); $classBullet = null; if ($Validation->isNotEmpty($attribute['bullet'])) { $classBullet = 'pb-list-' . PBHelper::createHash($attribute['bullet']); } $class = array('pb-list', $classBullet, $attribute['css_class']); $html = '<div' . PBHelper::createClassAttribute($class) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>'; return PBHelper::formatHTML($html, $content); }
function processShortcodeSpace($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $style = array(); $Validation = new PBValidation(); if ($Validation->isNumber($attribute['height'], -9999, 9999)) { if ((int) $attribute['height'] >= 0) { $style['height'] = (int) $attribute['height'] . 'px'; } else { $style['margin-top'] = (int) $attribute['height'] . 'px'; } } $class = array('pb-space', 'pb-clear-fix', $attribute['css_class']); $html = '<div' . PBHelper::createClassAttribute(array('pb-space-line')) . '></div><div' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '></div>'; return PBHelper::formatHTML($html); }
function processShortcodeLayoutColumn($attribute, $content, $tag) { $Layout = new PBLayout(); $attribute = $this->processAttribute($tag, $attribute); $index = PBComponentData::get('layout', 'index'); $layout = PBComponentData::get('layout', 'layout'); $class = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($layout, $index)); $html = ' <li' . PBHelper::createClassAttribute($class) . '> <div class="pb-space-line"></div> <div>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div> </li> '; PBComponentData::set('layout', 'index', $index + 1); return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false)); }
function processShortcodeHeader($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $style = array(); $Font = new PBFont(); $Header = new PBHeader(); $Validation = new PBValidation(); if ($Validation->isEmpty($content)) { return $html; } if (!array_key_exists($attribute['important'], $Header->important)) { return $html; } if (!$Validation->isBool($attribute['underline_enable'])) { return $html; } if ($Validation->isNumber($attribute['font_size'], 1, 200, true)) { $style['font-size'] = $attribute['font_size'] . 'px'; } if (array_key_exists($attribute['font_weight'], $Font->weight)) { $style['font-weight'] = $attribute['font_weight']; } if (array_key_exists($attribute['font_style'], $Font->style)) { $style['font-style'] = $attribute['font_style']; } if ($Validation->isColor($attribute['font_color'])) { $style['color'] = PBColor::getColor($attribute['font_color']); } if ($Validation->isColor($attribute['background_color'])) { $style['background-color'] = PBColor::getColor($attribute['background_color']); } if ($Validation->isNotEmpty($attribute['line_height'])) { $style['line-height'] = $attribute['line_height']; } if ($Validation->isNumber($attribute['text_indent'], 0, 999)) { $style['text-indent'] = $attribute['text_indent'] . 'px'; } $class = array(array('pb-header', $attribute['css_class']), array('pb-header-content'), array('pb-header-underline')); $html = '<h' . (int) $attribute['important'] . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style) . '><span' . PBHelper::createClassAttribute($class[1]) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</span>' . ($attribute['underline_enable'] == 1 ? '<span' . PBHelper::createClassAttribute($class[2]) . '></span>' : null) . '</h' . (int) $attribute['important'] . '>'; return PBHelper::formatHTML($html, $content); }
function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0) { $level = null; $Validation = new PBValidation(); for ($i = 0; $i < $depth; $i++) { $level .= '--'; } if (!is_null($level)) { $level .= ' '; } $linkClass = array(); if ($Validation->isNotEmpty($object->target)) { array_push($linkClass, 'pb-window-target-blank'); } $output .= ' <li class="' . join(' ', (array) $object->classes) . '"> <a href="' . esc_attr($object->url) . '"' . PBHelper::createClassAttribute($linkClass) . '>' . $level . $object->title . '</a> </li> '; }
function start_el(&$output, $object, $depth = 0, $args = array(), $current_object_id = 0) { $this->iconClass = null; if ($depth == 0) { $this->icon = $object->icon; $this->mega_menu_layout_column_index = 0; $this->mega_menu_enable = $object->mega_menu_enable; $this->mega_menu_layout = $object->mega_menu_layout; if ($object->icon != '-1') { $this->iconClass = 'pb-menu-icon pb-menu-icon-' . PBHelper::createHash($object->icon); } } if ($this->mega_menu_enable == 1) { if ($depth == 0 || $depth == 2) { $output .= '<li class="' . join(' ', (array) $object->classes) . ($depth == 0 ? ' sf-mega-enable-1' : null) . ' ' . $this->iconClass . ' ' . '">'; } if ($depth == 1) { $Layout = new PBLayout(); $class = array('sf-mega-section', 'pb-layout-' . $Layout->getLayoutColumnCSSClass($this->mega_menu_layout, $this->mega_menu_layout_column_index)); $output .= ' <div' . PBHelper::createClassAttribute($class) . '> '; $this->mega_menu_layout_column_index++; } if ($depth == 1) { $output .= ' <span class="sf-mega-header">' . esc_html($object->title) . '</span> '; } else { $output .= ' <a href="' . esc_attr($object->url) . '"><span></span>' . $object->title . '</a> '; } } else { $output .= ' <li class="' . join(' ', (array) $object->classes) . ($depth == 0 ? ' sf-mega-enable-0' : null) . ' ' . $this->iconClass . ' ' . '"> <a href="' . esc_attr($object->url) . '"><span></span>' . $object->title . '</a> '; } }
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 processShortcodeBlockquote($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $Validation = new PBValidation(); if ($Validation->isEmpty($content)) { return $html; } $class = array('pb-blockquote', $attribute['css_class']); if ($Validation->isNotEmpty($attribute['author'])) { $html = '<div class="pb-blockquote-author">— ' . $attribute['author'] . '</div>'; } $html = ' <div' . PBHelper::createClassAttribute($class) . '> <blockquote> ' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . ' </blockquote> ' . $html . ' </div> '; return PBHelper::formatHTML($html, PBHelper::formatContent($content)); }
function processShortcodeVideo($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $src = $this->parseVideoURL($attribute['src'], $attribute['type']); if ($src === false) { return $html; } $style = array(); if ((int) $attribute['player_width'] > 0) { $style['width'] = (int) $attribute['player_width'] . 'px'; } $class = array(array('pb-video', $attribute['css_class']), array('pb-video-content')); $html = ' <div' . PBHelper::createClassAttribute($class[0]) . PBHelper::createStyleAttribute($style) . '> <div' . PBHelper::createClassAttribute($class[1]) . '> <iframe src="' . esc_attr($src) . '"></iframe> </div> </div> '; return PBHelper::formatHTML($html); }
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('[', ']'), 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 processShortcodeDropcap($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $Validation = new PBValidation(); $style = array(); $class = array('pb-dropcap', 'pb-clear-fix', $attribute['css_class']); if ($Validation->isNumber($attribute['font_size'], 1, 100)) { $style['font-size'] = $attribute['font_size'] . 'px'; } if ($Validation->isColor($attribute['font_color'])) { $style['color'] = PBColor::getColor($attribute['font_color']); } if ($Validation->isColor($attribute['bg_color'])) { $style['background-color'] = PBColor::getColor($attribute['bg_color']); } $letter = mb_substr($content, 0, 1); $content = mb_substr($content, 1); $html = ' <p' . PBHelper::createClassAttribute($class) . '> <span class="pb-dropcap-first-letter" ' . PBHelper::createStyleAttribute($style) . '>' . $letter . '</span>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . ' </p> '; return PBHelper::formatHTML($html, PBHelper::formatContent($content, true, false, false)); }
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 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 processShortcodeCallToActionButton($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $style = array(); $option = array(); $Window = new PBWindow(); $Validation = new PBValidation(); $src = !$Validation->isEmpty($attribute['src']) ? $attribute['src'] : '#'; $class = array($Window->getTargetCSSClass($attribute['src_target'])); if ($Validation->isColor($attribute['text_color'])) { $style['color'] = PBColor::getColor($attribute['text_color']); $option['out']['color'] = $style['color']; } if ($Validation->isColor($attribute['bg_color'])) { $style['background-color'] = PBColor::getColor($attribute['bg_color']); $option['out']['background-color'] = $style['background-color']; } if ($Validation->isColor($attribute['border_color'])) { $style['border-color'] = PBColor::getColor($attribute['border_color']); $option['out']['border-color'] = $style['border-color']; } if ($Validation->isColor($attribute['text_color_hover'])) { $option['in']['color'] = PBColor::getColor($attribute['text_color_hover']); } if ($Validation->isColor($attribute['bg_color_hover'])) { $option['in']['background-color'] = PBColor::getColor($attribute['bg_color_hover']); } if ($Validation->isColor($attribute['border_color_hover'])) { $option['in']['border-color'] = PBColor::getColor($attribute['border_color_hover']); } if ($Validation->isNumber($attribute['padding_top'], 0, 9999)) { $style['padding-top'] = $attribute['padding_top'] . 'px'; } if ($Validation->isNumber($attribute['padding_right'], 0, 9999)) { $style['padding-right'] = $attribute['padding_right'] . 'px'; } if ($Validation->isNumber($attribute['padding_bottom'], 0, 9999)) { $style['padding-bottom'] = $attribute['padding_bottom'] . 'px'; } if ($Validation->isNumber($attribute['padding_left'], 0, 9999)) { $style['padding-left'] = $attribute['padding_left'] . 'px'; } if ($Validation->isNumber($attribute['margin_top'], -9999, 9999)) { $style['margin-top'] = $attribute['margin_top'] . 'px'; } if ($Validation->isNumber($attribute['margin_bottom'], -9999, 9999)) { $style['margin-bottom'] = $attribute['margin_bottom'] . 'px'; } $html = ' <div> <a href="' . $src . '"' . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '<i class="pb-button-arrow pb-button-arrow-right"></i></a> <input type="hidden" value="' . esc_attr(json_encode($option)) . '"/> </div> '; return PBHelper::formatHTML($html, $content); }
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 processShortcodeContactFormLayoutLine($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $Layout = new PBLayout(); $Validation = new PBValidation(); if (!$Layout->isLayout($attribute['layout'])) { return $html; } $columnCount = $Layout->getLayoutColumnCount($attribute['layout']); for ($i = 1; $i <= $columnCount; $i++) { $fieldHTML = null; if (!$Validation->isEmpty($attribute['column_' . $i . '_name'])) { $field = mb_split(',', $attribute['column_' . $i . '_name']); foreach ($field as $fieldValue) { $this->fieldCounter++; $class = array('pb-clear-fix', 'pb-contact-form-field'); $fieldHTML .= ' <div' . PBHelper::createClassAttribute($class) . '>' . $this->createField($fieldValue) . '</div> '; } } $class = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($attribute['layout'], $i - 1), $attribute['column_' . $i . '_css_class']); $html .= ' <li' . PBHelper::createClassAttribute($class) . '>' . $fieldHTML . '</li> '; } $class = array('pb-reset-list', 'pb-clear-fix', $Layout->getLayoutCSSClass($attribute['layout'])); $html = ' <ul' . PBHelper::createClassAttribute($class) . '> ' . $html . ' </ul> '; return PBHelper::formatHTML($html); }
function processShortcodeBoxHeader($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $style = array(); $Align = new PBAlign(); $Header = new PBHeader(); $Validation = new PBValidation(); if ($Validation->isEmpty($content)) { return $html; } if (!array_key_exists($attribute['align'], $Align->align)) { return $html; } if (!array_key_exists($attribute['important'], $Header->important)) { return $html; } if ($Validation->isColor($attribute['text_color'])) { $style['color'] = PBColor::getColor($attribute['text_color']); } $class = array('pb-box-header', 'pb-clear-fix', $Align->getCSSClass($attribute['align'])); $html = ' <h' . $attribute['important'] . PBHelper::createClassAttribute($class) . PBHelper::createStyleAttribute($style) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</h' . $attribute['important'] . '> '; return PBHelper::formatHTML($html, $content); }
function processShortcodeClassItemButton($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $Validation = new PBValidation(); if ($Validation->isEmpty($content)) { return $html; } if ($Validation->isEmpty($attribute['url'])) { return $html; } $class = array('pb-class-item-button'); $html = ' <div' . PBHelper::createClassAttribute($class) . '> <a href="' . esc_attr($attribute['url']) . '">' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '<i class="pb-button-arrow pb-button-arrow-right"></i></a> </div> '; return PBHelper::formatHTML($html, $content); }
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 processShortcodePricingPlanItemPriceSuffix($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $Validation = new PBValidation(); if ($Validation->isEmpty($content)) { return $html; } $class = array('pb-pricing-plan-item-price-box-suffix'); $html = '<span' . PBHelper::createClassAttribute($class) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</span>'; return PBHelper::formatHTML($html, $content); }
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 processShortcodeFeatureItemContent($attribute, $content, $tag) { $attribute = $this->processAttribute($tag, $attribute); $html = null; $Validation = new PBValidation(); if ($Validation->isEmpty($content)) { return $html; } $class = array('pb-feature-content'); $html = '<div' . PBHelper::createClassAttribute($class) . '>' . PLUGIN_PAGE_BUILDER_SHORTCODE_CONTENT . '</div>'; return PBHelper::formatHTML($html, PBHelper::formatContent($content)); }
function processShortcodeTeam($attribute, $content, $tag) { $html = null; $teamHTML = null; $option = array(); $attribute = $this->processAttribute($tag, $attribute); $Window = new PBWindow(); $Easing = new PBEasing(); $Layout = new PBLayout(); $Validation = new PBValidation(); $ImageHover = new PBImageHover(); $data = $this->getTeam($attribute); if ($data === false) { return; } if (!count($data->posts)) { return; } if (!array_key_exists($attribute['template'], $this->template)) { return $html; } if (!array_key_exists($attribute['layout'], $this->layout)) { return $html; } if (!PBFile::isWPImage($attribute['image_size'])) { return $html; } if (!$Validation->isBool($attribute['hover_enable'])) { return $html; } if (!array_key_exists($attribute['hover_type'], $ImageHover->type)) { return $html; } if (!$Validation->isBool($attribute['preloader_enable'])) { return $html; } if (!$Validation->isBool($attribute['skill_list_waypoint_enable'])) { return $html; } if (!$Validation->isNumber($attribute['skill_list_waypoint_duration'], 0, 99999)) { return $html; } if (!array_key_exists($attribute['skill_list_waypoint_easing'], $Easing->easingType)) { return $html; } $key = array('hover_type', 'hover_enable', 'preloader_enable', 'skill_list_waypoint_enable', 'skill_list_waypoint_easing', 'skill_list_waypoint_duration', 'skill_list_waypoint_offset_trigger'); foreach ($key as $index) { $option[$index] = $attribute[$index]; } $layoutCurrent = '100'; if ($attribute['template'] == 2) { $layoutCurrent = '50x50'; } elseif ($attribute['template'] == 3) { $layoutCurrent = $attribute['layout']; } global $post; $bPost = $post; $i = 0; while ($data->have_posts()) { global $post; $data->the_post(); $full = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full'); $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(), $attribute['image_size']); if ($full == false || $thumbnail == false) { continue; } $meta = PBMeta::get($post); PBHelper::removeUIndex($meta, 'team_social', 'team_skill'); /***/ $class = array(array(), array()); $class[0] = array('pb-layout-' . $Layout->getLayoutColumnCSSClass($layoutCurrent, $i)); $class[1] = array('pb-image-box', 'pb-image-preloader-animation-enable'); $class[2] = array('pb-image'); if ($attribute['preloader_enable'] == 1) { array_push($class[1], 'pb-image-preloader'); } if ($attribute['hover_enable'] == 1) { array_push($class[1], 'pb-image-hover', 'pb-image-hover-type-' . $attribute['hover_type'], 'pb-image-type-image'); } /***/ $textHTML = null; if ($Validation->isNotEmpty($meta['team_first_name']) || $Validation->isNotEmpty($meta['team_second_name'])) { $textHTML .= '<h3 class="pb-team-text-box-member-name">' . trim($meta['team_first_name'] . ' ' . $meta['team_second_name']) . '</h3>'; } if ($Validation->isNotEmpty($meta['team_position'])) { $textHTML .= '<div class="pb-team-text-box-member-position">' . $meta['team_position'] . '</div>'; } /***/ $socialHTML = null; if (is_array($meta['team_social'])) { $social = PBHelper::orderArrayByElement($meta['team_social'], 'team_social_order'); foreach ($social as $index => $value) { if (!array_key_exists($value['team_social_name'], $this->social)) { continue; } $socialHTML .= ' <li> <a href="' . esc_attr($value['team_social_url']) . '" class="pb-team-social-icon-' . $value['team_social_name'] . ' ' . $Window->getTargetCSSClass('_blank') . '"></a> </li> '; } if ($Validation->isNotEmpty($socialHTML)) { $socialHTML = ' <ul class="pb-team-social-icon-box pb-reset-list pb-clear-fix"> ' . $socialHTML . ' </ul> '; } } /***/ $skillHTML = null; if (is_array($meta['team_skill'])) { $skill = PBHelper::orderArrayByElement($meta['team_skill'], 'team_skill_order'); foreach ($skill as $index => $value) { if (!$Validation->isNumber($value['team_skill_level'], 0, 100)) { continue; } $skillHTML .= ' <div class="pb-team-skill pb-value-' . (int) $value['team_skill_level'] . '"> <span class="pb-team-skill-label">' . esc_html($value['team_skill_name']) . '</span> <span class="pb-team-skill-value"> <span class="pb-team-skill-value-value">' . (int) $value['team_skill_level'] . '</span> <span class="pb-team-skill-value-character-after">%</span> </span> <span class="pb-team-skill-foreground"></span> <span class="pb-team-skill-background"></span> </div> '; } if ($Validation->isNotEmpty($skillHTML)) { $skillHTML = ' <div class="pb-team-skill-box"> ' . $skillHTML . ' </div> '; } } /***/ $imageTextHTML = null; if ($Validation->isNotEmpty($meta['team_first_name']) || $Validation->isNotEmpty($meta['team_second_name'])) { $imageTextHTML .= '<' . PBComponentData::get($this->getComponentId(), 'image_text_caption_header_tag') . ' class="pb-image-text-caption">' . trim($meta['team_first_name'] . ' ' . $meta['team_second_name']) . '</' . PBComponentData::get($this->getComponentId(), 'image_text_caption_header_tag') . '>'; } if ($Validation->isNotEmpty($meta['team_position'])) { $imageTextHTML .= '<div class="pb-image-text-description">' . $meta['team_position'] . '</div>'; } if ($Validation->isNotEmpty($imageTextHTML)) { $imageTextHTML = '<div class="pb-image-text">' . $imageTextHTML . '</div>'; } /***/ $imageHTML = null; if ($attribute['hover_enable'] == 1) { $imageHTML = '<a href="' . $full[0] . '"' . PBHelper::createClassAttribute($class[2]) . '><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'); } $imageBoxHTML = '<div' . PBHelper::createClassAttribute($class[1]) . '>' . $imageHTML . $imageTextHTML . '</div>'; /***/ $teamHTML .= ' <li' . PBHelper::createClassAttribute($class[0]) . '> '; switch ($attribute['template']) { case 1: $teamHTML .= '<div class="pb-layout-33x66 pb-clear-fix"><div class="pb-layout-column-left">' . $imageBoxHTML . $socialHTML . '</div><div class="pb-layout-column-right"><div class="pb-team-text-box">' . $textHTML . apply_filters('the_content', do_shortcode(get_the_content())) . '</div>' . $skillHTML . '</div></div>'; break; case 2: $teamHTML .= '<div class="pb-layout-50x50 pb-clear-fix"><div class="pb-layout-column-left">' . $imageBoxHTML . '</div><div class="pb-layout-column-right"><div class="pb-team-quote-box"></div><div class="pb-team-text-box">' . apply_filters('the_content', do_shortcode(get_the_content())) . '</div>' . $socialHTML . '</div></div>'; break; case 3: $teamHTML .= '<div>' . $imageBoxHTML . $socialHTML . '</div>'; break; } $teamHTML .= ' </li> '; $i++; } wp_reset_query(); $post = $bPost; if ($Validation->isEmpty($teamHTML)) { return; } $id = PBHelper::createId('pb_team'); $class = array(); $class[0] = array('pb-team', 'pb-team-template-' . $attribute['template'], 'pb-clear-fix', $attribute['css_class']); $class[1] = array('pb-layout-' . $layoutCurrent, 'pb-reset-list', 'pb-clear-fix'); $html = ' <div' . PBHelper::createClassAttribute($class[0]) . ' id="' . $id . '"> <ul' . PBHelper::createClassAttribute($class[1]) . '> ' . $teamHTML . ' </ul> </div> <div class="pb-script-tag"> <script type="text/javascript"> jQuery(document).ready(function($) { $(\'#' . $id . '\').PBTeam(' . json_encode($option) . '); }); </script> </div> '; return $html; }
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); }