/**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $skipSecond = false;
     avia_sc_layerslider::$slide_count++;
     //check if we got a layerslider
     global $wpdb;
     // Table name
     $table_name = $wpdb->prefix . "layerslider";
     // Get slider
     $slider = $wpdb->get_row("SELECT * FROM {$table_name}\n\t\t\t\t\t\t\t\t\t\tWHERE id = " . (int) $atts['id'] . " AND flag_hidden = '0'\n\t\t\t\t\t\t\t\t\t\tAND flag_deleted = '0'\n\t\t\t\t\t\t\t\t\t\tORDER BY date_c DESC LIMIT 1", ARRAY_A);
     if (!empty($slider)) {
         $slides = json_decode($slider['data'], true);
         $height = $slides['properties']['height'];
         $width = $slides['properties']['width'];
         $responsive = !empty($slides['properties']['responsive']) ? $slides['properties']['responsive'] : '';
         $responsiveunder = !empty($slides['properties']['responsiveunder']) ? $slides['properties']['responsiveunder'] : '';
         $params['style'] = " style='height: " . ($height + 1) . "px;' ";
     }
     $params['class'] = "avia-layerslider main_color avia-shadow " . $meta['el_class'];
     $params['open_structure'] = false;
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if (empty($meta['index'])) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if (!empty($meta['index'])) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "layer_slider_" . avia_sc_layerslider::$slide_count;
     $output .= avia_new_section($params);
     $output .= function_exists('layerslider_init') ? layerslider_init($atts) : '';
     //fix for search results page
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_layer_slider_" . avia_sc_layerslider::$slide_count));
     }
     return $output;
 }
Example #2
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts['class'] = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
     if (current_theme_supports('avia_template_builder_custom_post_type_grid')) {
         if (isset($atts['link'])) {
             $atts['link'] = explode(',', $atts['link'], 2);
             $atts['taxonomy'] = $atts['link'][0];
             if (isset($atts['link'][1])) {
                 $atts['categories'] = $atts['link'][1];
             }
         }
         if (empty($atts['post_type']) || !current_theme_supports('add_avia_builder_post_type_option')) {
             $atts['post_type'] = get_post_types();
         }
         if (is_string($atts['post_type'])) {
             $atts['post_type'] = explode(',', $atts['post_type']);
         }
     }
     $atts['fullscreen'] = ShortcodeHelper::is_top_level();
     $grid = new avia_post_grid($atts);
     $grid->query_entries();
     $portfolio_html = $grid->html();
     if (!ShortcodeHelper::is_top_level()) {
         return $portfolio_html;
     }
     $params['class'] = "main_color avia-no-border-styling avia-fullwidth-portfolio " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     $output = avia_new_section($params);
     $output .= $portfolio_html;
     $output .= avia_section_after_element_content($meta, 'after_portfolio');
     return $output;
 }
Example #3
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $skipSecond = false;
     //check if we got a layerslider
     global $wpdb;
     $params['class'] = "main_color " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " masonry-not-first";
     }
     if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") {
         $params['class'] .= " masonry-not-first";
     }
     if ($atts['gap'] == 'no') {
         $params['class'] .= " avia-no-border-styling";
     }
     $atts['container_class'] = "av-masonry-gallery";
     $masonry = new avia_masonry($atts);
     $masonry->query_entries_by_id();
     $masonry_html = $masonry->html();
     if (!ShortcodeHelper::is_top_level()) {
         return $masonry_html;
     }
     $output .= avia_new_section($params);
     $output .= $masonry_html;
     $output .= "</div><!-- close section -->";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_masonry"));
     }
     return $output;
 }
Example #4
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $class = "";
     $alt = "";
     $title = "";
     $src = "";
     $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $hotspots = ShortcodeHelper::shortcode2array($content, 1);
     extract(shortcode_atts(array('animation' => 'no-animation', 'attachment' => '', 'attachment_size' => '', 'hotspot_layout' => 'numbered', 'hotspot_mobile' => '', 'hotspot_tooltip_display' => ''), $atts, $this->config['shortcode']));
     if (!empty($attachment)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             $alt = get_post_meta($attachment_entry->ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $title = trim($attachment_entry->post_title) ? esc_attr($attachment_entry->post_title) : "";
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     }
     //no src? return
     if (!empty($src)) {
         if (!ShortcodeHelper::is_top_level()) {
             $meta['el_class'] .= " av-non-fullwidth-hotspot-image";
         }
         $hotspot_html = "";
         $tooltip_html = "";
         $counter = 1;
         foreach ($hotspots as $hotspot) {
             if (!empty($hotspot_mobile)) {
                 $tooltip_html .= $this->add_fallback_tooltip($hotspot, $counter);
             }
             $extraClass = !empty($hotspot_mobile) ? " av-mobile-fallback-active " : "";
             $extraClass .= !empty($hotspot_tooltip_display) ? " {$hotspot_tooltip_display}-single " : "";
             $hotspot_html .= $this->add_hotspot($hotspot, $counter, $extraClass);
             $counter++;
         }
         //some custom classes
         $class .= $animation == "no-animation" ? "" : " avia_animated_image avia_animate_when_almost_visible " . $animation;
         $class .= " av-hotspot-" . $hotspot_layout;
         $class .= !empty($hotspot_mobile) ? " av-mobile-fallback-active " : "";
         $class .= " " . $hotspot_tooltip_display;
         $output .= "<div class='av-hotspot-image-container avia_animate_when_almost_visible {$class} " . $meta['el_class'] . " ' {$markup} >";
         $output .= "<div class='av-hotspot-container'>";
         $output .= "<div class='av-hotspot-container-inner-cell'>";
         $output .= "<div class='av-hotspot-container-inner-wrap'>";
         $output .= $hotspot_html;
         $output .= "<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
         $output .= "</div>";
         $output .= "</div>";
         $output .= "</div>";
         $output .= $tooltip_html;
         $output .= "</div>";
     }
     if (!ShortcodeHelper::is_top_level()) {
         return $output;
     }
     $skipSecond = false;
     $params['class'] = "main_color av-fullwidth-hotspots " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     $image = $output;
     $output = avia_new_section($params);
     $output .= $image;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_image_hotspots"));
     }
     return $output;
 }
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('size' => 'featured', 'animation' => 'slide', 'ids' => '', 'autoplay' => 'false', 'interval' => 5, 'handle' => $shortcodename, 'stretch' => '', 'bg_slider' => 'true', 'slide_height' => "100", 'content' => ShortcodeHelper::shortcode2array($content)), $atts);
     extract($atts);
     $output = "";
     $class = "";
     $skipSecond = false;
     avia_sc_slider_full::$slide_count++;
     $params['class'] = "avia-fullscreen-slider main_color " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "fullscreen_slider_" . avia_sc_slider_fullscreen::$slide_count;
     $output .= avia_new_section($params);
     $slider = new avia_slideshow($atts);
     $slider->set_extra_class($stretch);
     $output .= $slider->html();
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], array('av_layerslider', 'av_section', 'av_slideshow_full', 'av_fullscreen'))) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_slider_fullscreen::$slide_count));
     }
     return $output;
 }
Example #6
0
 function avia_section_after_element_content($meta, $second_id = "", $skipSecond = false, $extra = "")
 {
     $output = "</div>";
     //close section
     $output .= $extra;
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => $second_id));
     }
     return $output;
 }
Example #7
0
//check if we want to display breadcumb and title
if (get_post_meta(get_the_ID(), 'header', true) != 'no') {
    echo avia_title();
}
do_action('ava_after_main_title');
//filter the content for content builder elements
$content = apply_filters('avia_builder_precompile', get_post_meta(get_the_ID(), '_aviaLayoutBuilderCleanData', true));
//if user views a preview me must use the content because WordPress doesn't update the post meta field
if (is_preview()) {
    $content = apply_filters('avia_builder_precompile', get_the_content());
}
//check first builder element. if its a section or a fullwidth slider we dont need to create the default openeing divs here
$first_el = isset(ShortcodeHelper::$tree[0]) ? ShortcodeHelper::$tree[0] : false;
$last_el = !empty(ShortcodeHelper::$tree) ? end(ShortcodeHelper::$tree) : false;
if (!$first_el || !in_array($first_el['tag'], AviaBuilder::$full_el)) {
    echo avia_new_section(array('close' => false, 'main_container' => true));
}
$content = apply_filters('the_content', $content);
$content = apply_filters('avf_template_builder_content', $content);
echo $content;
$avia_wp_link_pages_args = apply_filters('avf_wp_link_pages_args', array('before' => '<nav class="pagination_split_post">' . __('Pages:', 'avia_framework'), 'after' => '</nav>', 'pagelink' => '<span>%</span>', 'separator' => ' '));
wp_link_pages($avia_wp_link_pages_args);
//only close divs if the user didnt add fullwidth slider elements at the end. also skip sidebar if the last element is a slider
if (!$last_el || !in_array($last_el['tag'], AviaBuilder::$full_el_no_section)) {
    $cm = avia_section_close_markup();
    echo "</div>";
    echo "</div>{$cm} <!-- section close by builder template -->";
    //get the sidebar
    if (is_singular('post')) {
        $avia_config['currently_viewing'] = 'blog';
    } else {
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('slide_type' => 'image-based', 'link' => '', 'size' => '', 'items' => '', 'autoplay' => 'false', 'title' => 'active', 'excerpt' => '', 'interval' => 5, 'offset' => 0, 'handle' => $shortcodename, 'content' => ShortcodeHelper::shortcode2array($content, 1)), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $class = "";
     $skipSecond = false;
     avia_sc_slider_accordion::$slide_count++;
     $params['class'] = "avia-accordion-slider-wrap main_color avia-shadow " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     $params['custom_markup'] = $atts['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "accordion_slider_" . avia_sc_slider_full::$slide_count;
     $slider = new aviaccordion($atts);
     $slide_html = $slider->html();
     //if the element is nested within a section or a column dont create the section shortcode around it
     if (!ShortcodeHelper::is_top_level()) {
         return $slide_html;
     }
     $output .= avia_new_section($params);
     $output .= $slide_html;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_slider_full::$slide_count));
     }
     return $output;
 }
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     if (isset($atts['link'])) {
         $atts['link'] = explode(',', $atts['link'], 2);
         $atts['taxonomy'] = $atts['link'][0];
         if (isset($atts['link'][1])) {
             $atts['categories'] = $atts['link'][1];
         }
     }
     // $atts['class'] = $meta['el_class'];
     extract($atts);
     $output = "";
     $class = "";
     $skipSecond = false;
     avia_sc_featureimage_slider::$slide_count++;
     $params['class'] = "avia-featureimage-slider-wrap main_color  " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     $params['custom_markup'] = $atts['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "avia_feature_image_slider_" . avia_sc_slider_full::$slide_count;
     $slider = new avia_feature_image_slider($atts);
     $slider->query_entries();
     $slide_html = $slider->html();
     //if the element is nested within a section or a column dont create the section shortcode around it
     if (!ShortcodeHelper::is_top_level()) {
         return $slide_html;
     }
     // $slide_html  = "<div class='container'>" . $slide_html . "</div>";
     $output .= avia_new_section($params);
     $output .= $slide_html;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_slider_full::$slide_count));
     }
     return $output;
 }
Example #10
0
 */
