Example #1
1
 function processData($atts)
 {
     $per_row = $atts['gallery_row_amount'];
     $col = (int) (12 / $per_row);
     $atts['col'] = $col;
     $atts['per_row'] = $per_row;
     $gallery_items = vc_param_group_parse_atts($atts['gallery_items']);
     $atts['amount'] = count($gallery_items);
     $i = 0;
     $items = array();
     foreach ($gallery_items as $item) {
         $items[$i]['id'] = self::GenerateId();
         // Headline
         $headline = self::Exists($item['headline'], '');
         $items[$i]['headline'] = $headline;
         // Image
         $attachment = wp_get_attachment_image_src($item['image'], 'full');
         $image_url = $attachment[0];
         $items[$i]['image_url'] = $image_url;
         // Text
         $text = self::Exists($item['text'], '');
         $items[$i]['image_text'] = $text;
         ++$i;
     }
     $atts['items'] = $items;
     return $atts;
 }
Example #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>';
 }
 /**
  * @param $settings
  * @param $value
  * @param $tag
  *
  * @since 4.4
  */
 public function __construct($settings, $value, $tag)
 {
     $this->settings = $settings;
     $this->settings['base'] = $tag;
     $this->value = vc_param_group_parse_atts($value);
     $this->unparsed_value = $value;
 }
Example #4
0
 public static function convertAttributesToNewProgressBar($atts)
 {
     if (isset($atts['values']) && strlen($atts['values']) > 0) {
         $values = vc_param_group_parse_atts($atts['values']);
         if (!is_array($values)) {
             $temp = explode(',', $atts['values']);
             $paramValues = array();
             foreach ($temp as $value) {
                 $data = explode('|', $value);
                 $colorIndex = 2;
                 $newLine = array();
                 $newLine['value'] = isset($data[0]) ? $data[0] : 0;
                 $newLine['label'] = isset($data[1]) ? $data[1] : '';
                 if (isset($data[1]) && preg_match('/^\\d{1,3}\\%$/', $data[1])) {
                     $colorIndex += 1;
                     $newLine['value'] = (double) str_replace('%', '', $data[1]);
                     $newLine['label'] = isset($data[2]) ? $data[2] : '';
                 }
                 if (isset($data[$colorIndex])) {
                     $newLine['customcolor'] = $data[$colorIndex];
                 }
                 $paramValues[] = $newLine;
             }
             $atts['values'] = urlencode(json_encode($paramValues));
         }
     }
     return $atts;
 }
Example #5
0
 function processData($atts)
 {
     $id = self::Exists($atts['facility'], '');
     if ($id !== '') {
         $title = get_the_title($id);
         $atts['title'] = $title;
         $content = htmlspecialchars($atts['facility_content']);
         $content = preg_replace('/\\`{2}/', '"', $content);
         $atts['facility_content'] = htmlspecialchars_decode($content);
         $coordinates = get_field('facility-visiting-address', $id);
         if ($coordinates) {
             $atts['coordinates'] = $coordinates;
             $atts['zoom'] = 14;
         }
         $i = 0;
         $buttons = array();
         $facility_buttons = vc_param_group_parse_atts($atts['facility_buttons']);
         foreach ($facility_buttons as $button) {
             $buttons[$i]['text'] = $button['button_text'];
             $buttons[$i]['color'] = $button['color'];
             $buttons[$i]['link_to'] = $button['link_to'];
             ++$i;
         }
         $atts['buttons'] = $buttons;
     }
     return $atts;
 }
Example #6
0
 public function ProcessData($atts)
 {
     if ($atts['use_picture'] == "0" && !isset($atts['icon_bytbil'])) {
         $atts['icon_bytbil'] = "";
     }
     $atts['links'] = vc_param_group_parse_atts($atts['link_list']);
     return $atts;
 }
Example #7
0
 function processData($atts)
 {
     $accordions = vc_param_group_parse_atts($atts['accordions']);
     $filtered = array_filter($accordions);
     if (!empty($filtered)) {
         $atts['accordions'] = $accordions;
     } else {
         $atts['accordions'] = false;
     }
     return $atts;
 }
Example #8
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>';
 }
Example #9
0
 public function market($settings, $value){
     $settings["params"] = array(
         array(
             "type" => "textfield",
             "heading" => __( "Database", 'slz-core' ),
             "param_name" => "database_code",
             "value" => ''
         ),
         array(
             "type" => "slz_dropdownmultiple",
             "heading" => __( "Dataset", 'slz-core' ),
             "param_name" => "dataset_code",
             "value" => array()
         )
     );
     
     return $this->render('market', array(
         'edit_form' => new Vc_ParamGroup_Edit_Form_Fields( $settings ),
         'value' => vc_param_group_parse_atts( $value ),
         'unparsed_value' => $value,
         'settings' => $settings,
     ), true);
 }
