Esempio n. 1
0
 public function init_shortcodes()
 {
     $min = defined('WP_DEBUG') && WP_DEBUG ? '' : '.min';
     WpbakeryShortcodeParams::addField('wyde_animation', array($this, 'animation_field'), get_template_directory_uri() . '/shortcodes/js/wyde-animation' . $min . '.js');
     WpbakeryShortcodeParams::addField('wyde_gmaps', array($this, 'gmaps_field'), get_template_directory_uri() . '/shortcodes/js/wyde-gmaps' . $min . '.js');
     $this->add_elements();
     $this->update_elements();
 }
Esempio n. 2
0
function vc_output_required_params_to_init()
{
    $params = WpbakeryShortcodeParams::getRequiredInitParams();
    $js_array = array();
    foreach ($params as $param) {
        $js_array[] = '"' . $param . '"';
    }
    echo '
		<script>
			if (window.vc) {
				window.vc.required_params_to_init = [' . implode(',', $js_array) . '];
			}
		</script>
	';
}
Esempio n. 3
0
 public function contentAdmin($atts, $content)
 {
     $this->loadDefaultParams();
     $output = $el_position = '';
     $groups_content = array();
     if (isset($this->settings['params'])) {
         $shortcode_attributes = array();
         foreach ($this->settings['params'] as $param) {
             if ($param['param_name'] != 'content') {
                 if (isset($param['std'])) {
                     $shortcode_attributes[$param['param_name']] = $param['std'];
                 } else {
                     $shortcode_attributes[$param['param_name']] = isset($param['value']) ? $param['value'] : null;
                 }
             } else {
                 if ($param['param_name'] == 'content' && $content === null) {
                     $content = isset($param['value']) ? $param['value'] : '';
                 }
             }
         }
         extract(shortcode_atts($shortcode_attributes, $atts));
         $editor_css_classes = apply_filters('vc_edit_form_class', array('wpb_edit_form_elements'));
         $output .= '<div class="' . implode(' ', $editor_css_classes) . '" data-title="' . htmlspecialchars(__('Edit', 'js_composer') . ' ' . __($this->settings['name'], "js_composer")) . '">';
         foreach ($this->settings['params'] as $param) {
             $param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : '';
             if (is_array($param_value) && !empty($param_value) && isset($param['std'])) {
                 $param_value = $param['std'];
             } elseif (is_array($param_value) && !empty($param_value) && !empty($param['type']) && $param['type'] != 'checkbox') {
                 // Get first element from the array
                 reset($param_value);
                 $first_key = key($param_value);
                 $param_value = $param_value[$first_key];
             } elseif (is_array($param_value)) {
                 $param_value = '';
             }
             $group = isset($param['group']) && $param['group'] !== '' ? $param['group'] : '_general';
             if (!isset($groups_content[$group])) {
                 $groups[] = $group;
                 $groups_content[$group] = '';
             }
             $groups_content[$group] .= $this->singleParamEditHolder($param, $param_value);
         }
         if (sizeof($groups) > 1) {
             $output .= '<div class="vc_panel-tabs" id="vc_edit-form-tabs"><ul>';
             $key = 0;
             foreach ($groups as $g) {
                 $output .= '<li><a href="#vc_edit-form-tab-' . $key++ . '">' . ($g === '_general' ? __('General', 'js_composer') : $g) . '</a></li>';
             }
             $output .= '</ul>';
             $key = 0;
             foreach ($groups as $g) {
                 $output .= '<div id="vc_edit-form-tab-' . $key++ . '" class="vc_edit-form-tab">';
                 $output .= $groups_content[$g];
                 $output .= '</div>';
             }
             $output .= '</div>';
         } elseif (!empty($groups_content['_general'])) {
             $output .= $groups_content['_general'];
         }
         $output .= '</div>';
         //close wpb_edit_form_elements
         if (!WpbakeryShortcodeParams::isEnqueue()) {
             foreach (WpbakeryShortcodeParams::getScripts() as $script) {
                 $output .= "\n\n" . '<script type="text/javascript" src="' . $script . '"></script>';
             }
         }
     }
     return $output;
 }
