示例#1
2
 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => '', 'suffix' => '', 'prefix' => '', 'image' => '', 'link' => '', 'img_size' => 'thumbnail', 'align' => 'center', 'el_class' => '', 'css' => '', 'style' => '1', 'overlay' => '', 'position' => 'middle'), $atts));
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'banner ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'style' => 'style' . $style, 'overlay' => 'banner-' . $overlay, 'align' => 'banner-' . $align, 'position' => 'position-' . $position);
     $banner_link = '';
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = $img['thumbnail'];
     $suffix = $suffix ? '<p class="banner-suffix">' . $suffix . '</p>' : '';
     $prefix = $prefix ? '<p class="banner-prefix">' . $prefix . '</p>' : '';
     $output .= sprintf('<div class="banner-content">%s<h3 class="banner-title">%s</h3>%s</div>', $suffix, $title, $prefix);
     if ($link) {
         $link = vc_build_link($link);
         $a_href = $link['url'];
         $a_title = $link['title'];
         $a_target = $link['target'];
         $icon_box_link = array('href="' . esc_attr($a_href) . '"', 'title="' . esc_attr($a_title) . '"', 'target="' . esc_attr($a_target) . '"');
         $banner_link = '<a class="banner-link" ' . implode(' ', $icon_box_link) . '></a>';
     }
     $output .= $banner_link;
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     return '<div class="' . esc_attr($elementClass) . '">' . $output . '</div>';
 }
示例#2
1
 protected function content($atts, $content = null)
 {
     $atts = shortcode_atts(array('image' => '', 'img_size' => 'thumbnail', 'values' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts);
     extract($atts);
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'image-tooltip', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation));
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = '';
     $values = (array) vc_param_group_parse_atts($values);
     $text = '';
     $left_text = '';
     $left_right = '';
     foreach ($values as $key => $data) {
         $new_line = $data;
         $new_line['left'] = isset($data['left']) ? $data['left'] : 0;
         $new_line['top'] = isset($data['top']) ? $data['top'] : 0;
         $new_line['label'] = isset($data['label']) ? $data['label'] : '';
         $new_line['color'] = isset($data['color']) ? $data['color'] : 'default';
         $new_line['color'] = isset($data['color']) ? $data['color'] : 'default';
         $new_line['content'] = isset($data['content']) ? $data['content'] : '';
         $active = $key == 0 ? ' active' : '';
         $text .= sprintf('<div class="image-tooltip-item %s" style="top: %s; left: %s;"><div class="image-tooltip-content" data-count="%s" title="%s"></div></div>', 'tooltip-' . $new_line['color'] . $active, $new_line['top'] . '%', $new_line['left'] . '%', $key, $new_line['label']);
         $tooltip = sprintf('<div class="image-tooltip-element %s" data-count="%s"><h4>%s</h4><div>%s</div></div>', $active, $key, $new_line['label'], $data['content']);
         if ($new_line['align'] == 'right') {
             $left_right .= $tooltip;
         } else {
             $left_text .= $tooltip;
         }
     }
     $output = sprintf('<div class="row"><div class="image-tooltip-left col-md-4">%s</div><div class="image-tooltip-center col-md-4">%s %s</div><div class="image-tooltip-right col-md-4">%s</div></div>', $left_text, '<div class="image-tooltip-image">' . $img['thumbnail'] . '</div>', '<div class="image-tooltip-text">' . $text . '</div>', $left_right);
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     if ($animation_delay) {
         $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay);
     }
     return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>';
 }
