コード例 #1
0
 /**
  * Render the child shortcode
  * 
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_child($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'background_color_front' => $evl_options['evl_shortcode_flip_boxes_bg_color_frontside'] . $smof_data['flip_boxes_front_bg'], 'background_color_back' => $evl_options['evl_shortcode_flip_bg_color_backside'] . $smof_data['flip_boxes_back_bg'], 'border_color' => $evl_options['evl_shortcode_flip_border_color'] . $smof_data['flip_boxes_border_color'], 'border_radius' => $evl_options['evl_shortcode_flip_border_radius'] . $smof_data['flip_boxes_border_radius'], 'border_size' => $evl_options['evl_shortcode_flip_border_size'] . $smof_data['flip_boxes_border_size'], 'circle' => '', 'circle_color' => $evl_options['evl_shortcode_icon_circle_color'] . $smof_data['icon_circle_color'], 'circle_border_color' => $evl_options['evl_shortcode_icon_circle_border_color'] . $smof_data['icon_border_color'], 'icon' => '', 'icon_color' => $evl_options['evl_shortcode_icon_color'] . $smof_data['icon_color'], 'icon_flip' => '', 'icon_rotate' => '', 'icon_spin' => '', 'image' => '', 'image_width' => '35', 'image_height' => '35', 'text_back_color' => $evl_options['evl_shortcode_flip_text_color_backside'] . $smof_data['flip_boxes_back_text'], 'text_front' => '', 'text_front_color' => $evl_options['evl_shortcode_flip_text_color_frontside'] . $smof_data['flip_boxes_front_text'], 'title_front' => '', 'title_front_color' => $evl_options['evl_shortcode_flip_boxes_heading_color_frontside'] . $smof_data['flip_boxes_front_heading'], 'title_back' => '', 'title_back_color' => $evl_options['evl_shortcode_flip_heading_color_backside'] . $smof_data['flip_boxes_back_heading'], 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1'), $args);
     extract($defaults);
     self::$child_args = $defaults;
     $style = $icon_output = $title_output = $title_front_output = $title_back_output = '';
     if ($image && $image_width && $image_height) {
         $icon_output = sprintf('<img src="%s" width="%s" height="%s" />', $image, $image_width, $image_height);
     } else {
         if ($icon) {
             $icon_output = sprintf('<i %s></i>', T4PCore_Plugin::attributes('flip-box-shortcode-icon'));
         }
     }
     if ($icon_output) {
         $icon_output = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('flip-box-shortcode-grafix'), $icon_output);
     } else {
         $icon_output = '';
     }
     if ($title_front) {
         $title_front_output = sprintf('<h2 %s>%s</h2>', T4PCore_Plugin::attributes('flip-box-shortcode-heading-front'), $title_front);
     }
     if ($title_back) {
         $title_back_output = sprintf('<h3 %s>%s</h3>', T4PCore_Plugin::attributes('flip-box-shortcode-heading-back'), $title_back);
     }
     $front_inner = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('flip-box-front-inner'), $icon_output . $title_front_output . $text_front);
     $back_inner = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('flip-box-back-inner'), $title_back_output . do_shortcode($content));
     $front = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('flip-box-shortcode-front-box'), $front_inner);
     $back = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('flip-box-shortcode-back-box'), $back_inner);
     $html = sprintf('<div %s><div class="t4p-flip-box"><div %s>%s%s</div></div></div>', T4PCore_Plugin::attributes('flip-box-shortcode'), T4PCore_Plugin::attributes('flip-box-inner-wrapper'), $front, $back);
     $this->flipbox_counter++;
     return $html;
 }
コード例 #2
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'bottom_margin' => '', 'icon' => '', 'sep_color' => $smof_data['sep_color'] . $evl_options['evl_shortcode_separator_color'], 'style_type' => 'none', 'top_margin' => '', 'width' => '', 'bottom' => '', 'color' => '', 'style' => '', 'top' => ''), $args);
     if ($defaults['style']) {
         $defaults['style_type'] = $defaults['style'];
     }
     extract($defaults);
     self::$args = $defaults;
     if ($bottom) {
         self::$args['bottom_margin'] = $bottom;
     }
     if ($color) {
         self::$args['sep_color'] = $color;
     }
     if ($top) {
         self::$args['top_margin'] = $top;
         if (!$bottom && $defaults['style'] != 'none') {
             self::$args['bottom_margin'] = $top;
         }
     }
     if ($icon && $style_type != 'none') {
         $icon_insert = sprintf('<span %s><i %s></i></span>', T4PCore_Plugin::attributes('separator-shortcode-icon-wrapper'), T4PCore_Plugin::attributes('separator-shortcode-icon'));
     } else {
         $icon_insert = '';
     }
     $html = sprintf('<div %s></div><div %s>%s</div>', T4PCore_Plugin::attributes('t4p-sep-clear'), T4PCore_Plugin::attributes('separator-shortcode'), $icon_insert);
     return $html;
 }
コード例 #3
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => strtolower($smof_data['tagline_bg']) . strtolower($evl_options['evl_shortcode_tagline_bg_color']), 'border' => '0px', 'bordercolor' => strtolower($smof_data['tagline_border_color']) . strtolower($evl_options['evl_shortcode_tagline_border_color']), 'button' => '', 'buttoncolor' => 'default', 'button_shape' => strtolower($smof_data['button_shape']), 'button_size' => strtolower($smof_data['button_size']), 'button_type' => strtolower($smof_data['button_type']), 'content_alignment' => 'left', 'description' => '', 'highlightposition' => 'left', 'link' => '', 'linktarget' => '_self', 'shadow' => 'no', 'shadowopacity' => '0.7', 'title' => '', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $additional_content = '';
     $styles = "<style type='text/css'>.reading-box-container-{$this->tagline_box_counter} .element-bottomshadow:before,.reading-box-container-{$this->tagline_box_counter} .element-bottomshadow:after{opacity:{$shadowopacity};}</style>";
     if (isset($link) && $link && (isset($button) && $button) && self::$args['content_alignment'] != 'center') {
         self::$args['button_class'] = ' continue';
         $additional_content = sprintf('<a %s>%s</a>', T4PCore_Plugin::attributes('tagline-shortcode-button'), $button);
     }
     if (isset($title) && $title) {
         $additional_content .= sprintf('<h2>%s</h2>', $title);
     }
     if (isset($description) && $description) {
         $additional_content .= sprintf('<p>%s</p>', $description);
     }
     if (isset($link) && $link && (isset($button) && $button) && self::$args['content_alignment'] == 'center') {
         self::$args['button_class'] = ' continue';
         $additional_content .= sprintf('<a %s>%s</a>', T4PCore_Plugin::attributes('tagline-shortcode-button'), $button);
     }
     if (isset($link) && $link && (isset($button) && $button)) {
         self::$args['button_class'] = ' mobile-button';
         $additional_content .= sprintf('<a %s>%s</a>', T4PCore_Plugin::attributes('tagline-shortcode-button'), $button);
     }
     $html = sprintf('%s<div %s><section %s>%s%s</section></div>', $styles, T4PCore_Plugin::attributes('tagline-shortcode'), T4PCore_Plugin::attributes('tagline-shortcode-reading-box'), do_shortcode($content), $additional_content);
     $this->tagline_box_counter++;
     return $html;
 }
コード例 #4
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'animation' => false, 'delay' => 0, 'placement' => 'top', 'title' => 'none', 'trigger' => 'hover'), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<span %s>%s</span>', T4PCore_Plugin::attributes('tooltip-shortcode'), do_shortcode($content));
     return $html;
 }
コード例 #5
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $woocommerce, $smof_data;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'cat_slug' => '', 'number_posts' => 10, 'show_cats' => 'yes', 'show_price' => 'yes', 'show_buttons' => 'yes', 'picture_size' => 'fixed'), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = '';
     $buttons = '';
     if (class_exists('Woocommerce')) {
         $number_posts = (int) $number_posts;
         $args = array('post_type' => 'product', 'posts_per_page' => $number_posts, 'meta_query' => array(array('key' => '_thumbnail_id', 'compare' => '!=', 'value' => null)));
         if ($cat_slug) {
             $cat_id = explode(',', $cat_slug);
             $args['tax_query'] = array(array('taxonomy' => 'product_cat', 'field' => 'slug', 'terms' => $cat_id));
         }
         $css_class = 'simple-products-slider';
         if ($picture_size != 'fixed') {
             $css_class = 'simple-products-slider-variable';
         }
         $products = new WP_Query($args);
         $products_wrapper = $product = '';
         if ($products->have_posts()) {
             while ($products->have_posts()) {
                 $products->the_post();
                 $image = $price_tag = $terms = '';
                 if (has_post_thumbnail()) {
                     if ($smof_data['image_rollover']) {
                         $image = get_the_post_thumbnail(get_the_ID(), 'shop_catalog');
                     } else {
                         $image = sprintf('<a href="%s">%s</a>', get_permalink(get_the_ID()), get_the_post_thumbnail(get_the_ID(), 'shop_catalog'));
                     }
                     if ($show_cats == 'yes') {
                         $terms = get_the_term_list(get_the_ID(), 'product_cat', sprintf('<span %s>', T4PCore_Plugin::attributes('cats')), ', ', '</span>');
                     }
                     ob_start();
                     woocommerce_get_template('loop/price.php');
                     $price = ob_get_contents();
                     ob_end_clean();
                     if ($price && $show_price == 'yes') {
                         $price_tag = $price;
                     }
                     if ($show_buttons == 'yes') {
                         ob_start();
                         woocommerce_get_template('loop/add-to-cart.php');
                         $cart_button = ob_get_contents();
                         ob_end_clean();
                         $buttons = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('product-buttons'), $cart_button, get_permalink());
                     }
                     $product .= sprintf('<li><div %s aria-haspopup="true">%s<div %s><div %s><h3><a href="%s">%s</a></h3><br />%s%s%s</div></div></div></li>', T4PCore_Plugin::attributes('woo-product-slider-shortcode-img-div'), $image, T4PCore_Plugin::attributes('image-extras'), T4PCore_Plugin::attributes('image-extras-content'), get_permalink(), get_the_title(), $terms, $price_tag, $buttons);
                 }
             }
             $products_wrapper = sprintf('<ul>%s</ul>', $product);
         }
         $html = sprintf('<div %s><div %s><div %s><div %s>%s</div><div %s><span %s></span><span %s></span></div></div></div><div class="t4p-clearfix"></div></div>', T4PCore_Plugin::attributes('woo-product-slider-shortcode'), T4PCore_Plugin::attributes($css_class . ' simple-products-slider'), T4PCore_Plugin::attributes('es-carousel-wrapper t4p-carousel-large'), T4PCore_Plugin::attributes('es-carousel'), $products_wrapper, T4PCore_Plugin::attributes('es-nav'), T4PCore_Plugin::attributes('es-nav-prev'), T4PCore_Plugin::attributes('es-nav-next'));
     }
     return $html;
 }
コード例 #6
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'boxed' => '', 'boxed_radius' => '', 'color' => strtolower($smof_data['dropcap_color']) . strtolower($evl_options['evl_shortcode_dropcap_color'])), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<span %s>%s</span>', T4PCore_Plugin::attributes('dropcap-shortcode'), do_shortcode($content));
     return $html;
 }
コード例 #7
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'color' => $evl_options['evl_general_link'] . $smof_data['primary_color'], 'rounded' => 'no'), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<span %s>%s</span>', T4PCore_Plugin::attributes('highlight-shortcode'), do_shortcode($content));
     return $html;
 }
コード例 #8
0
 /**
  * Render the child shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('alt' => '', 'image' => '', 'link' => '', 'linktarget' => '_self'), $args);
     extract($defaults);
     self::$child_args = $defaults;
     $output = sprintf('<img src="%s" alt="%s" />', $image, $alt);
     if ($link) {
         $output = sprintf('<a href="%s" target="%s">%s</a>', $link, $linktarget, $output);
     }
     $html = sprintf('<li><div %s>%s</div></li>', T4PCore_Plugin::attributes('image'), $output);
     return $html;
 }
コード例 #9
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'api_params' => '', 'autoplay' => "false", 'center' => 'no', 'height' => 360, 'id' => '', 'width' => 600), $args);
     extract($defaults);
     self::$args = $defaults;
     if ($autoplay == 'true' || $autoplay == 'yes') {
         $autoplay = '&amp;autoplay=1';
     } else {
         $autoplay = '';
     }
     $html = sprintf('<div %s><div %s><iframe title="YouTube video player" src="http://www.youtube.com/embed/%s?wmode=transparent%s%s" width="%s" height="%s" frameborder="0" allowfullscreen></iframe></div></div>', T4PCore_Plugin::attributes('youtube-shortcode'), T4PCore_Plugin::attributes('youtube-shortcode-video-sc'), $id, $autoplay, $api_params, $width, $height);
     return $html;
 }
コード例 #10
0
 /**
  * Render the child shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('open' => 'no', 'title' => ''), $args);
     extract($defaults);
     self::$child_args = $defaults;
     self::$child_args['toggle_class'] = '';
     if ($open == 'yes') {
         self::$child_args['toggle_class'] = 'in';
     }
     $this->collaps_id = uniqid('collapse-');
     $html = sprintf('<div %s><div %s><h4 %s><a %s><i %s></i>%s</a></h4></div><div %s><div %s>%s</div></div></div>', T4PCore_Plugin::attributes('panel panel-default'), T4PCore_Plugin::attributes('panel-heading'), T4PCore_Plugin::attributes('panel-title toggle'), T4PCore_Plugin::attributes('toggle-shortcode-data-toggle'), T4PCore_Plugin::attributes('toggle-shortcode-fa-icon'), $title, T4PCore_Plugin::attributes('toggle-shortcode-collapse'), T4PCore_Plugin::attributes('panel-body toggle-content'), do_shortcode($content));
     return $html;
 }
コード例 #11
0
 /**
  * Render the parent shortcode
  * @param  array $args    Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => strtolower($smof_data['sharing_box_bg_color']) . strtolower($evl_options['evl_shortcode_sharing_box_bg_color']), 'description' => '', 'icon_colors' => strtolower($smof_data['sharing_social_links_icon_color']) . strtolower($evl_options['evl_sharing_box_icon_color']), 'box_colors' => strtolower($smof_data['sharing_social_links_box_color']) . strtolower($evl_options['evl_sharing_box_box_color']), 'icons_boxed' => strtolower($smof_data['sharing_social_links_boxed']) . strtolower($evl_options['evl_sharing_box_control_color']), 'icons_boxed_radius' => strtolower($smof_data['sharing_social_links_boxed_radius']) . strtolower($evl_options['evl_sharing_box_radius']), 'link' => '', 'pinterest_image' => '', 'social_networks' => $this->get_theme_options_settings(), 'tagline' => __('Share This', 't4p-core'), 'tagline_color' => strtolower($smof_data['sharing_box_tagline_text_color']) . strtolower($evl_options['evl_shortcode_sharing_box_tagline_text_color']), 'title' => '', 'tooltip_placement' => strtolower($smof_data['sharing_social_links_tooltip_placement']) . strtolower($evl_options['evl_sharing_box_tooltip_position'])), $args);
     extract($defaults);
     self::$args = $defaults;
     $social_networks = explode('|', $social_networks);
     $icon_colors = explode('|', $icon_colors);
     $num_of_icon_colors = count($icon_colors);
     $box_colors = explode('|', $box_colors);
     $num_of_box_colors = count($box_colors);
     $args['icons_boxed_radius'] = isset($args['icons_boxed_radius']) ? $args['icons_boxed_radius'] : '';
     $icons = '';
     if (isset($smof_data['social_sorter']) && $smof_data['social_sorter']) {
         $order = $smof_data['social_sorter'];
         $ordered_array = explode(',', $order);
         if (isset($ordered_array) && $ordered_array && is_array($ordered_array)) {
             foreach ($social_networks as $reorder_social_network) {
                 $social_networks_old[$reorder_social_network] = $reorder_social_network;
             }
             $social_networks = array();
             foreach ($ordered_array as $key => $field_order) {
                 $field_order_number = str_replace('social_sorter_', '', $field_order);
                 $find_the_field = $smof_data['social_sorter_' . $field_order_number];
                 $field_name = str_replace('_link', '', $smof_data['social_sorter_' . $field_order_number]);
                 if ($field_name == 'google') {
                     $field_name = 'googleplus';
                 } elseif ($field_name == 'email') {
                     $field_name = 'mail';
                 }
                 if (!isset($social_networks_old[$field_name])) {
                     continue;
                 }
                 $social_networks[] = $social_networks_old[$field_name];
             }
         }
     }
     for ($i = 0; $i < count($social_networks); $i++) {
         if ($num_of_icon_colors == 1) {
             $icon_colors[$i] = $icon_colors[0];
         }
         if ($num_of_box_colors == 1) {
             $box_colors[$i] = $box_colors[0];
         }
         $icon_options = array('social_network' => $social_networks[$i], 'icon_color' => $i < count($icon_colors) ? $icon_colors[$i] : '', 'box_color' => $i < count($box_colors) ? $box_colors[$i] : '');
         $icons .= sprintf('<span class="t4p-icon-holder"><a %s></a></span>', T4PCore_Plugin::attributes('sharingbox-shortcode-icon', $icon_options));
     }
     $html = sprintf('<style type="text/css">.t4p-sharing-box .t4p-icon-holder, .t4p-sharing-box .t4p-social-networks.boxed-icons a:after {border-radius:%s;}</style><div %s><h4 %s>%s</h4><div %s>%s</div></div>', $args['icons_boxed_radius'], T4PCore_Plugin::attributes('sharingbox-shortcode'), T4PCore_Plugin::attributes('sharingbox-shortcode-tagline'), $tagline, T4PCore_Plugin::attributes('sharingbox-shortcode-social-networks'), $icons);
     return $html;
 }
コード例 #12
0
ファイル: class-vimeo.php プロジェクト: berniecultess/infirev
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'api_params' => '', 'autoplay' => 'no', 'center' => 'no', 'height' => 360, 'id' => '', 'width' => 600), $args);
     extract($defaults);
     self::$args = $defaults;
     $protocol = is_ssl() ? 's' : '';
     if ($autoplay == 'true' || $autoplay == 'yes') {
         $autoplay = '?autoplay=1';
     } else {
         $autoplay = '?autoplay=0';
     }
     $html = sprintf('<div %s><div %s><iframe src="http%s://player.vimeo.com/video/%s%s%s" width="%s" height="%s" frameborder="0"></iframe></div></div>', T4PCore_Plugin::attributes('vimeo-shortcode'), T4PCore_Plugin::attributes('vimeo-shortcode-video-sc'), $protocol, $id, $autoplay, $api_params, $width, $height);
     return $html;
 }
コード例 #13
0
 /**
  * Render the shortcode
  * 
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundattachment' => 'scroll', 'backgroundcolor' => $smof_data['full_width_bg_color'] . $evl_options['evl_shortcode_full_width_bg_color'], 'backgroundimage' => '', 'backgroundposition' => 'left top', 'backgroundrepeat' => 'no-repeat', 'bordercolor' => $smof_data['full_width_border_color'] . $evl_options['evl_shortcode_full_width_border_color'], 'bordersize' => $smof_data['full_width_border_size'] . $evl_options['evl_shortcode_full_width_border_size'], 'borderstyle' => 'solid', 'menu_anchor' => '', 'paddingbottom' => '20px', 'paddingtop' => '20px', 'paddingBottom' => '', 'paddingTop' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $this->depracted_args();
     if ($defaults['menu_anchor']) {
         $html = sprintf('<div id="%s"><div %s><div %s>%s</div></div></div>', $defaults['menu_anchor'], T4PCore_Plugin::attributes('fullwidth-shortcode'), T4PCore_Plugin::attributes('t4p-row'), do_shortcode($content));
     } else {
         $html = sprintf('<div %s><div %s>%s</div></div>', T4PCore_Plugin::attributes('fullwidth-shortcode'), T4PCore_Plugin::attributes('t4p-row'), do_shortcode($content));
     }
     return $html;
 }
コード例 #14
0
 /**
  * Render the shortcode
  * 
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'category' => '', 'excerpt' => '35', 'layout' => 'default', 'lightbox' => 'yes', 'limit' => '3', 'post_id' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $thumbnails = '';
     $theme = wp_get_theme();
     // gets the current theme
     if ('evolve Plus' == $theme->name || 'evolve Plus' == $theme->parent_theme) {
         if ($layout == 'attachments-only') {
             $slider = $this->posts_attachments();
             //$thumbnails = $this->get_attachments_thumbnails();
         } else {
             if ($layout == 'posts') {
                 $slider = $this->posts();
             } else {
                 if ($layout == 'posts-with-excerpt') {
                     $slider = $this->posts_excerpt();
                 } else {
                     $slider = $this->default_layout();
                 }
             }
         }
     } else {
         if ($layout == 'attachments') {
             $slider = $this->attachments();
             $thumbnails = $this->get_attachments_thumbnails();
         } else {
             if ($layout == 'posts') {
                 $slider = $this->posts();
             } else {
                 if ($layout == 'posts-with-excerpt') {
                     $slider = $this->posts_excerpt();
                 } else {
                     $slider = $this->default_layout();
                 }
             }
         }
     }
     $slides_html = sprintf('<ul %s>%s</ul>', T4PCore_Plugin::attributes('flexslider-shortcode-slides-container'), $slider);
     $html = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('flexslider-shortcode'), $slides_html);
     if ($layout == 'attachments') {
         //$thumbnails_html = sprintf( '<ul class="slides">%s</ul>', $thumbnails );
         $thumbnails_html = '';
         $html .= sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('flexslider-shortcode-thumbnails'), $thumbnails_html);
     }
     return $html;
 }
コード例 #15
0
ファイル: class-alert.php プロジェクト: berniecultess/infirev
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'accent_color' => '', 'background_color' => '', 'border_size' => '', 'box_shadow' => 'no', 'icon' => '', 'type' => 'general', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     switch ($args['type']) {
         case 'general':
             $this->alert_class = 'info';
             if (!$icon || $icon != 'none') {
                 self::$args['icon'] = $icon = 'fa-info-circle';
             }
             break;
         case 'error':
             $this->alert_class = 'danger';
             if (!$icon || $icon != 'none') {
                 self::$args['icon'] = $icon = 'fa-exclamation-triangle';
             }
             break;
         case 'success':
             $this->alert_class = 'success';
             if (!$icon || $icon != 'none') {
                 self::$args['icon'] = $icon = 'fa-check-circle';
             }
             break;
         case 'notice':
             $this->alert_class = 'warning';
             if (!$icon || $icon != 'none') {
                 self::$args['icon'] = $icon = 'fa-lg fa-cog';
             }
             break;
         case 'blank':
             $this->alert_class = 'blank';
             break;
         case 'custom':
             $this->alert_class = 'custom';
             break;
     }
     $html = sprintf('<div %s>', T4PCore_Plugin::attributes('alert-shortcode')) . "\n";
     $html .= sprintf('  <button %s>&times;</button>', T4PCore_Plugin::attributes('alert-shortcode-button')) . "\n";
     if ($icon && $icon != 'none') {
         $html .= sprintf('<span %s><i %s></i></span>', T4PCore_Plugin::attributes('alert-icon'), T4PCore_Plugin::attributes('alert-shortcode-icon'));
     }
     $html .= do_shortcode($content);
     $html .= '</div>' . "\n";
     return $html;
 }
コード例 #16
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $sc_content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'animation' => false, 'content' => '', 'content_bg_color' => $smof_data['popover_content_bg_color'] . $evl_options['evl_shortcode_popover_content_bg_color'], 'delay' => '', 'placement' => strtolower($smof_data['popover_placement']) . strtolower($evl_options['evl_shortcode_popover_position']), 'title' => '', 'title_bg_color' => $smof_data['popover_heading_bg_color'] . $evl_options['evl_shortcode_popover_heading_bg_color'], 'bordercolor' => $smof_data['popover_border_color'] . $evl_options['evl_shortcode_popover_border_color'], 'textcolor' => $smof_data['popover_text_color'] . $evl_options['evl_shortcode_popover_text_color'], 'trigger' => 'click'), $args);
     extract($defaults);
     self::$args = $defaults;
     if ($placement == 'bottom') {
         $arrow_color = $title_bg_color;
     } else {
         $arrow_color = $content_bg_color;
     }
     $styles = sprintf('<style>.popover-%s.%s .arrow{border-%s-color:%s;}.popover-%s{border-color:%s;}.popover{background-color:%s;}.popover-%s .popover-title{background-color:%s;color:%s;border-color:%s;}.popover-%s .popover-content{background-color:%s;color:%s;}.popover-%s.%s .arrow:after{border-%s-color:%s;}</style>', $this->popover_counter, $placement, $placement, $bordercolor, $this->popover_counter, $bordercolor, $bordercolor, $this->popover_counter, $title_bg_color, $textcolor, $bordercolor, $this->popover_counter, $content_bg_color, $textcolor, $this->popover_counter, $placement, $placement, $arrow_color);
     $html = sprintf('<span %s>%s%s</span>', T4PCore_Plugin::attributes('popover-shortcode'), $styles, do_shortcode($sc_content));
     $this->popover_counter++;
     return $html;
 }
コード例 #17
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'animated_stripes' => 'no', 'filledcolor' => '', 'percentage' => '70', 'striped' => 'no', 'textcolor' => '', 'unfilledcolor' => '', 'unit' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     if (!$filledcolor) {
         self::$args['filledcolor'] = $evl_options['evl_shortcode_progress_filled_color'] . $smof_data['progressbar_filled_color'];
     }
     if (!$textcolor) {
         self::$args['textcolor'] = $evl_options['evl_shortcode_progress_text_color'] . $smof_data['progressbar_text_color'];
     }
     if (!$unfilledcolor) {
         self::$args['unfilledcolor'] = $evl_options['evl_shortcode_progress_unfilled_color'] . $smof_data['progressbar_unfilled_color'];
     }
     $html = sprintf('<div %s><div %s></div><span %s>%s %s%s</div>', T4PCore_Plugin::attributes('progressbar-shortcode'), T4PCore_Plugin::attributes('progressbar-shortcode-content'), T4PCore_Plugin::attributes('progressbar-shortcode-span'), $content, $percentage, $unit);
     return $html;
 }
コード例 #18
0
ファイル: class-title.php プロジェクト: berniecultess/infirev
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'content_align' => 'left', 'sep_color' => '', 'size' => 1, 'style_type' => 'double'), $args);
     extract($defaults);
     self::$args = $defaults;
     if (!$style_type) {
         self::$args['style_type'] = $style_type = 'double';
     }
     if (strpos($style_type, 'underline') === false) {
         if (self::$args['content_align'] == 'right') {
             $html = sprintf('<div %s><div %s><div %s></div></div><h%s %s>%s</h%s></div>', T4PCore_Plugin::attributes('title-shortcode'), T4PCore_Plugin::attributes('title-sep-container'), T4PCore_Plugin::attributes('title-shortcode-sep'), $size, T4PCore_Plugin::attributes('title-shortcode-heading'), do_shortcode($content), $size);
         } else {
             $html = sprintf('<div %s><h%s %s>%s</h%s><div %s><div %s></div></div></div>', T4PCore_Plugin::attributes('title-shortcode'), $size, T4PCore_Plugin::attributes('title-shortcode-heading'), do_shortcode($content), $size, T4PCore_Plugin::attributes('title-sep-container'), T4PCore_Plugin::attributes('title-shortcode-sep'));
         }
     } else {
         $html = sprintf('<div %s><h%s %s>%s</h%s></div>', T4PCore_Plugin::attributes('title-shortcode'), $size, T4PCore_Plugin::attributes('title-shortcode-heading'), do_shortcode($content), $size);
     }
     return $html;
 }
コード例 #19
0
 /**
  * Render the parent shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_parent($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'circle' => strtolower($smof_data['checklist_circle']) . strtolower($evl_options['evl_shortcode_checklist_circle']), 'circlecolor' => $smof_data['checklist_circle_color'] . $evl_options['evl_shortcode_checklist_circle_color'], 'icon' => 'fa-check', 'iconcolor' => $smof_data['checklist_icons_color'] . $evl_options['evl_shortcode_checklist_circle_icon_color'], 'size' => 'small'), $args);
     $defaults['circle'] == 1 ? $defaults['circle'] = 'yes' : ($defaults['circle'] = $defaults['circle']);
     extract($defaults);
     self::$parent_args = $defaults;
     // legacy checklist integration
     if (strpos($content, '<li>') && strpos($content, '[list_item') === false) {
         $content = str_replace('<ul>', '', $content);
         $content = str_replace('</ul>', '', $content);
         $content = str_replace('<li>', '[li_item]', $content);
         $content = str_replace('</li>', '[/li_item]', $content);
     }
     $html = sprintf('<ul %s>%s</ul>', T4PCore_Plugin::attributes('checklist-shortcode'), do_shortcode($content));
     $html = str_replace('</li><br />', '</li>', $html);
     return $html;
 }
コード例 #20
0
 /**
  * Render the child shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('alt' => '', 'image' => '', 'link' => '', 'linktarget' => '_self'), $args);
     extract($defaults);
     self::$child_args = $defaults;
     $image_id = T4PCore_Plugin::get_attachment_id_from_url($image);
     if (!$alt && empty($alt) && $image_id) {
         self::$child_args['alt'] = $alt = get_post_meta($image_id, '_wp_attachment_image_alt', true);
     }
     if ($image_id) {
         self::$child_args['title_attr'] = get_post_field('post_excerpt', $image_id);
     }
     $output = sprintf('<img src="%s" alt="%s" />', $image, $alt);
     if ($link || self::$parent_args['lightbox'] == 'yes') {
         $output = sprintf('<a %s>%s</a>', T4PCore_Plugin::attributes('image-carousel-shortcode-slide-link'), $output);
     }
     $html = sprintf('<li><div %s>%s</div></li>', T4PCore_Plugin::attributes('image'), $output);
     return $html;
 }
コード例 #21
0
 /**
  * Render the child shortcode
  * 
  * @param  array  $args     Shortcode paramters
  * @param  string $content  Content between shortcode
  * @return string           HTML output
  */
 function render_child($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'countdown' => 'no', 'filledcolor' => strtolower($smof_data['counter_filled_color']) . strtolower($evl_options['evl_shortcode_counter_circle_filled_color']), 'unfilledcolor' => strtolower($smof_data['counter_unfilled_color']) . strtolower($evl_options['evl_shortcode_counter_circle_unfilled_color']), 'scales' => 'no', 'size' => '220', 'speed' => '1500', 'value' => '1'), $args);
     extract($defaults);
     self::$child_args = $defaults;
     if ($scales == 'yes') {
         self::$child_args['scales'] = true;
     } else {
         self::$child_args['scales'] = false;
     }
     if ($countdown == 'yes') {
         self::$child_args['countdown'] = true;
     } else {
         self::$child_args['countdown'] = false;
     }
     $output = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('counter-circle-shortcode'), do_shortcode($content));
     $html = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('counter-circle-wrapper-shortcode'), $output);
     return $html;
 }
