/** * 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' => "grid", 'columns' => "2", "autoplay" => true, "interval" => 5), $atts); $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : ""; extract($atts); $output = ""; switch ($columns) { case 1: $columnClass = "av_one_full flex_column no_margin"; break; case 2: $columnClass = "av_one_half flex_column no_margin"; break; case 3: $columnClass = "av_one_third flex_column no_margin"; break; case 4: $columnClass = "av_one_fourth flex_column no_margin"; break; } $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => 'fade', 'hoverpause' => true)); $output .= "<div {$data} class='avia-testimonial-wrapper avia-{$style}-testimonials avia-{$style}-{$columns}-testimonials avia_animate_when_almost_visible {$custom_class}'>"; avia_sc_testimonial::$counter = 1; avia_sc_testimonial::$rows = 1; avia_sc_testimonial::$columnClass = $columnClass; avia_sc_testimonial::$columns = $columns; avia_sc_testimonial::$style = $style; //if we got a slider we only need a single row wrpper if ($style == "slider") { avia_sc_testimonial::$columns = 100000; } $output .= ShortcodeHelper::avia_remove_autop($content, true); //close unclosed wrapper containers if (avia_sc_testimonial::$counter != 1) { $output .= "</div>"; } $output .= "</div>"; 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('style' => "grid", 'columns' => "2", "autoplay" => true, "interval" => 5, 'font_color' => '', 'custom_title' => '', 'custom_content' => ''), $atts, $this->config['shortcode']); $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : ""; extract($atts); $this->title_styling = ""; $this->content_styling = ""; $this->content_class = ""; $this->subtitle_class = ""; if ($font_color == "custom") { $this->title_styling .= !empty($custom_title) ? "color:{$custom_title}; " : ""; $this->content_styling .= !empty($custom_content) ? "color:{$custom_content}; " : ""; if ($this->title_styling) { $this->title_styling = " style='{$this->title_styling}'"; $this->subtitle_class = "av_opacity_variation"; } if ($this->content_styling) { $this->content_class = "av_inherit_color"; $this->content_styling = " style='{$this->content_styling}'"; } } $output = ""; switch ($columns) { case 1: $columnClass = "av_one_full flex_column no_margin"; break; case 2: $columnClass = "av_one_half flex_column no_margin"; break; case 3: $columnClass = "av_one_third flex_column no_margin"; break; case 4: $columnClass = "av_one_fourth flex_column no_margin"; break; } $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => 'fade', 'hoverpause' => true)); $controls = false; if ($style == "slider_large") { $style = "slider"; $custom_class .= " av-large-testimonial-slider"; $controls = true; } $output .= "<div {$data} class='avia-testimonial-wrapper avia-{$style}-testimonials avia-{$style}-{$columns}-testimonials avia_animate_when_almost_visible {$custom_class}'>"; avia_sc_testimonial::$counter = 1; avia_sc_testimonial::$rows = 1; avia_sc_testimonial::$columnClass = $columnClass; avia_sc_testimonial::$columns = $columns; avia_sc_testimonial::$style = $style; //if we got a slider we only need a single row wrpper if ($style != "grid") { avia_sc_testimonial::$columns = 100000; } $output .= ShortcodeHelper::avia_remove_autop($content, true); //close unclosed wrapper containers if (avia_sc_testimonial::$counter != 1) { $output .= "</section>"; } if ($controls) { $output .= $this->slide_navigation_arrows(); } $output .= "</div>"; return $output; }