Esempio n. 4
0
    $type = isset($settings['type']) ? $settings['type'] : '';
    $class = isset($settings['class']) ? $settings['class'] : '';
    $output = '<input type="hidden" class="wpb_vc_param_value ' . $param_name . ' ' . $type . ' ' . $class . '" name="' . $param_name . '" value="' . esc_attr($value) . '" ' . $dependency . ' />';
    $placeholder = isset($settings['placeholder']) ? $settings['placeholder'] : esc_html__('Search icon ...', 'adroit');
    $output .= '<div class="param-icon-header clearfix">';
    $preview_class = $value ? 'active' : '';
    $output .= '<span class="param-icon-preview ' . $preview_class . '"><i class="' . $value . '"></i><span class="icon-preview-remove"></span></span>';
    $output .= '<p><input type="text" placeholder="' . $placeholder . '" name="param-icon-search" class="param-icon-search" /></p>';
    $lists = apply_filters('kt_icons_source', array());
    if (is_array($lists)) {
        $icons = '';
        $output .= '<p><select name="param-icon-categories" class="param-icon-categories">';
        $output .= '<option value="">' . esc_html__('From all categories', 'adroit') . '</option>';
        foreach ($lists as $k => $v) {
            $text = ucwords(str_replace('_', ' ', $k));
            $output .= '<option value="' . $k . '">' . $text . '</option>';
            foreach ($v as $icon) {
                foreach ($icon as $key => $label) {
                    $current = $value == $key ? 'current' : '';
                    $icons .= '<li data-source="' . $k . '" class="' . $current . '" data-key="' . $key . '"><i class="' . $key . '" title="' . $label . '"></i></li>';
                }
            }
        }
        $output .= '</select></p>';
    }
    $output .= '</div>';
    $output .= '<ul class="clearfix">' . $icons . '</ul>';
    return $output;
}
WpbakeryShortcodeParams::addField('kt_icons', 'kt_icons_settings_field', KT_FW_JS . 'kt_icons.js');
Esempio n. 5
0
 public function contentAdmin($atts, $content)
 {
     $this->loadDefaultParams();
     $output = $el_position = '';
     //if ( $content != NULL ) { $content = apply_filters('the_content', $content); }
     if (isset($this->settings['params'])) {
         $shortcode_attributes = array();
         foreach ($this->settings['params'] as $param) {
             if ($param['param_name'] != 'content') {
                 $shortcode_attributes[$param['param_name']] = isset($param['value']) ? $param['value'] : null;
             } else {
                 if ($param['param_name'] == 'content' && $content == NULL) {
                     $content = $param['value'];
                 }
             }
         }
         extract(shortcode_atts($shortcode_attributes, $atts));
         $output .= '<div class="vc_span12 wpb_edit_form_elements"><h2 style="display: none;">' . __('Edit', 'meganews') . ' ' . __($this->settings['name'], "meganews") . '</h2>';
         foreach ($this->settings['params'] as $param) {
             $param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : '';
             if (is_array($param_value) && !empty($param_value) && !empty($param['type']) && $param['type'] != 'checkbox') {
                 // Get first element from the array
                 reset($param_value);
                 $first_key = key($param_value);
                 $param_value = $param_value[$first_key];
             } elseif (is_array($param_value)) {
                 $param_value = '';
             }
             $output .= $this->singleParamEditHolder($param, $param_value);
             if ($param['param_name'] == 'el_position') {
                 $el_position = $param_value;
             }
         }
         $output .= '</div>';
         //close wpb_edit_form_elements
         foreach (WpbakeryShortcodeParams::getScripts() as $script) {
             $output .= "\n\n" . '<script type="text/javascripts" src="' . $script . '"></script>';
         }
     }
     return $output;
 }
Esempio n. 6
0
 /**
  * @since 4.2
  *
  * @param $value
  */
 public static function setEnqueue($value)
 {
     self::$is_enqueue = (bool) $value;
 }
Esempio n. 7
0
/**
 * Call hook for attribute.
 * @param $name - attribute name
 * @param $param_settings - attribute settings from shortcode
 * @param $param_value - attribute value
 * @return mixed|string - returns html which will be render in hook
 */