コード例 #22
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => 't4p-soundcloud', 'id' => '', 'auto_play' => 'true', 'color' => 'ff7700', 'comments' => 'true', 'height' => 81, 'url' => '', 'width' => '100%'), $args);
     extract($defaults);
     self::$args = $defaults;
     if ($comments == 'yes') {
         $comments = 'true';
     } elseif ($comments == 'no') {
         $comments = 'false';
     }
     if ($auto_play == 'yes') {
         $autoplay = 'true';
     } else {
         $autoplay = 'false';
     }
     if ($color) {
         $color = str_replace('#', '', $color);
     }
     $html = sprintf('<div %s><iframe width="%s" height="%s" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=%s&amp;show_comments=%s&amp;auto_play=%s&amp;color=%s"></iframe></div>', T4PCore_Plugin::attributes('soundcloud-shortcode'), $width, $height, $url, $comments, $autoplay, $color);
     return $html;
 }
コード例 #23
0
 /**
  * Render the child shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('avatar' => 'none', 'company' => '', 'image' => '', 'link' => '', 'name' => '', 'target' => '_self', 'gender' => ''), $args);
     extract($defaults);
     self::$child_args = $defaults;
     // check for deprecated
     if ($gender) {
         self::$child_args['avatar'] = $gender;
     }
     $inner_content = $thumbnail = $pic = '';
     if ($name) {
         if (self::$child_args['avatar'] == 'image' && $image) {
             $image_id = T4PCore_Plugin::get_attachment_id_from_url($image);
             self::$child_args['alt'] = '';
             if ($image_id) {
                 self::$child_args['alt'] = get_post_field('post_excerpt', $image_id);
             }
             $pic = sprintf('<img %s />', T4PCore_Plugin::attributes('testimonials-shortcode-image'));
         }
         if (self::$child_args['avatar'] == 'image' && !self::$child_args['image']) {
             self::$child_args['avatar'] = 'none';
         }
         if (self::$child_args['avatar'] != 'none') {
             $thumbnail = sprintf('<span %s>%s</span>', T4PCore_Plugin::attributes('testimonials-shortcode-thumbnail'), $pic);
         }
         $inner_content .= sprintf('<div %s>%s<span %s><strong>%s</strong>', T4PCore_Plugin::attributes('author'), $thumbnail, T4PCore_Plugin::attributes('company-name'), $name);
         if ($company) {
             if (!empty($link) && $link) {
                 $inner_content .= sprintf(', <a href="%s" target="%s">%s</a>', $link, $target, sprintf('<span>%s</span>', $company));
             } else {
                 $inner_content .= sprintf(', <span>%s</span>', $company);
             }
         }
         $inner_content .= '</span></div>';
     }
     $html = sprintf('<div %s><blockquote %s><q>%s</q></blockquote>%s</div>', T4PCore_Plugin::attributes('testimonials-shortcode-review'), T4PCore_Plugin::attributes('testimonials-shortcode-quote'), do_shortcode($content), $inner_content);
     return $html;
 }
コード例 #24
0
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => $smof_data['section_sep_bg'] . $evl_options['evl_shortcode_section_separator_bg_color_candy'], 'bordersize' => $smof_data['section_sep_border_size'] . $evl_options['evl_shortcode_section_separator_border_size'], 'bordercolor' => $smof_data['section_sep_border_color'] . $evl_options['evl_shortcode_section_separator_border_color'], 'divider_candy' => '', 'icon' => '', 'icon_color' => $smof_data['icon_color'] . $evl_options['evl_shortcode_icon_color']), $args);
     extract($defaults);
     self::$args = $defaults;
     if ($icon) {
         if (!$icon_color) {
             self::$args['icon_color'] = $bordercolor;
         }
         $icon = sprintf('<div %s></div>', T4PCore_Plugin::attributes('section-separator-shortcode-icon'));
     }
     if ($divider_candy == 'bottom') {
         $candy = sprintf('<div %s></div>', T4PCore_Plugin::attributes('section-separator-shortcode-divider-candy', array('divider_candy' => 'bottom')));
     } elseif ($divider_candy == 'top') {
         $candy = sprintf('<div %s></div>', T4PCore_Plugin::attributes('section-separator-shortcode-divider-candy', array('divider_candy' => 'top')));
     } elseif (strpos($divider_candy, 'top') !== false && strpos($divider_candy, 'bottom') !== false) {
         $candy = sprintf('<div %s></div><div %s></div>', T4PCore_Plugin::attributes('section-separator-shortcode-divider-candy', array('divider_candy' => 'top')), T4PCore_Plugin::attributes('section-separator-shortcode-divider-candy', array('divider_candy' => 'bottom')));
     }
     $html = sprintf('<div %s>%s%s</div>', T4PCore_Plugin::attributes('section-separator-shortcode'), $icon, $candy);
     return $html;
 }
コード例 #25
0
 /**
  * Render the child shortcode
  * 
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render_child($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'backgroundcolor' => '', 'circle' => '', 'circlecolor' => '', 'circlebordercolor' => '', 'icon' => '', 'iconcolor' => '', 'iconflip' => '', 'iconrotate' => '', 'iconspin' => '', 'image' => '', 'image_height' => '35', 'image_width' => '35', 'link' => '', 'linktarget' => '_self', 'linktext' => '', 'textcolor' => '', 'title' => '', 'animation_type' => '', 'animation_direction' => 'left', 'animation_speed' => '0.1'), $args);
     extract($defaults);
     self::$child_args = $defaults;
     $output = '';
     $icon_output = '';
     $title_output = '';
     $content_output = '';
     $link_output = '';
     if ($image && $image_width && $image_height) {
         $icon_output = sprintf('<div %s><img src="%s" width="%s" height="%s" /></div>', T4PCore_Plugin::attributes('content-box-shortcode-icon'), $image, $image_width, $image_height);
     } elseif ($icon) {
         $icon_output = sprintf('<div %s><i %s></i></div>', T4PCore_Plugin::attributes('icon'), T4PCore_Plugin::attributes('content-box-shortcode-icon'));
     }
     if ($title) {
         $title_output = sprintf('<h2 %s>%s</h2>', T4PCore_Plugin::attributes('content-box-heading'), $title);
     }
     if ($link) {
         $heading_content = sprintf('<a %s %s>%s</a>', T4PCore_Plugin::attributes('heading-link'), T4PCore_Plugin::attributes('content-box-shortcode-link'), $icon_output . $title_output);
     } else {
         $heading_content = $icon_output . $title_output;
     }
     $heading = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('content-box-shortcode-heading-wrapper'), $heading_content);
     if ($link && $linktext) {
         $link_output = sprintf('<span class="more"><a %s %s>%s</a></span><div class="t4p-clearfix"></div>', T4PCore_Plugin::attributes('read-more btn t4p-button-default'), T4PCore_Plugin::attributes('content-box-shortcode-link'), $linktext);
     }
     $content_output = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('content-box-shortcode-content-container'), do_shortcode($content) . $link_output);
     $output = $heading . $content_output;
     $html = sprintf('<div %s><div %s>%s</div></div>', T4PCore_Plugin::attributes('content-box-shortcode'), T4PCore_Plugin::attributes('content-box-shortcode-content-wrapper'), $output);
     $clearfix_test = $this->column_counter / $this->num_of_columns;
     if (is_int($clearfix_test)) {
         $html .= '<div class="t4p-clearfix"></div>';
     }
     $this->column_counter++;
     return $html;
 }
コード例 #26
0
 /**
  * Render the child shortcode
  * 
  * @param  array  $args     Shortcode paramters
  * @param  string $content  Content between shortcode
  * @return string           HTML output
  */
 function render_child($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'border' => 'yes', 'color' => strtolower($evl_options['evl_shortcode_counter_boxes_color']) . strtolower($smof_data['counter_box_color']), 'direction' => 'up', 'icon' => '', 'unit' => '', 'unit_pos' => 'suffix', 'value' => '20', 'icon_size' => 'large'), $args);
     extract($defaults);
     self::$child_args = $defaults;
     self::$child_args['value'] = intval($value);
     $unit_output = '';
     if ($unit) {
         $unit_output = sprintf('<span %s>%s</span>', T4PCore_Plugin::attributes('counter-box-shortcode-unit'), $unit);
     }
     if ($direction == 'up') {
         $init_value = 0;
     } else {
         $init_value = self::$child_args['value'];
     }
     $counter = sprintf('<span %s>%s</span>', T4PCore_Plugin::attributes('counter-box-shortcode-counter'), $init_value);
     $icon_output = '';
     if ($icon) {
         $icon_output = sprintf('<i %s></i>', T4PCore_Plugin::attributes('counter-box-shortcode-icon'));
     }
     if ($unit_pos == 'prefix') {
         $counter = $icon_output . $unit_output . $counter;
     } else {
         $counter = $icon_output . $counter . $unit_output;
     }
     $counter_wrapper = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('counter-box-shortcode-counter-container'), $counter);
     $content_output = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('counter-box-shortcode-content'), do_shortcode($content));
     $border_class = '';
     if ($border == 'yes') {
         $border_class .= ' counter-box-border';
     }
     $html = sprintf('<div %s><div %s>%s</div></div>', T4PCore_Plugin::attributes('counter-box-shortcode'), T4PCore_Plugin::attributes('counter-box-container ' . $border_class), $counter_wrapper . $content_output);
     return $html;
 }