get_header();
// set up post data
setup_postdata($post);
//check if we want to display breadcumb and title
if (get_post_meta(get_the_ID(), 'header', true) != 'no') {
    echo avia_title();
}
//filter the content for content builder elements
$content = apply_filters('avia_builder_precompile', get_post_meta(get_the_ID(), '_aviaLayoutBuilderCleanData', true));
$content = apply_filters('the_content', $content);
//check first builder element. if its a section or a fullwidth slider we dont need to create the default openeing divs here
$first_el = isset(ShortcodeHelper::$tree[0]) ? ShortcodeHelper::$tree[0] : false;
$last_el = !empty(ShortcodeHelper::$tree) ? end(ShortcodeHelper::$tree) : false;
if (!$first_el || !in_array($first_el['tag'], array('av_section', 'av_layerslider', 'av_slideshow_full', 'av_fullscreen'))) {
    echo avia_new_section(array('close' => false));
}
echo $content;
//only close divs if the user didnt add fullwidth slider elements at the end. also skip sidebar if the last element is a slider
if (!$last_el || !in_array($last_el['tag'], array('av_layerslider', 'av_slideshow_full', 'av_fullscreen'))) {
    echo "\t\t\t</div>";
    echo "\t\t</div>";
    echo "\t</div>";
    //get the sidebar
    $avia_config['currently_viewing'] = 'page';
    get_sidebar();
} else {
    echo "<div><div>";
}
echo "\t</div><!--end builder template-->";
get_footer();
Example #11
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     avia_sc_section::$section_count++;
     extract(shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => ''), $atts));
     $output = "";
     $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow;
     $background = "";
     if ($src != "") {
         if ($repeat == 'stretch') {
             $background .= "background-repeat: no-repeat; ";
             $class .= " avia-full-stretch";
         } else {
             $background .= "background-repeat: {$repeat}; ";
         }
         $background .= "background-image: url({$src}); ";
         $background .= "background-attachment: {$attach}; ";
         $background .= "background-position: {$position}; ";
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     if ($background) {
         $background = "style = '{$background}'";
     }
     $params['class'] = $class . " " . $meta['el_class'];
     $params['bg'] = $background;
     $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count;
     if (isset($meta['index'])) {
         if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], array('av_layerslider', 'av_slideshow_full', 'av_fullscreen'))) {
             $params['close'] = false;
         }
     }
     $output .= avia_new_section($params);
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], array('av_layerslider', 'av_section', 'av_slideshow_full', 'av_fullscreen'))) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom
     if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $new_params['id'] = "after_section_" . avia_sc_section::$section_count;
         $output .= avia_new_section($new_params);
     }
     return $output;
 }
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $skipSecond = false;
     avia_sc_revolutionslider::$slide_count++;
     //check if we got a Revolution Slider
     global $wpdb;
     // Table name
     $table_name = $wpdb->prefix . "revslider_sliders";
     // Get slider
     $slider = $wpdb->get_row("SELECT * FROM {$table_name} WHERE id = '" . (int) $atts['id'] . "'", ARRAY_A);
     if (!empty($slider)) {
         $slides = json_decode($slider['params'], true);
         $height = $slides['height'];
         $params['style'] = " style='height: " . ($height + 1) . "px;' ";
     }
     $params['class'] = "avia-layerslider main_color avia-shadow " . $meta['el_class'];
     $params['open_structure'] = false;
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "layer_slider_" . avia_sc_revolutionslider::$slide_count;
     $output .= avia_new_section($params);
     $output .= do_shortcode('[rev_slider ' . $atts['id'] . ']');
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_layer_slider_" . avia_sc_revolutionslider::$slide_count));
     }
     return $output;
 }
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $skipSecond = false;
     avia_sc_layerslider::$slide_count++;
     //check if we got a layerslider
     global $wpdb;
     // Table name
     $table_name = $wpdb->prefix . "layerslider";
     // Get slider
     $slider = $wpdb->get_row("SELECT * FROM {$table_name}\n\t\t\t\t\t\t\t\t\t\tWHERE id = " . (int) $atts['id'] . " AND flag_hidden = '0'\n\t\t\t\t\t\t\t\t\t\tAND flag_deleted = '0'\n\t\t\t\t\t\t\t\t\t\tORDER BY date_c DESC LIMIT 1", ARRAY_A);
     if (!empty($slider)) {
         $slides = json_decode($slider['data'], true);
         $height = $slides['properties']['height'];
         $width = $slides['properties']['width'];
         $responsive = $slides['properties']['responsive'];
         $responsiveunder = $slides['properties']['responsiveunder'];
         $params['style'] = " style='height: " . ($height + 1) . "px;' ";
     }
     $params['class'] = "avia-layerslider main_color avia-shadow " . $meta['el_class'];
     $params['open_structure'] = false;
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "layer_slider_" . avia_sc_layerslider::$slide_count;
     $output .= avia_new_section($params);
     $output .= layerslider_init($atts);
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], array('av_layerslider', 'av_section', 'av_slideshow_full', 'av_fullscreen'))) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_layer_slider_" . avia_sc_layerslider::$slide_count));
     }
     return $output;
 }