示例#3
1
function wf_owlcarousel_func($atts, $content = null)
{
    $args = shortcode_atts(array("items" => 3, "loop" => 'true', "navpos" => 'top', "images" => 'images', "size" => 'full', "singleitem1" => 'true', "autoplay1" => 'true', "stoponhover1" => 'false', "navigation" => 'true', "autoheight1" => 'false', "mousedrag1" => 'true', "touchDrag" => 'true', "addclassactive1" => 'true', "pagination" => 'false'), $atts);
    $content = wpb_js_remove_wpautop($content, true);
    // fix unclosed/unwanted paragraph tags in $content
    $id = "wf_owl_carousel_" . uniqid();
    $items = $args['items'];
    $images = $args['images'];
    $images = explode(',', $images);
    $size = $args['size'];
    $items = $args['items'];
    $navpos = $args['navpos'];
    $singleitem = $args['singleitem1'];
    $autoplay = $args['autoplay1'];
    $stoponhover = $args['stoponhover1'];
    $navigation = $args['navigation'];
    $autoHeight = $args['autoheight1'];
    $mouseDrag = $args['mousedrag1'];
    $touchDrag = $args['touchDrag'];
    $pagination = $args['pagination'];
    $loop = $args['loop'];
    $addClassActive = $args['addclassactive1'];
    wp_enqueue_script("js.owl.carousel", plugin_dir_url(__FILE__) . 'js/owl.carousel.js', array('jquery'), false);
    wp_enqueue_script('js.owl.carousel', array('jquery'), false);
    $output = '';
    $output .= '<div class="wf_owl_carousel owl-carousel owl-theme" id="' . $id . '">';
    foreach ($images as $attach_id) {
        if ($attach_id > 0) {
            $post_thumbnail = wpb_getImageBySize(array('attach_id' => $attach_id, 'thumb_size' => $size));
        } else {
            $post_thumbnail = array();
            $post_thumbnail['thumbnail'] = '<img src="' . plugin_dir_path(dirname(__FILE__)) . '/images/wf_modal.jpg" />';
            $post_thumbnail['p_img_large'][0] = plugin_dir_path(dirname(__FILE__)) . " /images/wf_modal.jpg";
        }
        $thumbnail = $post_thumbnail['thumbnail'];
        $output .= '<div class="item">' . $thumbnail . '</div>';
    }
    $output .= '</div>';
    $output .= '<script type="text/javascript">jQuery(document).ready(function($) {';
    $output .= " jQuery('#" . $id . "').owlCarousel({";
    if ($singleitem === 'false') {
        $output .= "items : " . $items . ",";
    }
    if ($autoplay === 'true') {
        $output .= "autoPlay : 2500,";
    }
    $output .= '
	loop:' . $loop . ',
	autoPlay : ' . $autoplay . ',
	singleItem : ' . $singleitem . ',
	//margin: 6,
	stoponhover : ' . $stoponhover . ',
	autoHeight: ' . $autoHeight . ',
	mouseDrag: ' . $mouseDrag . ',
	touchDrag: ' . $touchDrag . ',
	addClassActive: ' . $addClassActive . ',
	navigation: ' . $navigation . ',
	navigationText :[ "<" , ">"],
	pagination: ' . $pagination . ',';
    $output .= " });";
    $output .= "});</script>";
    if ($singleitem === 'true') {
        $output .= "<style>\n    #" . $id . " .item img{\n        display: block !important;\n        width: 100% !important;\n        height: auto !important;\n    }\n    .attachment-full {\n    height: auto !important;\n    display: block !important;\n    width: 100% !important;\n}\n#" . $id . " .item{margin: 0px !important;}\n</style>";
    }
    if ($navpos === 'center') {
        $output .= "<style> #" . $id . " .owl-buttons {left: 0;\n    position: absolute;\n    top: 35% !important;\n    width: 100% !important;\n    opacity: 0.6;\n}#" . $id . " .item{margin: 3px;}\n #" . $id . " .owl-wrapper {\n    margin-top: 0px !important;\n}\n #" . $id . " .owl-prev {\n    left: 0 !important;\n    position: absolute;\n}\n #" . $id . " .owl-next {\n    position: absolute;\n    right: 0!important;\n}\n #" . $id . " .owl-prev, #" . $id . " .owl-next {\n    border: medium none !important;\n    border-radius: 0 !important;\n    color: white;\n    font-size: 1.2em !important;\n    margin: 0 auto !important;\n    text-align: center;\n    background: blue none repeat scroll 0 0 !important;\n}\n</style>";
    } else {
        $output .= '<style>#' . $id . ' .item{margin: 3px;} #' . $id . ' .owl-prev,#' . $id . ' .owl-next {
    border: medium none !important;
    border-radius: 0 !important;
    color: white;
    font-size: 1.2em !important;
    margin: 0 auto !important;
    text-align: center;
    background: blue none repeat scroll 0 0 !important;
}#' . $id . ' .owl-buttons {
    position: absolute;
    right: 0;
    top: 0;
}#' . $id . ' .owl-wrapper {
    margin-top: 40px;
}

</style>';
    }
    return $output;
}
示例#4
1
<?php

$output = $style1 = $style2 = $style3 = '';
extract(shortcode_atts(array('image' => '', 'title' => '', 'ca' => 'center', 'bg' => '', 'bo' => '', 'bc' => '', 'bw' => '', 'text_scheme' => 'default'), $atts));
$img_id = preg_replace('/[^\\d]/', '', $image);
$img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => 'full'));
if ($bg != '') {
    $rgb = brad_hex2rgb($bg);
    $rgba = "rgba({$rgb[0]} , {$rgb[1]} , {$rgb[2]} , {$bo})";
    $style3 = " style='background-color:{$rgba}'";
}
if ($bc != '') {
    $style2 = " style='border:{$bw}px solid {$bc};'";
}
$output .= "\n\t" . '<div class="teaser valign-' . $ca . '">';
$output .= "\n\t\t" . '<div class="image hoverlay">' . $img['thumbnail'];
$output .= "\n\t\t\t" . '<div class="teaser-container"><div class="box content-box ' . $text_scheme . '" ' . $style2 . '><div class="box-inner" ' . $style3 . '><div>';
if ($title != '') {
    $output .= '<h2 class="teaser-heading"><span>' . $title . '</span></h2>';
}
if ($content != '') {
    $output .= "\n\t\t\t\t" . '<div class="teaser-content">' . wpb_js_remove_wpautop($content) . '</div>';
}
$output .= "\n\t" . '</div></div></div></div></div></div> ' . $this->endBlockComment('.teaser');
echo $output;
function thb_image($atts, $content = null)
{
    extract(shortcode_atts(array('image' => '', 'target_blank' => false, 'img_size' => 'thumbnail', 'img_link' => '', 'img_link_target' => '', 'alignment' => '', 'lightbox' => '', 'size' => 'small', 'animation' => false), $atts));
    $img_id = preg_replace('/[^\\d]/', '', $image);
    $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $animation . ' ' . $alignment));
    if ($img == NULL) {
        $img = '<img src="http://placekitten.com/g/400/300" />';
    }
    $link_to = $c_lightbox = '';
    if ($lightbox == true) {
        $link_to = wp_get_attachment_image_src($img_id, 'large');
        $link_to = $link_to[0];
        $c_lightbox = ' rel="magnific"';
    } else {
        if (!empty($img_link)) {
            $link_to = $img_link;
        }
    }
    $css_class = ' class="align' . $alignment . '"';
    if (!empty($link_to) && !preg_match('/^(https?\\:\\/\\/|\\/\\/)/', $link_to)) {
        $link_to = 'http://' . $link_to;
    }
    $out = !empty($link_to) ? '<a' . $css_class . ' ' . $c_lightbox . ' href="' . $link_to . '"' . ($target_blank ? ' target="_blank"' : '') . '>' . $img['thumbnail'] . '</a>' : $img['thumbnail'];
    return $out;
}
示例#6
0
 protected function getPostThumbnail($grid_layout, $post_id, $grid_thumb_size)
 {
     if (in_array($grid_layout, array('title_thumbnail_text', 'thumbnail_title_text', 'thumbnail_text', 'thumbnail_title', 'thumbnail', 'title_text'))) {
         return wpb_getImageBySize(array('post_id' => $post_id, 'thumb_size' => $grid_thumb_size));
     }
     return false;
 }