コード例 #27
0
ファイル: class-modal.php プロジェクト: berniecultess/infirev
 /**
  * Render the shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'name' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $html = sprintf('<a %s>%s</a>', T4PCore_Plugin::attributes('modal-text-link-shortcode'), do_shortcode($content));
     return $html;
 }
コード例 #28
0
 /**
  * Render the parent shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     global $evl_options;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'cat_slug' => '', 'columns' => 3, 'exclude_cats' => '', 'excerpt_length' => '', 'excerpt_words' => '15', 'filters' => 'yes', 'layout' => 'carousel', 'number_posts' => 8, 'animation_direction' => 'left', 'animation_speed' => '', 'animation_type' => '', 'picture_size' => 'fixed'), $args);
     $defaults['filters'] == 'yes' || $defaults['filters'] == 'true' ? $defaults['filters'] = true : ($defaults['filters'] = false);
     extract($defaults);
     self::$args = $defaults;
     // set the image size for the slideshow
     $this->set_image_size();
     if ($excerpt_length || $excerpt_length === '0') {
         $excerpt_words = $excerpt_length;
     }
     $theme = wp_get_theme();
     // gets the current theme
     if ('evolve Plus' == $theme->name || 'evolve Plus' == $theme->parent_theme) {
         $args = array('post_type' => 'evolve_portfolio', 'paged' => 1, 'posts_per_page' => $number_posts, 'has_password' => false);
     } else {
         $args = array('post_type' => 'alora_portfolio', 'paged' => 1, 'posts_per_page' => $number_posts, 'has_password' => false);
     }
     if ($defaults['exclude_cats']) {
         $cats_to_exclude = explode(',', $defaults['exclude_cats']);
     }
     if ($defaults['cat_slug']) {
         $cat_slugs = explode(',', $defaults['cat_slug']);
         if (isset($cats_to_exclude) && $cats_to_exclude) {
             $args['tax_query'] = array('relation' => 'AND', array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cat_slugs, 'operator' => 'IN'), array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cats_to_exclude, 'operator' => 'NOT IN'));
         } else {
             $args['tax_query'] = array(array('taxonomy' => 'portfolio_category', 'field' => 'slug', 'terms' => $cat_slugs));
         }
     }
     wp_reset_query();
     $recent_works = new WP_Query($args);
     $works = '';
     while ($recent_works->have_posts()) {
         $recent_works->the_post();
         $item_classes = $terms = $image_wrapper = $item_content = $buttons = $url = '';
         // set classes, link and target for the image extras content
         $this->set_image_extras(get_the_ID());
         if ($layout == 'carousel') {
             if (has_post_thumbnail()) {
                 if ($smof_data['image_rollover'] || $evl_options['evl_portfolio_rollover']) {
                     $image = get_the_post_thumbnail(get_the_ID(), $this->image_size);
                     $image .= $this->get_image_extras(get_the_ID());
                 } else {
                     $image = sprintf('<a href="%s">%s</a>', get_permalink(get_the_ID()), get_the_post_thumbnail(get_the_ID(), $this->image_size));
                 }
                 $works .= sprintf('<li><div %s>%s</div></li>', T4PCore_Plugin::attributes('recentworks-shortcode-img-div'), $image);
             }
         } else {
             if (has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)) {
                 $item_cats = get_the_terms(get_the_ID(), 'portfolio_category');
                 if ($item_cats) {
                     foreach ($item_cats as $item_cat) {
                         $item_classes .= $item_cat->slug . ' ';
                     }
                 }
                 $permalink = get_permalink();
                 if (has_post_thumbnail()) {
                     $thumbnail = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), $this->image_size);
                     $src = $thumbnail[0];
                     $alt = get_post_field('post_excerpt', get_post_thumbnail_id(get_the_ID()));
                     if ($smof_data['image_rollover'] || $evl_options['evl_portfolio_rollover']) {
                         $image = sprintf('<img %s />', T4PCore_Plugin::attributes('recentworks-shortcode-img', array('src' => $src, 'alt' => $alt)));
                         $image .= $this->get_image_extras(get_the_ID());
                     } else {
                         $image = sprintf('<a href="%s"><img %s /></a>', $permalink, T4PCore_Plugin::attributes('recentworks-shortcode-img', array('src' => $src, 'alt' => $alt)));
                     }
                     $image_wrapper = sprintf('<div %s>%s</div>', T4PCore_Plugin::attributes('recentworks-shortcode-img-div'), $image);
                 }
                 if ($layout == 'grid-with-excerpts') {
                     $stripped_content = strip_shortcodes(t4p_content($excerpt_words, $smof_data['strip_html_excerpt']));
                     if ($columns == 1) {
                         if (get_post_meta(get_the_ID(), 'pyre_project_url', true)) {
                             $url = sprintf('<a href="%s" %s>%s</a>', get_post_meta(get_the_ID(), 'pyre_project_url', true), T4PCore_Plugin::attributes('t4p-button medium default'), __('View Project', 't4p-core'));
                         }
                         $buttons = sprintf('<div %s><a href="%s" %s>%s</a>%s</div>', T4PCore_Plugin::attributes('buttons'), $permalink, T4PCore_Plugin::attributes('t4p-button medium default'), __('Learn More', 't4p-core'), $url);
                     }
                     $item_content = sprintf('<div %s><h2 class="entry-title"><a href="%s">%s</a></h2><h4>%s</h4>%s</div>', T4PCore_Plugin::attributes('portfolio-content'), $permalink, get_the_title(), get_the_term_list(get_the_ID(), 'portfolio_category', '', '<span class="rw-comma">,</span> ', ''), $stripped_content);
                 }
                 $works .= sprintf('<div %s>%s%s</div>', T4PCore_Plugin::attributes('portfolio-item ' . $item_classes), $image_wrapper, $item_content);
             }
         }
     }
     wp_reset_query();
     if ($layout == 'carousel') {
         $html = sprintf('<div %s><div %s><div %s><ul>%s</ul></div><div %s><span %s></span><span %s></span></div></div></div>', T4PCore_Plugin::attributes('recentworks-shortcode'), T4PCore_Plugin::attributes('es-carousel-wrapper t4p-carousel-large'), T4PCore_Plugin::attributes('es-carousel'), $works, T4PCore_Plugin::attributes('es-nav'), T4PCore_Plugin::attributes('es-nav-prev'), T4PCore_Plugin::attributes('es-nav-next'));
     } else {
         $portfolio_category = get_terms('portfolio_category');
         $filter = '';
         $filter_wrapper = '';
         if ($portfolio_category && $filters == true) {
             $filter = sprintf('<li %s><a %s>%s</a></li>', T4PCore_Plugin::attributes('active'), T4PCore_Plugin::attributes('recentworks-shortcode-filter-link', array('data-filter' => '*')), __('All', 't4p-core'));
             foreach ($portfolio_category as $portfolio_cat) {
                 if (isset($args['cat_slug']) && $args['cat_slug']) {
                     $cat_slug = preg_replace('/\\s+/', '', $args['cat_slug']);
                     $cat_slug = explode(',', $cat_slug);
                     if (in_array($portfolio_cat->slug, $cat_slug)) {
                         $filter .= sprintf('<li><a %s>%s</a></li>', T4PCore_Plugin::attributes('recentworks-shortcode-filter-link', array('data-filter' => '.' . $portfolio_cat->slug)), $portfolio_cat->name);
                     }
                 } else {
                     $filter .= sprintf('<li><a %s>%s</a></li>', T4PCore_Plugin::attributes('recentworks-shortcode-filter-link', array('data-filter' => '.' . $portfolio_cat->slug)), $portfolio_cat->name);
                 }
             }
             $filter_wrapper = sprintf('<ul %s>%s</ul>', T4PCore_Plugin::attributes('portfolio-tabs'), $filter);
         }
         $html = sprintf('<div %s>%s<div %s>%s</div></div>', T4PCore_Plugin::attributes('recentworks-shortcode'), $filter_wrapper, T4PCore_Plugin::attributes('portfolio-wrapper'), $works);
     }
     $this->recent_works_counter++;
     return $html;
 }
コード例 #29
0
 /**
  * Render the parent shortcode
  * @param  array $args     Shortcode paramters
  * @param  string $content Content between shortcode
  * @return string          HTML output
  */
 function render($args, $content = '')
 {
     global $smof_data;
     $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'cat_id' => '', 'cat_slug' => '', 'columns' => 3, 'excerpt' => 'no', 'exclude_cats' => '', 'excerpt_length' => '', 'excerpt_words' => '15', 'layout' => 'default', 'meta' => 'yes', 'number_posts' => 4, 'strip_html' => 'yes', 'title' => 'yes', 'thumbnail' => 'yes', 'animation_direction' => 'left', 'animation_speed' => '', 'animation_type' => ''), $args);
     extract($defaults);
     self::$args = $defaults;
     $defaults['strip_html'] == 'yes' ? $defaults['strip_html'] = true : ($defaults['strip_html'] = false);
     if ($defaults['number_posts']) {
         $defaults['posts_per_page'] = $defaults['number_posts'];
     }
     if ($defaults['excerpt_length'] || $defaults['excerpt_length'] === '0') {
         $defaults['excerpt_words'] = $defaults['excerpt_length'];
     }
     //check for cats to exclude; needs to be checked via exclude_cats param and '-' prefixed cats on cats param
     //exclution via exclude_cats param
     $cats_to_exclude = explode(',', $defaults['exclude_cats']);
     if ($cats_to_exclude) {
         foreach ($cats_to_exclude as $cat_to_exclude) {
             $idObj = get_category_by_slug($cat_to_exclude);
             if ($idObj) {
                 $cats_id_to_exclude[] = $idObj->term_id;
             }
         }
         if (isset($cats_id_to_exclude) && $cats_id_to_exclude) {
             $defaults['category__not_in'] = $cats_id_to_exclude;
         }
     }
     //setting up cats to be used and exclution using '-' prefix on cats param; transform slugs to ids
     $cat_ids = '';
     $categories = explode(',', $defaults['cat_slug']);
     if (isset($categories) && $categories) {
         foreach ($categories as $category) {
             if ($category) {
                 if (strpos($category, '-') === 0) {
                     $cat_ids .= '-' . get_category_by_slug($category)->cat_ID . ',';
                 } else {
                     $cat_ids .= get_category_by_slug($category)->cat_ID . ',';
                 }
             }
         }
     }
     $defaults['cat'] = substr($cat_ids, 0, -1);
     $defaults['cat'] .= $defaults['cat_id'];
     $items = '';
     $args = array('posts_per_page' => $defaults['number_posts'], 'ignore_sticky_posts' => 1, 'has_password' => false);
     if ($defaults['cat']) {
         $args['cat'] = $defaults['cat'];
     }
     $recent_posts = new WP_Query($args);
     $count = 1;
     while ($recent_posts->have_posts()) {
         $recent_posts->the_post();
         $attachment = $date_box = $slideshow = $slides = $content = '';
         if ($layout == 'icon-on-side') {
             switch (get_post_format()) {
                 case 'gallery':
                     $format_class = 'camera-retro';
                     break;
                 case 'link':
                     $format_class = 'link';
                     break;
                 case 'image':
                     $format_class = 'picture-o';
                     break;
                 case 'quote':
                     $format_class = 'quote-left';
                     break;
                 case 'video':
                     $format_class = 'youtube-play';
                     break;
                 case 'audio':
                     $format_class = 'headphones';
                     break;
                 case 'chat':
                     $format_class = 'comments-o';
                     break;
                 default:
                     $format_class = 'pencil';
                     break;
             }
             $date_box = sprintf('<div %s><div %s><i %s></i></div></div>', T4PCore_Plugin::attributes('date-and-formats'), T4PCore_Plugin::attributes('format-box'), T4PCore_Plugin::attributes('t4p-icon-' . $format_class));
         }
         if ($thumbnail == 'yes' && $layout != 'icon-on-side') {
             if ($layout == 'default') {
                 $image_size = 'recent-posts';
             } elseif ($layout == 'thumbnails-on-side') {
                 $image_size = 'portfolio-two';
             }
             if ($smof_data['legacy_posts_slideshow']) {
                 $args = array('exclude' => get_post_thumbnail_id(), 'numberposts' => $smof_data['posts_slideshow_number'] - 1, 'order' => 'ASC', 'orderby' => 'menu_order', 'post_mime_type' => 'image', 'post_parent' => get_the_ID(), 'post_status' => null, 'post_type' => 'attachment');
                 $attachments = get_posts($args);
                 if ($attachments || has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)) {
                     if (get_post_meta(get_the_ID(), 'pyre_video', true)) {
                         $slides .= sprintf('<li><div %s>%s</div></li>', T4PCore_Plugin::attributes('full-video'), get_post_meta(get_the_ID(), 'pyre_video', true));
                     }
                     if (has_post_thumbnail()) {
                         $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $image_size);
                         $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                         $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
                         $slides .= sprintf('<li><a href="%s"><img %s/></a></li>', get_permalink(get_the_ID()), T4PCore_Plugin::attributes('recentposts-shortcode-img', array('src' => $attachment_image[0], 'alt' => get_the_title())));
                     }
                     if ($smof_data['posts_slideshow']) {
                         foreach ($attachments as $attachment) {
                             $attachment_image = wp_get_attachment_image_src($attachment->ID, $image_size);
                             $full_image = wp_get_attachment_image_src($attachment->ID, 'full');
                             $attachment_data = wp_get_attachment_metadata($attachment->ID);
                             $slides .= sprintf('<li><a href="%s"><img %s/></a></li>', get_permalink(get_the_ID()), T4PCore_Plugin::attributes('recentposts-shortcode-img', array('src' => $attachment_image[0], 'alt' => $attachment->post_title)));
                         }
                     }
                     $slideshow = sprintf('<div %s><ul %s>%s</ul></div>', T4PCore_Plugin::attributes('recentposts-shortcode-slideshow'), T4PCore_Plugin::attributes('slides'), $slides);
                 }
             } else {
                 if (has_post_thumbnail() || get_post_meta(get_the_ID(), 'pyre_video', true)) {
                     if (get_post_meta(get_the_ID(), 'pyre_video', true)) {
                         $slides .= sprintf('<li><div %s>%s</div></li>', T4PCore_Plugin::attributes('full-video'), get_post_meta(get_the_ID(), 'pyre_video', true));
                     }
                     if (has_post_thumbnail()) {
                         $attachment_image = wp_get_attachment_image_src(get_post_thumbnail_id(), $image_size);
                         $full_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'full');
                         $attachment_data = wp_get_attachment_metadata(get_post_thumbnail_id());
                         $attachment = get_post(get_post_thumbnail_id());
                         $slides .= sprintf('<li><a href="%s"><img %s/></a></li>', get_permalink(get_the_ID()), T4PCore_Plugin::attributes('recentposts-shortcode-img', array('src' => $attachment_image[0], 'alt' => $attachment->post_title)));
                     }
                     if ($smof_data['posts_slideshow']) {
                         $i = 2;
                         while ($i <= $smof_data['posts_slideshow_number']) {
                             $attachment_new_id = kd_mfi_get_featured_image_id('featured-image-' . $i, 'post');
                             if ($attachment_new_id) {
                                 $attachment_image = wp_get_attachment_image_src($attachment_new_id, $image_size);
                                 $full_image = wp_get_attachment_image_src($attachment_new_id, 'full');
                                 $attachment_data = wp_get_attachment_metadata($attachment_new_id);
                                 $slides .= sprintf('<li><a href="%s"><img %s/></a></li>', get_permalink(get_the_ID()), T4PCore_Plugin::attributes('recentposts-shortcode-img', array('src' => $attachment_image[0], 'alt' => '')));
                             }
                             $i++;
                         }
                     }
                     $slideshow = sprintf('<div %s><ul %s>%s</ul></div>', T4PCore_Plugin::attributes('recentposts-shortcode-slideshow'), T4PCore_Plugin::attributes('slides'), $slides);
                 }
             }
         }
         if ($title == 'yes') {
             $content .= sprintf('<h3><a href="%s">%s</a></h3>', get_permalink(get_the_ID()), get_the_title());
         }
         if ($meta == 'yes') {
             $comments = '';
             if (get_comments_number(get_the_ID()) >= 1) {
                 $comments = sprintf('<span %s>|</span><a href="%s">%s %s</a></span>', T4PCore_Plugin::attributes('meta-separator'), get_permalink(get_the_ID()), get_comments_number(get_the_ID()), __('Comments', 't4p-core'));
             }
             $content .= sprintf('<p %s><span><time %s>%s</time></span>%s</p>', T4PCore_Plugin::attributes('meta'), T4PCore_Plugin::attributes('date'), get_the_time($smof_data['date_format'], get_the_ID()), $comments);
         }
         if ($excerpt == 'yes') {
             $content .= t4p_content($excerpt_words, $strip_html);
         }
         $items .= sprintf('<article %s>%s%s<div %s>%s</div></article>', T4PCore_Plugin::attributes('recentposts-shortcode-column'), $date_box, $slideshow, T4PCore_Plugin::attributes('recent-posts-content'), $content);
         $count++;
     }
     $html = sprintf('<div %s><section %s><div %s>%s</div></section></div>', T4PCore_Plugin::attributes('recentposts-shortcode'), T4PCore_Plugin::attributes('recentposts-shortcode-section'), T4PCore_Plugin::attributes('row holder'), $items);
     wp_reset_query();
     return $html;
 }
