File: /home/shaping-sar.ru/public_html/wp-content/themes/beauty spa/builder/params/custom_params.php
<?php
if ( in_array( 'js_composer/js_composer.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) )
{
if(class_exists('WpbakeryShortcodeParams'))
{
function add_custum_shortcode_param( $name, $form_field_callback, $script_url = null ) {
return WpbakeryShortcodeParams::addField( $name, $form_field_callback, $script_url );
}
add_custum_shortcode_param('social_upload', 'iz_vc_social', get_template_directory_uri(). '/builder/assets/js/vc_js.js');
function iz_vc_social($settings, $value)
{
$dependency = vc_generate_dependencies_attributes($settings);
$html = '<div class="iz_add_social">';
$html .= '<span class="iz-backend-font-icon"><i class="iz-icon '.esc_attr($value).'"></i></span>';
$html .= '</div>';
$html .= '<button class="button iz_vc_add_icon" type="button">'.__('Choose Icon', IZ_LANG).' </button>';
$html .= '<input name="'.$settings['param_name'].'" class="iz-icon-value wpb_vc_param_value wpb-textinput '.$settings['param_name'].' '.$settings['type'].'_field" type="hidden" value="'.esc_attr($value).'" '.$dependency.'>';
return $html;
}
add_custum_shortcode_param('iz_about', 'iz_about', get_template_directory_uri(). '/builder/assets/js/vc_js.js');
function iz_about($settings, $value)
{
$dependency = vc_generate_dependencies_attributes($settings);
$return_val = $value;
parse_str(urldecode($value), $time);
$html = '<div class="iz_add_hours">';
$html .= '<table width="100%">';
$html .= '<thead>';
$html .= '<tr>';
// $html .= '<td width="20%">'.__('Day', IZ_LANG).'</td>';
$html .= '<td>'.__('Item', IZ_LANG).'</td>';
$html .= '<td width="20%">'.__('Delete', IZ_LANG).'</td>';
$html .= '</tr>';
$html .= '</thead>';
$html .= '<tbody>';
if(is_array($time) && count($time) > 0) :
$i=0;
foreach ($time as $key => $val) {
$i++;
$html .= '<tr data-index="'.$i.'">';
$html .= '<td><input name="'.$i.'[item]" value="'.esc_attr($val['item']).'" type="text" class="iz_input"></td>';
$html .= '<td><button type="button" class="iz_delete_time button">'.__('Delete', IZ_LANG).'</button></td>';
$html .= '</tr>';
}
else :
$html .= '<tr data-index="1">';
$html .= '<td><input name="1[item]" value="" type="text" class="iz_input"></td>';
$html .= '<td><button type="button" class="iz_delete_time button">'.__('Delete', IZ_LANG).'</button></td>';
$html .= '</tr>';
endif;
$html .= '</tbody>';
$html .= '<tfoot>';
$html .= '<tr><td colspan="3"><button type="button" class="button iz_add_hour">'.__('Add', IZ_LANG).'</button></td></tr>';
$html .= '</tfoot>';
$html .= '</table>';
$html .= '</div>';
$html .= '<input name="'.$settings['param_name'].'" class="iz_about_hours wpb_vc_param_value wpb-textinput '.$settings['param_name'].' '.$settings['type'].'_field" type="hidden" value="'.esc_attr($return_val).'" '.$dependency.'>';
return $html;
}
add_custum_shortcode_param('social_upload', 'awe_vc_social', get_template_directory_uri(). '/builder/assets/js/vc_js.js');
function awe_vc_social($settings, $value)
{
$dependency = vc_generate_dependencies_attributes($settings);
$val = $value;
$html = '<div class="awe_add_social">';
parse_str(urldecode($value), $social);
if(is_array($social))
{
$i = 1;
foreach ($social as $key => $value) {
$html .= '<div class="social-item" data-item="'.$i.'">';
$html .= '<input class="awe-input" name="'.$i.'[link]" value="'.$value['link'].'" type="text" >';
$html .= '<span class="awe-change-icon"><i class="mdicon '.$value['icon'].'"></i>';
$html .= '<input class="awe-input" name="'.$i.'[icon]" value="'.$value['icon'].'" type="hidden" >';
$html .= '</span>';
$html .= '<a href="#" class="awe-del-social">delete</a>';
$html .= '</div>';
$i++;
}
}
$html .= '</div>';
$html .= '<div class="awe-add"><button class="awe-button-add" type="button">'.__('Add social', IZ_LANG).' </button></div>';
$html .= '<input name="'.$settings['param_name'].'" class="awe-social-value wpb_vc_param_value wpb-textinput '.$settings['param_name'].' '.$settings['type'].'_field" type="hidden" value="'.$val.'" '.$dependency.'>';
return $html;
}
}
}