示例#7
0
 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if ('attach_image' === $param['type'] && 'image' === $param_name) {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         $element_icon = $this->settings('icon');
         $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
         $this->setSettings('logo', ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail vc_element-icon"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<span class="no_image_image vc_element-icon' . (!empty($element_icon) ? ' ' . $element_icon : '') . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>');
         $output .= $this->outputTitleTrue($this->settings['name']);
     } elseif (!empty($param['holder'])) {
         if ($param['holder'] === 'input') {
             $output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
         } elseif (in_array($param['holder'], array('img', 'iframe'))) {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">';
         } elseif ($param['holder'] !== 'hidden') {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
         }
     }
     if (!empty($param['admin_label']) && $param['admin_label'] === true) {
         $output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
     }
     return $output;
 }
function images_content($atts, $content = null)
{
    $title = $description = $content_img = $img_size = $more = $align = $link = $css_animation = $animated = $animated_data = '';
    $atts = vc_map_get_attributes('images_content', $atts);
    extract($atts);
    $animated = $animated_data = '';
    if ($css_animation != '') {
        $animated = ' animated ';
        $animated_data = ' data-gen="' . $css_animation . '"';
    }
    $out = '';
    $out .= '<div class="content-image wpb_content_element ' . $align . $animated . '"' . $animated_data . '>';
    if ($img_size == '') {
        $img_size = 'full';
    }
    if (!empty($content_img) && $content_img != '') {
        $img_id = preg_replace('/[^\\d]/', '', $content_img);
        $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size));
        $out .= '<div class="s_image">' . $img['thumbnail'] . '</div>';
    }
    $out .= '<div class="s_info">';
    if ($title != '') {
        $out .= '<h3>' . $title . '</h3>';
    }
    if ($description != '') {
        $out .= '<div class="desc">' . do_shortcode('[vc_column_text title=""]' . $description . '[/vc_column_text]') . '</div>';
    }
    if ($more != '') {
        $out .= '<div class="folio-more"><a href="' . $link . '"><span>' . $more . '</span></a></div>';
    }
    $out .= '</div>';
    $out .= '</div>';
    return $out;
}
 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if ($type == 'attach_image' and $param_name == 'image') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         $element_icon = $this->settings('icon');
         $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
         $logo_html = '';
         if ($img) {
             $logo_html .= $img['thumbnail'];
         } else {
             $logo_html .= '<img width="150" height="150" class="attachment-thumbnail icon-wpb-single-image vc_element-icon"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />';
         }
         $logo_html .= '<span class="no_image_image vc_element-icon' . (!empty($element_icon) ? ' ' . $element_icon : '') . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" />';
         $this->setSettings('logo', $logo_html);
         $output .= $this->outputTitleTrue($this->settings['name']);
     } elseif (!empty($param['holder'])) {
         if ($param['holder'] == 'input') {
             $output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
         } elseif (in_array($param['holder'], array('img', 'iframe'))) {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">';
         } elseif ($param['holder'] !== 'hidden') {
             $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
         }
     }
     if (!empty($param['admin_label']) && $param['admin_label'] === TRUE) {
         $output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . __($param['heading'], 'js_composer') . '</label>: ' . $value . '</span>';
     }
     return $output;
 }
示例#10
0
 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     // TODO: check $old_names & &new_names. Leftover from copypasting?
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) && 'hidden' !== $param['holder']) {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     if ('include' === $param_name) {
         $images_ids = empty($value) ? array() : explode(',', trim($value));
         $output .= '<ul class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
         foreach ($images_ids as $image) {
             $img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
             $output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
         }
         $output .= '</ul>';
         $output .= '<a href="#" class="column_edit_trigger' . (!empty($images_ids) ? ' image-exists' : '') . '">' . __('Add images', 'js_composer') . '</a>';
     }
     return $output;
 }