Example #14
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     avia_sc_button_full::$count++;
     $atts = shortcode_atts(array('label' => 'Click me', 'link' => '', 'link_target' => '', 'color' => 'theme-color', 'color_hover' => 'theme-color-subtle', 'custom_bg' => '#444444', 'custom_bg_hover' => '#444444', 'custom_font' => '#ffffff', 'position' => 'center', 'icon_select' => 'no', 'icon' => '', 'font' => '', 'icon_hover' => '', 'description_pos' => ''), $atts, $this->config['shortcode']);
     $display_char = av_icon($atts['icon'], $atts['font']);
     $style = "color:" . $atts['custom_font'] . "; ";
     $style_hover = "";
     if ($atts['color'] == "custom") {
         $style .= "background-color:" . $atts['custom_bg'] . ";  ";
     }
     if ($atts['color_hover'] == "custom") {
         $style_hover = "style='background-color:" . $atts['custom_bg_hover'] . "; '";
     }
     $extraClass = $atts['icon_hover'] ? "av-icon-on-hover" : "";
     $blank = strpos($atts['link_target'], '_blank') !== false ? ' target="_blank" ' : "";
     $blank .= strpos($atts['link_target'], 'nofollow') !== false ? ' rel="nofollow" ' : "";
     $link = AviaHelper::get_url($atts['link']);
     $link = $link == "http://" ? "" : $link;
     if ($style) {
         $style = "style='{$style}'";
     }
     $content_html = "";
     if ($content && $atts['description_pos'] == 'above') {
         $content_html .= "<div class='av-button-description av-button-description-above'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
     }
     if ('yes-left-icon' == $atts['icon_select']) {
         $content_html .= "<span class='avia_button_icon avia_button_icon_left ' {$display_char}></span>";
     }
     $content_html .= "<span class='avia_iconbox_title' >" . $atts['label'] . "</span>";
     if ('yes-right-icon' == $atts['icon_select']) {
         $content_html .= "<span class='avia_button_icon avia_button_icon_right' {$display_char}></span>";
     }
     if ($content && $atts['description_pos'] == 'below') {
         $content_html .= "<div class='av-button-description av-button-description-below'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
     }
     $output = "";
     $output .= "<a href='{$link}' class='avia-button avia-button-fullwidth {$extraClass} " . $this->class_by_arguments('icon_select, color', $atts, true) . "' {$blank} {$style} >";
     $output .= $content_html;
     $output .= "<span class='avia_button_background avia-button avia-button-fullwidth avia-color-" . $atts['color_hover'] . "' {$style_hover}></span>";
     $output .= "</a>";
     $output = "<div class='avia-button-wrap avia-button-" . $atts['position'] . " " . $meta['el_class'] . "'>" . $output . "</div>";
     $params['class'] = "main_color av-fullscreen-button avia-no-border-styling " . $meta['el_class'];
     $params['open_structure'] = false;
     $id = AviaHelper::save_string($atts['label'], '-');
     $params['id'] = !empty($id) ? $id : "av-fullwidth-button-" . avia_sc_button_full::$count;
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if (!ShortcodeHelper::is_top_level()) {
         return $output;
     }
     $button_html = $output;
     $output = avia_new_section($params);
     $output .= $button_html;
     $output .= avia_section_after_element_content($meta, 'after_fullwidth_button');
     return $output;
     return $output;
 }
