コード例 #1
0
ファイル: icon.php プロジェクト: bluedrone/plugins
 /**
  * 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 = "")
 {
     //this is a fix that solves the false paragraph removal by wordpress if the dropcaps shortcode is used at the beginning of the content of single posts/pages
     global $post, $avia_add_p;
     $add_p = "";
     $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
     if (isset($post->post_content) && strpos($post->post_content, '[av_font_icon') === 0 && $avia_add_p == false && is_singular()) {
         $add_p = "<p>";
         $avia_add_p = true;
     }
     extract(shortcode_atts(array('icon' => '1', 'color' => '', 'size' => '', 'use_link' => 'no', 'position' => 'left', 'link' => '', 'linktarget' => 'no'), $atts));
     $icon_el = $this->elements[0];
     $chars = $icon_el['chars'];
     $font = $icon_el['font'];
     if (!is_array($chars)) {
         include $icon_el['chars'];
     }
     $display_char = isset($chars[$icon - 1]) ? $chars[$icon - 1] : $chars[0];
     $color = !empty($color) ? "color:{$color};" : '';
     if (!empty($size) && is_numeric($size)) {
         $size .= 'px';
     }
     $size = !empty($size) ? "font-size:{$size};line-height:{$size};" : '';
     $linktarget = $linktarget == 'no' ? '' : 'target="_blank"';
     $link = aviaHelper::get_url($link);
     if (!empty($link)) {
         $display_char = "<a href='{$link}' {$linktarget}>{$display_char}</a>";
     }
     //this is the actual shortcode
     $output = $add_p . '<span class="' . $shortcodename . ' ' . $custom_class . ' avia-icon-pos-' . $position . ' avia-font-' . $font . '" style="' . $color . $size . '" >';
     $output .= $display_char;
     $output .= '</span>';
     return $output;
 }
コード例 #2
0
ファイル: iconbox.php プロジェクト: Jiersone/mac
 /**
  * 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('title' => 'Title', 'icon' => '1', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'linkelement' => '', 'font' => ''), $atts));
     $display_char = av_icon($icon, $font);
     $display_char_wrapper = array();
     if ($position == 'top') {
         $position .= " main_color";
     }
     $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : "";
     $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : "";
     $link = aviaHelper::get_url($link);
     if (!empty($link)) {
         $linktitle = $title;
         switch ($linkelement) {
             case 'both':
                 $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}>{$linktitle}</a>";
                 $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}";
                 $display_char_wrapper['end'] = 'a';
                 break;
             case 'only_icon':
                 $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}";
                 $display_char_wrapper['end'] = 'a';
                 break;
             default:
                 $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}>{$linktitle}</a>";
                 $display_char_wrapper['start'] = 'div';
                 $display_char_wrapper['end'] = 'div';
                 break;
         }
     }
     if (empty($display_char_wrapper)) {
         $display_char_wrapper['start'] = 'div';
         $display_char_wrapper['end'] = 'div';
     }
     // add blockquotes to the content
     $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false));
     $output = '<article class="iconbox iconbox_' . $position . ' ' . $meta['el_class'] . '" ' . $markup . '>';
     $output .= '        <div class="iconbox_content">';
     $output .= '        <header class="entry-content-header">';
     $output .= '            <' . $display_char_wrapper['start'] . ' class="iconbox_icon heading-color" ' . $display_char . '></' . $display_char_wrapper['end'] . '>';
     $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false));
     $output .= "            <h3 class='iconbox_content_title' {$markup}>" . $title . "</h3>";
     $output .= '        </header>';
     $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false));
     $output .= "        <div class='iconbox_content_container' {$markup}>";
     $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
     $output .= '        </div>';
     $output .= '    </div>';
     $output .= '    <footer class="entry-footer"></footer>';
     $output .= '</article>';
     return $output;
 }
コード例 #3
0
ファイル: iconlist.php プロジェクト: Jiersone/mac
 function av_iconlist_item($atts, $content = "", $shortcodename = "")
 {
     $atts = shortcode_atts(array('title' => '', 'link' => '', 'icon' => '', 'font' => '', 'linkelement' => '', 'linktarget' => ''), $atts);
     $display_char = av_icon($atts['icon'], $atts['font']);
     $display_char_wrapper = array();
     $blank = strpos($atts['linktarget'], '_blank') !== false || $atts['linktarget'] == 'yes' ? ' target="_blank" ' : "";
     $blank .= strpos($atts['linktarget'], 'nofollow') !== false ? ' rel="nofollow" ' : "";
     if (!empty($atts['link'])) {
         $atts['link'] = aviaHelper::get_url($atts['link']);
         if (!empty($atts['link'])) {
             $linktitle = $atts['title'];
             switch ($atts['linkelement']) {
                 case 'both':
                     $atts['title'] = "<a href='{$atts['link']}' title='" . esc_attr($linktitle) . "'{$blank}>{$linktitle}</a>";
                     $display_char_wrapper['start'] = "a href='{$atts['link']}' title='" . esc_attr($linktitle) . "' {$blank}";
                     $display_char_wrapper['end'] = 'a';
                     break;
                 case 'only_icon':
                     $display_char_wrapper['start'] = "a href='{$atts['link']}' title='" . esc_attr($linktitle) . "' {$blank}";
                     $display_char_wrapper['end'] = 'a';
                     break;
                 default:
                     $atts['title'] = "<a href='{$atts['link']}' title='" . esc_attr($linktitle) . "'{$blank}>{$linktitle}</a>";
                     $display_char_wrapper['start'] = 'div';
                     $display_char_wrapper['end'] = 'div';
                     break;
             }
         }
     }
     if (empty($display_char_wrapper)) {
         $display_char_wrapper['start'] = 'div';
         $display_char_wrapper['end'] = 'div';
     }
     $output = "";
     $output .= "<li>";
     $output .= "<{$display_char_wrapper['start']} class='iconlist_icon avia-font-" . $atts['font'] . "'><span class='iconlist-char' {$display_char}></span></{$display_char_wrapper['end']}>";
     $output .= '<article class="article-icon-entry" ' . avia_markup_helper(array('context' => 'entry', 'echo' => false)) . '>';
     $output .= "<div class='iconlist_content_wrap'>";
     $output .= '<header class="entry-content-header">';
     $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false));
     $output .= "<h4 class='iconlist_title' {$markup}>" . $atts['title'] . "</h4>";
     $output .= '</header>';
     $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false));
     $output .= "<div class='iconlist_content' {$markup}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
     $output .= "</div>";
     $output .= '<footer class="entry-footer"></footer>';
     $output .= '</article>';
     $output .= "<div class='iconlist-timeline'></div>";
     $output .= "</li>";
     return $output;
 }
コード例 #4
0
ファイル: numbers.php プロジェクト: DylanPeti/socialize
 /**
  * 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('number' => '100', 'icon' => '1', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'color' => '', 'custom_color' => '', 'icon_select' => '', 'icon' => 'no', 'font' => '', 'font_size' => '', 'font_size_description' => ''), $atts));
     $tags = array('div', 'div');
     $style = "";
     $font_style = "";
     $font_style2 = "";
     $linktarget = $linktarget == 'no' ? '' : 'target="_blank"';
     $link = aviaHelper::get_url($link);
     $display_char = $before = $after = "";
     if (!empty($link)) {
         $tags[0] = "a href='{$link}' title='' {$linktarget}";
         $tags[1] = "a";
     }
     if ($color == "font-custom") {
         $style = "style='color:{$custom_color}'";
     }
     if ($font_size) {
         $font_style = "style='font-size:{$font_size}px'";
     }
     if ($font_size_description) {
         $font_style2 = "style='font-size:{$font_size_description}px'";
     }
     if ($icon_select !== 'no') {
         $char = av_icon($icon, $font);
         $display_char = "<span class='avia-animated-number-icon {$icon_select}-number av-icon-char' {$char}></span>";
         if ($icon_select == 'av-icon-before') {
             $before = $display_char;
         }
         if ($icon_select == 'av-icon-after') {
             $after = $display_char;
         }
     }
     // add blockquotes to the content
     $output = '<' . $tags[0] . ' ' . $style . ' class="avia-animated-number av-force-default-color avia-color-' . $color . ' ' . $meta['el_class'] . ' avia_animate_when_visible" ' . $style . '>';
     $output .= '<strong class="heading avia-animated-number-title" ' . $font_style . '>';
     $output .= $before . $this->extract_numbers($number) . $after;
     $output .= "</strong>";
     $output .= "<div class='avia-animated-number-content' {$font_style2}>";
     $output .= wpautop(ShortcodeHelper::avia_remove_autop($content));
     $output .= '</div></' . $tags[1] . '>';
     return $output;
 }
コード例 #5
0
ファイル: catalogue.php プロジェクト: erynet/SUAWEBv2
 function av_catalogue_item($atts, $content = "", $shortcodename = "")
 {
     extract(shortcode_atts(array('title' => '', 'price' => '', 'link' => '', 'target' => '', 'disabled' => '', 'id' => ''), $atts, $this->config['shortcode_nested'][0]));
     if ($disabled) {
         return;
     }
     $item_markup = array("open" => "div", "close" => "div");
     $image = "";
     $blank = "";
     if ($link) {
         if ($link == 'lightbox' && $id) {
             $link = aviaHelper::get_url($link, $id);
         } else {
             $link = aviaHelper::get_url($link);
             $blank = strpos($target, '_blank') !== false || $target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
         }
         $item_markup = array("open" => "a href='{$link}' {$blank}", "close" => "a");
     }
     if (!empty($id)) {
         $attachment_entry = get_post($id);
         if (!empty($attachment_entry)) {
             $alt = get_post_meta($attachment_entry->ID, '_wp_attachment_image_alt', true);
             $alt = !empty($alt) ? esc_attr($alt) : '';
             $img_title = trim($attachment_entry->post_title) ? esc_attr($attachment_entry->post_title) : "";
             $src = wp_get_attachment_image_src($attachment_entry->ID, 'square');
             $src = !empty($src[0]) ? $src[0] : "";
             $image = "<img src='{$src}' title='{$img_title}' alt='{$alt}' class='av-catalogue-image' />";
         }
     }
     $output = "";
     $output .= "<li>";
     $output .= "<" . $item_markup['open'] . " class='av-catalogue-item'>";
     $output .= $image;
     $output .= "<div class='av-catalogue-item-inner'>";
     $output .= "<div class='av-catalogue-title-container'><div class='av-catalogue-title'>{$title}</div><div class='av-catalogue-price'>{$price}</div></div>";
     $output .= "<div class='av-catalogue-content'>{$content}</div>";
     $output .= "</div>";
     $output .= "</" . $item_markup['close'] . ">";
     $output .= "</li>";
     return $output;
 }
コード例 #6
0
ファイル: iconbox.php プロジェクト: bluedrone/plugins
 /**
  * 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('title' => 'Title', 'icon' => '1', 'position' => 'left', 'link' => '', 'linktarget' => 'no'), $atts));
     $icon_el = $this->elements[0];
     $chars = $icon_el['chars'];
     $font = $icon_el['font'];
     if (!is_array($chars)) {
         include $icon_el['chars'];
     }
     $display_char = isset($chars[$icon - 1]) ? $chars[$icon - 1] : $chars[0];
     if ($position == 'top') {
         $position .= " main_color";
     }
     $linktarget = $linktarget == 'no' ? '' : 'target="_blank"';
     $link = aviaHelper::get_url($link);
     if (!empty($link)) {
         $title = "<a href='{$link}' title='" . esc_attr($title) . "' {$linktarget}>{$title}</a>";
     }
     // add blockquotes to the content
     $output = '<div class="iconbox iconbox_' . $position . ' ' . $meta['el_class'] . '">';
     $output .= '<div class="iconbox_content">';
     $output .= '<div class="iconbox_icon heading-color avia-font-' . $font . '">' . $display_char . '</div>';
     $output .= '<h3 class="iconbox_content_title">' . $title . "</h3>";
     $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
     $output .= '</div></div>';
     return $output;
 }
コード例 #7
0
ファイル: image.php プロジェクト: erikdukker/medisom
 /**
  * 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 = "";
     $atts = shortcode_atts(array('src' => '', 'animation' => 'no-animation', 'link' => '', 'attachment' => '', 'attachment_size' => '', 'target' => 'no', 'styling' => '', 'caption' => '', 'font_size' => '', 'appearance' => '', 'hover' => '', 'align' => 'center', 'overlay_opacity' => '0.4', 'overlay_color' => '#444444', 'overlay_text_color' => '#ffffff'), $atts, $this->config['shortcode']);
     extract($atts);
     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] : "";
             }
         }
     } else {
         $attachment = false;
     }
     if (!empty($src)) {
         $class = $animation == "no-animation" ? "" : "avia_animated_image avia_animate_when_almost_visible " . $animation;
         $class .= " av-styling-" . $styling . " " . $hover;
         if (is_numeric($src)) {
             //$output = wp_get_attachment_image($src,'large');
             $output = wp_get_attachment_image($src, 'large', false, array('class' => "avia_image {$class} " . $this->class_by_arguments('align', $atts, true)));
         } else {
             $link = aviaHelper::get_url($link, $attachment);
             $blank = strpos($target, '_blank') !== false || $target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
             $overlay = "";
             $style = "";
             $style .= AviaHelper::style_string($atts, 'overlay_text_color', 'color');
             if ($font_size) {
                 // $style = "style='font-size: {$font_size}px;'";
                 $style .= AviaHelper::style_string($atts, 'font_size', 'font-size', 'px');
             }
             $style = AviaHelper::style_string($style);
             if ($caption == "yes") {
                 $caption_style = "";
                 $caption_style .= AviaHelper::style_string($atts, 'overlay_opacity', 'opacity');
                 $caption_style .= AviaHelper::style_string($atts, 'overlay_color', 'background-color');
                 $caption_style = AviaHelper::style_string($caption_style);
                 $overlay_bg = "<div class='av-caption-image-overlay-bg' {$caption_style}></div>";
                 $content = ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
                 $overlay = "<div class='av-image-caption-overlay'>{$overlay_bg}<div class='av-image-caption-overlay-position'><div class='av-image-caption-overlay-center' {$style}>{$content}</div></div></div>";
                 $class .= " noHover ";
                 if (empty($appearance)) {
                     $appearance = "hover-deactivate";
                 }
                 if ($appearance) {
                     $class .= " av-overlay-" . $appearance;
                 }
             }
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
             $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
             $output .= "<div class='avia-image-container {$class} " . $meta['el_class'] . " " . $this->class_by_arguments('align', $atts, true) . "' {$markup} >";
             $output .= "<div class='avia-image-container-inner'>";
             if ($link) {
                 $output .= "<a href='{$link}' class='avia_image'  {$blank}>{$overlay}<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}' {$markup_url} /></a>";
             } else {
                 $output .= "{$overlay}<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
             }
             $output .= "</div>";
             $output .= "</div>";
         }
     }
     return $output;
 }
コード例 #8
0
ファイル: iconbox.php プロジェクト: erikdukker/medisom
 /**
  * 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('title' => 'Title', 'icon' => 'ue800', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'linkelement' => '', 'font' => '', 'boxed' => '', 'color' => '', 'custom_bg' => '', 'custom_border' => '', 'custom_font' => '', 'font_color' => "", 'custom_title' => '', 'custom_content' => ''), $atts, $this->config['shortcode']));
     $display_char = av_icon($icon, $font);
     $display_char_wrapper = array();
     if ($position == 'top' && empty($boxed)) {
         $position .= " main_color";
     }
     if ($position != 'top') {
         $boxed = "";
     }
     $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : "";
     $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : "";
     $link = aviaHelper::get_url($link);
     if (!empty($link)) {
         $linktitle = $title;
         switch ($linkelement) {
             case 'both':
                 $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}>{$linktitle}</a>";
                 $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}";
                 $display_char_wrapper['end'] = 'a';
                 break;
             case 'only_icon':
                 $display_char_wrapper['start'] = "a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank}";
                 $display_char_wrapper['end'] = 'a';
                 break;
             default:
                 $title = "<a href='{$link}' title='" . esc_attr($linktitle) . "' {$blank} >{$linktitle}</a>";
                 $display_char_wrapper['start'] = 'div';
                 $display_char_wrapper['end'] = 'div';
                 break;
         }
     }
     if (empty($display_char_wrapper)) {
         $display_char_wrapper['start'] = 'div';
         $display_char_wrapper['end'] = 'div';
     }
     $icon_html_styling = "";
     $title_styling = "";
     $content_styling = "";
     $content_class = "";
     if ($color == "custom") {
         $icon_html_styling .= !empty($custom_bg) ? "background-color:{$custom_bg}; " : "";
         $icon_html_styling .= !empty($custom_border) ? "border:1px solid {$custom_border}; " : "";
         $icon_html_styling .= !empty($custom_font) ? "color:{$custom_font}; " : "";
         if ($icon_html_styling) {
             $icon_html_styling = " style='{$icon_html_styling}'";
         }
     }
     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}'";
         }
         if ($content_styling) {
             $content_styling = " style='{$content_styling}'";
             $content_class = "av_inherit_color";
         }
     }
     $icon_html = '<' . $display_char_wrapper['start'] . ' class="iconbox_icon heading-color" ' . $display_char . ' ' . $icon_html_styling . ' ></' . $display_char_wrapper['end'] . '>';
     // add blockquotes to the content
     $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $output = '<article class="iconbox iconbox_' . $position . ' ' . $boxed . ' ' . $meta['el_class'] . '" ' . $markup . '>';
     if ($position == 'left_content' || $position == 'right_content') {
         $output .= $icon_html;
         $icon_html = "";
     }
     $output .= '<div class="iconbox_content">';
     $output .= '<header class="entry-content-header">';
     $output .= $icon_html;
     $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $output .= "<h3 class='iconbox_content_title' {$markup} {$title_styling}>" . $title . "</h3>";
     $output .= '</header>';
     $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
     $output .= "<div class='iconbox_content_container {$content_class}' {$markup} {$content_styling}>";
     $output .= ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
     $output .= '</div>';
     $output .= '</div>';
     $output .= '<footer class="entry-footer"></footer>';
     $output .= '</article>';
     return $output;
 }
コード例 #9
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     //this is a fix that solves the false paragraph removal by wordpress if the dropcaps shortcode is used at the beginning of the content of single posts/pages
     global $post, $avia_add_p;
     $add_p = "";
     $custom_class = !empty($meta['custom_class']) ? $meta['custom_class'] : "";
     if (isset($post->post_content) && strpos($post->post_content, '[av_font_icon') === 0 && $avia_add_p == false && is_singular()) {
         $add_p = "<p>";
         $avia_add_p = true;
     }
     extract(shortcode_atts(array('icon' => '', 'font' => '', 'color' => '', 'size' => '', 'style' => '', 'caption' => '', 'use_link' => 'no', 'position' => 'left', 'link' => '', 'linktarget' => 'no', 'font' => ''), $atts, $this->config['shortcode']));
     $char = av_icon($icon, $font);
     $color = !empty($color) ? "color:{$color}; border-color:{$color};" : '';
     if (empty($color)) {
         $custom_class .= " av-no-color";
     }
     if (!empty($size) && is_numeric($size)) {
         $size .= 'px';
     }
     $size_string = !empty($size) ? "font-size:{$size};line-height:{$size};" : '';
     if (!empty($style)) {
         $size_string .= "width:{$size};";
         if (!empty($caption)) {
             $caption = "<span class='av_icon_caption av-special-font'>{$caption}</span>";
         }
     } else {
         $caption = "";
     }
     $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : "";
     $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : "";
     $link = aviaHelper::get_url($link);
     $tags = !empty($link) ? array("a href='{$link}' {$blank} ", 'a') : array('span', 'span');
     $tooltip = empty($content) ? '' : 'data-avia-icon-tooltip="' . htmlspecialchars(do_shortcode($content)) . '"';
     $display_char = "<{$tags[0]} class='av-icon-char' style='{$size_string}' {$char} {$tooltip}></{$tags[1]}>";
     $output = '<span class="' . $shortcodename . ' avia_animate_when_visible av-icon-style-' . $style . ' ' . $custom_class . ' avia-icon-pos-' . $position . ' " style="' . $color . '">' . $display_char . $caption . '</span>';
     return $output;
 }
コード例 #10
0
ファイル: contentslider.php プロジェクト: Jiersone/mac
 public function html()
 {
     $output = "";
     $counter = 0;
     avia_content_slider::$slider++;
     if (empty($this->config['content'])) {
         return $output;
     }
     //$html .= empty($this->subslides) ? $this->default_slide() : $this->advanced_slide();
     extract($this->config);
     $extraClass = 'first';
     $grid = 'one_third';
     $slide_loop_count = 1;
     $loop_counter = 1;
     $total = $columns % 2 ? "odd" : "even";
     $heading = !empty($this->config['heading']) ? '<h3>' . $this->config['heading'] . '</h3>' : "&nbsp;";
     $slide_count = count($content);
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             break;
         case "5":
             $grid = 'av_one_fifth';
             break;
         case "6":
             $grid = 'av_one_sixth';
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation, 'show_slide_delay' => 30));
     $thumb_fallback = "";
     $output .= "<div {$data} class='avia-content-slider-element-container avia-content-slider-element-{$type} avia-content-slider avia-smallarrow-slider avia-content-{$type}-active avia-content-slider" . avia_content_slider::$slider . " avia-content-slider-{$total} {$class}' >";
     $heading_class = '';
     if ($navigation == 'no') {
         $heading_class .= ' no-content-slider-navigation ';
     }
     if ($heading == '&nbsp;') {
         $heading_class .= ' no-content-slider-heading ';
     }
     $output .= "<div class='avia-smallarrow-slider-heading {$heading_class}'>";
     $output .= "<div class='new-special-heading'>" . $heading . "</div>";
     if ($slide_count > $columns && $type == 'slider' && $navigation != 'no') {
         if ($navigation == 'dots') {
             $output .= $this->slide_navigation_dots();
         }
         if ($navigation == 'arrows') {
             $output .= $this->slide_navigation_arrows();
         }
     }
     $output .= "</div>";
     $output .= "<div class='avia-content-slider-inner'>";
     foreach ($content as $key => $value) {
         $link = $linktarget = "";
         extract($value['attr']);
         $link = aviaHelper::get_url($link);
         $blank = strpos($linktarget, '_blank') !== false || $linktarget == 'yes' ? ' target="_blank" ' : "";
         $blank .= strpos($linktarget, 'nofollow') !== false ? ' rel="nofollow" ' : "";
         $parity = $loop_counter % 2 ? 'odd' : 'even';
         $last = $slide_count == $slide_loop_count ? " post-entry-last " : "";
         $post_class = "post-entry slide-entry-overview slide-loop-{$slide_loop_count} slide-parity-{$parity} {$last}";
         if ($loop_counter == 1) {
             $output .= "<div class='slide-entry-wrap'>";
         }
         $markup = avia_markup_helper(array('context' => 'entry', 'echo' => false));
         $output .= "<section class='slide-entry flex_column {$post_class} {$grid} {$extraClass}' {$markup}>";
         $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false));
         $output .= !empty($title) ? "<h3 class='slide-entry-title entry-title' {$markup}>" : '';
         $output .= !empty($link) && !empty($title) ? "<a href='{$link}' {$blank} title='" . esc_attr($title) . "'>" . $title . "</a>" : $title;
         $output .= !empty($title) ? '</h3>' : '';
         $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false));
         $output .= !empty($value['content']) ? "<div class='slide-entry-excerpt entry-content' {$markup}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($value['content'])) . "</div>" : "";
         $output .= '</section>';
         $loop_counter++;
         $slide_loop_count++;
         $extraClass = "";
         if ($loop_counter > $columns) {
             $loop_counter = 1;
             $extraClass = 'first';
         }
         if ($loop_counter == 1 || !empty($last)) {
             $output .= "</div>";
         }
     }
     $output .= "</div>";
     $output .= "</div>";
     return $output;
 }
コード例 #11
0
ファイル: slideshow.php プロジェクト: bluedrone/plugins
 private function advanced_slide()
 {
     $html = "";
     $counter = 0;
     foreach ($this->id_array as $id) {
         if (isset($this->slides[$id])) {
             $slide = $this->slides[$id];
             $meta = array_merge(array('content' => $this->subslides[$slide->ID]['content'], 'title' => '', 'link' => '', 'link_target' => '', 'position' => 'center center', 'caption_pos' => 'capt-bottom capt-left', 'link_apply' => '', 'button_label' => '', 'button_color' => 'light'), $this->subslides[$slide->ID]['attr']);
             extract($meta);
             //fetch image and link
             $counter++;
             $img = wp_get_attachment_image_src($slide->ID, $this->config['size']);
             $link = aviaHelper::get_url($link, $slide->ID);
             $link_target = !empty($link_target) ? " target='_blank' " : "";
             $tags = !empty($link) ? array("a href='{$link}'{$link_target}", 'a') : array('div', 'div');
             $caption = "";
             $button_html = "";
             //if we got a CTA button apply the link to the button istead of the slide
             if ($link_apply == 'button') {
                 $button_html .= "<" . $tags[0] . " class='avia-slideshow-button avia-button-{$button_color}' data-duration='800' data-easing='easeInOutQuad'>";
                 $button_html .= $button_label;
                 $button_html .= "</" . $tags[1] . ">";
                 $tags = array('div', 'div');
             }
             //check if we got a caption
             if (trim($title) != "") {
                 $title = "<h2 class='avia-caption-title'>" . trim(apply_filters('avf_slideshow_title', $title)) . "</h2>";
             }
             if (trim($content) != "") {
                 $content = "<div class='avia-caption-content'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop(trim($content))) . "</div>";
             }
             if (trim($title . $content . $button_html) != "") {
                 if (trim($title) != "" && trim($button_html) != "" && trim($content) == "") {
                     $content = "<br/>";
                 }
                 if ($this->config['handle'] == 'av_slideshow_full' || $this->config['handle'] == 'av_fullscreen') {
                     $caption .= '<div class = "caption_fullwidth ' . $caption_pos . '">';
                     $caption .= '<div class = "container caption_container">';
                     $caption .= '<div class = "slideshow_caption">';
                     $caption .= '<div class = "slideshow_inner_caption">';
                     $caption .= '<div class = "slideshow_align_caption">';
                     $caption .= $title;
                     $caption .= $content;
                     $caption .= $button_html;
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                 } else {
                     $caption = '<div class="avia-caption"><div class="avia-inner-caption">' . $title . $content . "</div></div>";
                 }
             }
             $linkalt = get_post_meta($slide->ID, '_wp_attachment_image_alt', true);
             $linkalt = !empty($linkalt) ? esc_attr($linkalt) : '';
             $linktitle = trim($slide->post_title) ? esc_attr($slide->post_title) : "";
             $linkdescription = trim($slide->post_content) && empty($link) ? "title='" . esc_attr($slide->post_content) . "'" : "";
             $bg_slider_style = $this->config['bg_slider'] == "true" ? "style='background-position:{$position};'" : "";
             $html .= "<li {$bg_slider_style} class='slide-{$counter} slide-id-" . $slide->ID . "' data-img-url='" . $img[0] . "'>";
             $html .= "<" . $tags[0] . " data-rel='slideshow-" . avia_slideshow::$slider . "' class='avia-slide-wrap' {$linkdescription} >{$caption}";
             if ($this->config['bg_slider'] != "true") {
                 $html .= "<img src='" . $img[0] . "' title='" . $linktitle . "' alt='" . $linkalt . "' />";
             }
             $html .= "</" . $tags[1] . ">";
             $html .= "</li>";
         } else {
             $this->slide_count--;
         }
     }
     return $html;
 }
コード例 #12
0
ファイル: logoslider.php プロジェクト: fredpaw/chuguo
 public function html()
 {
     $output = "";
     $counter = 0;
     avia_partner_logo::$slider++;
     if ($this->slide_count == 0) {
         return $output;
     }
     extract($this->config);
     $extraClass = 'first';
     $grid = 'one_third';
     $slide_loop_count = 1;
     $loop_counter = 1;
     $total = $columns % 2 ? "odd" : "even";
     $heading = !empty($this->config['heading']) ? '<h3>' . $this->config['heading'] . '</h3>' : "&nbsp;";
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             break;
         case "5":
             $grid = 'av_one_fifth';
             break;
         case "6":
             $grid = 'av_one_sixth';
             break;
         case "7":
             $grid = 'av_one_seventh';
             break;
         case "8":
             $grid = 'av_one_eighth';
             break;
     }
     $data = AviaHelper::create_data_string(array('autoplay' => $autoplay, 'interval' => $interval, 'animation' => $animation));
     $thumb_fallback = "";
     $output .= "<div {$data} class='avia-logo-element-container {$border} avia-logo-{$type} avia-content-slider avia-smallarrow-slider avia-content-{$type}-active noHover avia-content-slider" . avia_partner_logo::$slider . " avia-content-slider-{$total} {$class}' >";
     $heading_class = '';
     if ($navigation == 'no') {
         $heading_class .= ' no-logo-slider-navigation ';
     }
     if ($heading == '&nbsp;') {
         $heading_class .= ' no-logo-slider-heading ';
     }
     $output .= "<div class='avia-smallarrow-slider-heading {$heading_class}'>";
     if ($heading != '&nbsp;' || $navigation != 'no') {
         $output .= "<div class='new-special-heading'>" . $heading . "</div>";
     }
     if (count($this->id_array) > $columns && $type == 'slider' && $navigation != 'no') {
         if ($navigation == 'arrows') {
             $output .= $this->slide_navigation_arrows();
         }
     }
     $output .= "</div>";
     $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $custom_markup));
     $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $custom_markup));
     $output .= "<div class='avia-content-slider-inner'>";
     foreach ($this->id_array as $key => $id) {
         if (isset($this->slides[$id])) {
             $slide = $this->slides[$id];
             $meta = array_merge(array('link' => '', 'link_target' => '', 'linktitle' => '', 'hover' => '', 'custom_markup' => ''), $this->subslides[$key]['attr']);
             extract($meta);
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'id' => $slide->ID, 'custom_markup' => $custom_markup));
             $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'id' => $slide->ID, 'custom_markup' => $custom_markup));
             $img = wp_get_attachment_image($slide->ID, $size);
             $link = aviaHelper::get_url($link, $slide->ID);
             $blank = strpos($link_target, '_blank') !== false || $link_target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($link_target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
         }
         $parity = $loop_counter % 2 ? 'odd' : 'even';
         $last = $this->slide_count == $slide_loop_count ? " post-entry-last " : "";
         $post_class = "post-entry slide-entry-overview slide-loop-{$slide_loop_count} slide-parity-{$parity} {$last}";
         $thumb_class = "real-thumbnail";
         $single_data = empty($hover) ? '' : 'data-avia-tooltip="' . $hover . '"';
         if ($loop_counter == 1) {
             $output .= "<div class='slide-entry-wrap' {$markup}>";
         }
         $img = str_replace('<img ', "<img {$markup_url} ", $img);
         $output .= "<div {$single_data} class='slide-entry flex_column no_margin {$post_class} {$grid} {$extraClass} {$thumb_class}'>";
         $output .= !empty($link) ? "<a href='{$link}' data-rel='slide-" . avia_partner_logo::$slider . "' class='slide-image' title='{$linktitle}' {$blank} >{$img}</a>" : $img;
         $output .= "</div>";
         $loop_counter++;
         $slide_loop_count++;
         $extraClass = "";
         if ($loop_counter > $columns) {
             $loop_counter = 1;
             $extraClass = 'first';
         }
         if ($loop_counter == 1 || !empty($last)) {
             $output .= "</div>";
         }
     }
     $output .= "</div>";
     if (count($this->id_array) > $columns && $type == 'slider' && $navigation != 'no') {
         if ($navigation == 'dots') {
             $output .= $this->slide_navigation_dots();
         }
     }
     $output .= "</div>";
     return $output;
 }
コード例 #13
0
 /**
  * Frontend Shortcode Handler
  *
  * @param array $atts array of attributes
  * @param string $content text within enclosing form of shortcode element
  * @param string $shortcodename the shortcode found, when == callback name
  *
  * @return string $output returns the modified html string
  */
 function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "")
 {
     $output = "";
     $class = "";
     $alt = "";
     $title = "";
     /**
      * setting the variables for the extract function
      *
      * @var $src
      * @var $animation
      * @var $link
      * @var $attachment
      * @var $attachment_size
      * @var $target
      * @var $styling
      * @var $caption
      * @var $font_size
      * @var $appearance
      * @var $hover
      * @var $align
      * @var $overlay_opacity
      * @var $overlay_color
      * @var $overlay_text_color
      */
     $atts = shortcode_atts(array('src' => '', 'animation' => 'no-animation', 'link' => '', 'attachment' => '', 'attachment_size' => '', 'target' => 'no', 'styling' => '', 'caption' => '', 'font_size' => '', 'appearance' => '', 'hover' => '', 'align' => 'center', 'overlay_opacity' => '0.4', 'overlay_color' => '#444444', 'overlay_text_color' => '#ffffff'), $atts, $this->config['shortcode']);
     extract($atts);
     $post_id = get_the_ID();
     $primary_image = get_field('advertisement_package', $post_id) == '165' ? '' : $this->getPrimaryImage($post_id);
     if (!empty($primary_image)) {
         $alt = !empty($primary_image['alt']) ? esc_attr($primary_image['alt']) : '';
         $title = trim($primary_image['title']) ? esc_attr($primary_image['title']) : "";
         $src = $primary_image['url'];
     } else {
         $attachment = false;
     }
     if (!empty($src)) {
         $class = $animation == "no-animation" ? "" : "avia_animated_image avia_animate_when_almost_visible " . $animation;
         $class .= " av-styling-" . $styling . " " . $hover;
         if (is_numeric($src)) {
             //$output = wp_get_attachment_image($src,'large');
             $output = wp_get_attachment_image($src, 'large', false, array('class' => "avia_image {$class} " . $this->class_by_arguments('align', $atts, true)));
         } else {
             $link = aviaHelper::get_url($link, $attachment);
             $blank = strpos($target, '_blank') !== false || $target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
             $overlay = "";
             $style = "";
             $style .= AviaHelper::style_string($atts, 'overlay_text_color', 'color');
             if ($font_size) {
                 // $style = "style='font-size: {$font_size}px;'";
                 $style .= AviaHelper::style_string($atts, 'font_size', 'font-size', 'px');
             }
             $style = AviaHelper::style_string($style);
             if ($caption == "yes") {
                 $caption_style = "";
                 $caption_style .= AviaHelper::style_string($atts, 'overlay_opacity', 'opacity');
                 $caption_style .= AviaHelper::style_string($atts, 'overlay_color', 'background-color');
                 $caption_style = AviaHelper::style_string($caption_style);
                 $overlay_bg = "<div class='av-caption-image-overlay-bg' {$caption_style}></div>";
                 $content = ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content));
                 $overlay = "<div class='av-image-caption-overlay'>{$overlay_bg}<div class='av-image-caption-overlay-position'><div class='av-image-caption-overlay-center' {$style}>{$content}</div></div></div>";
                 $class .= " noHover ";
                 if (empty($appearance)) {
                     $appearance = "hover-deactivate";
                 }
                 if ($appearance) {
                     $class .= " av-overlay-" . $appearance;
                 }
             }
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
             $markup = avia_markup_helper(array('context' => 'image', 'echo' => false, 'custom_markup' => $meta['custom_markup']));
             $output .= "<div class='avia-image-container {$class} " . $meta['el_class'] . " " . $this->class_by_arguments('align', $atts, true) . "' {$markup} >";
             $output .= "<div class='avia-image-container-inner'>";
             if ($link) {
                 $output .= "<a href='{$link}' class='avia_image suppress-tooltip'  {$blank}>{$overlay}<img class='avia_image ' src='{$src}' alt='{$alt}' title='{$title}' {$markup_url} /></a>";
             } else {
                 $output .= "{$overlay}<img class='avia_image suppress-tooltip' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
             }
             $output .= "</div>";
             $output .= "</div>";
             $output .= '<div class="hr hr-default"><span class="hr-inner "><span class="hr-inner-style"></span></span></div>';
         }
     }
     return $output;
 }
