本文整理汇总了PHP中ShortcodeHelper::shortcode2array方法的典型用法代码示例。如果您正苦于以下问题:PHP ShortcodeHelper::shortcode2array方法的具体用法?PHP ShortcodeHelper::shortcode2array怎么用?PHP ShortcodeHelper::shortcode2array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ShortcodeHelper
的用法示例。
在下文中一共展示了ShortcodeHelper::shortcode2array方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: shortcode_handler
/**
* 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 = "")
{
extract(shortcode_atts(array('position' => 'left', 'bar_styling' => 'av-striped-bar', 'bar_animation' => 'av-animated-bar'), $atts, $this->config['shortcode']));
$bars = ShortcodeHelper::shortcode2array($content);
$extraClass = $bar_styling . " " . $bar_animation;
$output = "";
if (!empty($bars)) {
$output .= "<div class='avia-progress-bar-container avia_animate_when_almost_visible " . $meta['el_class'] . " {$extraClass}'>";
$defaults = array('color' => 'theme-color', 'progress' => "100", 'title' => "", 'icon' => '', 'font' => '', "icon_select" => "no");
foreach ($bars as $bar) {
$bar['attr'] = array_merge($defaults, $bar['attr']);
$display_char = av_icon($bar['attr']['icon'], $bar['attr']['font']);
$output .= "<div class='avia-progress-bar " . $bar['attr']['color'] . "-bar icon-bar-" . $bar['attr']['icon_select'] . "'>";
if ($bar['attr']['icon_select'] == "yes" || $bar['attr']['title']) {
$output .= "<div class='progressbar-title-wrap'>";
$output .= "<div class='progressbar-icon'><span class='progressbar-char' {$display_char}></span></div>";
$output .= "<div class='progressbar-title'>" . $bar['attr']['title'] . "</div>";
$output .= "</div>";
}
$output .= "<div class='progress'><div class='bar-outer'><div class='bar' style='width: " . $bar['attr']['progress'] . "%' data-progress='" . $bar['attr']['progress'] . "'></div></div></div>";
$output .= "</div>";
}
$output .= "</div>";
}
return $output;
}
示例2: shortcode_handler
/**
* 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('email' => get_option('admin_email'), 'button' => __("Submit", 'avia_framework'), 'autorespond' => '', 'captcha' => '', 'subject' => '', 'on_send' => '', 'link' => '', 'sent' => __("Your message has been sent!", 'avia_framework'), 'title' => __("Send us mail", 'avia_framework')), $atts, $this->config['shortcode']);
extract($atts);
$post_id = function_exists('avia_get_the_id') ? avia_get_the_id() : get_the_ID();
$redirect = !empty($on_send) ? AviaHelper::get_url($link) : "";
$form_args = array("heading" => $title ? "<h3>" . $title . "</h3>" : "", "success" => "<h3 class='avia-form-success'>" . $sent . "</h3>", "submit" => $button, "myemail" => $email, "action" => get_permalink($post_id), "myblogname" => get_option('blogname'), "autoresponder" => $autorespond, "autoresponder_subject" => __('Thank you for your Message!', 'avia_framework'), "autoresponder_email" => $email, "subject" => $subject, "form_class" => $meta['el_class'], "multiform" => true, "label_first" => true, "redirect" => $redirect);
if (trim($form_args['myemail']) == '') {
$form_args['myemail'] = get_option('admin_email');
}
//form fields passed by the user
$form_fields = $this->helper_array2form_fields(ShortcodeHelper::shortcode2array($content, 1));
//fake username field that is not visible. if the field has a value a spam bot tried to send the form
$elements['avia_username'] = array('type' => 'decoy', 'label' => '', 'check' => 'must_empty');
//captcha field for the user to verify that he is real
if ($captcha) {
$elements['avia_age'] = array('type' => 'captcha', 'check' => 'captcha', 'label' => __('Please prove that you are human by solving the equation', 'avia_framework'));
}
//merge all fields
$form_fields = apply_filters('avia_contact_form_elements', array_merge($form_fields, $elements));
$form_args = apply_filters('avia_contact_form_args', $form_args, $post_id);
$contact_form = new avia_form($form_args);
$contact_form->create_elements($form_fields);
$output = $contact_form->display_form(true);
return $output;
}
示例3: shortcode_handler
/**
* 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 = "")
{
extract(shortcode_atts(array('position' => 'left'), $atts));
$icon_el = $this->elements[0]['subelements'][4];
$chars = $icon_el['chars'];
if (!is_array($chars)) {
include $icon_el['chars'];
}
$bars = ShortcodeHelper::shortcode2array($content);
$output = "";
if (!empty($bars)) {
$output .= "<div class='avia-progress-bar-container avia_animate_when_almost_visible " . $meta['el_class'] . "'>";
$defaults = array('color' => 'theme-color', 'progress' => "100", 'title' => "", 'icon' => 1, "icon_select" => "no");
foreach ($bars as $bar) {
$bar['attr'] = array_merge($defaults, $bar['attr']);
$display_char = isset($chars[$bar['attr']['icon'] - 1]) ? $chars[$bar['attr']['icon'] - 1] : $chars[0];
$output .= "<div class='avia-progress-bar " . $bar['attr']['color'] . "-bar icon-bar-" . $bar['attr']['icon_select'] . "'>";
if ($bar['attr']['icon_select'] == "yes" || $bar['attr']['title']) {
$output .= "<div class='progressbar-title-wrap'>";
$output .= "<div class='progressbar-icon avia-font-" . $icon_el['font'] . "'><span class='progressbar-char'>{$display_char}</span></div>";
$output .= "<div class='progressbar-title'>" . $bar['attr']['title'] . "</div>";
$output .= "</div>";
}
$output .= "<div class='progress'><div class='bar-outer'><div class='bar' style='width: " . $bar['attr']['progress'] . "%' data-progress='" . $bar['attr']['progress'] . "'></div></div></div>";
$output .= "</div>";
}
$output .= "</div>";
}
return $output;
}
示例4: shortcode_handler
/**
* 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)), $atts);
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;
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'] = "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'], 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_full::$slide_count));
}
return $output;
}
示例5: shortcode_handler
/**
* 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('type' => 'slider', 'autoplay' => 'false', 'animation' => 'fade', 'interval' => 5, 'navigation' => 'arrows', 'heading' => '', 'columns' => 3, 'handle' => $shortcodename, 'content' => ShortcodeHelper::shortcode2array($content, 1), 'class' => $meta['el_class'], 'custom_markup' => $meta['custom_markup'], 'font_color' => '', 'color' => '', 'styling' => ''), $atts, $this->config['shortcode']);
if ($atts['font_color'] == "custom") {
$atts['class'] .= " av_inherit_color";
$atts['styling'] .= !empty($atts['color']) ? " color:" . $atts['color'] . "; " : "";
if ($atts['styling']) {
$atts['styling'] = " style='" . $atts['styling'] . "'";
}
}
$slider = new avia_content_slider($atts);
return $slider->html();
}
示例6: shortcode_handler
/**
* 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;
}
示例7: shortcode_handler
/**
* 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' => '', 'control_layout' => 'av-control-default', 'perma_caption' => '', 'autoplay_stopper' => '', '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 (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'] .= " 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;
}
示例8: shortcode_handler
/**
* 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;
}
示例9: shortcode_handler
/**
* 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;
}
示例10: shortcode_handler
/**
* 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('name' => '', 'src' => '', 'description' => '', 'job' => ''), $atts);
extract($atts);
$socials = ShortcodeHelper::shortcode2array($content);
$output = "";
$output .= "<div class='avia-team-member " . $meta['el_class'] . "' xmlns:v='http://rdf.data-vocabulary.org/#' typeof='v:Person'>";
if ($src) {
$output .= "<div class='team-img-container'>";
$output .= "<img property='v:photo' class='avia_image avia_image_team' src='" . $src . "' alt='" . esc_attr($name) . "' />";
if (!empty($socials)) {
$icon_el = $this->elements[4]['subelements'][3];
$chars = $icon_el['chars'];
if (!is_array($chars)) {
include $icon_el['chars'];
}
$output .= "<div class='team-social'>";
$output .= "<div class='team-social-inner'>";
foreach ($socials as $social) {
//set defaults
$social['attr'] = shortcode_atts(array('link' => '', 'link_target' => '', 'icon' => '1', 'title' => ''), $social['attr']);
//build link for each social item
$tooltip = $social['attr']['title'] ? 'data-avia-tooltip="' . $social['attr']['title'] . '"' : "";
$target = $social['attr']['link_target'] ? "target='_blank'" : "";
//apply special class in case its a link to a known social media service
$social_class = $this->get_social_class($social['attr']['link']);
$output .= "<a rel='v:url' {$tooltip} {$target} class='{$social_class} avia-team-icon avia-font-" . $icon_el['font'] . "' href='" . $social['attr']['link'] . "'>";
$output .= isset($chars[$social['attr']['icon'] - 1]) ? $chars[$social['attr']['icon'] - 1] : $chars[0];
$output .= "</a>";
}
$output .= "</div>";
$output .= "</div>";
}
$output .= "</div>";
}
if ($name) {
$output .= "<h3 class='team-member-name' property='v:name'>{$name}</h3>";
}
if ($job) {
$output .= "<div class='team-member-job-title' property='v:title'>{$job}</div>";
}
if ($description) {
$output .= "<div class='team-member-description'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($description)) . "</div>";
}
$output .= "<span class='hidden team-member-affiliation' property='v:affiliation'>" . get_bloginfo('name') . "</span>";
$output .= "</div>";
return $output;
}
示例11: shortcode_handler
/**
* 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;
}
示例12: shortcode_handler
/**
* 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('type' => 'slider', 'autoplay' => 'false', 'animation' => 'fade', 'interval' => 5, 'navigation' => 'arrows', 'heading' => '', 'columns' => 3, 'handle' => $shortcodename, 'content' => ShortcodeHelper::shortcode2array($content, 1), 'class' => $meta['el_class']), $atts);
$slider = new avia_content_slider($atts);
return $slider->html();
}
示例13: shortcode_handler
/**
* 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;
}
示例14: shortcode_handler
/**
* 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('purpose' => 'pricing', 'caption' => '', 'responsive_styling' => 'avia_responsive_table', 'pricing_hidden_cells' => '', 'pricing_table_design' => 'avia_pricing_default'), $atts, $this->config['shortcode']);
$depth = 2;
$table_rows = ShortcodeHelper::shortcode2array($content, $depth);
$output = "";
if (empty($table_rows)) {
return;
}
self::$table_count++;
switch ($atts['purpose']) {
case "pricing":
$output .= $this->pricing_table($table_rows, $atts, $meta);
break;
default:
$output .= $this->data_table($table_rows, $atts, $meta);
break;
}
return $output;
}
示例15: shortcode_handler
/**
* 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('name' => '', 'src' => '', 'description' => '', 'job' => '', 'custom_markup' => '', 'font_color' => '', 'custom_title' => '', 'custom_content' => ''), $atts, $this->config['shortcode']);
extract($atts);
$title_styling = "";
$content_styling = "";
$content_class = "";
$title_class = "";
if ($font_color == "custom") {
$title_styling .= !empty($custom_title) ? "color:{$custom_title}; " : "";
$content_styling .= !empty($custom_content) ? "color:{$custom_content}; " : "";
if ($title_styling) {
$title_styling = " style='{$title_styling}'";
$title_class = "av_opacity_variation";
}
if ($content_styling) {
$content_styling = " style='{$content_styling}'";
$content_class = "av_inherit_color";
}
}
$socials = ShortcodeHelper::shortcode2array($content);
$output = "";
$markup = avia_markup_helper(array('context' => 'person', 'echo' => false, 'custom_markup' => $custom_markup));
$output .= "<section class='avia-team-member " . $meta['el_class'] . "' {$markup}>";
if ($src) {
$output .= "<div class='team-img-container'>";
$markup = avia_markup_helper(array('context' => 'single_image', 'echo' => false, 'custom_markup' => $custom_markup));
$output .= "<img class='avia_image avia_image_team' src='" . $src . "' alt='" . esc_attr($name) . "' {$markup} />";
if (!empty($socials)) {
$output .= "<div class='team-social'>";
$output .= "<div class='team-social-inner'>";
foreach ($socials as $social) {
//set defaults
$social['attr'] = shortcode_atts(array('link' => '', 'link_target' => '', 'icon' => '', 'font' => '', 'title' => ''), $social['attr'], 'av_social');
//build link for each social item
$tooltip = $social['attr']['title'] ? 'data-avia-tooltip="' . $social['attr']['title'] . '"' : "";
$target = $social['attr']['link_target'] ? "target='_blank'" : "";
//apply special class in case its a link to a known social media service
$social_class = $this->get_social_class($social['attr']['link']);
if (strstr($social['attr']['link'], '@')) {
$markup = avia_markup_helper(array('context' => 'email', 'echo' => false, 'custom_markup' => $custom_markup));
} else {
$markup = avia_markup_helper(array('context' => 'url', 'echo' => false, 'custom_markup' => $custom_markup));
}
$display_char = av_icon($social['attr']['icon'], $social['attr']['font']);
$output .= "<span class='hidden av_member_url_markup {$social_class}' {$markup}>" . $social['attr']['link'] . "</span>";
$output .= "<a rel='v:url' {$tooltip} {$target} class='{$social_class} avia-team-icon ' href='" . $social['attr']['link'] . "' {$display_char}>";
$output .= "</a>";
}
$output .= "</div>";
$output .= "</div>";
}
$output .= "</div>";
}
if ($name) {
$markup = avia_markup_helper(array('context' => 'name', 'echo' => false, 'custom_markup' => $custom_markup));
$output .= "<h3 class='team-member-name' {$title_styling} {$markup}>{$name}</h3>";
}
if ($job) {
$markup = avia_markup_helper(array('context' => 'job', 'echo' => false, 'custom_markup' => $custom_markup));
$output .= "<div class='team-member-job-title {$title_class}' {$title_styling} {$markup}>{$job}</div>";
}
if ($description) {
$markup = avia_markup_helper(array('context' => 'description', 'echo' => false, 'custom_markup' => $custom_markup));
$output .= "<div class='team-member-description {$content_class}' {$markup} {$content_styling}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($description)) . "</div>";
}
$markup = avia_markup_helper(array('context' => 'affiliation', 'echo' => false, 'custom_markup' => $custom_markup));
$output .= "<span class='hidden team-member-affiliation' {$markup}>" . get_bloginfo('name') . "</span>";
$output .= "</section>";
return $output;
}