<?php

/**
 * Shortcode: us_single_image
 */
vc_map(array('base' => 'us_single_image', 'name' => __('Single Image', 'us'), 'icon' => 'icon-wpb-single-image', 'category' => __('Content', 'us'), 'description' => __('Simple image with CSS animation', 'us'), 'params' => array(array('type' => 'attach_image', 'heading' => __('Image', 'us'), 'param_name' => 'image', 'value' => '', 'description' => __('Select image from media library.', 'us')), array('type' => 'dropdown', 'heading' => __('Image Size', 'us'), 'param_name' => 'size', 'value' => us_image_sizes_select_values(array('large', 'medium', 'thumbnail', 'full')), 'std' => 'large', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Image Alignment', 'us'), 'param_name' => 'align', 'value' => array(__('Default', 'us') => '', __('Left', 'us') => 'left', __('Center', 'us') => 'center', __('Right', 'us') => 'right'), 'std' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'checkbox', 'heading' => '', 'param_name' => 'lightbox', 'description' => '', 'value' => array(__('Enable lightbox with the original image on click', 'us') => TRUE)), array('type' => 'vc_link', 'heading' => __('Image link', 'us'), 'param_name' => 'link', 'description' => __('Set URL if you want this image to have a link.', 'us'), 'dependency' => array('element' => 'lightbox', 'is_empty' => TRUE)), $us_css_animation, $us_css_animation_delay, array('type' => 'textfield', 'heading' => __('Extra class name', 'us'), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'us')), array('type' => 'css_editor', 'heading' => 'CSS', 'param_name' => 'css', 'group' => __('Design options', 'us')))));
vc_remove_element('vc_single_image');
class WPBakeryShortCode_us_single_image extends WPBakeryShortCode
{
    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') {
Exemplo n.º 2
0
 * Extending shortcode: vc_column_inner
 */
vc_add_params('vc_column_inner', array(array('type' => 'colorpicker', 'class' => '', 'heading' => __('Text Color', 'us'), 'param_name' => 'text_color', 'value' => '', 'description' => '', 'weight' => 20), array_merge($us_css_animation, array('weight' => 19)), array_merge($us_css_animation_delay, array('weight' => 18))));
/**
 * Shortcode: us_single_image
 */
include 'shortcode-us-single-image.php';
/**
 * Shortcode: us_gallery
 */
vc_map(array('base' => 'us_gallery', 'name' => __('Image Gallery', 'us'), 'icon' => 'icon-wpb-images-stack', 'category' => __('Content', 'us'), 'description' => __('Responsive image gallery', 'us'), 'params' => array(array('type' => 'attach_images', 'heading' => __('Images', 'us'), 'param_name' => 'ids', 'value' => '', 'description' => __('Select images from media library.', 'us')), array('type' => 'dropdown', 'heading' => __('Layout', 'us'), 'param_name' => 'layout', 'value' => array(__('Default (square thumbnails)', 'us') => 'default', __('Masonry (thumbnails with initial proportions)', 'us') => 'masonry'), 'std' => 'default', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Columns', 'us'), 'param_name' => 'columns', 'value' => array(__('1 column', 'us') => '1', __('2 columns', 'us') => '2', __('3 columns', 'us') => '3', __('4 columns', 'us') => '4', __('5 columns', 'us') => '5', __('6 columns', 'us') => '6', __('7 columns', 'us') => '7', __('8 columns', 'us') => '8', __('9 columns', 'us') => '9', __('10 columns', 'us') => '10'), 'std' => '6', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'checkbox', 'heading' => __('Random Order', 'us'), 'param_name' => 'orderby', 'description' => '', 'value' => array(__('Display thumbnails in random order', 'us') => 'rand'), 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'checkbox', 'heading' => __('Indents', 'us'), 'param_name' => 'indents', 'description' => '', 'value' => array(__('Add indents between thumbnails', 'us') => TRUE), 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'textfield', 'heading' => __('Extra class name', 'us'), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'us')))));
vc_remove_element('vc_gallery');
/**
 * Shortcode: us_image_slider
 */
vc_map(array('base' => 'us_image_slider', 'name' => __('Image Slider', 'us'), 'icon' => 'icon-wpb-images-stack', 'category' => __('Content', 'us'), 'params' => array(array('type' => 'attach_images', 'heading' => __('Images', 'us'), 'param_name' => 'ids', 'value' => '', 'description' => __('Select images from media library.', 'us')), array('type' => 'dropdown', 'heading' => __('Navigation Arrows', 'us'), 'param_name' => 'arrows', 'value' => array(__('Show always', 'us') => 'always', __('Show on hover', 'us') => 'hover', __('Hide', 'us') => 'hide'), 'std' => 'always', 'description' => '', 'edit_field_class' => 'vc_col-sm-4 vc_column'), array('type' => 'dropdown', 'heading' => __('Additional Navigation', 'us'), 'param_name' => 'nav', 'value' => array(__('None', 'us') => 'none', __('Dots', 'us') => 'dots', __('Thumbs', 'us') => 'thumbs'), 'std' => 'none', 'description' => '', 'edit_field_class' => 'vc_col-sm-4 vc_column'), array('type' => 'dropdown', 'heading' => __('Transition Effect', 'us'), 'param_name' => 'transition', 'value' => array(__('Slide', 'us') => 'slide', __('Fade', 'us') => 'crossfade'), 'std' => 'slide', 'description' => '', 'edit_field_class' => 'vc_col-sm-4 vc_column'), array('type' => 'checkbox', 'heading' => '', 'param_name' => 'autoplay', 'value' => array(__('Enable Auto Rotation', 'us') => TRUE)), array('type' => 'textfield', 'heading' => __('Auto Rotation Period (milliseconds)', 'us'), 'param_name' => 'autoplay_period', 'value' => '3000', 'dependency' => array('element' => 'autoplay', 'not_empty' => TRUE)), array('type' => 'checkbox', 'heading' => '', 'param_name' => 'fullscreen', 'value' => array(__('Allow Full Screen view', 'us') => TRUE)), array('type' => 'checkbox', 'heading' => '', 'param_name' => 'orderby', 'value' => array(__('Display images in random order', 'us') => 'rand')), array('type' => 'dropdown', 'heading' => __('Images Size', 'us'), 'param_name' => 'img_size', 'value' => us_image_sizes_select_values(array('large', 'medium', 'thumbnail', 'full')), 'std' => 'large', 'description' => ''), array('type' => 'dropdown', 'heading' => __('Images Fit', 'us'), 'param_name' => 'img_fit', 'value' => array(__('Scaledown - Images won\'t be stretched if they are smaller than the slider area', 'us') => 'scaledown', __('Contain - Images will fit inside the slider area', 'us') => 'contain', __('Cover - Images will cover the whole slider area', 'us') => 'cover'), 'std' => 'scaledown', 'description' => ''), array('type' => 'textfield', 'heading' => __('Extra class name', 'us'), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'us')))));
vc_remove_element('vc_simple_slider');
/**
 * Shortcode: us_separator
 */
vc_map(array('base' => 'us_separator', 'name' => __('Separator', 'us'), 'icon' => 'icon-wpb-ui-separator', 'category' => __('Content', 'us'), 'description' => __('Horizontal separator line', 'us'), 'params' => array(array('type' => 'dropdown', 'heading' => __('Separator Type', 'us'), 'param_name' => 'type', 'value' => array(__('Default', 'us') => 'default', __('Full Width', 'us') => 'fullwidth', __('Short', 'us') => 'short', __('Invisible', 'us') => 'invisible'), 'std' => 'default', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Separator Size', 'us'), 'param_name' => 'size', 'value' => array(__('Small', 'us') => 'small', __('Medium', 'us') => 'medium', __('Large', 'us') => 'large', __('Huge', 'us') => 'huge'), 'std' => 'medium', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Line Thickness', 'us'), 'param_name' => 'thick', 'value' => array('1px' => '1', '2px' => '2', '3px' => '3', '4px' => '4', '5px' => '5'), 'std' => '1', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Line Style', 'us'), 'param_name' => 'style', 'value' => array(__('Solid', 'us') => 'solid', __('Dashed', 'us') => 'dashed', __('Dotted', 'us') => 'dotted', __('Double', 'us') => 'double'), 'std' => 'solid', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Line Color', 'us'), 'param_name' => 'color', 'value' => array(__('Border (theme color)', 'us') => 'border', __('Primary (theme color)', 'us') => 'primary', __('Secondary (theme color)', 'us') => 'secondary', __('Custom Color', 'us') => 'custom'), 'std' => 'border', 'description' => ''), array('type' => 'colorpicker', 'class' => '', 'param_name' => 'bdcolor', 'value' => '', 'description' => '', 'dependency' => array('element' => 'color', 'value' => 'custom'), 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'textfield', 'heading' => __('Icon (optional)', 'us'), 'param_name' => 'icon', 'value' => '', 'description' => sprintf(__('<a href="%s" target="_blank">FontAwesome</a> or <a href="%s" target="_blank">Material Design</a> icon', 'us'), $url_fontawesome, $url_mdfi), 'edit_field_class' => 'vc_col-sm-6 vc_column newline'), array('type' => 'textfield', 'heading' => __('Text (optional)', 'us'), 'param_name' => 'text', 'value' => '', 'holder' => 'div', 'description' => __('Displays text in the middle of this separator', 'us'), 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'textfield', 'heading' => __('Extra class name', 'us'), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'us')))));
vc_remove_element('vc_separator');
vc_remove_element('vc_text_separator');
/**
 * Shortcode: us_btn
 */
vc_map(array('base' => 'us_btn', 'name' => __('Button', 'us'), 'icon' => 'icon-wpb-ui-button', 'category' => __('Content', 'us'), 'params' => array(array('type' => 'textfield', 'heading' => __('Button Label', 'us'), 'holder' => 'button', 'class' => 'wpb_button', 'param_name' => 'text', 'value' => __('Click Me', 'us'), 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'textfield', 'heading' => __('Button Icon (optional)', 'us'), 'param_name' => 'icon', 'description' => sprintf(__('<a href="%s" target="_blank">FontAwesome</a> or <a href="%s" target="_blank">Material Design</a> icon', 'us'), $url_fontawesome, $url_mdfi), 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Button Style', 'us'), 'param_name' => 'style', 'value' => array(__('Raised', 'us') => 'raised', __('Flat', 'us') => 'flat'), 'std' => 'raised', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Button Color', 'us'), 'param_name' => 'color', 'value' => array(__('Primary (theme color)', 'us') => 'primary', __('Secondary (theme color)', 'us') => 'secondary', __('Light (theme color)', 'us') => 'light', __('Contrast (theme color)', 'us') => 'contrast', __('Black', 'us') => 'black', __('White', 'us') => 'white', __('Custom colors', 'us') => 'custom'), 'std' => 'primary', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'colorpicker', 'class' => '', 'heading' => __('Background Color', 'us'), 'param_name' => 'bg_color', 'value' => '', 'description' => '', 'dependency' => array('element' => 'color', 'value' => 'custom')), array('type' => 'colorpicker', 'class' => '', 'heading' => __('Text Color', 'us'), 'param_name' => 'text_color', 'value' => '', 'description' => '', 'dependency' => array('element' => 'color', 'value' => 'custom')), array('type' => 'dropdown', 'heading' => __('Icon Position', 'us'), 'param_name' => 'iconpos', 'value' => array(__('Left', 'us') => 'left', __('Right', 'us') => 'right'), 'std' => 'left', 'description' => '', 'dependency' => array('element' => 'icon', 'not_empty' => TRUE)), array('type' => 'dropdown', 'heading' => __('Button Size', 'us'), 'param_name' => 'size', 'value' => array(__('Medium', 'us') => 'medium', __('Large', 'us') => 'large'), 'std' => 'medium', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'dropdown', 'heading' => __('Button Alignment', 'us'), 'param_name' => 'align', 'value' => array(__('Left', 'us') => 'left', __('Center', 'us') => 'center', __('Right', 'us') => 'right'), 'std' => 'left', 'description' => '', 'edit_field_class' => 'vc_col-sm-6 vc_column'), array('type' => 'vc_link', 'heading' => __('Button Link', 'us'), 'param_name' => 'link', 'description' => ''), array('type' => 'textfield', 'heading' => __('Extra class name', 'us'), 'param_name' => 'el_class', 'description' => __('If you wish to style particular content element differently, then use this field to add a class name and then refer to it in your css file.', 'us'))), 'js_view' => 'VcButtonView'));
vc_remove_element('vc_button');
vc_remove_element('vc_button2');
vc_remove_element('vc_btn');
/**