Example #15
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     global $avia_config;
     avia_sc_section::$section_count++;
     $atts = shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => '', 'min_height' => '', 'min_height_px' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'custom_markup' => '', 'attachment' => '', 'attachment_size' => '', 'bottom_border' => '', 'overlay_enable' => '', 'overlay_opacity' => '', 'overlay_color' => '', 'overlay_pattern' => '', 'overlay_custom_pattern' => '', 'scroll_down' => ''), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow;
     $background = "";
     $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count;
     $params['custom_markup'] = $meta['custom_markup'];
     $params['attach'] = "";
     if (!empty($attachment) && !empty($attachment_size)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     } else {
         $attachment = false;
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     /*set background image*/
     if ($src != "") {
         if ($repeat == 'stretch') {
             $background .= "background-repeat: no-repeat; ";
             $class .= " avia-full-stretch";
         } else {
             $background .= "background-repeat: {$repeat}; ";
         }
         $background .= "background-image: url({$src}); ";
         $background .= $attach == 'parallax' ? "background-attachment: scroll; " : "background-attachment: {$attach}; ";
         $background .= "background-position: {$position}; ";
         if ($attach == 'parallax') {
             $attachment_class = "";
             if ($repeat == 'stretch' || $repeat == 'no-repeat') {
                 $attachment_class .= " avia-full-stretch";
             }
             $class .= " av-parallax-section";
             $speed = apply_filters('avf_parallax_speed', "0.3", $params['id']);
             $params['attach'] .= "<div class='av-parallax' data-avia-parallax-ratio='{$speed}' >";
             $params['attach'] .= "<div class='av-parallax-inner {$color} {$attachment_class}' style = '{$background}' >";
             $params['attach'] .= "</div>";
             $params['attach'] .= "</div>";
             $background = "";
         }
         $params['data'] = "data-section-bg-repeat='{$repeat}'";
     } else {
         $attach = "scroll";
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     if ($background) {
         $background = "style = '{$background}'";
     }
     /*check/create overlay*/
     $overlay = "";
     $pre_wrap = "<div class='av-section-color-overlay-wrap'>";
     if (!empty($overlay_enable)) {
         $overlay_src = "";
         $overlay = "opacity: {$overlay_opacity}; ";
         if (!empty($overlay_color)) {
             $overlay .= "background-color: {$overlay_color}; ";
         }
         if (!empty($overlay_pattern)) {
             if ($overlay_pattern == "custom") {
                 $overlay_src = $overlay_custom_pattern;
             } else {
                 $overlay_src = str_replace('{{AVIA_BASE_URL}}', AVIA_BASE_URL, $overlay_pattern);
             }
         }
         if (!empty($overlay_src)) {
             $overlay .= "background-image: url({$overlay_src}); background-repeat: repeat;";
         }
         $overlay = "<div class='av-section-color-overlay' style='{$overlay}'></div>";
         $class .= " av-section-color-overlay-active";
         $params['attach'] .= $pre_wrap . $overlay;
     }
     if (!empty($scroll_down)) {
         if (!$overlay) {
             $params['attach'] .= $pre_wrap;
         }
         $params['attach'] .= "<a href='#next-section' title='' class='scroll-down-link' " . av_icon_string('scrolldown') . "></a>";
     }
     $class .= " avia-bg-style-" . $attach;
     $params['class'] = $class . " " . $meta['el_class'];
     $params['bg'] = $background;
     $params['min_height'] = $min_height;
     $params['min_height_px'] = $min_height_px;
     $params['video'] = $video;
     $params['video_ratio'] = $video_ratio;
     $params['video_mobile_disabled'] = $video_mobile_disabled;
     if (isset($meta['index'])) {
         if ($meta['index'] == 0) {
             $params['main_container'] = true;
         }
         if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
             $params['close'] = false;
         }
     }
     $avia_config['layout_container'] = "section";
     $output .= avia_new_section($params);
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     /*set extra arrow element*/
     if (strpos($bottom_border, 'border-extra') !== false) {
         $backgroundEl = "";
         $backgroundElColor = !empty($custom_bg) ? $custom_bg : $avia_config['backend_colors']['color_set'][$color]['bg'];
         if ($backgroundElColor) {
             $backgroundEl = " style='background-color:{$backgroundElColor};' ";
         }
         avia_sc_section::$add_to_closing = "<div class='av-extra-border-element {$bottom_border}'><div class='av-extra-border-outer'><div class='av-extra-border-inner' {$backgroundEl}></div></div></div>";
     } else {
         avia_sc_section::$add_to_closing = "";
     }
     //next section needs an extra closing tag if overlay with wrapper was added:
     if ($overlay || !empty($scroll_down)) {
         avia_sc_section::$close_overlay = "</div>";
     } else {
         avia_sc_section::$close_overlay = "";
     }
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom
     if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $new_params['id'] = "after_section_" . avia_sc_section::$section_count;
         $output .= avia_new_section($new_params);
     }
     unset($avia_config['layout_container']);
     return $output;
 }