コード例 #30
0
    /**
     * Render the shortcode
     * @param  array $args     Shortcode paramters
     * @param  string $content Content between shortcode
     * @return string          HTML output
     */
    function render($args, $content = '')
    {
        global $smof_data;
        $defaults = T4PCore_Plugin::set_shortcode_defaults(array('class' => '', 'id' => '', 'animation' => 'no', 'address' => '', 'height' => '300px', 'icon' => '', 'infobox' => '', 'infobox_background_color' => '', 'infobox_content' => '', 'infobox_text_color' => '', 'map_style' => '', 'overlay_color' => '', 'popup' => 'yes', 'scale' => 'yes', 'scrollwheel' => 'yes', 'type' => 'roadmap', 'width' => '100%', 'zoom' => '14', 'zoom_pancontrol' => 'yes'), $args);
        extract($defaults);
        self::$args = $defaults;
        $html = '';
        if ($address) {
            $addresses = explode('|', $address);
            if ($infobox_content) {
                $infobox_content_array = explode('|', $infobox_content);
            } else {
                $infobox_content_array = '';
            }
            if ($icon) {
                $icon_array = explode('|', $icon);
            } else {
                $icon_array = '';
            }
            if ($addresses) {
                self::$args['address'] = $addresses;
            }
            $num_of_addresses = count($addresses);
            if (is_array($infobox_content_array) && !empty($infobox_content_array)) {
                for ($i = 0; $i < $num_of_addresses; $i++) {
                    if (!$infobox_content_array[$i]) {
                        $infobox_content_array[$i] = $addresses[$i];
                    }
                }
                self::$args['infobox_content'] = $infobox_content_array;
            } else {
                self::$args['infobox_content'] = self::$args['address'];
            }
            if ($icon && strpos($icon, '|') === false) {
                for ($i = 0; $i < $num_of_addresses; $i++) {
                    $icon_array[$i] = $icon;
                }
            }
            if ($map_style == 'theme') {
                $map_style = 'custom';
                $icon = 'theme';
                $animation = 'yes';
                $infobox = 'custom';
                $infobox_background_color = T4PCore_Plugin::hex2rgb($smof_data['primary_color']);
                $infobox_background_color = 'rgba(' . $infobox_background_color[0] . ', ' . $infobox_background_color[1] . ', ' . $infobox_background_color[2] . ', 0.8)';
                $overlay_color = $smof_data['primary_color'];
                $brightness_level = T4PCore_Plugin::calc_color_brightness($smof_data['primary_color']);
                if ($brightness_level > 140) {
                    $infobox_text_color = '#fff';
                } else {
                    $infobox_text_color = '#747474';
                }
            }
            if ($icon == 'theme' && $map_style == 'custom') {
                for ($i = 0; $i < $num_of_addresses; $i++) {
                    $icon_array[$i] = plugins_url('images/t4p_map_marker.png', dirname(__FILE__));
                }
            }
            wp_print_scripts('google-maps-api');
            wp_print_scripts('google-maps-infobox');
            foreach (self::$args['address'] as $add) {
                $coordinates[] = $this->get_coordinates($add);
            }
            if (!is_array($coordinates)) {
                return;
            }
            $map_id = uniqid('t4p_map_');
            // generate a unique ID for this map
            $this->map_id = $map_id;
            ob_start();
            ?>
			<script type="text/javascript">
				var map_<?php 
            echo $map_id;
            ?>
;
				var markers = [];
				var counter = 0;
				function t4p_run_map_<?php 
            echo $map_id;
            ?>
() {
					var location = new google.maps.LatLng(<?php 
            echo $coordinates[0]['lat'];
            ?>
, <?php 
            echo $coordinates[0]['lng'];
            ?>
);
					var map_options = {
						zoom: <?php 
            echo $zoom;
            ?>
,
						center: location,
						mapTypeId: google.maps.MapTypeId.<?php 
            echo strtoupper($type);
            ?>
,
						scrollwheel: <?php 
            echo $scrollwheel == 'yes' ? 'true' : 'false';
            ?>
,
						scaleControl: <?php 
            echo $scale == 'yes' ? 'true' : 'false';
            ?>
,
						panControl: <?php 
            echo $zoom_pancontrol == 'yes' ? 'true' : 'false';
            ?>
,
						zoomControl: <?php 
            echo $zoom_pancontrol == 'yes' ? 'true' : 'false';
            ?>
						
					};
					map_<?php 
            echo $map_id;
            ?>
 = new google.maps.Map(document.getElementById("<?php 
            echo esc_attr($map_id);
            ?>
"), map_options);
					<?php 
            $i = 0;
            ?>
					<?php 
            foreach ($coordinates as $key => $coordinate) {
                ?>
					
					var content_string = "<div class='info-window'><?php 
                echo self::$args['infobox_content'][$key];
                ?>
</div>";
					
					<?php 
                if ($overlay_color && $map_style == 'custom') {
                    ?>
					var styles = [
					  {
						stylers: [
						  { hue: '<?php 
                    echo $overlay_color;
                    ?>
' },
						  { saturation: -20 }
						]
					  },{
						featureType: "road",
						elementType: "geometry",
						stylers: [
						  { lightness: 100 },
						  { visibility: "simplified" }
						]
					  },{
						featureType: "road",
						elementType: "labels",
					  }
					];

					map_<?php 
                    echo $map_id;
                    ?>
.setOptions({styles: styles});
					
					<?php 
                }
                ?>

					map_<?php 
                echo $map_id;
                ?>
_args = {
						position: new google.maps.LatLng("<?php 
                echo $coordinate['lat'];
                ?>
", "<?php 
                echo $coordinate['lng'];
                ?>
"),
						map: map_<?php 
                echo $map_id;
                ?>
					};

					<?php 
                if ($animation == 'yes' && $map_style == 'custom') {
                    ?>
					map_<?php 
                    echo $map_id;
                    ?>
_args.animation = google.maps.Animation.DROP;
					<?php 
                }
                ?>
					<?php 
                if ($icon == 'theme' && isset($icon_array[$i]) && $icon_array[$i] && $map_style == 'custom') {
                    ?>
					map_<?php 
                    echo $map_id;
                    ?>
_args.icon = new google.maps.MarkerImage( '<?php 
                    echo $icon_array[$i];
                    ?>
', null, null, null, new google.maps.Size( 37, 55 ) );
					<?php 
                } else {
                    if (isset($icon_array[$i]) && $icon_array[$i] && $map_style == 'custom') {
                        ?>
					map_<?php 
                        echo $map_id;
                        ?>
_args.icon = '<?php 
                        echo $icon_array[$i];
                        ?>
';
					<?php 
                    }
                }
                ?>
					<?php 
                $i++;
                ?>

					markers[counter] = new google.maps.Marker(map_<?php 
                echo $map_id;
                ?>
_args);
					
					<?php 
                if ($infobox == 'custom' && $map_style == 'custom') {
                    ?>
					
						var info_box_div = document.createElement('div');
						info_box_div.className = 't4p-info-box';
						info_box_div.style.cssText = 'background-color:<?php 
                    echo $infobox_background_color;
                    ?>
;color:<?php 
                    echo $infobox_text_color;
                    ?>
;';

						info_box_div.innerHTML = content_string;

						var info_box_options = {
							 content: info_box_div
							,disableAutoPan: false
							,maxWidth: 150
							,pixelOffset: new google.maps.Size(-125, 10)
							,zIndex: null
							,boxStyle: { 
							  background: 'none'
							  ,opacity: 1
							  ,width: "250px"
							 }
							,closeBoxMargin: "2px 2px 2px 2px"
							,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif"
							,infoBoxClearance: new google.maps.Size(1, 1)

						};

						markers[counter]['infowindow'] = new InfoBox(info_box_options);
						markers[counter]['infowindow'].open(map_<?php 
                    echo $map_id;
                    ?>
, markers[counter]);
						<?php 
                    if ($popup != 'yes') {
                        ?>
							markers[counter]['infowindow'].setVisible( false );
						<?php 
                    }
                    ?>
						google.maps.event.addListener(markers[counter], 'click', function() {
							if( this['infowindow'].getVisible() ) {
								this['infowindow'].setVisible( false );
							} else {
								this['infowindow'].setVisible( true );
							}
						}); 					
						
					<?php 
                } else {
                    ?>
					
						markers[counter]['infowindow'] = new google.maps.InfoWindow({
							content: content_string
						});					
						
						<?php 
                    if ($popup == 'yes') {
                        ?>
							markers[counter]['infowindow'].show = true;
							markers[counter]['infowindow'].open(map_<?php 
                        echo $map_id;
                        ?>
, markers[counter]);
						<?php 
                    }
                    ?>
						

						google.maps.event.addListener(markers[counter], 'click', function() {
							if(this['infowindow'].show) {
								this['infowindow'].close(map_<?php 
                    echo $map_id;
                    ?>
, this);
								this['infowindow'].show = false;
							} else {
								this['infowindow'].open(map_<?php 
                    echo $map_id;
                    ?>
, this);
								this['infowindow'].show = true;
							}
						});
					
					<?php 
                }
                ?>
					
					counter++;
					<?php 
            }
            ?>

				}

				google.maps.event.addDomListener(window, 'load', t4p_run_map_<?php 
            echo $map_id;
            ?>
);

			</script>
			<?php 
            if ($defaults['id']) {
                $html = ob_get_clean() . sprintf('<div id="%s"><div %s></div></div>', $defaults['id'], T4PCore_Plugin::attributes('google-map-shortcode'));
            } else {
                $html = ob_get_clean() . sprintf('<div %s></div>', T4PCore_Plugin::attributes('google-map-shortcode'));
            }
        }
        return $html;
    }