/** * 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; }
function avia_mynew_section($params = array()) { global $avia_section_markup, $avia_config; $defaults = array('class' => 'main_color', 'bg' => '', 'close' => true, 'open' => true, 'open_structure' => true, 'open_color_wrap' => true, 'data' => '', "style" => '', 'id' => "", 'main_container' => false, 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'attach' => "", 'before_new' => "", 'custom_markup' => ''); $defaults = array_merge($defaults, $params); extract($defaults); $post_class = ""; $output = ""; $bg_slider = ""; $container_style = ""; if ($id) { $id = "id='{$id}'"; } if ($close) { $cm = avia_obeysection_close_markup(); $output .= "<!-- after firstsection-->" . avia_sc_section::$add_to_closing . avia_sc_section::$close_overlay; } //start new if ($open) { if (function_exists('avia_get_the_id')) { $post_class = "post-entry-" . avia_get_the_id(); } if ($open_color_wrap) { if (!empty($video)) { $slide = array('shortcode' => 'av_slideshow', 'content' => '', 'attr' => array('id' => '', 'video' => $video, 'slide_type' => 'video', 'video_mute' => true, 'video_loop' => true, 'video_ratio' => $video_ratio, 'video_controls' => 'disabled', 'video_section_bg' => true, 'video_format' => '', 'video_mobile' => '', 'video_mobile_disabled' => $video_mobile_disabled)); $bg_slider = new avia_slideshow(array('content' => array($slide))); $bg_slider->set_extra_class('av-section-video-bg'); $class .= " av-section-with-video-bg"; $class .= !empty($video_mobile_disabled) ? " av-section-mobile-video-disabled" : ""; $data .= " data-section-video-ratio='{$video_ratio}'"; } // add parallax div $output .= $attach; $output .= apply_filters('avf_section_container_add', '', $defaults); } } 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", '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; }
function avia_new_section($params = array()) { global $avia_section_markup, $avia_config; $defaults = array('class' => 'main_color', 'bg' => '', 'close' => true, 'open' => true, 'open_structure' => true, 'open_color_wrap' => true, 'data' => '', "style" => '', 'id' => "", 'main_container' => false, 'min_height' => '', 'video' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'attach' => "", 'custom_markup' => ''); $defaults = array_merge($defaults, $params); extract($defaults); $post_class = ""; $output = ""; $bg_slider = ""; if ($id) { $id = "id='{$id}'"; } //close old content structure. only necessary when previous element was a section. other fullwidth elements dont need this if ($close) { $cm = avia_section_close_markup(); $output .= "</div></div>{$cm}</div></div>"; } //start new if ($open) { if (function_exists('avia_get_the_id')) { $post_class = "post-entry-" . avia_get_the_id(); } if ($open_color_wrap) { if (!empty($min_height)) { $class .= " av-minimum-height av-minimum-height-" . $min_height; } if (!empty($video)) { $slide = array('shortcode' => 'av_slideshow', 'content' => '', 'attr' => array('id' => '', 'video' => $video, 'slide_type' => 'video', 'video_mute' => true, 'video_loop' => true, 'video_ratio' => $video_ratio, 'video_controls' => 'disabled', 'video_section_bg' => true, 'video_format' => '', 'video_mobile' => '', 'video_mobile_disabled' => $video_mobile_disabled)); $bg_slider = new avia_slideshow(array('content' => array($slide))); $bg_slider->set_extra_class('av-section-video-bg'); $class .= " av-section-with-video-bg"; $class .= !empty($video_mobile_disabled) ? " av-section-mobile-video-disabled" : ""; $data .= " data-section-video-ratio='{$video_ratio}'"; } $output .= "<div {$id} class='{$class} container_wrap " . avia_layout_class('main', false) . "' {$bg} {$data} {$style}>"; $output .= !empty($bg_slider) ? $bg_slider->html() : ""; $output .= $attach; $output .= apply_filters('avf_section_container_add', '', $defaults); } //this applies only for sections. other fullwidth elements dont need the container for centering if ($open_structure) { if (!empty($main_container)) { $markup = 'main ' . avia_markup_helper(array('context' => 'content', 'echo' => false, 'custom_markup' => $custom_markup)); $avia_section_markup = 'main'; } else { $markup = "div"; } $output .= "<div class='container'>"; $output .= "<{$markup} class='template-page content " . avia_layout_class('content', false) . " units'>"; $output .= "<div class='post-entry post-entry-type-page {$post_class}'>"; $output .= "<div class='entry-content-wrapper clearfix'>"; } } 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; }