Example #16
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('style' => '', 'menu' => '', 'position' => 'center', 'sticky' => '', 'color' => 'main_color', 'mobile' => 'disabled', 'mobile_submenu' => '', 'which_menu' => ''), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $sticky_div = "";
     avia_sc_submenu::$count++;
     avia_sc_submenu::$custom_items = 0;
     $params['class'] = "av-submenu-container {$color} " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = "sub_menu" . avia_sc_submenu::$count;
     $params['custom_markup'] = $meta['custom_markup'];
     $params['style'] = "style='z-index:" . (avia_sc_submenu::$count + 300) . "'";
     if ($sticky && $sticky != "disabled") {
         $params['class'] .= " av-sticky-submenu";
         $params['before_new'] = "<div class='clear'></div>";
         $sticky_div = "<div class='sticky_placeholder'></div>";
     }
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if (isset($meta['index']) && $meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if (isset($meta['index']) && $meta['index'] != 0) {
         $params['class'] .= " submenu-not-first";
     }
     if ($which_menu == "custom") {
         $element = "";
         $custom_menu = ShortcodeHelper::avia_remove_autop($content, true);
         if (!empty($custom_menu)) {
             $element .= "<ul id='av-custom-submenu-" . avia_sc_submenu::$count . "' class='av-subnav-menu av-submenu-pos-{$position}'>";
             $element .= $custom_menu;
             $element .= "</ul>";
         }
     } else {
         $element = wp_nav_menu(array('menu' => wp_get_nav_menu_object($menu), 'menu_class' => "av-subnav-menu av-submenu-pos-{$position}", 'fallback_cb' => '', 'container' => false, 'echo' => false, 'walker' => new avia_responsive_mega_menu(array('megamenu' => 'disabled'))));
     }
     $submenu_hidden = "";
     $mobile_button = $mobile == "active" ? "<a href='#' class='mobile_menu_toggle' " . av_icon_string('mobile_menu') . "><span class='av-current-placeholder'>" . __('Menu', 'avia_framework') . "</span></a>" : "";
     if (!empty($mobile_button) && !empty($mobile_submenu) && $mobile_submenu != "disabled") {
         $submenu_hidden = "av-submenu-hidden";
     }
     // if(!ShortcodeHelper::is_top_level()) return $element;
     $output .= avia_new_section($params);
     $output .= "<div class='container av-menu-mobile-{$mobile} {$submenu_hidden}'>{$mobile_button}" . $element . "</div>";
     $output .= avia_section_after_element_content($meta, 'after_submenu', false, $sticky_div);
     return $output;
 }