function do_shortcode_param_settings_field($name, $param_settings, $param_value)
{
    return WpbakeryShortcodeParams::renderSettingsField($name, $param_settings, $param_value);
}
Esempio n. 8
0
            }
        }
        $classes[] = $icon;
        $output = sprintf('<a title="%2$s" target="%4$s" href="%1$s" class="%3$s"><i class="fa fa-%3$s"></i></a>', $url, esc_attr($title), esc_attr(implode(' ', $classes)), $target);
        return $output;
    }
}
// presscore_get_social_icon
if (!function_exists('vc_taxonomy_form_field')) {
    function vc_taxonomy_form_field($settings, $value)
    {
        $terms_fields = array();
        $terms_slugs = array();
        $value_arr = $value;
        if (!is_array($value_arr)) {
            $value_arr = array_map('trim', explode(',', $value_arr));
        }
        if (!empty($settings['taxonomy'])) {
            $terms = get_terms($settings['taxonomy']);
            if ($terms && !is_wp_error($terms)) {
                foreach ($terms as $term) {
                    $terms_slugs[] = $term->slug;
                    $terms_fields[] = sprintf('<option id="%s" class="%s" value="%s" %s>%s</option>', $settings['param_name'] . '-' . $term->slug, $settings['param_name'] . ' ' . $settings['type'], $term->slug, selected(in_array($term->slug, $value_arr), true, false), $term->name);
                }
            }
        }
        return '<select name="' . $settings['param_name'] . '" class="wpb_vc_param_value wpb-input wpb-select dropdown">' . '<option value=""></option>' . implode($terms_fields) . '</select>';
    }
}
WpbakeryShortcodeParams::addField('wd_taxonomy', 'vc_taxonomy_form_field');
Esempio n. 9
0
<?php

global $menu, $submenu, $parent_file;
$menu = array();
add_thickbox();
wp_enqueue_media(array('post' => $this->post_id));
require_once $this->adminFile('admin-header.php');
?>
<div class="wpb-edit-form" id="vc-inline-shortcode-edit-form">
    <div class="vc_row-fluid wpb-edit-form-inner">
        <div class="vc_span12 wpb_edit_form_elements">
            <?php 
echo $this->buildEditForm();
?>
            <?php 
WpbakeryShortcodeParams::enqueueScripts();
?>
            </div>
    </div>
</div>
<script type="text/html" id="vc-settings-image-block">
    <li class="added">
        <div class="inner" style="width: 75px; height: 75px; overflow: hidden;text-align: center;">
            <img rel="<%= id %>" src="<%= url %>" />
        </div>
        <a href="#" class="icon-remove"></a>
    </li>
</script>

<?php 
require_once $this->adminFile('admin-footer.php');
Esempio n. 10
0
 function add_extra_field($name, $form_field_callback, $script_url = null)
 {
     return WpbakeryShortcodeParams::addField($name, $form_field_callback, $script_url);
     // $check =  WpbakeryShortcodeParams::addField( $name, $form_field_callback, $script_url );
     //  print_r($check);die();
 }