コード例 #14
0
ファイル: image.php プロジェクト: bluedrone/plugins
 /**
  * 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 = "";
     extract(shortcode_atts(array('src' => '', 'animation' => 'no-animation', 'link' => '', 'attachment' => '', 'target' => 'no'), $atts));
     if (!empty($attachment)) {
         $attachment_entry = get_post($attachment);
         $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($src)) {
         $class = $animation == "no-animation" ? "" : "avia_animated_image avia_animate_when_almost_visible " . $animation;
         if (is_numeric($src)) {
             $output = wp_get_attachment_image($src, 'large');
         } else {
             $link = aviaHelper::get_url($link);
             $linktarget = $target == 'yes' ? "target='_blank'" : '';
             if ($link) {
                 $output .= "<a href='{$link}' class='avia_image " . $meta['el_class'] . " " . $this->class_by_arguments('align', $atts, true) . "' {$linktarget}><img class='avia_image {$class}' src='{$src}' alt='{$alt}' title='{$title}' /></a>";
             } else {
                 $output .= "<img class='avia_image " . $meta['el_class'] . " " . $this->class_by_arguments('align', $atts, true) . " {$class}' src='{$src}' alt='{$alt}' title='{$title}' />";
             }
         }
     }
     return $output;
 }
コード例 #15
0
ファイル: image.php プロジェクト: Jiersone/mac
 /**
  * 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 = "";
     extract(shortcode_atts(array('src' => '', 'animation' => 'no-animation', 'link' => '', 'attachment' => '', 'target' => 'no'), $atts));
     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($src)) {
         $class = $animation == "no-animation" ? "" : "avia_animated_image avia_animate_when_almost_visible " . $animation;
         if (is_numeric($src)) {
             //$output = wp_get_attachment_image($src,'large');
             $output = wp_get_attachment_image($src, 'large', false, array('class' => "avia_image {$class} " . $this->class_by_arguments('align', $atts, true)));
         } else {
             $link = aviaHelper::get_url($link);
             $blank = strpos($target, '_blank') !== false || $target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
             $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false));
             $markup = avia_markup_helper(array('context' => 'image', 'echo' => false));
             $output .= "<span class='avia-image-container' {$markup}>";
             if ($link) {
                 $output .= "<a href='{$link}' class='avia_image " . $meta['el_class'] . " " . $this->class_by_arguments('align', $atts, true) . "' {$blank}><img class='avia_image {$class}' src='{$src}' alt='{$alt}' title='{$title}' {$markup_url} /></a>";
             } else {
                 $output .= "<img class='avia_image " . $meta['el_class'] . " " . $this->class_by_arguments('align', $atts, true) . " {$class}' src='{$src}' alt='{$alt}' title='{$title}'  {$markup_url} />";
             }
             $output .= "</span>";
         }
     }
     return $output;
 }
コード例 #16
0
ファイル: iconlist.php プロジェクト: bluedrone/plugins
 function av_iconlist_item($atts, $content = "", $shortcodename = "")
 {
     $icon_el = $this->elements[0]['subelements'][3];
     $chars = $icon_el['chars'];
     if (!is_array($chars)) {
         include $icon_el['chars'];
     }
     $display_char = isset($chars[$atts['icon'] - 1]) ? $chars[$atts['icon'] - 1] : $chars[0];
     $atts['linktarget'] = !empty($atts['linktarget']) && $atts['linktarget'] == 'no' ? '' : 'target="_blank"';
     if (!empty($atts['link'])) {
         $atts['link'] = aviaHelper::get_url($atts['link']);
         $atts['title'] = "<a href='{$atts['link']}' title='" . esc_attr($atts['title']) . "'>{$atts['title']}</a>";
     }
     $output = "";
     $output .= "<li>";
     $output .= "<div class='iconlist_icon avia-font-" . $icon_el['font'] . "'><span class='iconlist-char'>{$display_char}</span></div>";
     $output .= "<div class='iconlist_content_wrap'>";
     $output .= "<h4 class='iconlist_title'>" . $atts['title'] . "</h4>";
     $output .= "<div class='iconlist_content'>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop($content)) . "</div>";
     $output .= "</div>";
     $output .= "<div class='iconlist-timeline'></div>";
     $output .= "</li>";
     return $output;
 }
コード例 #17
0
ファイル: portfolio.php プロジェクト: NemanjaTck/virtual
 public function html()
 {
     if (empty($this->entries) || empty($this->entries->posts)) {
         return;
     }
     avia_post_grid::$grid++;
     extract($this->atts);
     $container_id = avia_post_grid::$grid;
     $extraClass = 'first';
     $grid = 'one_fourth';
     if ($preview_mode == 'auto') {
         $image_size = 'portfolio';
     }
     $post_loop_count = 1;
     $loop_counter = 1;
     $output = "";
     $style_class = empty($style) ? 'no_margin' : $style;
     $total = $this->entries->post_count % 2 ? "odd" : "even";
     if ($set_breadcrumb && is_page()) {
         $_SESSION["avia_{$post_type}"] = get_the_ID();
     }
     switch ($columns) {
         case "1":
             $grid = 'av_fullwidth';
             if ($preview_mode == 'auto') {
                 $image_size = 'featured';
             }
             break;
         case "2":
             $grid = 'av_one_half';
             break;
         case "3":
             $grid = 'av_one_third';
             break;
         case "4":
             $grid = 'av_one_fourth';
             if ($preview_mode == 'auto') {
                 $image_size = 'portfolio_small';
             }
             break;
         case "5":
             $grid = 'av_one_fifth';
             if ($preview_mode == 'auto') {
                 $image_size = 'portfolio_small';
             }
             break;
         case "6":
             $grid = 'av_one_sixth';
             if ($preview_mode == 'auto') {
                 $image_size = 'portfolio_small';
             }
             break;
     }
     if ($fullscreen && $preview_mode == 'auto' && $image_size == "portfolio_small") {
         $image_size = 'portfolio';
     }
     $output .= $sort != "no" ? $this->sort_buttons($this->entries->posts, $this->atts) : "";
     if ($linking == "ajax") {
         global $avia_config;
         $container_class = $fullscreen ? "container" : "";
         $output .= "<div class='portfolio_preview_container {$container_class}' data-portfolio-id='{$container_id}'>\n\t\t\t\t\t\t\t\t<div class='ajax_controlls iconfont'>\n\t\t\t\t\t\t\t\t\t<a href='#prev' class='ajax_previous' \t" . av_icon_string('prev') . "></a>\n\t\t\t\t\t\t\t\t\t<a href='#next' class='ajax_next'\t\t" . av_icon_string('next') . "></a>\n\t\t\t\t\t\t\t\t\t<a class='avia_close' href='#close'\t\t" . av_icon_string('close') . "></a>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class='portfolio-details-inner'></div>\n\t\t\t\t\t\t\t</div>";
     }
     $output .= "<div class='{$class} grid-sort-container isotope {$style_class}-container with-{$contents}-container grid-total-{$total} grid-col-{$columns} grid-links-{$linking}' data-portfolio-id='{$container_id}'>";
     foreach ($this->entries->posts as $entry) {
         $the_id = $entry->ID;
         $parity = $post_loop_count % 2 ? 'odd' : 'even';
         $last = $this->entries->post_count == $post_loop_count ? " post-entry-last " : "";
         $post_class = "post-entry post-entry-{$the_id} grid-entry-overview grid-loop-{$post_loop_count} grid-parity-{$parity} {$last}";
         $sort_class = $this->sort_cat_string($the_id, $this->atts);
         switch ($linking) {
             case "lightbox":
                 $link = aviaHelper::get_url('lightbox', get_post_thumbnail_id($the_id));
                 break;
             default:
                 $link = get_permalink($the_id);
                 break;
         }
         $title_link = get_permalink($the_id);
         $custom_link = get_post_meta($the_id, '_portfolio_custom_link', true) != "" ? get_post_meta($the_id, '_portfolio_custom_link_url', true) : false;
         if ($custom_link) {
             $title_link = "";
             $link = $custom_link;
         }
         $excerpt = '';
         $title = '';
         switch ($contents) {
             case "excerpt":
                 $excerpt = $entry->post_excerpt;
                 $title = $entry->post_title;
                 break;
             case "title":
                 $excerpt = '';
                 $title = $entry->post_title;
                 break;
             case "only_excerpt":
                 $excerpt = $entry->post_excerpt;
                 $title = '';
                 break;
             case "no":
                 $excerpt = '';
                 $title = '';
                 break;
         }
         $custom_overlay = apply_filters('avf_portfolio_custom_overlay', "", $entry);
         $link_markup = apply_filters('avf_portfolio_custom_image_container', array("a href='{$link}' title='" . esc_attr(strip_tags($title)) . "' ", 'a'), $entry);
         $title = apply_filters('avf_portfolio_title', $title, $entry);
         $title_link = apply_filters('avf_portfolio_title_link', $title_link, $entry);
         $image_attrs = apply_filters('avf_portfolio_image_attrs', array(), $entry);
         if ($columns == "1" && $one_column_template == 'special') {
             $extraClass .= ' special_av_fullwidth ';
             $output .= "<div data-ajax-id='{$the_id}' class=' grid-entry flex_column isotope-item all_sort {$style_class} {$post_class} {$sort_class} {$grid} {$extraClass}'>";
             $output .= "<article class='main_color inner-entry' " . avia_markup_helper(array('context' => 'entry', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup)) . ">";
             $output .= apply_filters('avf_portfolio_extra', "", $entry);
             $output .= "<div class='av_table_col first portfolio-entry grid-content'>";
             if (!empty($title)) {
                 $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
                 $output .= '<header class="entry-content-header">';
                 $output .= "<h2 class='portfolio-grid-title entry-title' {$markup}>";
                 if (!empty($title_link)) {
                     $output .= "<a href='{$title_link}'>" . $title . "</a>";
                 } else {
                     $output .= "" . $title . "";
                 }
                 $output .= '</h2></header>';
             }
             if (!empty($excerpt)) {
                 $markup = avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
                 $output .= "<div class='entry-content-wrapper'>";
                 $output .= "<div class='grid-entry-excerpt entry-content' {$markup}>" . $excerpt . "</div>";
                 $output .= "</div>";
             }
             $output .= '<div class="avia-arrow"></div>';
             $output .= "</div>";
             $image = get_the_post_thumbnail($the_id, $image_size, $image_attrs);
             if (!empty($image)) {
                 $output .= "<div class='av_table_col portfolio-grid-image'>";
                 $output .= "<" . $link_markup[0] . " data-rel='grid-" . avia_post_grid::$grid . "' class='grid-image avia-hover-fx'>" . $custom_overlay . $image . "</" . $link_markup[1] . ">";
                 $output .= "</div>";
             }
             $output .= '<footer class="entry-footer"></footer>';
             $output .= "</article>";
             $output .= "</div>";
         } else {
             $extraClass .= ' default_av_fullwidth ';
             $output .= "<div data-ajax-id='{$the_id}' class=' grid-entry flex_column isotope-item all_sort {$style_class} {$post_class} {$sort_class} {$grid} {$extraClass}'>";
             $output .= "<article class='main_color inner-entry' " . avia_markup_helper(array('context' => 'entry', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup)) . ">";
             $output .= apply_filters('avf_portfolio_extra', "", $entry);
             $output .= "<" . $link_markup[0] . " data-rel='grid-" . avia_post_grid::$grid . "' class='grid-image avia-hover-fx'>" . $custom_overlay . get_the_post_thumbnail($the_id, $image_size, $image_attrs) . "</" . $link_markup[1] . ">";
             $output .= !empty($title) || !empty($excerpt) ? "<div class='grid-content'><div class='avia-arrow'></div>" : '';
             if (!empty($title)) {
                 $markup = avia_markup_helper(array('context' => 'entry_title', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup));
                 $output .= '<header class="entry-content-header">';
                 $output .= "<h3 class='grid-entry-title entry-title' {$markup}>";
                 if (!empty($title_link)) {
                     $output .= "<a href='{$title_link}' title='" . esc_attr(strip_tags($title)) . "'>" . $title . "</a>";
                 } else {
                     $output .= "" . $title . "";
                 }
                 $output .= '</h3></header>';
             }
             $output .= !empty($excerpt) ? "<div class='grid-entry-excerpt entry-content' " . avia_markup_helper(array('context' => 'entry_content', 'echo' => false, 'id' => $the_id, 'custom_markup' => $custom_markup)) . ">" . $excerpt . "</div>" : '';
             $output .= !empty($title) || !empty($excerpt) ? "</div>" : '';
             $output .= '<footer class="entry-footer"></footer>';
             $output .= "</article>";
             $output .= "</div>";
         }
         $loop_counter++;
         $post_loop_count++;
         $extraClass = "";
         if ($loop_counter > $columns) {
             $loop_counter = 1;
             $extraClass = 'first';
         }
     }
     $output .= "</div>";
     //append pagination
     if ($paginate == "yes" && ($avia_pagination = avia_pagination($this->entries->max_num_pages, 'nav'))) {
         $output .= "<div class='pagination-wrap pagination-{$post_type}'>{$avia_pagination}</div>";
     }
     return $output;
 }
コード例 #18
0
ファイル: image_hotspots.php プロジェクト: erikdukker/medisom
 function add_hotspot($hotspot, $counter, $extraClass = "")
 {
     extract(shortcode_atts(array('tooltip_width' => 'av-tt-default-width', 'tooltip_pos' => 'av-tt-pos-above av-tt-align-left', 'hotspot_pos' => '50,50', 'output' => '', 'hotspot_color' => '', 'custom_bg' => '', 'custom_font' => '', 'custom_pulse' => '', 'tooltip_style' => 'main_color', 'link' => '', 'link_target' => ''), $hotspot['attr']));
     $content = ShortcodeHelper::avia_remove_autop($hotspot['content']);
     $tags = array('div', 'div');
     if (!empty($link)) {
         $blank = strpos($link_target, '_blank') !== false ? ' target="_blank" ' : "";
         $blank .= strpos($link_target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
         $link = aviaHelper::get_url($link, false);
         $tags = array("a href={$link} {$blank}", 'a');
     }
     if (empty($hotspot_pos)) {
         $hotspot_pos = '50,50';
     }
     $layout = explode(' ', $tooltip_pos);
     $hotspot_pos = explode(',', $hotspot_pos);
     $top = $hotspot_pos[0];
     $left = $hotspot_pos[1];
     $position = $layout[0];
     $align = isset($layout[1]) ? str_replace('av-tt-align-', '', $layout[1]) : "centered";
     $pos_string = "top: {$top}%; left: {$left}%; ";
     $data_pos = "";
     if (strpos($position, 'above') !== false) {
         $data_pos = "top";
     }
     if (strpos($position, 'below') !== false) {
         $data_pos = "bottom";
     }
     if (strpos($position, 'left') !== false) {
         $data_pos = "left";
     }
     if (strpos($position, 'right') !== false) {
         $data_pos = "right";
     }
     if ($hotspot_color == "custom") {
         if ($custom_bg) {
             $custom_bg = "background-color: {$custom_bg};";
         }
         if ($custom_font) {
             $custom_font = "color: {$custom_font};";
         }
         if ($custom_pulse) {
             $custom_pulse = "style='background-color:{$custom_pulse};'";
         }
     } else {
         $custom_bg = $custom_font = $custom_pulse = "";
     }
     $output .= "<div class='av-image-hotspot' data-avia-tooltip-position='{$data_pos}' data-avia-tooltip-alignment='{$align}' data-avia-tooltip-class='{$tooltip_width} {$tooltip_pos} {$extraClass} {$tooltip_style} av-tt-hotspot' data-avia-tooltip='" . esc_attr(ShortcodeHelper::avia_apply_autop($content)) . "' style='{$pos_string}'>";
     $output .= "<" . $tags[0] . " class='av-image-hotspot_inner' style='{$custom_bg} {$custom_font}'>{$counter}</" . $tags[1] . ">";
     $output .= "<div class='av-image-hotspot-pulse' {$custom_pulse}></div>";
     $output .= "</div>";
     return $output;
 }
コード例 #19
0
ファイル: slideshow.php プロジェクト: Jiersone/mac
 protected function advanced_slide()
 {
     $html = "";
     $counter = 0;
     $this->ie8_fallback = "";
     $markup_url = avia_markup_helper(array('context' => 'image_url', 'echo' => false));
     foreach ($this->id_array as $key => $id) {
         $meta = array_merge(array('content' => $this->subslides[$key]['content'], 'title' => '', 'link_apply' => '', 'link' => '', 'link_target' => '', 'button_label' => '', 'button_color' => 'light', 'link1' => '', 'link_target1' => '', 'button_label2' => '', 'button_color2' => 'light', 'link2' => '', 'link_target2' => '', 'position' => 'center center', 'caption_pos' => 'capt-bottom capt-left', 'video_cover' => '', 'video_controls' => '', 'video_mute' => '', 'video_loop' => '', 'video_format' => '', 'video_ratio' => '16:9', 'video_mobile_disabled' => '', 'video_mobile' => 'mobile-fallback-image', 'mobile_image' => '', 'slide_type' => ''), $this->subslides[$key]['attr']);
         extract($meta);
         if (isset($this->slides[$id]) || $slide_type == 'video') {
             $img = array('');
             $slide = "";
             $attachment_id = isset($this->slides[$id]) ? $id : false;
             $link = aviaHelper::get_url($link, $attachment_id);
             $extra_class = "";
             $linkdescription = "";
             $linkalt = "";
             $this->service = false;
             $slider_data = "";
             $stretch_height = false;
             $final_ratio = "";
             $viewport = 16 / 9;
             if ($slide_type == 'video') {
                 $this->service = avia_slideshow_video_helper::which_video_service($video);
                 $video = avia_slideshow_video_helper::set_video_slide($video, $this->service, $meta);
                 $video_class = !empty($video_controls) ? " av-hide-video-controls" : "";
                 $video_class .= !empty($video_mute) ? " av-mute-video" : "";
                 $video_class .= !empty($video_loop) ? " av-loop-video" : "";
                 $video_class .= !empty($video_mobile) ? " av-" . $video_mobile : "";
                 $extra_class .= " av-video-slide " . $video_cover . " av-video-service-" . $this->service . " " . $video_class;
                 $slider_data .= " data-controls='{$video_controls}' data-mute='{$video_mute}' data-loop='{$video_loop}' ";
                 if ($mobile_image) {
                     $fallback_img = wp_get_attachment_image_src($mobile_image, $this->config['size']);
                     $slider_data .= " data-mobile-img='" . $fallback_img[0] . "'";
                 }
                 //if we dont use a fullscreen slider pass the video ratio to the slider
                 if ($this->config['bg_slider'] != "true") {
                     global $avia_config;
                     //if we use the small slideshow only allow the "full" $video_format
                     if ($this->config['handle'] == 'av_slideshow') {
                         $video_format = "full";
                     }
                     //calculate the viewport ratio
                     if (!empty($avia_config['imgSize'][$this->config['size']])) {
                         $viewport = $avia_config['imgSize'][$this->config['size']]['width'] / $avia_config['imgSize'][$this->config['size']]['height'];
                     }
                     //calculate the ratio when passed as a string (eg: 16:9, 4:3). fallback is 16:9
                     $video_ratio = explode(':', trim($video_ratio));
                     if (empty($video_ratio[0])) {
                         $video_ratio[0] = 16;
                     }
                     if (empty($video_ratio[1])) {
                         $video_ratio[1] = 9;
                     }
                     $final_ratio = (int) $video_ratio[0] / (int) $video_ratio[1];
                     switch ($video_format) {
                         case "":
                             $final_ratio = $viewport;
                             break;
                         case "stretch":
                             $final_ratio = $viewport;
                             $stretch_height = ceil($viewport / ($video_ratio[0] / $video_ratio[1]) * 100);
                             $stretch_pos = ($stretch_height - 100) / 2 * -1;
                             $slider_data .= " data-video-height='{$stretch_height}'";
                             $slider_data .= " data-video-toppos='{$stretch_pos}'";
                             $extra_class .= " av-video-stretch";
                             break;
                         case "full":
                             // do nothing and apply the entered ratio
                             break;
                     }
                     $slider_data .= " data-video-ratio='{$final_ratio}'";
                 }
             } else {
                 $slide = $this->slides[$id];
                 $linktitle = trim($slide->post_title) ? esc_attr($slide->post_title) : "";
                 $linkdescription = trim($slide->post_content) && empty($link) ? "title='" . esc_attr($slide->post_content) . "'" : "";
                 $linkalt = get_post_meta($slide->ID, '_wp_attachment_image_alt', true);
                 $linkalt = !empty($linkalt) ? esc_attr($linkalt) : '';
                 $img = wp_get_attachment_image_src($slide->ID, $this->config['size']);
                 $video = "";
             }
             if ($this->slide_count === 1) {
                 $extra_class .= " av-single-slide";
             }
             $blank = strpos($link_target, '_blank') !== false || $link_target == 'yes' ? ' target="_blank" ' : "";
             $blank .= strpos($link_target, 'nofollow') !== false ? ' rel="nofollow" ' : "";
             $tags = !empty($link) && $link_apply == 'image' ? array("a href='{$link}'{$blank}", 'a') : array('div', 'div');
             $caption = "";
             $button_html = "";
             $counter++;
             $button_count = "";
             if (strpos($link_apply, 'button-two') !== false) {
                 $button_count = "avia-multi-slideshow-button";
             }
             //if we got a CTA button apply the link to the button istead of the slide
             if (strpos($link_apply, 'button') !== false) {
                 $button_html .= $this->slideshow_cta_button($link1, $link_target1, $button_color, $button_label, $button_count);
                 $tags = array('div', 'div');
             }
             if (strpos($link_apply, 'button-two') !== false) {
                 $button_count .= " avia-slideshow-button-2";
                 $button_html .= $this->slideshow_cta_button($link2, $link_target2, $button_color2, $button_label2, $button_count);
             }
             //check if we got a caption
             $markup_description = avia_markup_helper(array('context' => 'description', 'echo' => false));
             $markup_name = avia_markup_helper(array('context' => 'name', 'echo' => false));
             if (trim($title) != "") {
                 $title = "<h2 class='avia-caption-title' {$markup_name}>" . trim(apply_filters('avf_slideshow_title', $title)) . "</h2>";
             }
             if (is_array($content)) {
                 $content = implode(' ', $content);
             }
             //temp fix for trim() expects string warning until I can actually reproduce the problem
             if (trim($content) != "") {
                 $content = "<div class='avia-caption-content' {$markup_description}>" . ShortcodeHelper::avia_apply_autop(ShortcodeHelper::avia_remove_autop(trim($content))) . "</div>";
             }
             if (trim($title . $content . $button_html) != "") {
                 if (trim($title) != "" && trim($button_html) != "" && trim($content) == "") {
                     $content = "<br/>";
                 }
                 if ($this->config['handle'] == 'av_slideshow_full' || $this->config['handle'] == 'av_fullscreen') {
                     $caption .= '<div class = "caption_fullwidth ' . $caption_pos . '">';
                     $caption .= '<div class = "container caption_container">';
                     $caption .= '<div class = "slideshow_caption">';
                     $caption .= '<div class = "slideshow_inner_caption">';
                     $caption .= '<div class = "slideshow_align_caption">';
                     $caption .= $title;
                     $caption .= $content;
                     $caption .= $button_html;
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                     $caption .= '</div>';
                 } else {
                     $caption = '<div class="avia-caption"><div class="avia-inner-caption">' . $title . $content . "</div></div>";
                 }
             }
             if (!empty($img[0])) {
                 $slider_data .= $this->config['bg_slider'] == "true" ? "style='background-position:{$position};' data-img-url='" . $img[0] . "'" : "";
                 if ($slider_data) {
                     if (empty($this->ie8_fallback)) {
                         $this->ie8_fallback .= "<!--[if lte IE 8]>";
                         $this->ie8_fallback .= "<style type='text/css'>";
                     }
                     $this->ie8_fallback .= "\n #{$this->config['css_id']} .slide-{$counter}{";
                     $this->ie8_fallback .= "\n -ms-filter: \"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{$img[0]}', sizingMethod='scale')\"; ";
                     $this->ie8_fallback .= "\n filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(src='{$img[0]}', sizingMethod='scale'); ";
                     $this->ie8_fallback .= "\n } \n";
                 }
             }
             $html .= "<li {$slider_data} class='{$extra_class} slide-{$counter} ' >";
             $html .= "<" . $tags[0] . " data-rel='slideshow-" . avia_slideshow::$slider . "' class='avia-slide-wrap' {$linkdescription} >{$caption}";
             if ($this->config['bg_slider'] != "true" && empty($video)) {
                 $html .= "<img src='" . $img[0] . "' width='" . $img[1] . "' height='" . $img[2] . "' title='" . $linktitle . "' alt='" . $linkalt . "' {$markup_url} />";
             }
             $html .= $video;
             $html .= "</" . $tags[1] . ">";
             $html .= "</li>";
         } else {
             $this->slide_count--;
         }
     }
     if (!empty($this->ie8_fallback)) {
         $this->ie8_fallback .= "</style> <![endif]-->";
         add_action('wp_footer', array($this, 'add_ie8_fallback_to_footer'));
     }
     return $html;
 }