示例#11
0
 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     //$value = __($value, LANGUAGE_ZONE);
     //
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == true && $param['holder'] !== 'hidden') {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     if ($param_name == 'images') {
         $images_ids = empty($value) ? array() : explode(',', trim($value));
         $output .= '<ul class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
         foreach ($images_ids as $image) {
             $img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
             $output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
         }
         $output .= '</ul>';
         $output .= '<a href="#" class="column_edit_trigger' . (!empty($images_ids) ? ' image-exists' : '') . '">' . __('Add images', LANGUAGE_ZONE) . '</a>';
     }
     return $output;
 }
 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('mode' => '', 'effect' => '', "speed" => '', "pause" => '', 'autoplay' => '', 'controlnav' => '', 'pagernav' => '', 'img_size' => 'thumbnail', 'slide_count' => 1, 'el_id' => '', 'el_class' => '', 'css_animation' => '', 'anim_type' => '', 'anim_delay' => '', 'css' => ''), $atts));
     $sc_class = 'wt_testimonials_slider_sc';
     $id = mt_rand(9999, 99999);
     if (trim($el_id) != false) {
         $el_id = esc_attr(trim($el_id));
     } else {
         $el_id = $sc_class . '-' . $id;
     }
     wp_print_scripts('wt-extend-bx-slider');
     wp_enqueue_style('wt-extend-bx-slider');
     $output = '';
     $autoplay !== "true" ? $autoplay = 'false' : '';
     $controlnav !== "true" ? $controlnav = 'false' : '';
     $pagernav !== "true" ? $pagernav = 'false' : '';
     $el_class = esc_attr($this->getExtraClass($el_class));
     $css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $sc_class . $el_class . vc_shortcode_custom_css_class($css, ' '), $this->settings['base']);
     $css_class .= $this->wt_sc->getWTCSSAnimationClass($css_animation, $anim_type);
     $anim_data = $this->wt_sc->getWTCSSAnimationData($css_animation, $anim_delay);
     $speed = (int) $speed;
     $pause = (int) $pause;
     $img_size = esc_html($img_size);
     $output .= '<div id="' . $el_id . '" class="' . $css_class . '"' . $anim_data . '>';
     $output .= "\n\t\t\t" . '<ul class="wt_bxslider" data-bx-mode="' . $mode . '" data-bx-effect="' . $effect . '" data-bx-speed="' . $speed . '" data-bx-pause="' . $pause . '" data-bx-autoPlay="' . $autoplay . '" data-bx-controlNav="' . $controlnav . '" data-bx-pagerNav="' . $pagernav . '">';
     for ($i = 1; $i <= $slide_count; $i++) {
         $item_content = '';
         $image = '';
         isset($atts["content_" . $i]) && $atts["content_" . $i] != "" ? $item_content = $atts["content_" . $i] : '';
         if ($item_content != '') {
             $item_content = wpb_js_remove_wpautop($item_content, true);
             // fix unclosed/unwanted paragraph tags in $content
         }
         if ($atts["image_" . $i] != NULL) {
             $image = $atts["image_" . $i];
             $img_id = preg_replace('/[^\\d]/', '', $image);
             $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'wt_testimonial_image'));
         } else {
             $image = '';
         }
         isset($atts["target_" . $i]) && $atts["target_" . $i] == "true" ? $target = '_blank' : ($target = '_self');
         $output .= "\n\t\t\t\t" . '<li class="item">';
         if ($image != '') {
             $output .= "\n\t\t\t\t\t" . $img['thumbnail'];
         }
         $output .= "\n\t\t\t\t\t" . $item_content;
         if (isset($atts["name_" . $i]) && $atts["name_" . $i] != "") {
             $item_name = esc_html($atts["name_" . $i]);
             if (isset($atts["link_" . $i]) && $atts["link_" . $i] != "") {
                 $output .= "\n\t\t\t\t\t" . '<h3><a href="' . esc_url($atts["link_" . $i]) . '" title="' . $item_name . '" target="' . $target . '">' . $item_name . '</a></h3>';
             } else {
                 $output .= "\n\t\t\t\t\t" . '<h3>' . $item_name . '</h3>';
             }
         }
         $output .= "\t\t\t\t" . '</li>';
     }
     $output .= "\n\t\t\t" . '</ul>';
     $output .= "\n\t\t\t" . '</div>';
     return $output;
 }
示例#13
0
function thb_image($atts, $content = null)
{
    extract(shortcode_atts(array('image' => '', 'target_blank' => false, 'img_size' => 'full', 'img_link' => '', 'alignment' => '', 'lightbox' => '', 'full_width' => false, 'size' => 'full', 'animation' => false), $atts));
    $img_id = preg_replace('/[^\\d]/', '', $image);
    $full = $full_width == 'true' ? 'full' : '';
    $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => $animation . ' ' . $alignment . ' ' . $full));
    if ($img == NULL) {
        $img['thumbnail'] = '<img src="http://placekitten.com/g/400/300" />';
    }
    $link_to = $c_lightbox = '';
    if ($lightbox == true) {
        $link_to = wp_get_attachment_image_src($img_id, 'large');
        $link_to = $link_to[0];
        $c = ' class="fresco overlay-effect"';
    } else {
        $img_link = $img_link == '||' ? '' : $img_link;
        $link = vc_build_link($img_link);
        $c = ' class="overlay-effect"';
        $link_to = $link['url'];
        $a_title = $link['title'];
        $a_target = $link['target'];
    }
    $out = !empty($link_to) ? '<a ' . $c . ' href="' . $link_to . '" target="' . esc_attr($a_target) . '" title="' . esc_attr($a_title) . '"><div class="simple-overlay"></div>' . $img['thumbnail'] . '</a>' : $img['thumbnail'];
    return $out;
}
示例#14
0
 public function singleParamHtmlHolder($param, $value)
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     //$value = __($value, "js_composer");
     //
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == false || $param['holder'] == 'hidden') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         if ($param['type'] == 'attach_image') {
             $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
             $output .= ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<img src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/elements_icons/single_image.png') . '" class="no_image_image' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>';
         } else {
             if ($param['type'] == 'attach_video') {
                 $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
                 $output .= ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<img src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/elements_icons/single_image.png') . '" class="no_image_image' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>';
             }
         }
     } else {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     return $output;
 }
示例#15
0
 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('name' => '', 'image' => '', 'image_size' => 'full', 'agency' => '', 'facebook_link' => '', 'twitter_link' => '', 'dribbble_link' => '', 'linkedin_link' => '', 'el_class' => '', 'css' => ''), $atts));
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'team ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class));
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $image_size, 'class' => 'vc_single_image-img img-responsive team-avatar'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder vc_single_image-img team-avatar" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     $output = '';
     $socials = array('<i class="fa fa-facebook"></i>' => $facebook_link, '<i class="fa fa-twitter"></i>' => $twitter_link, '<i class="fa fa-dribbble"></i>' => $dribbble_link, '<i class="fa fa-linkedin"></i>' => $linkedin_link);
     if ($name) {
         $output .= '<div class="' . $elementClass . '">';
         $output .= $img['thumbnail'];
         $output .= '<div class="team-attr">';
         $output .= '<h4 class="name">' . $name . '</h4>';
         $output .= '<div class="agency">' . $agency . '</div>';
         if ($facebook_link || $twitter_link || $dribbble_link || $linkedin_link) {
             $output .= '<ul class="clearfix">';
             foreach ($socials as $key => $value) {
                 if ($value) {
                     $output .= '<li><a href="' . $value . '">' . $key . '</a></li>';
                 }
             }
             $output .= '</ul>';
         }
         $output .= '</div>';
         $output .= '</div>';
     }
     return $output;
 }