Esempio n. 11
0
 public function contentAdmin($atts, $content)
 {
     $this->loadDefaultParams();
     $output = $el_position = '';
     //if ( $content != NULL ) { $content = apply_filters('the_content', $content); }
     if (isset($this->settings['params'])) {
         $shortcode_attributes = array();
         foreach ($this->settings['params'] as $param) {
             if ($param['param_name'] != 'content') {
                 $shortcode_attributes[$param['param_name']] = isset($param['value']) ? $param['value'] : null;
             } else {
                 if ($param['param_name'] == 'content' && $content == NULL) {
                     $content = $param['value'];
                 }
             }
         }
         extract(shortcode_atts($shortcode_attributes, $atts));
         $output .= '<div class="span12 wpb_edit_form_elements"><h2>' . __('Edit', 'js_composer') . ' ' . __($this->settings['name'], "js_composer") . '</h2>';
         foreach ($this->settings['params'] as $param) {
             $param_value = '';
             $param_value = ${$param}['param_name'];
             if (is_array($param_value)) {
                 // Get first element from the array
                 reset($param_value);
                 $first_key = key($param_value);
                 $param_value = $param_value[$first_key];
             }
             $output .= $this->singleParamEditHolder($param, $param_value);
             if ($param['param_name'] == 'el_position') {
                 $el_position = $param_value;
             }
         }
         $output .= '<div class="edit_form_actions"><a href="#" class="wpb_save_edit_form button-primary">' . __('Save', "js_composer") . '</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="#" id="cancel-background-options">' . __('Cancel', 'js_composer') . '</a></div>';
         $output .= '</div>';
         //close wpb_edit_form_elements
         foreach (WpbakeryShortcodeParams::getScripts() as $script) {
             $output .= "\n\n" . '<script type="text/javascripts" src="' . $script . '"></script>';
         }
     }
     return $output;
 }
Esempio n. 12
0
 public function contentAdmin($atts, $content)
 {
     $this->loadDefaultParams();
     $output = $el_position = '';
     if (isset($this->settings['params'])) {
         $shortcode_attributes = array();
         foreach ($this->settings['params'] as $param) {
             if ($param['param_name'] != 'content') {
                 if (isset($param['std'])) {
                     $shortcode_attributes[$param['param_name']] = $param['std'];
                 } else {
                     $shortcode_attributes[$param['param_name']] = isset($param['value']) ? $param['value'] : null;
                 }
             } else {
                 if ($param['param_name'] == 'content' && $content == NULL) {
                     $content = $param['value'];
                 }
             }
         }
         extract(shortcode_atts($shortcode_attributes, $atts));
         $editor_css_classes = apply_filters('vc_edit_form_class', array('vc_span12', 'wpb_edit_form_elements'));
         $output .= '<div class="' . implode(' ', $editor_css_classes) . '" data-title="' . htmlspecialchars(__('Edit', 'js_composer') . ' ' . __($this->settings['name'], "js_composer")) . '">';
         foreach ($this->settings['params'] as $param) {
             $param_value = isset(${$param}['param_name']) ? ${$param}['param_name'] : '';
             if (is_array($param_value) && !empty($param_value) && isset($param['std'])) {
                 $param_value = $param['std'];
             } elseif (is_array($param_value) && !empty($param_value) && !empty($param['type']) && $param['type'] != 'checkbox') {
                 // Get first element from the array
                 reset($param_value);
                 $first_key = key($param_value);
                 $param_value = $param_value[$first_key];
             } elseif (is_array($param_value)) {
                 $param_value = '';
             }
             $output .= $this->singleParamEditHolder($param, $param_value);
         }
         $output .= '</div>';
         //close wpb_edit_form_elements
         if (!WpbakeryShortcodeParams::isEnqueue()) {
             foreach (WpbakeryShortcodeParams::getScripts() as $script) {
                 $output .= "\n\n" . '<script type="text/javascript" src="' . $script . '"></script>';
             }
         }
     }
     return $output;
 }
Esempio n. 13
0
 function vc_add_extra_field($name, $form_field_callback, $script_url = null)
 {
     return WpbakeryShortcodeParams::addField($name, $form_field_callback, $script_url);
 }