Example #10
0
if (!empty($stroke_color)) {
    if ('custom' === $stroke_color) {
        if ($custom_stroke_color) {
            $color = $custom_stroke_color;
        } else {
            $color = $base_colors['normal']['white'];
        }
    } else {
        $color = $base_colors['normal'][$stroke_color];
    }
    $options[] = 'data-vc-stroke-color="' . $color . '"';
}
if (!empty($stroke_width)) {
    $options[] = 'data-vc-stroke-width="' . $stroke_width . '"';
}
$values = (array) vc_param_group_parse_atts($values);
$data = array();
foreach ($values as $k => $v) {
    if ('custom' === $style) {
        if (!empty($v['custom_color'])) {
            $color = $v['custom_color'];
            $highlight = vc_colorCreator($v['custom_color'], -10);
            //10% darker
        } else {
            $color = $base_colors['normal']['grey'];
            $highlight = $base_colors['active']['grey'];
        }
    } else {
        $color = isset($colors[$style]['normal'][$v['color']]) ? $colors[$style]['normal'][$v['color']] : $v['normal']['color'];
        $highlight = isset($colors[$style]['active'][$v['color']]) ? $colors[$style]['active'][$v['color']] : $v['active']['color'];
    }
Example #11
0
 function processData($atts)
 {
     $atts['tabs'] = vc_param_group_parse_atts($atts['tabs']);
     return $atts;
 }
Example #12
0
function x_shortcode_page_list($atts)
{
    ob_start();
    $titles = vc_param_group_parse_atts($atts['titles']);
    $output = '<div class="abt_facilities bullet"><ul>';
    foreach ($titles as $value) {
        $output .= '<li>';
        $output .= '<h5>' . $value['title'] . "</h5>";
        $output .= '<p class="text-justify">' . $value['excerpt'] . "</p>";
        $link = explode('|', $value['link']);
        $url = explode(':', $link[0]);
        $url_text = explode(':', $link[1]);
        $output .= '<div><a href="' . urldecode($url[1]) . '"  class="aboutLink">' . urldecode($url_text[1]) . '</a></div></li>';
    }
    $output .= '</ul></div>';
    return $output;
    $returnvariable = ob_get_clean();
    return $returnvariable;
}
Example #13
0
 function vc_featured_product_func($atts, $content = null)
 {
     // New function parameter $content is added!
     global $makeclean_theme_option;
     extract(shortcode_atts(array('title' => '', 'list_tabs' => ''), $atts));
     $tabs = vc_param_group_parse_atts($list_tabs);
     $output = '<div class="col-md-12 col-sm-12 ">';
     $output .= '<div class="product-category"> ';
     $output .= '<ul class="nav nav-tabs" role="tablist">';
     $active = 'active';
     for ($i = 0; $i < count($tabs); $i++) {
         if ($i != 0) {
             $active = '';
         }
         $output .= '<li class="' . $active . '" role="presentation" ><a  href="#tab' . $i . '" aria-controls="tab' . $i . '" role="tab" data-toggle="tab">' . $tabs[$i]["title_tab"] . ' </a></li>';
     }
     $output .= '</ul> </div>';
     $active = 'in active';
     $output .= '  <div class="tab-content">';
     foreach ($tabs as $key => $tab) {
         if ($key != 0) {
             $active = '';
         }
         $output .= '<div role="tabpanel" class="tab-pane fade  ' . $active . '" id="tab' . $key . '">';
         $output .= do_shortcode('[' . $tab["my_product_cat"] . ' per_page="' . $tab["num_items"] . '" columns="' . $tab["columns_count"] . '"]');
         $output .= '</div>';
     }
     $output .= '</div>';
     $output .= '</div>';
     return $output;
 }
			</span>
		</li>
		<?php 
if (strlen($desc) > 0) {
    ?>
		<li class="desc"><?php 
    echo esc_attr($desc);
    ?>
</li>
		<?php 
}
?>
		
		<?php 
if (strlen($features) > 0) {
    $features = (array) vc_param_group_parse_atts($features);
    //$features = array_map( 'trim', explode(',', wp_strip_all_tags($features)) );
    ?>
			<?php 
    foreach ($features as $feature) {
        if (isset($feature['title']) && strlen($feature['title']) > 0) {
            ?>
			<li class="feature"><?php 
            echo do_shortcode($feature['title']);
            if (isset($feature['tooltip']) && strlen($feature['tooltip']) > 0) {
                echo '<span class="nth-more-info" data-toggle="tooltip" data-placement="top" title="' . esc_attr($feature['tooltip']) . '">?</span>';
            }
            ?>
</li>
			<?php 
        }
Example #15
0
 public function processData($atts)
 {
     $processed_slides = array();
     if (!empty($atts['slides'])) {
         $slides = vc_param_group_parse_atts($atts['slides']);
         foreach ($slides as $slide) {
             switch ($slide['slide_type']) {
                 case 'image':
                     $processed_slide = self::build_image_slide($slide);
                     if (!empty($processed_slide)) {
                         array_push($processed_slides, $processed_slide);
                     }
                     break;
                 case 'offer':
                     $processed_slide = self::build_offer_slide($slide);
                     if (!empty($processed_slide)) {
                         array_push($processed_slides, $processed_slide);
                     }
                     break;
             }
         }
     }
     $atts['slides'] = $processed_slides;
     // Slider animation
     $slider_animation = self::Exists($atts['slider_effect'], 'fade');
     $atts['slider_effect'] = $slider_animation;
     // Slider animation speed
     $slider_animation_speed = self::Exists($atts['slider_animation_speed'], '600');
     $atts['slider_animation_speed'] = $slider_animation_speed;
     // Slider speed
     $slider_speed = self::Exists($atts['slider_speed'], '7') * 1000;
     $atts['slider_speed'] = $slider_speed;
     // Arrows
     $slider_arrows = self::Exists($atts['slider_arrows'], 'false');
     $atts['slider_arrows'] = $slider_arrows;
     // Slideshow controls
     $slider_controls = self::Exists($atts['slider_controls'], 'false');
     $atts['slider_controls'] = $slider_controls;
     return $atts;
 }
Example #16
0
 function processData($atts)
 {
     $buttons = vc_param_group_parse_atts($atts['the_buttons']);
     $atts['the_buttons'] = $buttons;
     return $atts;
 }