示例#16
0
 function shortcode_handler($atts, $content = null)
 {
     if (function_exists('wpb_map')) {
         //        extract($this->getPreparedAtts($atts, $content));
         //
         //        $src = $src ? wp_get_attachment_image_src($src, $image_size) : '';
         //        $src = is_array($src) ? $src[0] : '';
         //
         //        return sprintf('<img src="%s" class="img-%s">', $src, $style);
         $output = $el_class = $image = $img_size = $img_link = $img_link_target = $img_link_large = $title = $css_animation = '';
         extract(shortcode_atts(array('title' => '', 'image' => $image, 'img_size' => 'full', 'img_link_large' => false, 'img_link' => '', 'img_link_target' => '_self', 'el_class' => '', 'css_animation' => '', 'style' => '', 'align' => 'none'), $atts));
         $img_id = preg_replace('/[^\\d]/', '', $image);
         $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size));
         if ($img == NULL) {
             $img['thumbnail'] = '<img src="http://placekitten.com/g/400/300" /> <small>' . __('This is image placeholder, edit your page to replace it.', 'adap_sc') . '</small>';
         }
         $el_class = $this->getExtraClass($el_class);
         $a_class = '';
         if ($img_link_target == 'lightbox') {
             wp_enqueue_script('prettyphoto');
             wp_enqueue_style('prettyphoto');
             $a_class = ' class="prettyphoto"';
         } elseif ($el_class != '') {
             $tmp_class = explode(" ", strtolower($el_class));
             $tmp_class = str_replace(".", "", $tmp_class);
             if (in_array("prettyphoto", $tmp_class)) {
                 wp_enqueue_script('prettyphoto');
                 wp_enqueue_style('prettyphoto');
                 $a_class = ' class="prettyphoto"';
                 $el_class = str_ireplace(" prettyphoto", "", $el_class);
             }
         }
         $link_to = '';
         if ($img_link_large == true) {
             $link_to = wp_get_attachment_image_src($img_id, 'large');
             $link_to = $link_to[0];
         } else {
             if (!empty($img_link)) {
                 $link_to = $img_link;
             }
         }
         $img['thumbnail'] = str_replace('class="', 'class="' . $style . ' ', $img['thumbnail']);
         $image_string = !empty($link_to) ? '<a' . $a_class . ' href="' . $link_to . '"' . ($img_link_target != '_self' ? ' target="' . $img_link_target . '"' : '') . '>' . $img['thumbnail'] . '</a>' : $img['thumbnail'];
         $css_class = $this->getCSSAnimation($css_animation);
         $css_class .= ' pull-' . $align;
         $output .= "\n\t" . '<div class="' . $css_class . '">';
         $output .= "\n\t\t" . '<div class="wpb_wrapper">';
         $output .= "\n\t\t\t" . wpb_widget_title(array('title' => $title, 'extraclass' => 'wpb_singleimage_heading'));
         $output .= "\n\t\t\t" . $image_string;
         $output .= "\n\t\t" . '</div> ' . $this->endBlockComment('.wpb_wrapper');
         $output .= "\n\t" . '</div> ' . $this->endBlockComment('.wpb_single_image');
         return $output;
     } else {
         return '';
     }
 }
示例#17
0
function cruxstore_get_thumbnail_callback()
{
    $image = intval($_POST['image']);
    $img_size = $_POST['size'];
    $img = wpb_getImageBySize(array('attach_id' => $image, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
    if ($img == null) {
        $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
    }
    echo $img['thumbnail'];
    wp_die();
}
function timeline_event($atts, $content = null)
{
    extract(shortcode_atts(array('title' => 'Enter the Title.', 'image' => '', 'animation' => ''), $atts));
    ob_start();
    $img_id = preg_replace('/[^\\d]/', '', $image);
    $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => '250'));
    $output = '<div class="timeline_event ' . $animation . '"><div class="event_img">' . $img['thumbnail'] . '</div><div class="event_info"><h2>' . $title . '</h2><p>' . do_shortcode($content) . '</p></div></div>';
    echo !empty($output) ? $output : '';
    $output_string = ob_get_contents();
    ob_end_clean();
    return $output_string;
}
示例#19
0
 public function content($atts, $content = null)
 {
     $img = wpb_getImageBySize(array('attach_id' => preg_replace('/[^\\d]/', '', $atts['avatar']), 'thumb_size' => array(60, 60)));
     //print_r ($img);
     $bg = $img['thumbnail'];
     wp_enqueue_script('jquery-isotope');
     //$el_class = $this->getExtraClass($el_class);
     $output = '';
     $output .= '<div class="item-testi">';
     $output .= '<div class="car-content">';
     $output .= $content;
     $output .= '<div class="tt-tooltip"><!----></div>';
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
示例#20
0
 protected function content($atts, $content = null)
 {
     extract(shortcode_atts(array('title' => esc_html__('Title', 'js_composer'), 'image' => '', 'link' => '', 'img_size' => 'thumbnail', 'background_title_color' => '#ebebeb', 'use_theme_fonts' => 'true', 'font_container' => '', 'google_fonts' => '', 'css_animation' => '', 'animation_delay' => '', 'el_class' => '', 'css' => ''), $atts));
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'box-colored ', $this->settings['base'], $atts), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '), 'extra' => $this->getExtraClass($el_class), 'css_animation' => cruxstore_getCSSAnimation($css_animation));
     $style_title = '';
     extract($this->getAttributes($atts));
     unset($font_container_data['values']['text_align']);
     $styles = array();
     extract($this->getStyles($el_class, $css, $google_fonts_data, $font_container_data, $atts));
     $settings = get_option('wpb_js_google_fonts_subsets');
     $subsets = '';
     if (is_array($settings) && !empty($settings)) {
         $subsets = '&subset=' . implode(',', $settings);
     }
     if (!empty($google_fonts_data) && isset($google_fonts_data['values']['font_family'])) {
         wp_enqueue_style('vc_google_fonts_' . vc_build_safe_css_class($google_fonts_data['values']['font_family']), '//fonts.googleapis.com/css?family=' . $google_fonts_data['values']['font_family'] . $subsets);
     }
     if ($background_title_color) {
         $styles[] = 'background-color: ' . $background_title_color . ';';
     }
     if (!empty($styles)) {
         $style_title .= 'style="' . esc_attr(implode(';', $styles)) . '"';
     }
     $img_id = preg_replace('/[^\\d]/', '', $image);
     $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size, 'class' => 'img-responsive'));
     if ($img == null) {
         $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
     }
     if ($link) {
         $link = vc_build_link($link);
         $a_href = $link['url'];
         $a_title = $link['title'];
         $a_target = $link['target'];
         $icon_box_link = array('href="' . esc_attr($a_href) . '"', 'title="' . esc_attr($a_title) . '"', 'target="' . esc_attr($a_target) . '"');
         $title = '<a class="box-link" ' . implode(' ', $icon_box_link) . '>' . $title . '</a>';
         $img['thumbnail'] = '<a class="box-link" ' . implode(' ', $icon_box_link) . '>' . $img['thumbnail'] . '</a>';
     }
     $box_title = $title ? '<' . $font_container_data['values']['tag'] . ' class="box-colored-title" ' . $style_title . '>' . $title . '</' . $font_container_data['values']['tag'] . '>' : '';
     $output = '<div class="box-colored-image">' . $img['thumbnail'] . '</div>' . $box_title;
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     if ($animation_delay) {
         $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay);
     }
     return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>';
 }