Esempio n. 14
0
    $output .= '<p><input type="text" placeholder="' . $placeholder . '" name="param-icon-search" class="param-icon-search" /></p>';
    $lists = apply_filters('cruxstore_icons_source', array());
    if (is_array($lists)) {
        $icons = '';
        $output .= '<p><select name="param-icon-categories" class="param-icon-categories">';
        $output .= '<option value="">' . esc_html__('From all categories', 'cruxstore') . '</option>';
        foreach ($lists as $k => $v) {
            $text = ucwords(str_replace('_', ' ', $k));
            $output .= '<option value="' . $k . '">' . $text . '</option>';
            foreach ($v as $icon) {
                foreach ($icon as $key => $label) {
                    $current = $value == $key ? 'current' : '';
                    $icons .= '<li data-source="' . $k . '" class="' . $current . '" data-key="' . $key . '"><i class="' . $key . '" title="' . $label . '"></i></li>';
                }
            }
        }
        $output .= '</select></p>';
    }
    $output .= '</div>';
    $output .= '<ul class="clearfix">' . $icons . '</ul>';
    return $output;
}
WpbakeryShortcodeParams::addField('cruxstore_icons', 'cruxstore_icons_settings_field', CRUXSTORE_FW_JS . 'icons.js');
function cruxstore_preview_settings_field($settings, $value)
{
    $output = '<p class="preview-position-center"><button class="button button-second preview-position"><i class="fa fa-eye" aria-hidden="true"></i></button></p>';
    $output .= '<div class="preview-position-content"><div class="preview-position-image"></div><div class="preview-position-text"></div></div>';
    return $output;
}
WpbakeryShortcodeParams::addField('cruxstore_preview', 'cruxstore_preview_settings_field', CRUXSTORE_FW_JS . 'preview.js');
 /**
  * Enqueue js scripts for attributes types.
  * @since 4.4
  * @return string
  */
 public function enqueueScripts()
 {
     $output = '';
     if (!WpbakeryShortcodeParams::isEnqueue()) {
         $scripts = apply_filters('vc_edit_form_enqueue_script', WpbakeryShortcodeParams::getScripts());
         foreach ($scripts as $script) {
             $output .= "\n\n" . '<script type="text/javascript" src="' . $script . '"></script>';
         }
     }
     return $output;
 }
Esempio n. 16
0
	function buildEditForm() {
		$element = vc_get_param( 'element' );
		$shortCode = stripslashes( vc_get_param( 'shortcode' ) );
		WpbakeryShortcodeParams::setEnqueue( true );
		$this->removeShortCode( $element );
		$settings = WPBMap::getShortCode( $element );
		new WPBakeryShortCode_Settings( $settings );
		return do_shortcode( $shortCode );
	}