Example #17
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     avia_sc_section::$section_count++;
     $atts = shortcode_atts(array('src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'color' => 'main_color', 'custom_bg' => '', 'padding' => 'default', 'shadow' => 'shadow', 'id' => '', 'min_height' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'custom_markup' => '', 'attachment' => '', 'attachment_size' => ''), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $class = "avia-section " . $color . " avia-section-" . $padding . " avia-" . $shadow . " avia-bg-style-" . $attach;
     $background = "";
     $params['id'] = !empty($id) ? AviaHelper::save_string($id, '-') : "av_section_" . avia_sc_section::$section_count;
     $params['custom_markup'] = $meta['custom_markup'];
     if (!empty($attachment) && !empty($attachment_size)) {
         $attachment_entry = get_post($attachment);
         if (!empty($attachment_entry)) {
             if (!empty($attachment_size)) {
                 $src = wp_get_attachment_image_src($attachment_entry->ID, $attachment_size);
                 $src = !empty($src[0]) ? $src[0] : "";
             }
         }
     } else {
         $attachment = false;
     }
     if ($src != "") {
         if ($repeat == 'stretch') {
             $background .= "background-repeat: no-repeat; ";
             $class .= " avia-full-stretch";
         } else {
             $background .= "background-repeat: {$repeat}; ";
         }
         $background .= "background-image: url({$src}); ";
         $background .= $attach == 'parallax' ? "background-attachment: scroll; " : "background-attachment: {$attach}; ";
         $background .= "background-position: {$position}; ";
         if ($attach == 'parallax') {
             $attachment_class = "";
             if ($repeat == 'stretch' || $repeat == 'no-repeat') {
                 $attachment_class .= " avia-full-stretch";
             }
             $class .= " av-parallax-section";
             $speed = apply_filters('avf_parallax_speed', "0.3", $params['id']);
             $params['attach'] = "<div class='av-parallax {$attachment_class}' data-avia-parallax-ratio='{$speed}' style = '{$background}' ></div>";
             $background = "";
         }
         $params['data'] = "data-section-bg-repeat='{$repeat}'";
     }
     if ($custom_bg != "") {
         $background .= "background-color: {$custom_bg}; ";
     }
     if ($background) {
         $background = "style = '{$background}'";
     }
     $params['class'] = $class . " " . $meta['el_class'];
     $params['bg'] = $background;
     $params['min_height'] = $min_height;
     $params['video'] = $video;
     $params['video_ratio'] = $video_ratio;
     $params['video_mobile_disabled'] = $video_mobile_disabled;
     if (isset($meta['index'])) {
         if ($meta['index'] == 0) {
             $params['main_container'] = true;
         }
         if ($meta['index'] == 0 || isset($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
             $params['close'] = false;
         }
     }
     global $avia_config;
     $avia_config['layout_container'] = "section";
     $output .= avia_new_section($params);
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section. if we got a sidebar always create a next section at the bottom
     if (empty($meta['siblings']['next']['tag']) && !avia_has_sidebar()) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $new_params['id'] = "after_section_" . avia_sc_section::$section_count;
         $output .= avia_new_section($new_params);
     }
     unset($avia_config['layout_container']);
     return $output;
 }
Example #18
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('style' => '', 'menu' => '', 'position' => 'center', 'sticky' => '', 'color' => 'main_color'), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $sticky_div = "";
     avia_sc_submenu::$count++;
     $params['class'] = "av-submenu-container {$color} " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = "sub_menu" . avia_sc_submenu::$count;
     $params['custom_markup'] = $meta['custom_markup'];
     $params['style'] = "style='z-index:" . (avia_sc_submenu::$count + 300) . "'";
     if ($sticky && $sticky != "disabled") {
         $params['class'] .= " av-sticky-submenu";
         $params['before_new'] = "<div class='clear'></div>";
         $sticky_div = "<div class='sticky_placeholder'></div>";
     }
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if (isset($meta['index']) && $meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if (isset($meta['index']) && $meta['index'] != 0) {
         $params['class'] .= " submenu-not-first";
     }
     $element = wp_nav_menu(array('menu' => wp_get_nav_menu_object($menu), 'menu_class' => "av-subnav-menu av-submenu-pos-{$position}", 'fallback_cb' => '', 'container' => false, 'echo' => false, 'walker' => new avia_responsive_mega_menu(array('megamenu' => 'disabled'))));
     // if(!ShortcodeHelper::is_top_level()) return $element;
     $output .= avia_new_section($params);
     $output .= "<div class='container'>" . $element . "</div>";
     $output .= avia_section_after_element_content($meta, 'after_submenu', false, $sticky_div);
     return $output;
 }
Example #19
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $params['class'] = "main_color " . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($atts['id']) ? AviaHelper::save_string($atts['id'], '-') : "";
     $params['custom_markup'] = $meta['custom_markup'];
     if ($atts['gap'] == 'no' && $atts['sort'] == "no" || $meta['index'] == 0) {
         $params['class'] .= " avia-no-border-styling";
     }
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " masonry-not-first";
     }
     if ($meta['index'] == 0 && get_post_meta(get_the_ID(), 'header', true) != "no") {
         $params['class'] .= " masonry-not-first";
     }
     $masonry = new avia_masonry($atts);
     $masonry->extract_terms();
     $masonry->query_entries();
     $masonry_html = $masonry->html();
     if (!ShortcodeHelper::is_top_level()) {
         return $masonry_html;
     }
     $output .= avia_new_section($params);
     $output .= $masonry_html;
     $output .= avia_section_after_element_content($meta, 'after_masonry');
     return $output;
 }