示例#21
0
 public function singleParamHtmlHolder($param, $value)
 {
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == false || $param['holder'] == 'hidden') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         if ($param['type'] == 'attach_image') {
             $element_icon = $this->settings('icon');
             $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
             $this->setSettings('logo', $img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail small"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />');
             $output .= $this->settings('logo');
         }
     } else {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     return $output;
 }
示例#22
0
function service_two($atts, $content = null)
{
    $title = $description = $icon = $icon_awesome = $icon_metrize = $icon_img = $img_size = $more = $align = $link = $css_animation = $animated = $animated_data = '';
    $atts = vc_map_get_attributes('service_two', $atts);
    extract($atts);
    if ($img_size == '') {
        $img_size = 'full';
    }
    $out = $service_icon = $icon_class = $animated = $animated_data = '';
    if ($icon == 'metrize') {
        $service_icon = 'icons-' . $icon_metrize;
        $icon_class = 'metrize';
    } else {
        $service_icon = 'fa-' . $icon_awesome;
        $icon_class = 'awesome';
    }
    if ($css_animation != '') {
        $animated = ' animated ';
        $animated_data = ' data-gen="' . $css_animation . '"';
    }
    $out .= '<div class="service service-two ' . $align . $animated . '"' . $animated_data . '>';
    if ($icon != 'custom') {
        $out .= '<div class="s_icon ' . $icon_class . '"><i class="' . $service_icon . '"></i></div>';
    } else {
        if (!empty($icon_img) && $icon_img != '') {
            $img_id = preg_replace('/[^\\d]/', '', $icon_img);
            $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => $img_size));
            $out .= '<div class="s_icon">' . $img['thumbnail'] . '</div>';
        }
    }
    $out .= '<div class="s_info">';
    if ($title != '') {
        $out .= '<h3>' . $title . '</h3>';
    }
    if ($description != '') {
        $out .= '<p>' . $description . '</p>';
    }
    if ($more != '') {
        $out .= '<a class="tbutton small" href="' . $link . '"><span>' . $more . '</span></a>';
    }
    $out .= '</div>';
    $out .= '</div>';
    return $out;
}
示例#23
0
 protected function content($atts, $content = null)
 {
     $atts = shortcode_atts(array('badge' => esc_html__('only', 'cruxstore'), 'price' => 245, 'currency' => esc_html__('$', 'cruxstore'), 'desktop' => 4, 'values' => '', 'el_class' => '', 'css_animation' => '', 'animation_delay' => '', 'css' => ''), $atts);
     extract($atts);
     $output = '';
     $product_columns = 12 / $desktop;
     $product_land = $product_columns == 4 ? 2 : 3;
     $values = (array) vc_param_group_parse_atts($values);
     $text = '';
     foreach ($values as $data) {
         $new_line = $data;
         $button_text = '';
         $img_id = isset($data['image']) ? $data['image'] : 0;
         $pd_link = isset($data['link']) ? $data['link'] : '';
         $pd_title = isset($data['label']) ? $data['label'] : '';
         $img_id = preg_replace('/[^\\d]/', '', $img_id);
         $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => 'full', 'class' => 'img-responsive'));
         if ($img == null) {
             $img['thumbnail'] = '<img class="vc_img-placeholder img-responsive" src="' . vc_asset_url('vc/no_image.png') . '" />';
         }
         $pd_image = $img['thumbnail'];
         if (!empty($pd_link)) {
             $pd_link = vc_build_link($pd_link);
             if ($pd_title) {
                 $pd_title = '<a href="' . esc_attr($pd_link['url']) . '"' . ($pd_link['target'] ? ' target="' . esc_attr($pd_link['target']) . '"' : '') . ($pd_link['title'] ? ' title="' . esc_attr($pd_link['title']) . '"' : '') . '>' . $pd_title . '</a>';
             }
             $pd_image = '<a href="' . esc_attr($pd_link['url']) . '"' . ($pd_link['target'] ? ' target="' . esc_attr($pd_link['target']) . '"' : '') . ($pd_link['title'] ? ' title="' . esc_attr($pd_link['title']) . '"' : '') . '>' . $img['thumbnail'] . '</a>';
         }
         $pd_image = sprintf('<div class="product-price-image">%s</div>', $pd_image);
         if ($pd_title) {
             $pd_title = sprintf('<h5>%s</h5>', $pd_title);
         }
         $text .= sprintf('<div class="%s %s">%s</div>', 'col-md-' . $product_columns . ' col-sm-' . $product_land, 'product-price-item', $pd_image . $pd_title);
     }
     $output = '<div class="row multi-columns-row">' . $text . '</div>';
     $output .= sprintf('<div class="products-price-content visible-lg-block"><div class="products-price-circle"><span class="products-price-only">%s</span><span class="products-price-currency">%s</span><span class="products-price-text">%s</span></div><span class="products-price-cart">%s</span></div>', $badge, $currency, $price, '<i class="fa fa-shopping-basket" aria-hidden="true"></i>');
     $elementClass = array('base' => apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, 'products-price ', $this->settings['base'], $atts), 'extra' => $this->getExtraClass($el_class), 'css_animation' => $this->getCSSAnimation($css_animation), 'shortcode_custom' => vc_shortcode_custom_css_class($css, ' '));
     $elementClass = preg_replace(array('/\\s+/', '/^\\s|\\s$/'), array(' ', ''), implode(' ', $elementClass));
     if ($animation_delay) {
         $animation_delay = sprintf(' data-wow-delay="%sms"', $animation_delay);
     }
     return '<div class="' . esc_attr($elementClass) . '"' . $animation_delay . '>' . $output . '</div>';
 }
 public function singleParamHtmlHolder($param, $value, $settings = array(), $atts = array())
 {
     $output = '';
     // Compatibility fixes
     $old_names = array('yellow_message', 'blue_message', 'green_message', 'button_green', 'button_grey', 'button_yellow', 'button_blue', 'button_red', 'button_orange');
     $new_names = array('alert-block', 'alert-info', 'alert-success', 'btn-success', 'btn', 'btn-info', 'btn-primary', 'btn-danger', 'btn-warning');
     $value = str_ireplace($old_names, $new_names, $value);
     //$value 		= __($value, "ts_visual_composer_extend");
     //
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $heading = isset($param['heading']) ? $param['heading'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) === true && in_array($param['holder'], array('div', 'span', 'p', 'pre', 'code'))) {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     } else {
         if (isset($param['holder']) === true && $param['holder'] == 'input') {
             $output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
         } else {
             if (isset($param['holder']) === true && in_array($param['holder'], array('img', 'iframe'))) {
                 if (!empty($value)) {
                     $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" src="' . $value . '">';
                 }
             } else {
                 if (isset($param['holder']) === true && $param['holder'] == 'imagelist') {
                     $images_ids = empty($value) ? array() : explode(',', trim($value));
                     $output .= '<ul style="margin-top: 5px;" class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
                     foreach ($images_ids as $image) {
                         $img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
                         $output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
                     }
                     $output .= '</ul>';
                     $output .= '<a style="max-width: 100%; display: block;" href="#" class="column_edit_trigger' . (!empty($images_ids) ? ' image-exists' : '') . '" style="margin-bottom: 10px;">' . __('Add or Remove Image(s)', "ts_visual_composer_extend") . '</a>';
                 }
             }
         }
     }
     if (isset($param['admin_label']) && $param['admin_label'] === true) {
         $output .= '<span style="max-width: 100%; display: block;" class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
     }
     return $output;
 }