Esempio n. 17
0
    vc_map(array('name' => esc_html__('TS Products Slider', 'gon'), 'base' => 'ts_products_slider', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Content Border', 'gon'), 'param_name' => 'style_content', 'admin_label' => true, 'value' => array('Border' => 'content-border', 'No Border' => 'content-no-border'), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Product type', 'gon'), 'param_name' => 'product_type', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Columns', 'gon'), 'param_name' => 'columns', 'admin_label' => true, 'value' => 5, 'description' => esc_html__('Number of Columns', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Rows', 'gon'), 'param_name' => 'rows', 'admin_label' => true, 'value' => 1, 'description' => esc_html__('Number of Rows', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'product_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product SKU', 'gon'), 'param_name' => 'show_sku', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product short description', 'gon'), 'param_name' => 'show_short_desc', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product label', 'gon'), 'param_name' => 'show_label', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show add to cart button', 'gon'), 'param_name' => 'show_add_to_cart', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Position navigation button', 'gon'), 'param_name' => 'position_nav', 'admin_label' => true, 'value' => array('Top' => 'nav-top', 'Bottom' => 'nav-bottom'), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Margin', 'gon'), 'param_name' => 'margin', 'admin_label' => false, 'value' => '20', 'description' => esc_html__('Set margin between items', 'gon')))));
    /*** TS Products Widget ***/
    vc_map(array('name' => esc_html__('TS Products Widget', 'gon'), 'base' => 'ts_products_widget', 'class' => '', 'description' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Product type', 'gon'), 'param_name' => 'product_type', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'product_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show in a carousel slider', 'gon'), 'param_name' => 'is_slider', 'admin_label' => true, 'value' => array('No' => 0, 'Yes' => 1), 'description' => '', 'group' => 'Slider Options'), array('type' => 'textfield', 'heading' => esc_html__('Row', 'gon'), 'param_name' => 'rows', 'admin_label' => false, 'value' => 3, 'description' => esc_html__('Number of Rows for slider', 'gon'), 'group' => 'Slider Options'), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => '', 'group' => 'Slider Options'), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => '', 'group' => 'Slider Options'))));
    /*** TS Product Deals Slider ***/
    vc_map(array('name' => esc_html__('TS Product Deals Slider', 'gon'), 'base' => 'ts_product_deals_slider', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Content Border', 'gon'), 'param_name' => 'style_content', 'admin_label' => true, 'value' => array('Border' => 'content-border', 'No Border' => 'content-no-border'), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Item Layout', 'gon'), 'param_name' => 'layout', 'admin_label' => true, 'value' => array('Grid' => 'grid', 'List' => 'list'), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Columns', 'gon'), 'param_name' => 'columns', 'admin_label' => false, 'value' => 4, 'description' => esc_html__('Number of Columns', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 5, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'product_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show counter', 'gon'), 'param_name' => 'show_counter', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Counter position', 'gon'), 'param_name' => 'counter_position', 'admin_label' => false, 'value' => array('Bottom' => 'bottom', 'On thumbnail' => 'on-thumbnail'), 'description' => '', 'dependency' => array('element' => 'show_counter', 'value' => array('1'))), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product SKU', 'gon'), 'param_name' => 'show_sku', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product short description', 'gon'), 'param_name' => 'show_short_desc', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product label', 'gon'), 'param_name' => 'show_label', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show add to cart button', 'gon'), 'param_name' => 'show_add_to_cart', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Margin', 'gon'), 'param_name' => 'margin', 'admin_label' => false, 'value' => '20', 'description' => esc_html__('Set margin between items', 'gon')))));
    /*** TS Product Categories Slider ***/
    vc_map(array('name' => esc_html__('TS Product Categories Slider', 'gon'), 'base' => 'ts_product_categories_slider', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Columns', 'gon'), 'param_name' => 'columns', 'admin_label' => true, 'value' => 4, 'description' => esc_html__('Number of Columns', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 5, 'description' => esc_html__('Number of Product Categories', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Parent', 'gon'), 'param_name' => 'parent', 'admin_label' => true, 'settings' => array('multiple' => false, 'sortable' => true, 'unique_values' => true), 'value' => '', 'description' => esc_html__('Select a category. Get direct children of this category', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Child Of', 'gon'), 'param_name' => 'child_of', 'admin_label' => true, 'settings' => array('multiple' => false, 'sortable' => true, 'unique_values' => true), 'value' => '', 'description' => esc_html__('Select a category. Get all descendents of this category', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'ids', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => esc_html__('Include these categories', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Hide empty product categories', 'gon'), 'param_name' => 'hide_empty', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product category title', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Margin', 'gon'), 'param_name' => 'margin', 'admin_label' => false, 'value' => '0', 'description' => esc_html__('Set margin between items', 'gon')))));
    /*** TS Products In Category Tabs ***/
    vc_map(array('name' => esc_html__('TS Products In Category Tabs', 'gon'), 'base' => 'ts_products_in_category_tabs', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'colorpicker', 'heading' => esc_html__('Color', 'gon'), 'param_name' => 'color', 'admin_label' => true, 'value' => '#40bea7', 'description' => ''), array('type' => 'iconpicker', 'heading' => esc_html__('Icon', 'gon'), 'param_name' => 'icon_fontawesome', 'admin_label' => true, 'value' => 'fa fa-info-circle', 'settings' => array('emptyIcon' => false, 'iconsPerPage' => 4000), 'description' => esc_html__('Add this icon before the block title', 'gon')), array('type' => 'attach_image', 'heading' => esc_html__('Custom Icon', 'gon'), 'param_name' => 'icon_image', 'admin_label' => false, 'value' => '', 'description' => ''), array('type' => 'attach_images', 'heading' => esc_html__('Banners', 'gon'), 'param_name' => 'banners', 'admin_label' => false, 'value' => '', 'description' => esc_html__('Display these banners on the right side', 'gon')), array('type' => 'textarea', 'heading' => esc_html__('Links for banners', 'gon'), 'param_name' => 'links', 'admin_label' => false, 'value' => '', 'description' => esc_html__('A comma separated list of links. Ex: if you have 3 banners, the value of this field should be "link1, link2, link3"', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Product type', 'gon'), 'param_name' => 'product_type', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Columns', 'gon'), 'param_name' => 'columns', 'admin_label' => true, 'value' => 3, 'description' => esc_html__('Number of Columns', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Categories', 'gon'), 'param_name' => 'product_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => ''), array('type' => 'autocomplete', 'heading' => esc_html__('Parent Category', 'gon'), 'param_name' => 'parent_cat', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => false, 'sortable' => false, 'unique_values' => true), 'description' => esc_html__('Each tab will be a sub category of this category. This option is available when the Product Categories option is empty', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Include children', 'gon'), 'param_name' => 'include_children', 'admin_label' => true, 'value' => array('No' => 0, 'Yes' => 1), 'description' => esc_html__('Load the products of sub categories in each tab', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Show general tab', 'gon'), 'param_name' => 'show_general_tab', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => esc_html__('Get products from all categories or sub categories', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('General tab heading', 'gon'), 'param_name' => 'general_tab_heading', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Product type of general tab', 'gon'), 'param_name' => 'product_type_general_tab', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product SKU', 'gon'), 'param_name' => 'show_sku', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product short description', 'gon'), 'param_name' => 'show_short_desc', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product label', 'gon'), 'param_name' => 'show_label', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show add to cart button', 'gon'), 'param_name' => 'show_add_to_cart', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show see more button', 'gon'), 'param_name' => 'show_see_more_button', 'admin_label' => true, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('See more button label', 'gon'), 'param_name' => 'see_more_button_text', 'admin_label' => true, 'value' => 'See more', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show in a carousel slider', 'gon'), 'param_name' => 'is_slider', 'admin_label' => true, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Rows', 'gon'), 'param_name' => 'rows', 'admin_label' => true, 'value' => array('1' => '1', '2' => '2'), 'description' => esc_html__('Number of Rows in slider', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''))));
    /*** TS Products In Sub Category Tabs ***/
    vc_map(array('name' => esc_html__('TS Products In Sub Category Tabs', 'gon'), 'base' => 'ts_products_in_sub_category_tabs', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'colorpicker', 'heading' => esc_html__('Color title', 'gon'), 'param_name' => 'color_title', 'admin_label' => true, 'value' => '#66b1d4', 'description' => ''), array('type' => 'iconpicker', 'heading' => esc_html__('Icon', 'gon'), 'param_name' => 'icon_fontawesome', 'admin_label' => true, 'value' => 'fa fa-info-circle', 'settings' => array('emptyIcon' => false, 'iconsPerPage' => 4000), 'description' => esc_html__('Add this icon before the block title', 'gon')), array('type' => 'attach_image', 'heading' => esc_html__('Custom Icon', 'gon'), 'param_name' => 'icon_image', 'admin_label' => false, 'value' => '', 'description' => ''), array('type' => 'colorpicker', 'heading' => esc_html__('Color icon', 'gon'), 'param_name' => 'color_icon', 'admin_label' => true, 'value' => '#73d2ff', 'description' => ''), array('type' => 'attach_images', 'heading' => esc_html__('Banners', 'gon'), 'param_name' => 'banners', 'admin_label' => false, 'value' => '', 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Banner position', 'gon'), 'param_name' => 'banner_position', 'admin_label' => true, 'value' => array('Bottom' => 'bottom', 'Top' => 'top'), 'description' => esc_html__('Display the banners on the top or bottom of products', 'gon')), array('type' => 'textarea', 'heading' => esc_html__('Links for banners', 'gon'), 'param_name' => 'links', 'admin_label' => false, 'value' => '', 'description' => esc_html__('A comma separated list of links. Ex: if you have 3 banners, the value of this field should be "link1, link2, link3"', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Product type', 'gon'), 'param_name' => 'product_type', 'admin_label' => true, 'value' => array('Recent' => 'recent', 'Sale' => 'sale', 'Featured' => 'featured', 'Best Selling' => 'best_selling', 'Top Rated' => 'top_rated'), 'description' => esc_html__('Select type of product', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit', 'gon'), 'param_name' => 'per_page', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Products', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Product Category', 'gon'), 'param_name' => 'product_cat', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => false, 'sortable' => false, 'unique_values' => true), 'description' => esc_html__('You have to choose at least one category. Each tab will be a sub category of this category', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('Limit sub categories', 'gon'), 'param_name' => 'limit_sub_cat', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Number of Sub Categories. If this value is 0, the tab wont be displayed', 'gon')), array('type' => 'textfield', 'heading' => esc_html__('The text of link to category page', 'gon'), 'param_name' => 'link_all_text', 'admin_label' => true, 'value' => 'All', 'description' => ''), array('type' => 'autocomplete', 'heading' => esc_html__('Featured product', 'gon'), 'param_name' => 'featured_product', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => false, 'sortable' => false, 'unique_values' => true), 'description' => esc_html__('This product will be displayed on the left side', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Show product image', 'gon'), 'param_name' => 'show_image', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product name', 'gon'), 'param_name' => 'show_title', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product SKU', 'gon'), 'param_name' => 'show_sku', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product price', 'gon'), 'param_name' => 'show_price', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product short description', 'gon'), 'param_name' => 'show_short_desc', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product rating', 'gon'), 'param_name' => 'show_rating', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product label', 'gon'), 'param_name' => 'show_label', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show product categories', 'gon'), 'param_name' => 'show_categories', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show add to cart button', 'gon'), 'param_name' => 'show_add_to_cart', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Show navigation button', 'gon'), 'param_name' => 'show_nav', 'admin_label' => false, 'value' => array('No' => 0, 'Yes' => 1), 'description' => ''), array('type' => 'dropdown', 'heading' => esc_html__('Auto play', 'gon'), 'param_name' => 'auto_play', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''))));
    /*** TS List Of Product Categories ***/
    vc_map(array('name' => esc_html__('TS List Of Product Categories', 'gon'), 'base' => 'ts_list_of_product_categories', 'class' => '', 'category' => 'Theme-Sky', 'params' => array(array('type' => 'textfield', 'heading' => esc_html__('Block title', 'gon'), 'param_name' => 'title', 'admin_label' => true, 'value' => '', 'description' => ''), array('type' => 'attach_image', 'heading' => esc_html__('Background image', 'gon'), 'param_name' => 'bg_image', 'admin_label' => false, 'value' => '', 'description' => ''), array('type' => 'autocomplete', 'heading' => esc_html__('Product Category', 'gon'), 'param_name' => 'product_cat', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => false, 'sortable' => false, 'unique_values' => true), 'description' => esc_html__('Display sub categories of this category', 'gon')), array('type' => 'dropdown', 'heading' => esc_html__('Include parent category in list', 'gon'), 'param_name' => 'include_parent', 'admin_label' => false, 'value' => array('Yes' => 1, 'No' => 0), 'description' => ''), array('type' => 'textfield', 'heading' => esc_html__('Number of Sub Categories', 'gon'), 'param_name' => 'limit_sub_cat', 'admin_label' => true, 'value' => 6, 'description' => esc_html__('Leave blank to show all', 'gon')), array('type' => 'autocomplete', 'heading' => esc_html__('Include these categories', 'gon'), 'param_name' => 'include_cats', 'admin_label' => true, 'value' => '', 'settings' => array('multiple' => true, 'sortable' => true, 'unique_values' => true), 'description' => esc_html__('If you set the Product Category option above, this option wont be available', 'gon')))));
}
/*** Add Shortcode Param ***/
WpbakeryShortcodeParams::addField('ts_category', 'ts_product_catgories_shortcode_param');
if (!function_exists('ts_product_catgories_shortcode_param')) {
    function ts_product_catgories_shortcode_param($settings, $value)
    {
        $categories = ts_get_list_categories_shortcode_param(0, $settings);
        $arr_value = explode(',', $value);
        ob_start();
        ?>
		<input type="hidden" class="wpb_vc_param_value wpb-textinput product_cats textfield ts-hidden-selected-categories" name="<?php 
        echo esc_attr($settings['param_name']);
        ?>
" value="<?php 
        echo esc_attr($value);
        ?>
" />
		<div class="categorydiv">