Example #20
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('id' => '', 'height' => '', 'hue' => '', 'saturation' => '', 'zoom' => '', 'zoom_control' => '', 'pan_control' => '', 'mobile_drag_control' => '', 'handle' => $shortcodename, 'content' => ShortcodeHelper::shortcode2array($content, 1)), $atts, $this->config['shortcode']);
     $atts['zoom_control'] = empty($atts['zoom_control']) ? false : true;
     $atts['pan_control'] = empty($atts['pan_control']) ? false : true;
     $atts['mobile_drag_control'] = empty($atts['mobile_drag_control']) ? true : false;
     extract($atts);
     $output = "";
     $class = "";
     $skipSecond = false;
     avia_sc_gmaps::$map_count++;
     $params['class'] = "avia-google-maps avia-google-maps-section main_color " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     $params['id'] = empty($id) ? "avia-google-map-nr-" . avia_sc_gmaps::$map_count : $id;
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     //print the javascript vars necessary in the frontend footer
     $this->generate_js_vars($content, $atts);
     add_action('wp_footer', array($this, 'send_var_to_frontend'), 2, 100000);
     //create the map div that will be used to insert the google map
     $map = "<div id='av_gmap_" . avia_sc_gmaps::$map_count . "' class='avia-google-map-container' data-mapid='" . avia_sc_gmaps::$map_count . "' " . $this->define_height($height) . "></div>";
     //if the element is nested within a section or a column dont create the section shortcode around it
     if (!ShortcodeHelper::is_top_level()) {
         return $map;
     }
     $output .= avia_new_section($params);
     $output .= $map;
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_gmaps::$map_count));
     }
     return $output;
 }