示例#25
0
 public function content($atts, $content = null)
 {
     $img = wpb_getImageBySize(array('attach_id' => preg_replace('/[^\\d]/', '', $atts['avatar']), 'thumb_size' => array(60, 60)));
     //print_r ($img);
     $bg = $img['thumbnail'];
     wp_enqueue_script('jquery-isotope');
     //$el_class = $this->getExtraClass($el_class);
     $output = '';
     $output .= '<div class="item-testi">';
     $output .= '<div class="tt-content icon-quote-right">';
     $output .= strip_tags($content);
     $output .= '<div class="tt-tooltip"><!----></div>';
     $output .= '</div>';
     $output .= '<div class="avata">' . $bg . '</div>';
     $output .= '<div class="name">' . $atts['name'] . '</div>';
     $output .= '<div class="name pos">' . $atts['position'] . '</div>';
     $output .= '<p class="end"> &nbsp;</p>';
     $output .= '</div>';
     return $output;
 }
 public function singleParamHtmlHolder($param, $value)
 {
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) == false || $param['holder'] == 'hidden') {
         $output .= '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '" />';
         if ($param['type'] == 'attach_image') {
             $element_icon = $this->settings('icon');
             $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
             $this->setSettings('logo', ($img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail vc_element-icon"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />') . '<span class="no_image_image vc_element-icon' . (!empty($element_icon) ? ' ' . $element_icon : '') . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '" /><a href="#" class="column_edit_trigger' . ($img && !empty($img['p_img_large'][0]) ? ' image-exists' : '') . '">' . __('Add image', 'js_composer') . '</a>');
             $output .= $this->outputTitleTrue($this->settings['name']);
         }
     } else {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     }
     if (!empty($param['admin_label']) && $param['admin_label'] === true) {
         $output .= '<span class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . __($param['heading'], 'js_composer') . '</label>: ' . $value . '</span>';
     }
     return $output;
 }
示例#27
0
function testimonial($atts, $content = null)
{
    $atts = vc_map_get_attributes('testimonial', $atts);
    extract($atts);
    $out = $img_id = $img = $img2 = $company2 = '';
    $animated = $animated_data = '';
    if ($css_animation != '') {
        $animated = ' animated ';
        $animated_data = ' data-gen="' . $css_animation . '"';
    }
    $img_id = preg_replace('/[^\\d]/', '', $photo);
    $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => 'cart-nav'));
    $img2 = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => 'facebook'));
    if ($company != '') {
        $company2 = ' - ' . $company;
    }
    if ($style == 'style1') {
        $out .= '<div class="testimonial wpb_content_element' . $animated . '"' . $animated_data . '>';
        $out .= '<div class="testimonial-content">';
        $out .= '<p>' . $testimoni . '</p>';
        $out .= '<div class="testimonial-arrow"></div>';
        $out .= '</div>';
        $out .= '<p class="testimonial-desc">';
        $out .= $img['thumbnail'];
        $out .= '<span class="testimonial-details"><span class="testimonial-name">' . $name . '</span><span class="testimonial-company">' . $company . '</span></span>';
        $out .= '</p>';
        $out .= '</div>';
    } else {
        $out .= '<div class="testimonial2 wpb_content_element' . $animated . '"' . $animated_data . '>';
        $out .= $img2['thumbnail'];
        $out .= '<div class="testimonial-content">';
        $out .= '<p>' . $testimoni . '</p>';
        $out .= '</div>';
        $out .= '<p class="testimonial-desc">';
        $out .= '<span class="testimonial-details"><span class="testimonial-name">' . $name . '</span><span class="testimonial-company">' . $company2 . '</span></span>';
        $out .= '</p>';
        $out .= '</div>';
    }
    return $out;
}
 public function singleParamHtmlHolder($param, $value, $settings = array(), $atts = array())
 {
     $output = '';
     $param_name = isset($param['param_name']) ? $param['param_name'] : '';
     $heading = isset($param['heading']) ? $param['heading'] : '';
     $type = isset($param['type']) ? $param['type'] : '';
     $class = isset($param['class']) ? $param['class'] : '';
     if (isset($param['holder']) === true && in_array($param['holder'], array('div', 'span', 'p', 'pre', 'code'))) {
         $output .= '<' . $param['holder'] . ' class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '">' . $value . '</' . $param['holder'] . '>';
     } else {
         if (isset($param['holder']) === true && $param['holder'] == 'input') {
             $output .= '<' . $param['holder'] . ' readonly="true" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . $value . '">';
         } else {
             if (isset($param['holder']) === true && $param['holder'] == 'img') {
                 $img = wpb_getImageBySize(array('attach_id' => (int) preg_replace('/[^\\d]/', '', $value), 'thumb_size' => 'thumbnail'));
                 $output .= $img ? $img['thumbnail'] : '<img width="150" height="150" src="' . vc_asset_url('vc/blank.gif') . '" class="attachment-thumbnail ts_vcsc_holder_image"  data-name="' . $param_name . '" alt="" title="" style="display: none;" />';
             } else {
                 if (isset($param['holder']) === true && $param['holder'] == 'imagelist') {
                     $images_ids = empty($value) ? array() : explode(',', trim($value));
                     $output .= '<ul style="margin-top: 5px;" class="attachment-thumbnails' . (empty($images_ids) ? ' image-exists' : '') . '" data-name="' . $param_name . '">';
                     foreach ($images_ids as $image) {
                         $img = wpb_getImageBySize(array('attach_id' => (int) $image, 'thumb_size' => 'thumbnail'));
                         $output .= $img ? '<li>' . $img['thumbnail'] . '</li>' : '<li><img width="150" height="150" test="' . $image . '" src="' . WPBakeryVisualComposer::getInstance()->assetURL('vc/blank.gif') . '" class="attachment-thumbnail" alt="" title="" /></li>';
                     }
                     $output .= '</ul>';
                 }
             }
         }
     }
     if (isset($param['admin_label']) && $param['admin_label'] === true) {
         $output .= '<span style="max-width: 100%; display: block;" class="vc_admin_label admin_label_' . $param['param_name'] . (empty($value) ? ' hidden-label' : '') . '"><label>' . $param['heading'] . '</label>: ' . $value . '</span>';
     }
     if ('dropdown' === $param['type'] && 'type' === $param_name) {
         $output .= '<a style="max-width: 100%; display: block;" href="#" class="column_edit_trigger" style="margin-bottom: 10px;">' . __('Add, Change or Remove Image(s)', "ts_visual_composer_extend") . '</a>';
     }
     return $output;
 }
