Exemple #1
0
 /**
  * @param $grid_style
  * @param $settings
  * @param $content
  *
  * @return string
  */
 protected function contentLoadMore($grid_style, $settings, $content)
 {
     if (!isset($settings['btn_data']) && isset($settings['button_style']) && isset($settings['button_size']) && isset($settings['button_color'])) {
         // BC: for those who overrided
         return '<div class="vc_pageable-slide-wrapper vc_clearfix" data-vc-grid-content="true">' . $content . '</div>' . '<div class="vc_pageable-load-more-btn" data-vc-grid-load-more-btn="true">' . do_shortcode('[vc_button2 size="' . $settings['button_size'] . '" title="' . __('Load more', 'js_composer') . '" style="' . $settings['button_style'] . '" color="' . $settings['button_color'] . '" el_class="vc_grid-btn-load_more"]') . '</div>';
     } elseif (isset($settings['btn_data'])) {
         $data = $settings['btn_data'];
         $data['el_class'] = 'vc_grid-btn-load_more';
         $data['link'] = 'load-more-grid';
         $button3 = new WPBakeryShortCode_VC_Btn(array('base' => 'vc_btn'));
         return '<div class="vc_pageable-slide-wrapper vc_clearfix" data-vc-grid-content="true">' . $content . '</div>' . '<div class="vc_pageable-load-more-btn" data-vc-grid-load-more-btn="true">' . apply_filters('vc_gitem_template_attribute_' . 'vc_btn', '', array('post' => new stdClass(), 'data' => str_replace(array('{{ vc_btn:', '}}'), '', $button3->output($data)))) . '</div>';
     }
     return '';
 }
 public static function convertButton2ToButton3($atts)
 {
     if (isset($atts['button_style']) || isset($atts['button_size']) || isset($atts['button_color'])) {
         // we use old button 2 attributes:
         $style = isset($atts['button_style']) ? $atts['button_style'] : 'rounded';
         $size = isset($atts['button_size']) ? $atts['button_size'] : 'md';
         $color = isset($atts['button_color']) ? $atts['button_color'] : 'blue';
         $oldData = array('style' => $style, 'size' => $size, 'color' => str_replace('_', '-', $color));
         // remove attributes on save
         $atts['button_style'] = '';
         $atts['button_size'] = '';
         $atts['button_color'] = '';
         $newData = WPBakeryShortCode_VC_Btn::convertAttributesToButton3($oldData);
         foreach ($newData as $key => $value) {
             $atts['btn_' . $key] = $value;
         }
     }
     return $atts;
 }
Exemple #3
0
 * @var $url
 * @var $title
 * @var $button_block
 * @var $el_class
 * @var $outline_custom_color
 * @var $outline_custom_hover_background
 * @var $outline_custom_hover_text
 * @var $css
 * @var $add_icon
 * @var $i_align
 * @var $i_type
 */
$atts = array();
parse_str($data, $atts);
VcShortcodeAutoloader::getInstance()->includeClass('WPBakeryShortCode_VC_Btn');
$vc_btn = new WPBakeryShortCode_VC_Btn(array('base' => 'vc_btn'));
$inline_css = '';
$icon_wrapper = false;
$icon_html = false;
$attributes = array();
/** @var $vc_btn WPBakeryShortCode_VC_Btn */
$atts = vc_map_get_attributes($vc_btn->getShortcode(), $atts);
extract($atts);
//parse link
$class_to_filter = 'vc_btn3-container ' . $vc_btn->getCSSAnimation($css_animation);
$class_to_filter .= vc_shortcode_custom_css_class($css, ' ') . $vc_btn->getExtraClass($el_class);
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, $class_to_filter, $vc_btn->settings('base'), $atts);
$button_class = ' vc_btn3-size-' . $size . ' vc_btn3-shape-' . $shape . ' vc_btn3-style-' . $style;
$button_html = $title;
if ('' === trim($title)) {
    $button_class .= ' vc_btn3-o-empty';
Exemple #4
0
 * @var $size
 * @var $align
 * @var $link
 * @var $url
 * @var $title
 * @var $button_block
 * @var $el_class
 *
 * @var $add_icon
 * @var $i_align
 * @var $i_type
 */
$atts = array();
parse_str($data, $atts);
require_once vc_path_dir('SHORTCODES_DIR', 'vc-btn.php');
$vc_btn = new WPBakeryShortCode_VC_Btn(array('base' => 'vc_btn'));
$defaults = array('style' => 'classic', 'shape' => 'rounded', 'color' => 'grey', 'custom_background' => '', 'custom_text' => '', 'size' => 'md', 'align' => 'inline', 'link' => '', 'url' => '', 'title' => '', 'button_block' => '', 'el_class' => '', 'add_icon' => '', 'add_icon' => '', 'i_align' => 'left', 'i_icon_pixelicons' => '', 'i_type' => 'fontawesome', 'i_icon_fontawesome' => 'fa fa-adjust', 'i_icon_openiconic' => 'vc-oi vc-oi-dial', 'i_icon_typicons' => 'typcn typcn-adjust-brightness', 'i_icon_entypo' => 'entypo-icon entypo-icon-note', 'i_icon_linecons' => 'vc_li vc_li-heart', 'css_animation' => '');
$inline_css = '';
$icon_wrapper = false;
$icon_html = false;
$atts = vc_shortcode_attribute_parse($defaults, $atts);
extract($atts);
//parse link
$el_class = $vc_btn->getExtraClass($el_class);
$css_class = apply_filters(VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, ' vc_btn3-container ' . $el_class, $vc_btn->settings('base'), $atts);
$css_class .= $vc_btn->getCSSAnimation($css_animation);
$button_class = ' vc_btn3-size-' . $size . ' vc_btn3-shape-' . $shape . ' vc_btn3-style-' . $style;
$button_html = $title;
if ('' == trim($title)) {
    $button_class .= ' vc_btn3-o-empty';
    $button_html = '<span class="vc_btn3-placeholder">&nbsp;</span>';