Example #21
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     avia_sc_grid_row::$count++;
     $atts = shortcode_atts(array('color' => 'main_color', 'border' => '', 'min_height' => '0', 'mobile' => 'av-flex-cells', 'id' => ''), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $params['class'] = "av-layout-grid-container {$color} {$mobile} {$border}" . $meta['el_class'];
     $params['open_structure'] = false;
     $params['id'] = !empty($id) ? $id : "av-layout-grid-" . avia_sc_grid_row::$count;
     $params['custom_markup'] = $meta['custom_markup'];
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if (isset($meta['index']) && $meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if (isset($meta['index']) && $meta['index'] != 0) {
         $params['class'] .= " submenu-not-first";
     }
     avia_sc_cell::$attr = $atts;
     $output .= avia_new_section($params);
     $output .= ShortcodeHelper::avia_remove_autop($content, true);
     $output .= avia_section_after_element_content($meta, 'after_submenu', false);
     return $output;
 }
Example #22
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('size' => 'featured', 'animation' => 'slide', 'ids' => '', 'autoplay' => 'false', 'interval' => 5, 'handle' => $shortcodename, 'stretch' => '', 'bg_slider' => 'true', 'slide_height' => "100", 'scroll_down' => '', 'control_layout' => '', 'perma_caption' => '', 'content' => ShortcodeHelper::shortcode2array($content, 1)), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $class = "";
     $skipSecond = false;
     avia_sc_slider_full::$slide_count++;
     $params['class'] = "avia-fullscreen-slider main_color " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = $atts['css_id'] = "fullscreen_slider_" . avia_sc_slider_fullscreen::$slide_count;
     $output .= avia_new_section($params);
     $slider = new avia_slideshow($atts);
     $slider->set_extra_class($stretch);
     $output .= $slider->html();
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_slider_fullscreen::$slide_count));
     }
     return $output;
 }
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element 
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string 
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $atts = shortcode_atts(array('size' => 'featured', 'animation' => 'slide', 'ids' => '', 'autoplay' => 'false', 'interval' => 5, 'handle' => $shortcodename, 'src' => '', 'position' => 'top left', 'repeat' => 'no-repeat', 'attach' => 'scroll', 'stretch' => '', 'content' => ShortcodeHelper::shortcode2array($content, 1)), $atts, $this->config['shortcode']);
     extract($atts);
     $output = "";
     $background = "";
     $class = "";
     if ($src != "") {
         if ($repeat == 'stretch') {
             $background .= "background-repeat: no-repeat; ";
             $class .= " avia-full-stretch";
         } else {
             $background .= "background-repeat: {$repeat}; ";
         }
         $background .= "background-image: url({$src}); ";
         $background .= "background-attachment: {$attach}; ";
         $background .= "background-position: {$position}; ";
     }
     if ($background) {
         $params['bg'] = "style = '{$background}'";
     }
     $skipSecond = false;
     avia_sc_slider_full::$slide_count++;
     $params['class'] = "avia-fullwidth-slider main_color avia-shadow " . $meta['el_class'] . $class;
     $params['open_structure'] = false;
     //we dont need a closing structure if the element is the first one or if a previous fullwidth element was displayed before
     if ($meta['index'] == 0) {
         $params['close'] = false;
     }
     if (!empty($meta['siblings']['prev']['tag']) && in_array($meta['siblings']['prev']['tag'], AviaBuilder::$full_el_no_section)) {
         $params['close'] = false;
     }
     if ($meta['index'] != 0) {
         $params['class'] .= " slider-not-first";
     }
     $params['id'] = "full_slider_" . avia_sc_slider_full::$slide_count;
     $output .= avia_new_section($params);
     $slider = new avia_slideshow($atts);
     $slider->set_extra_class($stretch);
     $output .= $slider->html();
     $output .= "</div>";
     //close section
     //if the next tag is a section dont create a new section from this shortcode
     if (!empty($meta['siblings']['next']['tag']) && in_array($meta['siblings']['next']['tag'], AviaBuilder::$full_el)) {
         $skipSecond = true;
     }
     //if there is no next element dont create a new section.
     if (empty($meta['siblings']['next']['tag'])) {
         $skipSecond = true;
     }
     if (empty($skipSecond)) {
         $output .= avia_new_section(array('close' => false, 'id' => "after_full_slider_" . avia_sc_slider_full::$slide_count));
     }
     return $output;
 }
Example #24
0
//check if we want to display breadcumb and title
if (get_post_meta(get_the_ID(), 'header', true) != 'no') {
    echo avia_title();
}
do_action('ava_after_main_title');
//filter the content for content builder elements
$content = apply_filters('avia_builder_precompile', get_post_meta(get_the_ID(), '_aviaLayoutBuilderCleanData', true));
//if user views a preview me must use the content because WordPress doesn't update the post meta field
if (is_preview()) {
    $content = apply_filters('avia_builder_precompile', get_the_content());
}
//check first builder element. if its a section or a fullwidth slider we dont need to create the default openeing divs here
$first_el = isset(ShortcodeHelper::$tree[0]) ? ShortcodeHelper::$tree[0] : false;
$last_el = !empty(ShortcodeHelper::$tree) ? end(ShortcodeHelper::$tree) : false;
if (!$first_el || !in_array($first_el['tag'], AviaBuilder::$full_el)) {
    echo avia_new_section(array('close' => false, 'main_container' => true, 'class' => 'main_color container_wrap_first'));
}
$content = apply_filters('the_content', $content);
$content = apply_filters('avf_template_builder_content', $content);
echo $content;
$avia_wp_link_pages_args = apply_filters('avf_wp_link_pages_args', array('before' => '<nav class="pagination_split_post">' . __('Pages:', 'avia_framework'), 'after' => '</nav>', 'pagelink' => '<span>%</span>', 'separator' => ' '));
wp_link_pages($avia_wp_link_pages_args);
//only close divs if the user didnt add fullwidth slider elements at the end. also skip sidebar if the last element is a slider
if (!$last_el || !in_array($last_el['tag'], AviaBuilder::$full_el_no_section)) {
    $cm = avia_section_close_markup();
    echo "</div>";
    echo "</div>{$cm} <!-- section close by builder template -->";
    //get the sidebar
    if (is_singular('post')) {
        $avia_config['currently_viewing'] = 'blog';
    } else {