function profile_testimonial_sc($atts, $content = null)
{
    extract(shortcode_atts(array('bg' => '', 'image' => '', 'author' => '', 'quote' => '', 'hl_color' => '', 'animation' => ''), $atts));
    ob_start();
    global $rd_data;
    $id = RandomString(20);
    if ($hl_color == '') {
        $hl_color = $rd_data['rd_content_hl_color'];
    }
    $img_id = preg_replace('/[^\\d]/', '', $image);
    $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => '400x400'));
    $bg_id = preg_replace('/[^\\d]/', '', $bg);
    $bg_img = wp_get_attachment_image_src($bg_id, 'staff_tn');
    $output = '<style>#rd_' . $id . ' {background:url(' . $bg_img[0] . ');}#rd_' . $id . ' .tm_quote:before{background:' . $hl_color . ';}</style><div id="rd_' . $id . '" class="rd_profile_testimonial ' . $animation . '">

<div class="tm_logo">' . $img['thumbnail'] . '
<div class="tm_quote">' . $quote . '</div>
<div class="tm_author">' . $author . '</div></div>
</div>';
    echo !empty($output) ? $output : '';
    $output_string = ob_get_contents();
    ob_end_clean();
    return $output_string;
}
function profile_testimonial_sc($atts, $content = null)
{
    extract(shortcode_atts(array('bg' => '', 'image' => '', 'author' => 'Enter Author name.', 'quote' => 'I am promo text. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.', 'hl_color' => '', 'animation' => ''), $atts));
    ob_start();
    global $rd_data;
    $id = RandomString(20);
    if ($hl_color == '') {
        $hl_color = $rd_data['rd_content_hl_color'];
    }
    $img_id = preg_replace('/[^\\d]/', '', $image);
    $img = wpb_getImageBySize(array('attach_id' => $img_id, 'thumb_size' => '400x400'));
    $bg_id = preg_replace('/[^\\d]/', '', $bg);
    $bg_img = wp_get_attachment_image_src($bg_id, 'staff_tn');
    $output = '<style>#rd_' . $id . ' {background:url(' . $bg_img[0] . ');}#rd_' . $id . ' .tm_quote:before{background:' . $hl_color . ';}</style><div id="rd_' . $id . '" class="rd_profile_testimonial ' . $animation . '">

<div class="tm_logo">' . $img['thumbnail'] . '
<div class="tm_quote">' . $quote . '</div>
<div class="tm_author">' . $author . '</div></div>
</div>';
    echo !empty($output) ? $output : '';
    $output_string = ob_get_contents();
    ob_end_clean();
    return $output_string;
}