Import legacy nurinda.co.id website

This commit is contained in:
dirga committed 2026-10-01 14:27:19 +07:00
1 parent 3f59bb9038
commit 6e21646ac4
13389 files changed
+3246690

No files matched your search

@@ -0,0 +1 @@
<?php␍/*Silence is Golden*/␍?>
@@ -0,0 +1,172 @@
<?php
/*
* Module - Animation Block
*/
if(!class_exists('Ultimate_Animation')){
class Ultimate_Animation{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'animate_shortcode_mapper'));
}
add_shortcode('ult_animation_block',array($this,'animate_shortcode'));
}/* end constructor*/
function animate_shortcode($atts, $content=null){
//wp_enqueue_script('ultimate-appear');
//wp_enqueue_script('ultimate-custom');
$output = $animation = $opacity = $opacity_start_effect = $animation_duration = $animation_delay = $animation_iteration_count = $inline_disp = $el_class = '';
$opacity_start_effect_data = '';
extract(shortcode_atts(array(
"animation" => "none",
"opacity" => "set",
"opacity_start_effect" => "",
"animation_duration" => "3",
"animation_delay" => "0",
"animation_iteration_count" => "1",
"inline_disp" => "",
"css" => "",
"el_class" => "",
),$atts));
$style = $infi = $mobile_opt = $css_class = '';
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), "ult_createlink", $atts );
$css_class = esc_attr( $css_class );
$ultimate_animation = get_option('ultimate_animation');
if($ultimate_animation == "disable"){
$mobile_opt = 'ult-no-mobile';
}
if($inline_disp !== ''){
$style .= 'display:inline-block;';
}
if($opacity == "set"){
$style .= 'opacity:0;';
$el_class .= ' ult-animate-viewport ';
$opacity_start_effect_data = 'data-opacity_start_effect="'.esc_attr( $opacity_start_effect ).'"';
}
$inifinite_arr = array("InfiniteRotate", "InfiniteDangle","InfiniteSwing","InfinitePulse","InfiniteHorizontalShake","InfiniteBounce","InfiniteFlash","InfiniteTADA");
if($animation_iteration_count == 0 || in_array($animation,$inifinite_arr)){
$animation_iteration_count = 'infinite';
$animation = 'infinite '.$animation;
}
$output .= '<div class="ult-animation '.esc_attr( $el_class ).' '.esc_attr( $mobile_opt ).' '. esc_attr( $css_class ) .'" data-animate="'. esc_attr( $animation ) .'" data-animation-delay="'. esc_attr( $animation_delay ) .'" data-animation-duration="'. esc_attr( $animation_duration ) .'" data-animation-iteration="'. esc_attr( $animation_iteration_count ) .'" style="'.esc_attr( $style ).'" '.$opacity_start_effect_data.'>';
$output .= do_shortcode($content);
$output .= '</div>';
return $output;
} /* end animate_shortcode()*/
function animate_shortcode_mapper(){
if(function_exists('vc_map')){
vc_map(
array(
"name" => __("Animation Block", "ultimate_vc"),
"base" => "ult_animation_block",
"icon" => "animation_block",
"class" => "animation_block",
"as_parent" => array('except' => 'ult_animation_block'),
"content_element" => true,
"controls" => "full",
"show_settings_on_create" => true,
"category" => "Ultimate VC Addons",
"description" => __("Apply animations everywhere.",'ultimate_vc'),
//"is_container" => true,
"params" => array(
// add params same as with any other content element
array(
"type" => "animator",
"class" => "",
"heading" => __("Animation","ultimate_vc"),
"param_name" => "animation",
"value" => "",
//"description" => __("","smile"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Animation Duration","ultimate_vc"),
"param_name" => "animation_duration",
"value" => 3,
"min" => 1,
"max" => 100,
"suffix" => "s",
"description" => __("How long the animation effect should last. Decides the speed of effect.","ultimate_vc"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Animation Delay","ultimate_vc"),
"param_name" => "animation_delay",
"value" => 0,
"min" => 1,
"max" => 100,
"suffix" => "s",
"description" => __("Delays the animation effect for seconds you enter above.","ultimate_vc"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Animation Repeat Count","ultimate_vc"),
"param_name" => "animation_iteration_count",
"value" => 1,
"min" => 0,
"max" => 100,
"suffix" => "",
"description" => __("The animation effect will repeat to the count you enter above. Enter 0 if you want to repeat it infinitely.","ultimate_vc"),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Hide Elements Until Delay", "ultimate_vc"),
"param_name" => "opacity",
"admin_label" => true,
"value" => "set",
"default_set" => true,
"options" => array(
"set" => array(
"label" => __("If set to yes, the elements inside block will stay hidden until animation starts (depends on delay settings above).",'ultimate_vc'),
"on" => "Yes",
"off" => "No",
),
),
//"description" => __("", "woocomposer"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Viewport Position", "ultimate_vc"),
"param_name" => "opacity_start_effect",
"suffix" => "%",
//"admin_label" => true,
"value" => "90",
"description" => __("The area of screen from top where animation effects will start working.", "ultimate_vc"),
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc")
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/pd-ct' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
),
"js_view" => 'VcColumnView'
)
);/* end vc_map*/
} /* end vc_map check*/
}/*end animate_shortcode_mapper()*/
} /* end class Ultimate_Animation*/
// Instantiate the class
new Ultimate_Animation;
if ( class_exists( 'WPBakeryShortCodesContainer' ) && !class_exists( 'WPBakeryShortCode_ult_animation_block' ) ) {
class WPBakeryShortCode_ult_animation_block extends WPBakeryShortCodesContainer {
}
}
}
@@ -0,0 +1,859 @@
<?php
/*
* Module - Advanced Buttons
*/
if(!class_exists("Ultimate_Buttons")){
class Ultimate_Buttons{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action( 'init', array($this, 'init_buttons') );
}
add_shortcode( 'ult_buttons',array($this,'ult_buttons_shortcode'));
add_action( 'admin_enqueue_scripts', array( $this, 'button_admin_scripts') );
add_action( "wp_enqueue_scripts", array( $this, "advanced_button_scripts"),1 );
}
function advanced_button_scripts() {
Ultimate_VC_Addons::ultimate_register_style( 'ult-btn', 'advanced-buttons' );
}
function button_admin_scripts($hook){
if($hook == "post.php" || $hook == "post-new.php"){
$bsf_dev_mode = bsf_get_option('dev_mode');
if($bsf_dev_mode === 'enable') {
$js_path = UAVC_URL.'/assets/js/';
$css_path = UAVC_URL.'/assets/css/';
$ext = '';
wp_enqueue_style( 'ult-button', $css_path.'advanced-buttons'.$ext.'.css' );
}
}
}
function ult_buttons_shortcode($atts){
$output = $btn_title = $btn_link = $btn_size = $btn_width = $btn_height = $btn_hover = $btn_bg_color = $btn_radius = $btn_shadow = '';
$btn_shadow_color = $btn_bg_color_hover = $btn_border_style = $btn_color_border = $btn_border_size = $btn_shadow_size = $el_class = '';
$btn_font_family = $btn_font_style = $btn_title_color = $btn_font_size = $icon = $icon_size = $icon_color = $btn_icon_pos = $btn_anim_effect = '';
$btn_padding_left = $btn_padding_top = $button_bg_img = $btn_title_color_hover = $btn_align = $btn_color_border_hover = $btn_shadow_color_hover = '';
$btn_shadow_click = $enable_tooltip = $tooltip_text = $tooltip_pos = $rel_attr = $btn_line_height = $target = $link_title = $ult_btn_custom_onclick = $ult_btn_custom_onclick_code = '';
extract(shortcode_atts(array(
'btn_title' => '',
'btn_link' => '',
'btn_size' => 'ubtn-normal',
'btn_width' => '',
'btn_height' => '',
'btn_padding_left' => '',
'btn_padding_top' => '',
'btn_hover' => 'ubtn-no-hover-bg',
'btn_bg_color' => '#e0e0e0',
'btn_radius' => '',
'btn_shadow' => '',
'btn_shadow_color' => '',
'btn_shadow_size' => '',
'btn_bg_color_hover' => '',
'btn_title_color_hover' => '',
'btn_border_style' => '',
'btn_color_border' => '',
'btn_color_border_hover' => '',
'btn_border_size' => '',
'btn_font_family' => '',
'btn_font_style' => '',
'btn_title_color' => '#000000',
'btn_font_size' => '',
'btn_line_height' => '',
'icon' => '',
'icon_size' => '',
'icon_color' => '',
'btn_icon_pos' => '',
'btn_anim_effect' => 'none',
'button_bg_img' => '',
'btn_align' => 'ubtn-left',
'btn_shadow_color_hover' => '',
'btn_shadow_click' => '',
'enable_tooltip' => '',
'tooltip_text' => '',
'tooltip_pos' => 'left',
'rel_attr' => '',
'el_class' => '',
'css_adv_btn' => '',
'ult_btn_custom_onclick' => '',
'ult_btn_custom_onclick_code' => '',
),$atts));
$style = $hover_style = $btn_style_inline = $link_sufix = $link_prefix = $img = $shadow_hover = $shadow_click = $shadow_color = $box_shadow = $main_extra_class = '';
$main_extra_class = $el_class;
$tooltip = $tooltip_class = $el_class = $css_btn_design = '';
$el_class .= ' '.$btn_anim_effect.' ';
$uniqid = uniqid();
$tooltip_class = 'tooltip-'.$uniqid;
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$css_btn_design = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_adv_btn, ' ' ), "ult_buttons", $atts );
$css_btn_design = esc_attr( $css_btn_design );
if($enable_tooltip == "yes"){
wp_enqueue_script('ultimate-tooltip');
wp_enqueue_style('ultimate-tooltip');
$tooltip .= 'data-toggle="tooltip" data-placement="'.esc_attr( $tooltip_pos ).'" title="'.esc_attr( $tooltip_text ).'"';
$tooltip_class .= " ubtn-tooltip ".$tooltip_pos;
}
if($btn_shadow_click !== "enable"){
$shadow_click = 'none';
}
if($btn_shadow_color_hover == "")
$shadow_color = $btn_shadow_color;
else
$shadow_color = $btn_shadow_color_hover;
$alt = 'icon';
if($button_bg_img !== ''){
$img = apply_filters('ult_get_img_single', $button_bg_img, 'url');
$alt = apply_filters('ult_get_img_single', $button_bg_img, 'alt');
}
if($btn_link !== ''){
$href = vc_build_link($btn_link);
if($href['url'] !== ""){
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
if( $rel == "" ) {
$rel .= esc_attr($rel_attr);
}else {
$rel .= ' ' . esc_attr($rel_attr);
}
if($btn_size == "ubtn-block"){
$tooltip_class .= ' ubtn-block';
}
$link_prefix .= '<a class="ubtn-link '.esc_attr($is_vc_49_plus).' '.esc_attr($btn_align).' '.esc_attr($btn_size).' '.esc_attr($main_extra_class).'" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'>';
$link_sufix .= '</a>';
}
} else {
if($enable_tooltip !== ""){
$link_prefix .= '<span class="'.esc_attr( $btn_align ).'">';
$link_sufix .= '</span>';
}
}
if($btn_icon_pos !== '' && $icon !== 'none' && $icon !== '')
$el_class .= ' ubtn-sep-icon '.$btn_icon_pos.' ';
if($btn_font_family != '')
{
$mhfont_family = get_ultimate_font_family($btn_font_family);
$btn_style_inline .= 'font-family:\''.$mhfont_family.'\';';
}
$btn_style_inline .= get_ultimate_font_style($btn_font_style);
$adv_btn_id = 'ubtn-'.rand(1000, 9999);
if (is_numeric($btn_font_size)) {
$btn_font_size = 'desktop:'.$btn_font_size.'px;';
}
if(is_numeric($btn_line_height)){
$btn_line_height = 'desktop:'.$btn_line_height.'px';
}
$advbtnargs = array(
'target' => '#'.$adv_btn_id,
'media_sizes' => array(
'font-size' => $btn_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $btn_line_height
),
);
$data_list = get_ultimate_vc_responsive_media_css($advbtnargs);
$style .= $btn_style_inline;
if($btn_size == 'ubtn-custom'){
$style .= 'width:'.$btn_width.'px;';
$style .= 'min-height:'.$btn_height.'px;';
$style .= 'padding:'.$btn_padding_top.'px '.$btn_padding_left.'px;';
}
if($btn_border_style !== ''){
$style .= 'border-radius:'.$btn_radius.'px;';
$style .= 'border-width:'.$btn_border_size.'px;';
$style .= 'border-color:'.$btn_color_border.';';
$style .= 'border-style:'.$btn_border_style.';';
} else {
$style .= 'border:none;';
}
if($btn_shadow !== ''){
switch($btn_shadow){
case 'shd-top':
$style .= 'box-shadow: 0 -'.$btn_shadow_size.'px '.$btn_shadow_color.';';
// $style .= 'bottom: '.($btn_shadow_size-3).'px;';
$box_shadow .= '0 -'.$btn_shadow_size.'px '.$btn_shadow_color.';';
if($shadow_click !== "none")
$shadow_hover .= '0 -3px '.$shadow_color.';';
else
$shadow_hover .= '0 -'.$btn_shadow_size.'px '.$shadow_color.';';
break;
case 'shd-bottom':
$style .= 'box-shadow: 0 '.$btn_shadow_size.'px '.$btn_shadow_color.';';
// $style .= 'top: '.($btn_shadow_size-3).'px;';
$box_shadow .= '0 '.$btn_shadow_size.'px '.$btn_shadow_color.';';
if($shadow_click !== "none")
$shadow_hover .= '0 3px '.$shadow_color.';';
else
$shadow_hover .= '0 '.$btn_shadow_size.'px '.$shadow_color.';';
break;
case 'shd-left':
$style .= 'box-shadow: -'.$btn_shadow_size.'px 0 '.$btn_shadow_color.';';
// $style .= 'right: '.($btn_shadow_size-3).'px;';
$box_shadow .= '-'.$btn_shadow_size.'px 0 '.$btn_shadow_color.';';
if($shadow_click !== "none")
$shadow_hover .= '-3px 0 '.$shadow_color.';';
else
$shadow_hover .= '-'.$btn_shadow_size.'px 0 '.$shadow_color.';';
break;
case 'shd-right':
$style .= 'box-shadow: '.$btn_shadow_size.'px 0 '.$btn_shadow_color.';';
// $style .= 'left: '.($btn_shadow_size-3).'px;';
$box_shadow .= $btn_shadow_size.'px 0 '.$btn_shadow_color.';';
if($shadow_click !== "none")
$shadow_hover .= '3px 0 '.$shadow_color.';';
else
$shadow_hover .= $btn_shadow_size.'px 0 '.$shadow_color.';';
break;
}
}
$btn_custom_onclick_code = '';
if ( ! empty( $ult_btn_custom_onclick ) && $ult_btn_custom_onclick_code ) {
$btn_custom_onclick_code = 'onclick="' . esc_attr( ult_prepareAtts( $ult_btn_custom_onclick_code ) ) . '"';
}
if($btn_bg_color !== ''){
$style .= 'background: '.$btn_bg_color.';';
}
if($btn_title_color !== ''){
$style .= 'color: '.$btn_title_color.';';
}
if($btn_shadow){
$el_class .= ' ubtn-shd ';
}
if($btn_align){
$el_class .= ' '.$btn_align.' ';
}
if($btn_title == "" && $icon !== ""){
$el_class .= ' ubtn-only-icon ';
}
if($btn_link === '') {
$el_class .= $main_extra_class;
}
$output .= '<button type="button" id="'. esc_attr( $adv_btn_id ).'" '.$btn_custom_onclick_code.' class="ubtn '.esc_attr( $is_vc_49_plus ).' ult-responsive '.esc_attr($btn_size).' '.esc_attr($btn_hover).' '.esc_attr($el_class).' '.esc_attr($btn_shadow).' '.esc_attr($tooltip_class).'" '.$tooltip.' data-hover="'.esc_attr($btn_title_color_hover).'" data-border-color="'.esc_attr($btn_color_border).'" data-bg="'.esc_attr($btn_bg_color).'" data-hover-bg="'.esc_attr($btn_bg_color_hover).'" data-border-hover="'.esc_attr($btn_color_border_hover).'" data-shadow-hover="'.esc_attr($shadow_hover).'" data-shadow-click="'.esc_attr($shadow_click).'" data-shadow="'.esc_attr($box_shadow).'" data-shd-shadow="'.esc_attr($btn_shadow_size).'" '.$data_list.' style="'.esc_attr($style).'">';
if($icon !== ''){
$output .= '<span class="ubtn-data ubtn-icon"><i class="'.esc_attr($icon).'" style="font-size:'.esc_attr($icon_size).'px;color:'.esc_attr($icon_color).';"></i></span>';
}
$output .= '<span class="ubtn-hover" style="background-color:'.esc_attr($btn_bg_color_hover).'"></span>';
$output .= '<span class="ubtn-data ubtn-text " >'.esc_html( $btn_title ).'</span>';
$output .= '</button>';
$output = $link_prefix.$output.$link_sufix;
// Add a wrapper class to handle bottom margin
$wrapper_class = '';
switch ($btn_align) {
case 'ubtn-inline': $wrapper_class = 'ubtn-ctn-inline'; break;
case 'ubtn-center': $wrapper_class = 'ubtn-ctn-center'; break;
case 'ubtn-right': $wrapper_class = 'ubtn-ctn-right'; break;
case 'ubtn-left':
default: $wrapper_class = 'ubtn-ctn-left'; break;
}
if($img !== ''){
$output = '<div class="'.esc_attr($wrapper_class).' '.esc_attr($main_extra_class).'">'.$output.'</div>';
}else{
$output = '<div class="'.esc_attr($css_btn_design).' '.esc_attr($wrapper_class).' '.esc_attr($main_extra_class).'">'.$output.'</div>';
}
if($img !== ''){
$html = '<div class="ubtn-img-container '.esc_attr($css_btn_design).'">';
$html .= '<img src="'.esc_url(apply_filters( 'ultimate_images', $img )).'" alt="'.esc_attr($alt).'"/>';
$html .= $output;
$html .= '</div>';
$output = $html;
}
if($enable_tooltip !== ""){
$output .= '<script>
jQuery(function () {
jQuery(".tooltip-'.esc_attr($uniqid).'").bsf_tooltip();
})
</script>';
}
$is_preset = false;
if(isset($_GET['preset'])) { //It will retrieve settings array
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>'; // remove backslash once copied
}
return $output;
}
function init_buttons(){
if(function_exists("vc_map"))
{
$json = ultimate_get_icon_position_json();
vc_map(
array(
"name" => __("Advanced Button", "ultimate_vc"),
"base" => "ult_buttons",
"icon" => "ult_buttons",
"class" => "ult_buttons",
"content_element" => true,
"controls" => "full",
"category" => "Ultimate VC Addons",
"description" => __("Create creative buttons.","ultimate_vc"),
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __("Button Title","ultimate_vc"),
"param_name" => "btn_title",
"value" => "",
"description" => "",
"group" => "General",
"admin_label" => true
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Button Link","ultimate_vc"),
"param_name" => "btn_link",
"value" => "",
"description" => "",
"group" => "General"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Button Alignment","ultimate_vc"),
"param_name" => "btn_align",
"value" => array(
"Left Align" => "ubtn-left",
"Center Align" => "ubtn-center",
"Right Align" => "ubtn-right",
"Inline" => "ubtn-inline",
),
"description" => "",
"group" => "General"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Button Size","ultimate_vc"),
"param_name" => "btn_size",
"value" => array(
__("Normal Button","ultimate_vc") => "ubtn-normal",
__("Mini Button","ultimate_vc") => "ubtn-mini",
__("Small Button","ultimate_vc") => "ubtn-small",
__("Large Button","ultimate_vc") => "ubtn-large",
__("Button Block","ultimate_vc") => "ubtn-block",
__("Custom Size","ultimate_vc") => "ubtn-custom",
),
"description" => "",
"group" => "General"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Button Width","ultimate_vc"),
"param_name" => "btn_width",
"value" => "",
"min" => 10,
"max" => 1000,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "btn_size", "value" => "ubtn-custom" ),
"group" => "General"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Button Height","ultimate_vc"),
"param_name" => "btn_height",
"value" => "",
"min" => 10,
"max" => 1000,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "btn_size", "value" => "ubtn-custom" ),
"group" => "General"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Button Left / Right Padding","ultimate_vc"),
"param_name" => "btn_padding_left",
"value" => "",
"min" => 10,
"max" => 1000,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "btn_size", "value" => "ubtn-custom" ),
"group" => "General"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Button Top / Bottom Padding","ultimate_vc"),
"param_name" => "btn_padding_top",
"value" => "",
"min" => 10,
"max" => 1000,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "btn_size", "value" => "ubtn-custom" ),
"group" => "General"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Button Title Color","ultimate_vc"),
"param_name" => "btn_title_color",
"value" => "#000000",
"description" => "",
"group" => "General"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color","ultimate_vc"),
"param_name" => "btn_bg_color",
"value" => "#e0e0e0",
"description" => "",
"group" => "General"
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc"),
"group" => "General"
),
array(
"type" => "textfield",
"heading" => __("Rel Attribute", "ultimate_vc"),
"param_name" => "rel_attr",
"description" => __("This is useful when you want to trigger third party features. Example- prettyPhoto, thickbox etc", "ultimate_vc"),
"group" => "General",
),
array(
'type' => 'checkbox',
'heading' => __( 'Advanced on click action', 'ultimate_vc' ),
'param_name' => 'ult_btn_custom_onclick',
'description' => __( 'Insert inline onclick javascript action.', 'ultimate_vc' ),
"group" => "General",
),
array(
'type' => 'textfield',
'heading' => __( 'On click code', 'ultimate_vc' ),
'param_name' => 'ult_btn_custom_onclick_code',
'description' => __( 'Enter onclick action code.', 'ultimate_vc' ),
'dependency' => array(
'element' => 'ult_btn_custom_onclick',
'not_empty' => true,
),
"group" => "General",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Button Hover Background Effect","ultimate_vc"),
"param_name" => "btn_hover",
"value" => array(
__("No Effect","ultimate_vc") => "ubtn-no-hover-bg",
__("Fade Background","ultimate_vc") => "ubtn-fade-bg",
__("Fill Background from Top","ultimate_vc") => "ubtn-top-bg",
__("Fill Background from Bottom","ultimate_vc") => "ubtn-bottom-bg",
__("Fill Background from Left","ultimate_vc") => "ubtn-left-bg",
__("Fill Background from Right","ultimate_vc") => "ubtn-right-bg",
__("Fill Background from Center Horizontally","ultimate_vc") => "ubtn-center-hz-bg",
__("Fill Background from Center Vertically","ultimate_vc") => "ubtn-center-vt-bg",
__("Fill Background from Center Diagonal","ultimate_vc") => "ubtn-center-dg-bg",
),
"description" => "",
"group" => "Background"
),
array(
"type" => "dropdown",
"class" => "no-ult-effect",
'edit_field_class' => 'ult-no-effect vc_column vc_col-sm-12',
"heading" => __("Button Hover Animation Effects","ultimate_vc"),
"param_name" => "btn_anim_effect",
"value" => array(
"No Effect" => "none",
"Grow" => "ulta-grow",
"Shrink" => "ulta-shrink",
"Pulse" => "ulta-pulse",
"Pulse Grow" => "ulta-pulse-grow",
"Pulse Shrink" => "ulta-pulse-shrink",
"Push" => "ulta-push",
"Pop" => "ulta-pop",
"Rotate" => "ulta-rotate",
"Grow Rotate" => "ulta-grow-rotate",
"Float" => "ulta-float",
"Sink" => "ulta-sink",
"Hover" => "ulta-hover",
"Hang" => "ulta-hang",
"Skew" => "ulta-skew",
"Skew Forward" => "ulta-skew-forward",
"Skew Backward" => "ulta-skew-backward",
"Wobble Horizontal" => "ulta-wobble-horizontal",
"Wobble Vertical" => "ulta-wobble-vertical",
"Wobble to Bottom Right" => "ulta-wobble-to-bottom-right",
"Wobble to Top Right" => "ulta-wobble-to-top-right",
"Wobble Top" => "ulta-wobble-top",
"Wobble Bottom" => "ulta-wobble-bottom",
"Wobble Skew" => "ulta-wobble-skew",
"Buzz" => "ulta-buzz",
"Buzz Out" => "ulta-buzz-out",
),
"description" => "",
"group" => "Background"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Hover Background Color","ultimate_vc"),
"param_name" => "btn_bg_color_hover",
"value" => "",
"description" => "",
"group" => "Background"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Hover Text Color","ultimate_vc"),
"param_name" => "btn_title_color_hover",
"value" => "",
"description" => "",
"group" => "Background"
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Button Background Image","ultimate_vc"),
"param_name" => "button_bg_img",
"value" => "",
"description" => __("Upload the image on which you want to place the button.","ultimate_vc"),
"group" => "Background"
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose, you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__('add new here','ultimate_vc')."</a>.",
"group" => "Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"group" => "Icon"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"group" => "Icon"
),
/*
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Position", "smile"),
"param_name" => "btn_icon_pos",
"value" => array(
"Icon pull from left" => "ubtn-sep-icon-left",
"Icon push to left" => "ubtn-sep-icon-left-rev",
"Icon pull from right" => "ubtn-sep-icon-right",
"Icon push to right" => "ubtn-sep-icon-right-rev",
"Icon push from top" => "ubtn-sep-icon-top-push",
"Icon push from bottom" => "ubtn-sep-icon-bottom-push",
"Icon push from left" => "ubtn-sep-icon-left-push",
"Icon push from right" => "ubtn-sep-icon-right-push",
),
"description" => "",
"group" => "Icon"
),
*/
array(
"type" => "ult_button",
"class" => "",
"heading" => __("Icon Position ","ultimate_vc"),
"param_name" => "btn_icon_pos",
"value" => "",
"json" => $json,
"description" => "",
"group" => "Icon"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Button Border Style", "ultimate_vc"),
"param_name" => "btn_border_style",
"value" => array(
"None"=> "",
"Solid"=> "solid",
"Dashed" => "dashed",
"Dotted" => "dotted",
"Double" => "double",
"Inset" => "inset",
"Outset" => "outset",
),
"description" => "",
"group" => "Styling"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "btn_color_border",
"value" => "",
"description" => "",
"dependency" => Array("element" => "btn_border_style", "not_empty" => true),
"group" => "Styling"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color on Hover", "ultimate_vc"),
"param_name" => "btn_color_border_hover",
"value" => "",
"description" => "",
"dependency" => Array("element" => "btn_border_style", "not_empty" => true),
"group" => "Styling"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "btn_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "btn_border_style", "not_empty" => true),
"group" => "Styling"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius","ultimate_vc"),
"param_name" => "btn_radius",
"value" => 3,
"min" => 0,
"max" => 500,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "btn_border_style", "not_empty" => true),
"group" => "Styling"
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_adv_btn',
'group' => __( 'Styling', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Button Shadow", "ultimate_vc"),
"param_name" => "btn_shadow",
"value" => array(
__('No Shadow','ultimate_vc') => '',
__('Shadow at Top','ultimate_vc') => 'shd-top',
__('Shadow at Bottom','ultimate_vc') => 'shd-bottom',
__('Shadow at Left','ultimate_vc') => 'shd-left',
__('Shadow at Right','ultimate_vc') => 'shd-right',
),
//"description" => __("", "smile"),
"group" => "Shadow"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Shadow Color","ultimate_vc"),
"param_name" => "btn_shadow_color",
"value" => "",
"description" => "",
"dependency" => Array("element" => "btn_shadow", "not_empty" => true),
"group" => "Shadow"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Shadow Color on Hover","ultimate_vc"),
"param_name" => "btn_shadow_color_hover",
"value" => "",
"description" => "",
"dependency" => Array("element" => "btn_shadow", "not_empty" => true),
"group" => "Shadow"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Shadow Size","ultimate_vc"),
"param_name" => "btn_shadow_size",
"value" => 5,
"min" => 0,
"max" => 100,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "btn_shadow", "not_empty" => true),
"group" => "Shadow"
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Button Click Effect", "ultimate_vc"),
"param_name" => "btn_shadow_click",
"value" => "",
"options" => array(
"enable" => array(
"label" => "",
"on" => "Yes",
"off" => "No",
)
),
"description" => __("Enable Click effect on hover", "ultimate_vc"),
"dependency" => Array("element" => "btn_shadow", "not_empty" => true),
"group" => "Shadow"
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "btn_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "btn_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "btn_font_size",
// "min" => 14,
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "btn_font_size",
"unit" => "px",
"media" => array(
/*"Large Screen" => '',*/
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "btn_line_height",
"unit" => "px",
"media" => array(
/*"Large Screen" => '',*/
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "checkbox",
"class" => "",
"heading" => __("Tooltip Options", "ultimate_vc"),
"param_name" => "enable_tooltip",
"value" => array("Enable tooltip on button" => "yes"),
"group" => "Tooltip"
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Text", "ultimate_vc"),
"param_name" => "tooltip_text",
"value" => "",
"dependency" => Array("element" => "enable_tooltip", "value" => "yes"),
"group" => "Tooltip",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Position", "ultimate_vc"),
"param_name" => "tooltip_pos",
"value" => array(
__("Tooltip from Left","ultimate_vc") => "left",
__("Tooltip from Right","ultimate_vc") => "right",
__("Tooltip from Top","ultimate_vc") => "top",
__("Tooltip from Bottom","ultimate_vc") => "bottom",
),
"description" => __("Select the tooltip position","ultimate_vc"),
"dependency" => Array("element" => "enable_tooltip", "value" => "yes"),
"group" => "Tooltip",
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/0n-7p' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
"group" => "General"
),
)
)
);
}
}
}
new Ultimate_Buttons;
if(class_exists('WPBakeryShortCode') && !class_exists('WPBakeryShortCode_ult_buttons'))
{
class WPBakeryShortCode_ult_buttons extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,839 @@
<?php
/*
Module Name: Ultimate Carousel for WPBakery Page Builder
Module URI: https://www.brainstormforce.com/demos/ultimate-carousel
*/
if ( ! class_exists( "Ultimate_Carousel" ) ) {
class Ultimate_Carousel {
function __construct() {
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action( "init", array( $this, "init_carousel_addon" ) );
}
add_shortcode( "ultimate_carousel", array( $this, "ultimate_carousel_shortcode" ) );
add_action( "wp_enqueue_scripts", array( $this, "ultimate_front_scripts" ), 1 );
add_action( "admin_enqueue_scripts", array( $this, "custom_param_styles" ) );
add_action( "admin_enqueue_scripts", array( $this, "ultimate_admin_scripts" ), 100 );
}
function custom_param_styles() {
echo '<style type="text/css">
.items_to_show.vc_shortcode-param {
background: #E6E6E6;
padding-bottom: 10px;
}
.items_to_show.ult_margin_bottom{
margin-bottom: 15px;
}
.items_to_show.ult_margin_top{
margin-top: 15px;
}
</style>';
}
function ultimate_front_scripts() {
Ultimate_VC_Addons::ultimate_register_script( 'ult-slick', 'slick', false, array( 'jquery' ), ULTIMATE_VERSION, false );
Ultimate_VC_Addons::ultimate_register_script( 'ult-slick-custom', 'slick-custom', false, array( 'jquery', 'ult-slick' ), ULTIMATE_VERSION, false );
Ultimate_VC_Addons::ultimate_register_style( 'ult-slick', 'slick' );
Ultimate_VC_Addons::ultimate_register_style( 'ult-icons', UAVC_URL.'assets/css/icons.css', true );
}
function ultimate_admin_scripts( $hook ) {
if ( $hook == "post.php" || $hook == "post-new.php" ) {
wp_enqueue_style( "ult-icons", UAVC_URL.'assets/css/icons.css' );
}
}
function init_carousel_addon() {
if ( function_exists( "vc_map" ) ) {
vc_map(
array(
"name" => __( "Advanced Carousel", "ultimate_vc" ),
"base" => "ultimate_carousel",
"icon" => "ultimate_carousel",
"class" => "ultimate_carousel",
"as_parent" => array( 'except' => 'ultimate_carousel' ),
"content_element" => true,
"controls" => "full",
"show_settings_on_create" => true,
"category" => "Ultimate VC Addons",
"description" => __( "Carousel anything.", "ultimate_vc" ),
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Slider Type", "ultimate_vc" ),
"param_name" => "slider_type",
"value" => array(
"Horizontal" => "horizontal",
"Vertical" => "vertical",
"Horizontal Full Width" => "full_width"
),
//"description" => __("","smile"),
"group" => "General",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Slides to Scroll", "ultimate_vc" ),
"param_name" => "slide_to_scroll",
"value" => array( "All visible" => "all", "One at a Time" => "single" ),
//"description" => __("","smile"),
"group" => "General",
),
array(
"type" => "text",
"param_name" => "title_text_typography",
"heading" => "<p>" . __( "Items to Show‏ -", "ultimate_vc" ) . "</p>",
"value" => "",
"edit_field_class" => "vc_col-sm-12 items_to_show ult_margin_top",
"group" => "General"
),
array(
"type" => "number",
"class" => "",
"edit_field_class" => "vc_col-sm-4 items_to_show ult_margin_bottom",
"heading" => __( "On Desktop", "ultimate_vc" ),
"param_name" => "slides_on_desk",
"value" => "5",
"min" => "1",
"max" => "25",
"step" => "1",
//"description" => __("","smile"),
"group" => "General",
),
array(
"type" => "number",
"class" => "",
"edit_field_class" => "vc_col-sm-4 items_to_show ult_margin_bottom",
"heading" => __( "On Tabs", "ultimate_vc" ),
"param_name" => "slides_on_tabs",
"value" => "3",
"min" => "1",
"max" => "25",
"step" => "1",
//"description" => __("","smile"),
"group" => "General",
),
array(
"type" => "number",
"class" => "",
"edit_field_class" => "vc_col-sm-4 items_to_show ult_margin_bottom",
"heading" => __( "On Mobile", "ultimate_vc" ),
"param_name" => "slides_on_mob",
"value" => "2",
"min" => "1",
"max" => "25",
"step" => "1",
//"description" => __("","smile"),
"group" => "General",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Infinite loop", "ultimate_vc" ),
"param_name" => "infinite_loop",
// "admin_label" => true,
"value" => "on",
"options" => array(
"on" => array(
"label" => __( "Restart the slider automatically as it passes the last slide.", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
//"description" => __("", "smile"),
"dependency" => "",
"default_set" => true,
"group" => "General",
),
array(
"type" => "number",
"class" => "",
"heading" => __( "Transition speed", "ultimate_vc" ),
"param_name" => "speed",
"value" => "300",
"min" => "100",
"max" => "10000",
"step" => "100",
"suffix" => "ms",
"description" => __( "Speed at which next slide comes.", "ultimate_vc" ),
"group" => "General",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Autoplay Slides‏", "ultimate_vc" ),
"param_name" => "autoplay",
// "admin_label" => true,
"value" => "on",
"options" => array(
"on" => array(
"label" => __( "Enable Autoplay", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
//"description" => __("", "smile"),
"dependency" => "",
"default_set" => true,
"group" => "General",
),
array(
"type" => "number",
"class" => "",
"heading" => __( "Autoplay Speed", "ultimate_vc" ),
"param_name" => "autoplay_speed",
"value" => "5000",
"min" => "100",
"max" => "10000",
"step" => "10",
"suffix" => "ms",
//"description" => __("","smile"),
"dependency" => Array( "element" => "autoplay", "value" => array( "on" ) ),
"group" => "General",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __( "Extra Class", "ultimate_vc" ),
"param_name" => "el_class",
"value" => "",
//"description" => __("","smile"),
"group" => "General",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Navigation Arrows", "ultimate_vc" ),
"param_name" => "arrows",
// "admin_label" => true,
"value" => "show",
"options" => array(
"show" => array(
"label" => __( "Display next / previous navigation arrows", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
//"description" => __("", "smile"),
"dependency" => "",
"default_set" => true,
"group" => "Navigation",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Arrow Style", "ultimate_vc" ),
"param_name" => "arrow_style",
"value" => array(
"Default" => "default",
"Circle Background" => "circle-bg",
"Square Background" => "square-bg",
"Circle Border" => "circle-border",
"Square Border" => "square-border",
),
//"description" => __("","smile"),
"dependency" => Array( "element" => "arrows", "value" => array( "show" ) ),
"group" => "Navigation",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __( "Background Color", "ultimate_vc" ),
"param_name" => "arrow_bg_color",
"value" => "",
//"description" => __("","smile"),
"dependency" => Array(
"element" => "arrow_style",
"value" => array( "circle-bg", "square-bg" )
),
"group" => "Navigation",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __( "Border Color", "ultimate_vc" ),
"param_name" => "arrow_border_color",
"value" => "",
//"description" => __("","smile"),
"dependency" => Array(
"element" => "arrow_style",
"value" => array( "circle-border", "square-border" )
),
"group" => "Navigation",
),
array(
"type" => "number",
"class" => "",
"heading" => __( "Border Size", "ultimate_vc" ),
"param_name" => "border_size",
"value" => "2",
"min" => "1",
"max" => "100",
"step" => "1",
"suffix" => "px",
//"description" => __("","smile"),
"dependency" => Array(
"element" => "arrow_style",
"value" => array( "circle-border", "square-border" )
),
"group" => "Navigation",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __( "Arrow Color", "ultimate_vc" ),
"param_name" => "arrow_color",
"value" => "#333333",
//"description" => __("","smile"),
"dependency" => Array( "element" => "arrows", "value" => array( "show" ) ),
"group" => "Navigation",
),
array(
"type" => "number",
"class" => "",
"heading" => __( "Arrow Size", "ultimate_vc" ),
"param_name" => "arrow_size",
"value" => "24",
"min" => "10",
"max" => "75",
"step" => "1",
"suffix" => "px",
//"description" => __("","smile"),
"dependency" => Array( "element" => "arrows", "value" => array( "show" ) ),
"group" => "Navigation",
),
array(
"type" => "ultimate_navigation",
"class" => "",
"heading" => __( "Select icon for 'Next Arrow'", "ultimate_vc" ),
"param_name" => "next_icon",
"value" => "ultsl-arrow-right4",
//"description" => __("","smile"),
"dependency" => Array( "element" => "arrows", "value" => array( "show" ) ),
"group" => "Navigation",
),
array(
"type" => "ultimate_navigation",
"class" => "",
"heading" => __( "Select icon for 'Previous Arrow'", "ultimate_vc" ),
"param_name" => "prev_icon",
"value" => "ultsl-arrow-left4",
//"description" => __("","smile"),
"dependency" => Array( "element" => "arrows", "value" => array( "show" ) ),
"group" => "Navigation",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Dots Navigation", "ultimate_vc" ),
"param_name" => "dots",
// "admin_label" => true,
"value" => "show",
"options" => array(
"show" => array(
"label" => __( "Display dot navigation", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
//"description" => __("", "smile"),
"dependency" => "",
"default_set" => true,
"group" => "Navigation",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __( "Color of dots", "ultimate_vc" ),
"param_name" => "dots_color",
"value" => "#333333",
//"description" => __("","smile"),
"dependency" => Array( "element" => "dots", "value" => array( "show" ) ),
"group" => "Navigation",
),
array(
"type" => "ultimate_navigation",
"class" => "",
"heading" => __( "Select icon for 'Navigation Dots'", "ultimate_vc" ),
"param_name" => "dots_icon",
"value" => "ultsl-record",
//"description" => __("","smile"),
"dependency" => Array( "element" => "dots", "value" => array( "show" ) ),
"group" => "Navigation",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Item Animation", "ultimate_vc" ),
"param_name" => "item_animation",
"value" => array(
__( "No Animation", "ultimate_vc" ) => "",
__( "Swing", "ultimate_vc" ) => "swing",
__( "Pulse", "ultimate_vc" ) => "pulse",
__( "Fade In", "ultimate_vc" ) => "fadeIn",
__( "Fade In Up", "ultimate_vc" ) => "fadeInUp",
__( "Fade In Down", "ultimate_vc" ) => "fadeInDown",
__( "Fade In Left", "ultimate_vc" ) => "fadeInLeft",
__( "Fade In Right", "ultimate_vc" ) => "fadeInRight",
__( "Fade In Up Long", "ultimate_vc" ) => "fadeInUpBig",
__( "Fade In Down Long", "ultimate_vc" ) => "fadeInDownBig",
__( "Fade In Left Long", "ultimate_vc" ) => "fadeInLeftBig",
__( "Fade In Right Long", "ultimate_vc" ) => "fadeInRightBig",
__( "Slide In Down", "ultimate_vc" ) => "slideInDown",
__( "Slide In Left", "ultimate_vc" ) => "slideInLeft",
__( "Slide In Left", "ultimate_vc" ) => "slideInLeft",
__( "Bounce In", "ultimate_vc" ) => "bounceIn",
__( "Bounce In Up", "ultimate_vc" ) => "bounceInUp",
__( "Bounce In Down", "ultimate_vc" ) => "bounceInDown",
__( "Bounce In Left", "ultimate_vc" ) => "bounceInLeft",
__( "Bounce In Right", "ultimate_vc" ) => "bounceInRight",
__( "Rotate In", "ultimate_vc" ) => "rotateIn",
__( "Light Speed In", "ultimate_vc" ) => "lightSpeedIn",
__( "Roll In", "ultimate_vc" ) => "rollIn",
),
//"description" => __("", "smile"),
"group" => "Animation",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Draggable Effect", "ultimate_vc" ),
"param_name" => "draggable",
"value" => "on",
"options" => array(
"on" => array(
"label" => __( "Allow slides to be draggable", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
"dependency" => "",
"default_set" => true,
"group" => "Advanced",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Touch Move", "ultimate_vc" ),
"param_name" => "touch_move",
// "admin_label" => true,
"value" => "on",
"options" => array(
"on" => array(
"label" => __( "Enable slide moving with touch", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
//"description" => __("", "smile"),
"dependency" => Array( "element" => "draggable", "value" => array( "on" ) ),
"default_set" => true,
"group" => "Advanced",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "RTL Mode", "ultimate_vc" ),
"param_name" => "rtl",
// "admin_label" => true,
"value" => "",
"options" => array(
"on" => array(
"label" => __( "Turn on RTL mode", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
//"description" => __("", "smile"),
"dependency" => "",
"group" => "Advanced",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Adaptive Height", "ultimate_vc" ),
"param_name" => "adaptive_height",
// "admin_label" => true,
"value" => "",
"options" => array(
"on" => array(
"label" => __( "Turn on Adaptive Height", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
//"description" => __("", "smile"),
"dependency" => "",
"group" => "Advanced",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Pause on hover", "ultimate_vc" ),
"param_name" => "pauseohover",
// "admin_label" => true,
"value" => "on",
"options" => array(
"on" => array(
"label" => __( "Pause the slider on hover", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
"dependency" => Array("element" => "autoplay", "value" => "on" ),
"group" => "Advanced",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Center mode", "ultimate_vc" ),
"param_name" => "centermode",
// "admin_label" => true,
"value" => "off",
"options" => array(
"on" => array(
"label" => __( "Enable center mode of the carousel", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
"description" => __("Enables centered view with partial prev/next slides. <br>Animations do not work with center mode.<br>Slides to scroll -> 'All Visible' do not work with center mode.", "ultimate_vc"),
"dependency" => "",
"group" => "Advanced",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __( "Focus on select", "ultimate_vc" ),
"param_name" => "focusonselect",
// "admin_label" => true,
"value" => "off",
"options" => array(
"on" => array(
"label" => __( "Middle the slide on select", "ultimate_vc" ),
"on" => "Yes",
"off" => "No",
),
),
"dependency" => Array("element" => "centermode", "value" => "on" ),
"group" => "Advanced",
),
array(
"type" => "number",
"class" => "",
"heading" => __( "Space between two items", "ultimate_vc" ),
"param_name" => "item_space",
"value" => "15",
"min" => "0",
"max" => "1000",
"step" => "1",
"suffix" => "px",
//"description" => __("","smile"),
"group" => "Advanced",
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/bzyci' target='_blank' rel='noopener'>" . __( "Watch Video Tutorial", "ultimate_vc" ) . " &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
"group" => "General"
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_ad_caraousel',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
),
"js_view" => 'VcColumnView'
)
); // vc_map
}
}
function ultimate_carousel_shortcode( $atts, $content ) {
$slider_type = $slides_on_desk = $slides_on_tabs = $slides_on_mob = $slide_to_scroll = $speed = $infinite_loop = $autoplay = $autoplay_speed = '';
$lazyload = $arrows = $dots = $dots_icon = $next_icon = $prev_icon = $dots_color = $draggable = $swipe = $touch_move = '';
$rtl = $arrow_color = $arrow_size = $arrow_style = $arrow_bg_color = $arrow_border_color = $border_size = $item_space = $el_class = '';
$item_animation = '';
extract( shortcode_atts( array(
"slider_type" => "horizontal",
"slides_on_desk" => "5",
"slides_on_tabs" => "3",
"slides_on_mob" => "2",
"slide_to_scroll" => "all",
"speed" => "300",
"infinite_loop" => "on",
"autoplay" => "on",
"autoplay_speed" => "5000",
"lazyload" => "",
"arrows" => "show",
"dots" => "show",
"dots_icon" => "ultsl-record",
"next_icon" => "ultsl-arrow-right4",
"prev_icon" => "ultsl-arrow-left4",
"dots_color" => "#333333",
"arrow_color" => "#333333",
"arrow_size" => "20",
"arrow_style" => "default",
"arrow_bg_color" => "",
"arrow_border_color" => "",
"border_size" => "1.5",
"draggable" => "on",
"swipe" => "true",
"touch_move" => "on",
"rtl" => "",
"item_space" => "15",
"el_class" => "",
"item_animation" => "",
"adaptive_height" => "",
"css_ad_caraousel" => "",
"pauseohover" => "on",
"focusonselect" => "off",
"centermode" => "off"
), $atts ) );
$uid = uniqid( rand() );
$settings = $responsive = $infinite = $dot_display = $custom_dots = $arr_style = $wrap_data = $design_style = '';
$desing_style = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_ad_caraousel, ' ' ), "ultimate_carousel", $atts );
$desing_style = esc_attr( $desing_style );
if ( $slide_to_scroll == "all" ) {
$slide_to_scroll = $slides_on_desk;
$slide_to_tab = $slides_on_tabs;
$slide_to_mob = $slides_on_mob;
} else {
$slide_to_scroll = 1;
$slide_to_tab = 1;
$slide_to_mob = 1;
}
$arr_style .= 'color:' . $arrow_color . '; font-size:' . $arrow_size . 'px;';
if ( $arrow_style == "circle-bg" || $arrow_style == "square-bg" ) {
$arr_style .= "background:" . $arrow_bg_color . ";";
} elseif ( $arrow_style == "circle-border" || $arrow_style == "square-border" ) {
$arr_style .= "border:" . $border_size . "px solid " . $arrow_border_color . ";";
}
if ( $dots !== "off" && $dots !== "" ) {
$settings .= 'dots: true,';
} else {
$settings .= 'dots: false,';
}
if ( $autoplay !== 'off' && $autoplay !== '' ) {
$settings .= 'autoplay: true,';
}
if ( $autoplay_speed !== '' ) {
$settings .= 'autoplaySpeed: ' . $autoplay_speed . ',';
}
if ( $speed !== '' ) {
$settings .= 'speed: ' . $speed . ',';
}
if ( $infinite_loop !== 'off' && $infinite_loop !== '' ) {
$settings .= 'infinite: true,';
} else {
$settings .= 'infinite: false,';
}
if ( $lazyload !== 'off' && $lazyload !== '' ) {
$settings .= 'lazyLoad: true,';
}
if ( is_rtl() ) {
if ( $arrows !== 'off' && $arrows !== '' ) {
$settings .= 'arrows: true,';
$settings .= 'nextArrow: \'<button type="button" role="button" aria-label="Next" style="' . esc_attr($arr_style) . '" class="slick-next ' . esc_attr($arrow_style) . '"><i class="' . esc_attr($prev_icon) . '"></i></button>\',';
$settings .= 'prevArrow: \'<button type="button" role="button" aria-label="Previous" style="' . esc_attr($arr_style) . '" class="slick-prev ' . esc_attr($arrow_style) . '"><i class="' . esc_attr($next_icon) . '"></i></button>\',';
} else {
$settings .= 'arrows: false,';
}
} else {
if ( $arrows !== 'off' && $arrows !== '' ) {
$settings .= 'arrows: true,';
$settings .= 'nextArrow: \'<button type="button" role="button" aria-label="Next" style="' . esc_attr($arr_style) . '" class="slick-next ' . esc_attr($arrow_style) . '"><i class="' . esc_attr($next_icon) . '"></i></button>\',';
$settings .= 'prevArrow: \'<button type="button" role="button" aria-label="Previous" style="' . esc_attr($arr_style) . '" class="slick-prev ' . esc_attr($arrow_style) . '"><i class="' . esc_attr($prev_icon) . '"></i></button>\',';
} else {
$settings .= 'arrows: false,';
}
}
if ( $slide_to_scroll !== '' ) {
$settings .= 'slidesToScroll:' . $slide_to_scroll . ',';
}
if ( $slides_on_desk !== '' ) {
$settings .= 'slidesToShow:' . $slides_on_desk . ',';
}
if ( $slides_on_mob == '' ) {
$slides_on_mob = $slides_on_desk;
$slide_to_tab = $slide_to_scroll;
}
if ( $slides_on_tabs == '' ) {
$slides_on_tabs = $slides_on_desk;
$slide_to_mob = $slide_to_scroll;
}
if ( $draggable !== 'off' && $draggable !== '' ) {
$settings .= 'swipe: true,';
$settings .= 'draggable: true,';
} else {
$settings .= 'swipe: false,';
$settings .= 'draggable: false,';
}
if ( $touch_move == "on" ) {
$settings .= 'touchMove: true,';
} else {
$settings .= 'touchMove: false,';
}
if ( $rtl !== "off" && $rtl !== "" ) {
$settings .= 'rtl: true,';
$wrap_data = 'dir="rtl"';
}
if ( $slider_type == "vertical" ) {
$settings .= 'vertical: true,';
}
$site_rtl = 'false';
if ( is_rtl() ) {
$site_rtl = 'true';
}
if ( $site_rtl === 'false' || $site_rtl === false ) {
$ultimate_rtl_support = get_option( 'ultimate_rtl_support' );
if ( $ultimate_rtl_support == 'enable' ) {
$site_rtl = 'true';
}
}
if ( is_rtl() ) {
$settings .= 'rtl: true,';
}
if ( $pauseohover == 'on' ) {
$settings .= 'pauseOnHover: true,';
} else {
$settings .= 'pauseOnHover: false,';
}
$settings .= 'pauseOnFocus: false,';
if ( $centermode == 'on' ) {
$settings .= 'centerMode: true,';
}
if ( $focusonselect == 'on' && $centermode == 'on' ) {
$settings .= 'focusOnSelect: true,';
}
if ( $adaptive_height === 'on' ) {
$settings .= 'adaptiveHeight: true,';
}
$settings .= 'responsive: [
{
breakpoint: 1026,
settings: {
slidesToShow: ' . $slides_on_desk . ',
slidesToScroll: ' . $slide_to_scroll . ', ' . $infinite . ' ' . $dot_display . '
}
},
{
breakpoint: 1025,
settings: {
slidesToShow: ' . $slides_on_tabs . ',
slidesToScroll: ' . $slide_to_tab . '
}
},
{
breakpoint: 760,
settings: {
slidesToShow: ' . $slides_on_mob . ',
slidesToScroll: ' . $slide_to_mob . '
}
}
],';
$settings .= 'pauseOnDotsHover: true,';
if ( $dots_icon !== 'off' && $dots_icon !== '' ) {
if ( $dots_color !== 'off' && $dots_color !== '' ) {
$custom_dots = 'style= "color:' . esc_attr( $dots_color ) . ';"';
}
$settings .= 'customPaging: function(slider, i) {
return \'<i type="button" ' . $custom_dots . ' class="' . esc_attr( $dots_icon ) . '" data-role="none"></i>\';
},';
}
if ( $item_animation == '' ) {
$item_animation = 'no-animation';
}
ob_start();
$uniqid = uniqid( rand() );
echo '<div id="ult-carousel-' . esc_attr( $uniqid ) . '" class="ult-carousel-wrapper ' . esc_attr( $desing_style ) . ' ' . esc_attr($el_class) . ' ult_' . esc_attr($slider_type) . '" data-gutter="' . esc_attr($item_space) . '" data-rtl="' . esc_attr($site_rtl) . '" >';
echo '<div class="ult-carousel-' . esc_attr($uid) . ' " ' . $wrap_data . '>';
ultimate_override_shortcodes( $item_space, $item_animation );
echo do_shortcode( $content );
ultimate_restore_shortcodes();
echo '</div>';
echo '</div>';
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
if( typeof jQuery('.ult-carousel-<?php echo $uid; ?>').slick == "function"){
$('.ult-carousel-<?php echo $uid; ?>').slick({<?php echo $settings; ?>});
}
});
</script>
<?php
return ob_get_clean();
}
}
new Ultimate_Carousel;
if ( class_exists( 'WPBakeryShortCodesContainer' ) && !class_exists( 'WPBakeryShortCode_ultimate_carousel' ) ) {
class WPBakeryShortCode_ultimate_carousel extends WPBakeryShortCodesContainer {
}
}
}
if ( ! function_exists( 'ultimate_override_shortcodes' ) ) {
function ultimate_override_shortcodes( $item_space, $item_animation ) {
global $shortcode_tags, $_shortcode_tags;
// Let's make a back-up of the shortcodes
$_shortcode_tags = $shortcode_tags;
// Add any shortcode tags that we shouldn't touch here
$disabled_tags = array( '' );
foreach ( $shortcode_tags as $tag => $cb ) {
if ( in_array( $tag, $disabled_tags ) ) {
continue;
}
// Overwrite the callback function
$shortcode_tags[ $tag ] = 'ultimate_wrap_shortcode_in_div';
$_shortcode_tags["ult_item_space"] = $item_space;
$_shortcode_tags["item_animation"] = $item_animation;
}
}
}
// Wrap the output of a shortcode in a div with class "ult-item-wrap"
// The original callback is called from the $_shortcode_tags array
if ( ! function_exists( 'ultimate_wrap_shortcode_in_div' ) ) {
function ultimate_wrap_shortcode_in_div( $attr, $content = null, $tag ) {
global $_shortcode_tags;
return '<div class="ult-item-wrap" data-animation="animated ' . esc_attr($_shortcode_tags["item_animation"]) . '">' . call_user_func( $_shortcode_tags[ $tag ], $attr, $content, $tag ) . '</div>';
}
}
if ( ! function_exists( 'ultimate_restore_shortcodes' ) ) {
function ultimate_restore_shortcodes() {
global $shortcode_tags, $_shortcode_tags;
// Restore the original callbacks
if ( isset( $_shortcode_tags ) ) {
$shortcode_tags = $_shortcode_tags;
}
}
}
@@ -0,0 +1,467 @@
<?php
if(!class_exists('Ult_Content_Box')) {
class Ult_Content_Box {
function __construct() {
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action( 'init', array( $this, 'ult_content_box_init' ) );
}
add_shortcode("ult_content_box",array($this,"ult_content_box_callback"));
add_action( 'wp_enqueue_scripts', array( $this, 'ult_content_box_scripts' ), 1 );
}
function ult_content_box_callback($atts, $content = null){
extract( shortcode_atts( array(
'bg_type' => 'bg_color',
'bg_image' => '',
'bg_color' => '',
'bg_repeat' => 'repeat',
'bg_size' => 'cover',
'bg_position' => 'center center',
'border' => '',
'box_shadow' => '',
'box_shadow_color' => '',
'padding' => '',
'margin' => '',
'link' => '',
'hover_bg_color' => '',
'hover_border_color' => '',
'hover_box_shadow' => '',
'box_hover_shadow_color' => '',
'min_height' => '',
'el_class' => '',
'trans_property' => 'all',
'trans_duration' => '700',
'trans_function' => 'ease',
'responsive_margin' => '',
/*'img_overlay_hover_effect' => '',*/
), $atts ) );
/* init var's */
$style = $url = $link_title = $target = $responsive_margins = $normal_margins = $hover = $shadow = $data_attr = $target = $link_title = $rel = '';
if($bg_type!='') {
switch ($bg_type) {
case 'bg_color': /* background color */
if($bg_color!='') {
$style .= 'background-color:'.$bg_color.';';
$data_attr .= ' data-bg="'.esc_attr( $bg_color ).'" ';
}
if($hover_bg_color!='') {
$hover .= ' data-hover_bg_color="'.esc_attr($hover_bg_color).'" ';
}
break;
case 'bg_image': if($bg_image != '') {
$img = wp_get_attachment_image_src( $bg_image, 'large');
$style .= "background-image:url('".esc_url($img[0])."');";
$style .= 'background-size: '.esc_attr($bg_size).';';
$style .= 'background-repeat: '.esc_attr($bg_repeat).';';
$style .= 'background-position: '.esc_attr($bg_position).';';
$style .= 'background-color: rgba(0, 0, 0, 0);';
}
break;
}
}
/* box shadow */
if($box_shadow!='' ) {
$style .= apply_filters('Ultimate_GetBoxShadow', $box_shadow, 'css');
}
/* box shadow - {HOVER} */
if($hover_box_shadow!='' ) {
$data = apply_filters('Ultimate_GetBoxShadow', $hover_box_shadow, 'data');
if ( strpos($data,'none') !== false ) {
$data = 'none';
}
// Apply default box shadow
if ( strpos($data,'inherit') !== false ) {
if($box_shadow!='') {
$data = apply_filters('Ultimate_GetBoxShadow', $box_shadow, 'data');
}
}
$hover .= ' data-hover_box_shadow="'.esc_attr($data).'" ';
}
/* border */
if($border!=''){
$border_array = explode('|', $border);
$border_color = '';
foreach ($border_array as $border_val) {
$border_value_array = explode(':', $border_val);
if(isset($border_value_array[0]) && $border_value_array[0] === 'border-color') {
$border_color = (isset($border_value_array[1])) ? rtrim($border_value_array[1], ';') : '';
}
}
$temp_border = str_replace( '|', '', $border );
$style .= $temp_border;
$data_attr .= ' data-border_color="'.esc_attr($border_color).'" ';
}
/* link */
if($link!='') {
$href = vc_build_link($link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
}
/* padding */
if($padding!=''){ $style .= $padding; }
/* margin */
if($margin!=''){ $style .= $margin; }
// HOVER
if($hover_border_color!='') {
$hover .= ' data-hover_border_color="'.esc_attr($hover_border_color).'" ';
}
if($min_height!='') { $style .= 'min-height:'.esc_attr($min_height).'px;'; }
// Transition Effect
if($trans_property!='' && $trans_duration!='' && $trans_function!='') {
$style .= '-webkit-transition: '.$trans_property.' '.$trans_duration.'ms '.$trans_function.';';
$style .= '-moz-transition: '.$trans_property.' '.$trans_duration.'ms '.$trans_function.';';
$style .= '-ms-transition: '.$trans_property.' '.$trans_duration.'ms '.$trans_function.';';
$style .= '-o-transition: '.$trans_property.' '.$trans_duration.'ms '.$trans_function.';';
$style .= 'transition: '.$trans_property.' '.$trans_duration.'ms '.$trans_function.';';
}
/* Margins - Responsive */
if($responsive_margin!='') {
$responsive_margins .= ' data-responsive_margins="'.esc_attr($responsive_margin).'" ';
}
/* Margins - Normal */
if($margin!='') {
$normal_margins .= ' data-normal_margins="'.esc_attr($margin).'" ';
}
$output = '<div class="ult-content-box-container '.esc_attr($el_class).'" >';
if($link!='') {
$output .= ' <a class="ult-content-box-anchor" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'>';
}
$output .= ' <div class="ult-content-box" style="'.esc_attr($style).'" '.$hover.' '.$responsive_margins.' '.$normal_margins.' '.$data_attr.'>';
$output .= do_shortcode( $content );
$output .= ' </div>';
if($link!='') {
$output .= ' </a>';
}
$output .= '</div>';
return $output;
}
function ult_content_box_init() {
if(function_exists("vc_map")){
vc_map( array(
"name" => __("Content Box", "ultimate_vc"),
"base" => "ult_content_box",
"icon" => "vc_icon_content_box",
"class" => "vc_icon_content_box",
"as_parent" => array('except' => 'ult_content_box'),
//"as_parent" => '',
///"content_element" => true,
"controls" => "full",
"show_settings_on_create" => true,
//"is_container" => true,
"category" => "Ultimate VC Addons",
"description" => __("Content Box.","ultimate_vc"),
"js_view" => 'VcColumnView',
"params" => array(
array(
"type" => "dropdown",
"heading" => __("Background Type","ultimate_vc"),
"param_name" => "bg_type",
"value" => array(
__("Background Color","ultimate_vc") => "bg_color",
__("Background Image","ultimate_vc") => "bg_image",
),
),
/*array(
"type" => "dropdown",
"class" => "",
"heading" => __("Transition Property","ultimate_vc"),
"param_name" => "trans_property",
"value" => array(
__("All", "ultimate_vc") => 'all',
__("Background", "ultimate_vc") => 'background',
__("Color", "ultimate_vc") => 'color',
__("Height", "ultimate_vc") => 'height',
__("Width", "ultimate_vc") => 'width',
__("Outline", "ultimate_vc") => 'outline',
),
"group"=> "Effect",
),*/
array(
"type" => "colorpicker",
"heading" => __("Background Color","ultimate_vc"),
"param_name" => "bg_color",
"dependency" => Array("element" => "bg_type", "value" => "bg_color" ),
),
array(
"type" => "attach_image",
"heading" => __("Background Image", 'ultimate_vc'),
"param_name" => "bg_image",
"description" => __("Set background image for content box.", 'ultimate_vc'),
"dependency" => Array("element" => "bg_type", "value" => "bg_image" ),
),
array(
"type" => "ultimate_border",
"heading" => __("Border","ultimate_vc"),
"param_name" => "border",
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array(
__("Top","ultimate_vc") => "",
__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
__("Left","ultimate_vc") => ""
),
//"enable_radius" => false, // Enable border-radius. default true
"radius" => array(
__("Top Left","ultimate_vc") => "", // use 'Top Left'
__("Top Right","ultimate_vc") => "", // use 'Top Right'
__("Bottom Right","ultimate_vc") => "", // use 'Bottom Right'
__("Bottom Left","ultimate_vc") => "" // use 'Bottom Left'
),
//"label_color" => __("Border Color","ultimate_vc"), // label for 'border color' default 'Border Color'
//"label_radius" => __("Border Radius","ultimate_vc"), // label for 'radius' default 'Border Redius'
//"label_border" => "Border Style", // label for 'style' default 'Border Style'
),
array(
"type" => "ultimate_boxshadow",
"heading" => __("Box Shadow", "ultimate_vc"),
"param_name" => "box_shadow",
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array(
__("Horizontal","ultimate_vc") => "",
__("Vertical","ultimate_vc") => "",
__("Blur","ultimate_vc") => "",
__("Spread","ultimate_vc") => ""
),
//"enable_color" => false,
//"label_style" => __("Style","ultimate_vc"),
//"label_color" => __("Shadow Color","ultimate_vc"),
),
/*array(
"type" => "colorpicker",
"edit_field_class" => "vc_col-sm-12 vc_column box_shadow_ultimate_box_shadow_color", // color dependency
"heading" => __("Shadow Color","ultimate_vc"),
"param_name" => "box_shadow_color",
),*/
// Spacing
array(
"type" => "ult_param_heading",
"param_name" => "content_spacing",
"text" => __("Spacing","ultimate_vc"),
"value" => "",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_spacing",
"heading" => __("Padding", "ultimate_vc"),
"param_name" => "padding",
"mode" => "padding", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
__("Top","ultimate_vc") => "",
__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
__("Left","ultimate_vc") => ""
),
),
array(
"type" => "ultimate_spacing",
"heading" => __("Margin", "ultimate_vc"),
"param_name" => "margin",
"mode" => "margin", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
__("Top","ultimate_vc") => "",
__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
__("Left","ultimate_vc") => ""
),
),
array(
"type" => "vc_link",
"heading" => __("Content Box Link","ultimate_vc"),
"param_name" => "link",
//"description" => __("", "ultimate_vc"),
//"dependency" => array("element" => "img_link_type", "value" => "custom"),
),
array(
"type" => "number",
"heading" => __("Min Height", "ultimate_vc"),
"param_name" => "min_height",
"suffix"=>"px",
"min"=>"0",
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc")
),
// Background
array(
"type" => "dropdown",
"heading" => __("Background Image Repeat","ultimate_vc"),
"param_name" => "bg_repeat",
"value" => array(
__("Repeat", "ultimate_vc") => 'repeat',
__("Repeat X", "ultimate_vc") => 'repeat-x',
__("Repeat Y", "ultimate_vc") => 'repeat-y',
__("No Repeat", "ultimate_vc") => 'no-repeat',
),
"group" => "Background",
"dependency" => Array("element" => "bg_type", "value" => "bg_image" ),
),
array(
"type" => "dropdown",
"heading" => __("Background Image Size","ultimate_vc"),
"param_name" => "bg_size",
"value" => array(
__("Cover - Image to be as large as possible", "ultimate_vc") => 'cover',
__("Contain - Image will try to fit inside the container area", "ultimate_vc") => 'contain',
__("Initial", "ultimate_vc") => 'initial',
),
"group" => "Background",
"dependency" => Array("element" => "bg_type", "value" => "bg_image" ),
),
array(
"type" => "textfield",
"heading" => __("Background Image Posiiton", "ultimate_vc"),
"param_name" => "bg_position",
"description" => __("You can use any number with px, em, %, etc. Example- 100px 100px.", "ultimate_vc"),
"group" => "Background",
"dependency" => Array("element" => "bg_type", "value" => "bg_image" ),
),
// Hover
array(
"type" => "colorpicker",
//"class" => "",
"heading" => __("Background Color","ultimate_vc"),
"param_name" => "hover_bg_color",
"dependency" => Array("element" => "bg_type", "value" => "bg_color" ),
"group" => "Hover",
),
array(
"type" => "colorpicker",
"heading" => __("Border Color","ultimate_vc"),
"param_name" => "hover_border_color",
"edit_field_class" => "vc_col-sm-12 vc_column border_ultimate_border", // Custom dependency
"group" => "Hover",
),
array(
"type" => "ultimate_boxshadow",
"heading" => __("Box Shadow", "ultimate_vc"),
"param_name" => "hover_box_shadow",
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array(
__("Horizontal","ultimate_vc") => "",
__("Vertical","ultimate_vc") => "",
__("Blur","ultimate_vc") => "",
__("Spread","ultimate_vc") => ""
),
"label_color" => __("Shadow Color","ultimate_vc"),
//"enable_color" => false,
//"label_style" => __("Style","ultimate_vc"),
//"dependency" => Array("element" => "img_box_shadow_type", "value" => "on" ),
"group" => "Hover",
),
/*array(
"type" => "colorpicker",
"edit_field_class" => "vc_col-sm-12 vc_column hover_box_shadow_ultimate_box_shadow_color", // color dependency
"heading" => __("Shadow Color","ultimate_vc"),
"param_name" => "box_hover_shadow_color",
"group" => "Hover",
),*/
// Effect
array(
"type" => "ult_param_heading",
"param_name" => "content_transition",
"text" => __("Transition Options","ultimate_vc"),
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
"group" => "Hover",
),
array(
"type" => "dropdown",
//"class" => "",
"heading" => __("Transition Property","ultimate_vc"),
"param_name" => "trans_property",
"value" => array(
__("All", "ultimate_vc") => 'all',
__("Background", "ultimate_vc") => 'background',
__("Color", "ultimate_vc") => 'color',
__("Height", "ultimate_vc") => 'height',
__("Width", "ultimate_vc") => 'width',
__("Outline", "ultimate_vc") => 'outline',
),
"group"=> "Hover",
),
array(
"type" => "number",
//"class" => "",
"heading" => __("Duration", "ultimate_vc"),
"param_name" => "trans_duration",
"suffix"=>"ms",
"min"=>"0",
"value" => "",
"group"=> "Hover",
),
array(
"type" => "dropdown",
//"class" => "",
"heading" => __("Transition Effect","ultimate_vc"),
"param_name" => "trans_function",
"value" => array(
__("Ease", "ultimate_vc") => 'ease',
__("Linear", "ultimate_vc") => 'linear',
__("Ease-In", "ultimate_vc") => 'ease-in',
__("Ease-Out", "ultimate_vc") => 'ease-out',
__("Ease-In-Out", "ultimate_vc") => 'ease-in-out',
),
"group"=> "Hover",
),
// Responsive
array(
"type" => "ultimate_spacing",
"heading" => __("Margin", "ultimate_vc"),
"param_name" => "responsive_margin",
"mode" => "margin", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
__("Top","ultimate_vc") => "",
__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
__("Left","ultimate_vc") => ""
),
"group" => __( 'Responsive', 'ultimate_vc' ),
"description" => __( 'This margin will apply below screen 768px.', 'ultimate_vc' )
),
),
) );
}
}
function ult_content_box_scripts() {
Ultimate_VC_Addons::ultimate_register_style( 'ult_content_box_css', 'content-box' );
Ultimate_VC_Addons::ultimate_register_script( 'ult_content_box_js', 'content-box', false, array( 'jquery' ) );
}
}
// Finally initialize code
new Ult_Content_Box;
if ( class_exists( 'WPBakeryShortCodesContainer' ) && !class_exists( 'WPBakeryShortCode_ult_content_box' ) ) {
class WPBakeryShortCode_ult_content_box extends WPBakeryShortCodesContainer {
}
}
}
@@ -0,0 +1,651 @@
<?php
/*
* Add-on Name: CountDown for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('Ultimate_CountDown'))
{
class Ultimate_CountDown
{
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'countdown_init'));
}
add_shortcode('ult_countdown',array($this,'countdown_shortcode'));
add_action('admin_enqueue_scripts',array($this,'admin_scripts'));
add_action('wp_enqueue_scripts',array($this,'count_down_scripts'),1);
}
function count_down_scripts() {
Ultimate_VC_Addons::ultimate_register_script( 'jquery.timecircle', 'countdown', false, array( 'jquery' ), ULTIMATE_VERSION, false );
Ultimate_VC_Addons::ultimate_register_script( 'jquery.countdown', 'count-timer', false, array( 'jquery' ), ULTIMATE_VERSION, false );
Ultimate_VC_Addons::ultimate_register_style( 'ult-countdown', 'countdown' );
}
function admin_scripts($hook) {
if($hook == "post.php" || $hook == "post-new.php"){
$bsf_dev_mode = bsf_get_option('dev_mode');
if($bsf_dev_mode === 'enable') {
Ultimate_VC_Addons::ultimate_register_style( 'ult-colorpicker-style', UAVC_URL.'admin/css/bootstrap-datetimepicker-admin.css', true );
wp_enqueue_style('ult-colorpicker-style');
}
}
}
function countdown_init()
{
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Countdown","ultimate_vc"),
"base" => "ult_countdown",
"class" => "vc_countdown",
"icon" => "vc_countdown",
"category" => "Ultimate VC Addons",
"description" => __("Countdown Timer.","ultimate_vc"),
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Countdown Timer Style", "ultimate_vc"),
"param_name" => "count_style",
"value" => array(
__("Digit and Unit Side by Side","smile") => "ult-cd-s1",
__("Digit and Unit Up and Down","smile") => "ult-cd-s2",
),
"group" => "General Settings",
//"description" => __("Select style for countdown timer.", "smile"),
),
array(
"type" => "datetimepicker",
"class" => "",
"heading" => __("Target Time For Countdown", "ultimate_vc"),
"param_name" => "datetime",
"value" => "",
"description" => __("Date and time format (yyyy/mm/dd hh:mm:ss).", "ultimate_vc"),
"group" => "General Settings",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Countdown Timer Depends on", "ultimate_vc"),
"param_name" => "ult_tz",
"value" => array(
__("WordPress Defined Timezone","ultimate_vc") => "ult-wptz",
__("User's System Timezone","ultimate_vc") => "ult-usrtz",
),
//"description" => __("Select style for countdown timer.", "smile"),
"group" => "General Settings",
),
array(
"type" => "checkbox",
"class" => "",
"heading" => __("Select Time Units To Display In Countdown Timer", "ultimate_vc"),
"param_name" => "countdown_opts",
"value" => array(
__("Years","ultimate_vc") => "syear",
__("Months","ultimate_vc") => "smonth",
__("Weeks","ultimate_vc") => "sweek",
__("Days","ultimate_vc") => "sday",
__("Hours","ultimate_vc") => "shr",
__("Minutes","ultimate_vc") => "smin",
__("Seconds","ultimate_vc") => "ssec",
),
//"description" => __("Select options for the video.", "smile"),
"group" => "General Settings",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Timer Digit Border Style", "ultimate_vc"),
"param_name" => "br_style",
"value" => array(
"None"=>'',
"Solid"=>"solid",
"Dashed"=>"dashed",
"Dotted"=>"dotted",
"Double"=>"double",
"Inset"=>"inset",
"Outset"=>"outset",
),
//"description" => __("Border-style.", "smile"),
"group" => "General Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Timer Digit Border Size", "ultimate_vc"),
"param_name" => "br_size",
"value" => "",
"min"=>"0",
"suffix"=>"px",
//"description" => __("Border-size.", "smile"),
"dependency" => Array("element"=>"br_style","value"=>array("solid","dotted","dashed","double","inset","outset",)),
"group" => "General Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Timer Digit Border Color", "ultimate_vc"),
"param_name" => "br_color",
"value" => "",
//"description" => __("Text color for time ticks Period.", "smile"),
"dependency" => Array("element"=>"br_style","value"=>array("solid","dotted","dashed","double","inset","outset",)),
"group" => "General Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Timer Digit Border Radius", "ultimate_vc"),
"param_name" => "br_radius",
"value" => "",
"min"=>"0",
"suffix"=>"px",
//"description" => __("Border-Time Radius.", "smile"),
"dependency" => Array("element"=>"br_style","value"=>array("solid","dotted","dashed","double","inset","outset",)),
"group" => "General Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Timer Digit Background Color", "ultimate_vc"),
"param_name" => "timer_bg_color",
"value" => "",
//"description" => __("Background-Color.", "smile"),
"group" => "General Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Timer Digit Background Size", "ultimate_vc"),
"param_name" => "br_time_space",
"min"=>"0",
"value" => "0",
"suffix"=>"px",
//"description" => __("Border-Timer Space.", "smile"),
"group" => "General Settings",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Extra Class for the Wrapper.", "ultimate_vc"),
"group" => "General Settings",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Day (Singular)", "ultimate_vc"),
"param_name" => "string_days",
"value" => "Day",
//"description" => __("Enter your string for day.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Days (Plural)", "ultimate_vc"),
"param_name" => "string_days2",
"value" => "Days",
//"description" => __("Enter your string for days.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Week (Singular)", "ultimate_vc"),
"param_name" => "string_weeks",
"value" => "Week",
//"description" => __("Enter your string for Week.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Weeks (Plural)", "ultimate_vc"),
"param_name" => "string_weeks2",
"value" => "Weeks",
//"description" => __("Enter your string for Weeks.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Month (Singular)", "ultimate_vc"),
"param_name" => "string_months",
"value" => "Month",
//"description" => __("Enter your string for Month.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Months (Plural)", "ultimate_vc"),
"param_name" => "string_months2",
"value" => "Months",
//"description" => __("Enter your string for Months.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Year (Singular)", "ultimate_vc"),
"param_name" => "string_years",
"value" => "Year",
//"description" => __("Enter your string for Year.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Years (Plural)", "ultimate_vc"),
"param_name" => "string_years2",
"value" => "Years",
//"description" => __("Enter your string for Years.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Hour (Singular)", "ultimate_vc"),
"param_name" => "string_hours",
"value" => "Hour",
//"description" => __("Enter your string for Hour.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Hours (Plural)", "ultimate_vc"),
"param_name" => "string_hours2",
"value" => "Hours",
//"description" => __("Enter your string for Hours.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Minute (Singular)", "ultimate_vc"),
"param_name" => "string_minutes",
"value" => "Minute",
//"description" => __("Enter your string for Minute.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Minutes (Plural)", "ultimate_vc"),
"param_name" => "string_minutes2",
"value" => "Minutes",
//"description" => __("Enter your string for Minutes.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Second (Singular)", "ultimate_vc"),
"param_name" => "string_seconds",
"value" => "Second",
//"description" => __("Enter your string for Second.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Seconds (Plural)", "ultimate_vc"),
"param_name" => "string_seconds2",
"value" => "Seconds",
//"description" => __("Enter your string for Seconds.", "smile"),
"group" => "Strings Translation",
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/szdd2' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
"group" => "General Settings",
),
array(
"type" => "ult_param_heading",
"text" => __("Timer Digit Settings","ultimate_vc"),
"param_name" => "countdown_typograpy",
"group" => "Typography",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "timer_digit_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "tick_style",
"group" => "Typography"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Timer Digit Text Color", "ultimate_vc"),
"param_name" => "tick_col",
"value" => "",
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Timer Digit Text Size", 'ultimate_vc'),
"param_name" => "tick_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Timer Digit Text Line height", 'ultimate_vc'),
"param_name" => "tick_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"text" => __("Timer Unit Settings","ultimate_vc"),
"param_name" => "countdown_typograpy",
"group" => "Typography",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "timer_unit_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "tick_unit_style",
"group" => "Typography"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Timer Unit Text Color", "ultimate_vc"),
"param_name" => "tick_sep_col",
"value" => "",
//"description" => __("Text color for time ticks Period.", "smile"),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Timer Unit Text Size", 'ultimate_vc'),
"param_name" => "tick_sep_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Timer Unit Line Height", 'ultimate_vc'),
"param_name" => "tick_sep_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_countdown',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)
)
);
}
}
// Shortcode handler function for icon block
function countdown_shortcode($atts)
{
$count_style = $datetime = $ult_tz = $countdown_opts = $tick_col = $tick_size = $tick_line_height = $tick_style = $tick_sep_col = $tick_sep_size = $tick_sep_line_height = '';
$tick_sep_style = $br_color = $br_style = $br_size = $timer_bg_color = $br_radius = $br_time_space = $el_class = '';
$string_days = $string_weeks = $string_months = $string_years = $string_hours = $string_minutes = $string_seconds = '';
$string_days2 = $string_weeks2 = $string_months2 = $string_yers2 = $string_hours2 = $string_minutes2 = $string_seconds2 = $timer_digit_font_family = $timer_unit_font_family = $tick_unit_style = '';
extract(shortcode_atts( array(
'count_style'=>'ult-cd-s1',
'datetime'=>'',
'ult_tz'=>'ult-wptz',
'countdown_opts'=>'',
'tick_col'=>'',
'tick_size'=>'36',
'tick_line_height'=>'',
'tick_style'=>'',
'tick_unit_style' => '',
'timer_digit_font_family' => '',
'timer_unit_font_family' => '',
'tick_sep_col'=>'',
'tick_sep_size'=>'13',
'tick_sep_line_height'=> '',
'tick_sep_style'=>'',
'br_color'=>'',
'br_style'=>'',
'br_size'=>'',
'timer_bg_color'=>'',
'br_radius'=>'',
'br_time_space'=>'0',
'el_class'=>'',
'string_days' => 'Day',
'string_days2' => 'Days',
'string_weeks' => 'Week',
'string_weeks2' => 'Weeks',
'string_months' => 'Month',
'string_months2' => 'Months',
'string_years' => 'Year',
'string_years2' => 'Years',
'string_hours' => 'Hour',
'string_hours2' => 'Hours',
'string_minutes' => 'Minute',
'string_minutes2' => 'Minutes',
'string_seconds' => 'Second',
'string_seconds2' => 'Seconds',
'css_countdown' => '',
),$atts));
$count_frmt = $labels = $countdown_design_style = $tdfamily = $tunifamily = '';
$labels = $string_years2 .','.$string_months2.','.$string_weeks2.','.$string_days2.','.$string_hours2.','.$string_minutes2.','.$string_seconds2;
$labels2 = $string_years .','.$string_months.','.$string_weeks.','.$string_days.','.$string_hours.','.$string_minutes.','.$string_seconds;
$countdown_opt = explode(",",$countdown_opts);
if(is_array($countdown_opt)){
foreach($countdown_opt as $opt){
if($opt == "syear") $count_frmt .= 'Y';
if($opt == "smonth") $count_frmt .= 'O';
if($opt == "sweek") $count_frmt .= 'W';
if($opt == "sday") $count_frmt .= 'D';
if($opt == "shr") $count_frmt .= 'H';
if($opt == "smin") $count_frmt .= 'M';
if($opt == "ssec") $count_frmt .= 'S';
}
}
if (is_numeric($tick_size)) {
$tick_size = 'desktop:'.$tick_size.'px;';
}
$countdown_design_style = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_countdown, ' ' ), "ult_countdown", $atts );
$countdown_design_style = esc_attr( $countdown_design_style );
$countdown_id = 'countdown-wrap-'.rand(1000, 9999);
// $ult_countdown_args = array(
// 'target' => '#'.$countdown_id.' .ult_countdown-amount', // set targeted element e.g. unique class/id etc.
// 'media_sizes' => array(
// 'font-size' => $tick_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
// //'line-height' => $title_font_line_height
// ),
// );
// $data_list = get_ultimate_vc_responsive_media_css($ult_countdown_args);
$data_attr = '';
if($count_frmt=='') $count_frmt = 'DHMS';
if($br_size =='' || $br_color == '' || $br_style ==''){
if($timer_bg_color==''){
$el_class.=' ult-cd-no-border';
}
}
else{
$data_attr .= 'data-br-color="'.esc_attr( $br_color ).'" data-br-style="'.esc_attr($br_style).'" data-br-size="'.esc_attr($br_size).'" ';
}
// Responsive param
if(is_numeric($tick_sep_size)) { $tick_sep_size = 'desktop:'.$tick_sep_size.'px;'; }
if(is_numeric($tick_sep_line_height)) { $tick_sep_line_height = 'desktop:'.$tick_sep_line_height.'px;'; }
$count_down_id = "count-down-wrap-".rand(1000,9999);
$count_down_sep_args = array(
'target' => '#'.$count_down_id.' .ult_countdown-period',
'media_sizes' => array(
'font-size' => $tick_sep_size,
'line-height' => $tick_sep_line_height,
),
);
$count_down_sep_data_list = get_ultimate_vc_responsive_media_css($count_down_sep_args);
if($timer_digit_font_family != '')
{
$tdfamily = get_ultimate_font_family($timer_digit_font_family);
$timer_d_font_family = 'font-family:\''.$tdfamily.'\';';
}
if($timer_unit_font_family != '')
{
$tunifamily = get_ultimate_font_family($timer_unit_font_family);
$data_attr .= ' data-tuni-font-family ="'.esc_attr($tunifamily).'"';
}
$stick_style = get_ultimate_font_style($tick_style);
$stick_unit_style = get_ultimate_font_style($tick_unit_style);
$data_attr .= ' data-tick-style="'.esc_attr($stick_style).'" ';
$data_attr .= ' data-tick-p-style="'.esc_attr($tick_sep_style).'" ';
$data_attr .= ' data-bg-color="'.esc_attr($timer_bg_color).'" data-br-radius="'.esc_attr($br_radius).'" data-padd="'.esc_attr($br_time_space).'" ';
switch( $tick_style ) {
case 'bold':
$tick_style_css = 'font-weight:bold;';
break;
case 'italic':
$tick_style_css = 'font-style:italic;';
break;
case 'boldnitalic':
$tick_style_css = 'font-weight:bold;';
$tick_style_css .= 'font-style:italic;';
break;
default:
$tick_style_css = $tick_style;
break;
}
switch( $tick_sep_style ) {
case 'bold':
$tick_sep_style_css ='font-weight:bold;';
break;
case 'italic':
$tick_sep_style_css='font-style:italic;';
break;
case 'boldnitalic':
$tick_sep_style_css='font-style:italic;';
$tick_sep_style_css ='font-weight:bold;';
break;
default:
$tick_sep_style_css = $tick_sep_style;
break;
}
$output = '<style>';
$output .= '#'.$count_down_id.' .ult_countdown-amount { ';
$output .= $stick_style;
$output .= $tick_style_css;
$output .= ' font-family : '.$tdfamily.';';
$output .= ' color: '.$tick_col.';';
$output .= ' } ';
$output .= '#'.$count_down_id.' .ult_countdown-period{';
$output .= $stick_unit_style;
$output .= ' color: '.$tick_sep_col.';';
$output .= ' font-family: '.$tunifamily.';';
$output .= $tick_sep_style_css;
$output .= $tick_sep_style;
$output .= '}';
$output .= '</style>';
$output .= '<div "'.$count_down_sep_data_list.'" class="ult-responsive ult_countdown '.esc_attr($countdown_design_style).' '.esc_attr($el_class).' '.esc_attr($count_style).'">';
//Responsive param
if(is_numeric($tick_size)) { $tick_size = 'desktop:'.$tick_size.'px;'; }
if(is_numeric($tick_line_height)) { $tick_line_height = 'desktop:'.$tick_line_height.'px;'; }
$count_down_args = array(
'target' => '#'.$count_down_id.' .ult_countdown-amount',
'media_sizes' => array(
'font-size' => $tick_size,
'line-height' => $tick_line_height,
),
);
$count_down_data_list = get_ultimate_vc_responsive_media_css($count_down_args);
if($datetime!=''){
$output .='<div id="'.esc_attr($count_down_id).'" class="ult-responsive ult_countdown-div ult_countdown-dateAndTime '.esc_attr($ult_tz).'" data-labels="'.esc_attr($labels).'" data-labels2="'.esc_attr($labels2).'" data-terminal-date="'.esc_attr($datetime).'" data-countformat="'.esc_attr($count_frmt).'" data-time-zone="'.esc_attr(get_option('gmt_offset')).'" data-time-now="'.esc_attr(str_replace('-', '/', current_time('mysql'))).'" data-tick-col="'.esc_attr($tick_col).'" '.$count_down_data_list.' data-tick-p-col="'.esc_attr($tick_sep_col).'" '.$data_attr.'>'.$datetime.'</div>';
}
$output .='</div>';
$is_preset = false;
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>'; // remove backslash once copied
}
return $output;
}
}
//instantiate the class
$ult_countdown = new Ultimate_CountDown;
if(class_exists('WPBakeryShortCode') && !class_exists('WPBakeryShortCode_ult_countdown'))
{
class WPBakeryShortCode_ult_countdown extends WPBakeryShortCode {
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,727 @@
<?php
/*
* Add-on Name: Ultimate Fancy Text
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('Ultimate_FancyText')){
class Ultimate_FancyText{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'ultimate_fancytext_init'));
}
add_shortcode('ultimate_fancytext',array($this,'ultimate_fancytext_shortcode'));
add_action('wp_enqueue_scripts', array($this, 'register_fancytext_assets'),1);
}
function register_fancytext_assets()
{
Ultimate_VC_Addons::ultimate_register_style( 'ultimate-fancytext-style', 'fancytext' );
Ultimate_VC_Addons::ultimate_register_script( 'ultimate-typed-js', 'typed', false, array( 'jquery' ), ULTIMATE_VERSION, false );
Ultimate_VC_Addons::ultimate_register_script( 'ultimate-easy-ticker-js', 'easy-ticker', false, array( 'jquery' ), ULTIMATE_VERSION, false );
}
function ultimate_fancytext_init(){
if(function_exists("vc_map")){
vc_map(
array(
"name" => __("Fancy Text","ultimate_vc"),
"base" => "ultimate_fancytext",
"class" => "vc_ultimate_fancytext",
"icon" => "vc_ultimate_fancytext",
"category" => "Ultimate VC Addons",
"description" => __("Fancy lines with animation effects.","ultimate_vc"),
"params" => array(
array(
"type" => "textfield",
"param_name" => "fancytext_prefix",
"heading" => __("Prefix","ultimate_vc"),
"value" => "",
),
array(
'type' => 'textarea',
'heading' => __( 'Fancy Text', 'ultimate_vc' ),
'param_name' => 'fancytext_strings',
'description' => __('Enter each string on a new line','ultimate_vc'),
'admin_label' => true
),
array(
"type" => "textfield",
"param_name" => "fancytext_suffix",
"heading" => __("Suffix","ultimate_vc"),
"value" => "",
),
array(
"type" => "dropdown",
"heading" => __("Effect", "ultimate_vc"),
"param_name" => 'fancytext_effect',
"value" => array(
__("Type", "ultimate_vc") => "typewriter",
__("Slide Up", "ultimate_vc") => "ticker",
//__("Slide Down", "ultimate_vc") => "ticker-down"
),
),
array(
"type" => "dropdown",
"heading" => __("Alignment", "ultimate_vc"),
"param_name" => "fancytext_align",
"value" => array(
__("Center","ultimate_vc") => "center",
__("Left","ultimate_vc") => "left",
__("Right","ultimate_vc") => "right"
)
),
array(
"type" => "number",
"heading" => __("Type Speed", "ultimate_vc"),
"param_name" => "strings_textspeed",
"min" => 0,
"value" => 35,
"suffix" => __("In Miliseconds","ultimate_vc"),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter")),
"description" => __("Speed at which line progresses / Speed of typing effect.", "ultimate_vc")
),
array(
"type" => "number",
"heading" => __("Backspeed", "ultimate_vc"),
"param_name" => "strings_backspeed",
"min" => 0,
"value" => 0,
"suffix" => __("In Miliseconds","ultimate_vc"),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter")),
"description" => __("Speed of delete / backspace effect.", "ultimate_vc")
),
array(
"type" => "number",
"heading" => __("Start Delay", "ultimate_vc"),
"param_name" => "strings_startdelay",
"min" => 0,
"value" => '200',
"suffix" => __("In Miliseconds","ultimate_vc"),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter")),
"description" => __("Example - If set to 5000, the first string will appear after 5 seconds.", "ultimate_vc")
),
array(
"type" => "number",
"heading" => __("Back Delay", "ultimate_vc"),
"param_name" => "strings_backdelay",
"min" => 0,
"value" => '1500',
"suffix" => __("In Miliseconds","ultimate_vc"),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter")),
"description" => __("Example - If set to 5000, the string will remain visible for 5 seconds before backspace effect.","ultimate_vc")
),
array(
"type" => "ult_switch",
"heading" => __("Enable Loop","ultimate_vc"),
"param_name" => "typewriter_loop",
"value" => "true",
"default_set" => true,
"options" => array(
"true" => array(
"label" => "",
"on" => "Yes",
"off" => "No"
)
),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter"))
),
array(
"type" => "ult_switch",
"heading" => __("Show Cursor","ultimate_vc"),
"param_name" => "typewriter_cursor",
"value" => "true",
"default_set" => true,
"options" => array(
"true" => array(
"label" => "",
"on" => "Yes",
"off" => "No",
)
),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter"))
),
array(
"type" => "textfield",
"heading" => __("Cursor Text","ultimate_vc"),
"param_name" => "typewriter_cursor_text",
"value" => "|",
"group" => "Advanced Settings",
"dependency" => array("element" => "typewriter_cursor", "value" => array("true"))
),
array(
"type" => "number",
"heading" => __("Animation Speed", "ultimate_vc"),
"param_name" => "strings_tickerspeed",
"min" => 0,
"value" => 200,
"suffix" => __("In Miliseconds","ultimate_vc"),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("ticker","ticker-down")),
"description" => __("Duration of 'Slide Up' animation", "ultimate_vc")
),
array(
"type" => "number",
"heading" => __("Pause Time", "ultimate_vc"),
"param_name" => "ticker_wait_time",
"min" => 0,
"value" => "3000",
"suffix" => __("In Miliseconds","ultimate_vc"),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("ticker","ticker-down")),
"description" => __("How long the string should stay visible?","ultimate_vc")
),
array(
"type" => "number",
"heading" => __("Show Items", "ultimate_vc"),
"param_name" => "ticker_show_items",
"min" => 1,
"value" => 1,
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("ticker","ticker-down")),
"description" => __("How many items should be visible at a time?", "ultimate_vc")
),
array(
"type" => "ult_switch",
"heading" => __("Pause on Hover","ultimate_vc"),
"param_name" => "ticker_hover_pause",
"value" => "",
"options" => array(
"true" => array(
"label" => "",
"on" => "Yes",
"off" => "No",
)
),
"group" => "Advanced Settings",
"dependency" => array("element" => "fancytext_effect", "value" => array("ticker","ticker-down"))
),
array(
"type" => "textfield",
"heading" => __("Extra Class","ultimate_vc"),
"param_name" => "ex_class"
),
array(
"type" => "ult_param_heading",
"param_name" => "fancy_text_typography",
"text" => __("Fancy Text Settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "strings_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "strings_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "strings_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font Size", 'ultimate_vc'),
"param_name" => "strings_font_size",
"unit" => "px",
"media" => array(
/*"Large Screen" => '',*/
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "strings_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "strings_line_height",
"unit" => "px",
"media" => array(
/*"Large Screen" => '',*/
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "colorpicker",
"heading" => __("Fancy Text Color","ultimate_vc"),
"param_name" => "fancytext_color",
"group" => "Advanced Settings",
"group" => "Typography",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter","ticker","ticker-down"))
),
array(
"type" => "colorpicker",
"heading" => __("Fancy Text Background","ultimate_vc"),
"param_name" => "ticker_background",
"group" => "Advanced Settings",
"group" => "Typography",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter","ticker","ticker-down"))
),
array(
"type" => "dropdown",
"heading" => __("Transform","ultimate_vc"),
"param_name" => "fancytext_trans",
"value" => array(
__("Default","ultimate_vc") => "unset",
__("UPPERCASE","ultimate_vc") => "uppercase",
__("lowercase","ultimate_vc") => "lowercase",
__("Capitalize","ultimate_vc") => "capitalize",
),
"group" => "Typography",
),
array(
"type" => "ult_param_heading",
"param_name" => "fancy_prefsuf_text_typography",
"text" => __("Prefix Suffix Text Settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "prefsuf_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "prefsuf_font_style",
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font Size", 'ultimate_vc'),
"param_name" => "prefix_suffix_font_size",
"unit" => "px",
"media" => array(
/*"Large Screen" => '',*/
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "prefix_suffix_line_height",
"unit" => "px",
"media" => array(
/*"Large Screen" => '',*/
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Prefix & Suffix Text Color", "ultimate_vc"),
"param_name" => "sufpref_color",
"value" => "",
"group" => "Typography"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Prefix & Suffix Background Color", "ultimate_vc"),
"param_name" => "sufpref_bg_color",
"value" => "",
"group" => "Typography"
),
array(
"type" => "colorpicker",
"heading" => __("Cursor Color","ultimate_vc"),
"param_name" => "typewriter_cursor_color",
"group" => "Advanced Settings",
"group" => "Typography",
"dependency" => array("element" => "fancytext_effect", "value" => array("typewriter"))
),
array(
"type" => "dropdown",
"heading" => __("Markup","ultimate_vc"),
"param_name" => "fancytext_tag",
"value" => array(
__("Default","ultimate_vc") => "div",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H3","ultimate_vc") => "h3",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is Div", "ultimate_vc"),
"group" => "Typography",
),
array(
"type" => "dropdown",
"heading" => __("Transform","ultimate_vc"),
"param_name" => "fancypre_trans",
"value" => array(
__("Default","ultimate_vc") => "unset",
__("UPPERCASE","ultimate_vc") => "uppercase",
__("lowercase","ultimate_vc") => "lowercase",
__("Capitalize","ultimate_vc") => "capitalize",
),
"group" => "Typography",
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/t5ir4' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_fancy_design',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)
)
);
}
}
function ultimate_fancytext_shortcode($atts, $content = null){
$output = $fancytext_strings = $fancytext_prefix = $fancytext_suffix = $fancytext_effect = $strings_textspeed = $strings_tickerspeed = $typewriter_cursor = $typewriter_cursor_text = $typewriter_loop = $fancytext_align = $strings_font_family = $strings_font_style = $strings_font_size = $sufpref_color = $strings_line_height = $strings_startdelay = $strings_backspeed = $strings_backdelay = $ticker_wait_time = $ticker_show_items = $ticker_hover_pause = $ex_class = '';
$prefsuf_font_family = $prefsuf_font_style = $prefix_suffix_font_size = $prefix_suffix_line_height = $sufpref_bg_color = $fancypre_trans = $fancy_trans = $fancytext_trans = $fancyt_trans ='';
$id = uniqid(rand());
extract(shortcode_atts(array(
'fancytext_strings' => '',
'fancytext_prefix' => '',
'fancytext_suffix' => '',
'fancytext_effect' => 'typewriter',
'strings_textspeed' => '35',
'strings_tickerspeed' => '200',
'typewriter_loop' => 'true',
'typewriter_cursor_color' => '',
'fancytext_tag' => 'div',
'fancytext_align' => 'center',
'strings_font_family' => '',
'strings_font_style' => '',
'strings_font_size' => '',
'sufpref_color' => '',
'strings_line_height' => '',
'strings_startdelay' => '200',
'strings_backspeed' => '0',
'strings_backdelay' => '1500',
'typewriter_cursor' => 'true',
'typewriter_cursor_text' => '|',
'ticker_wait_time' => '3000',
'ticker_show_items' => '1',
'ticker_hover_pause' => '',
'ticker_background' => '',
'fancytext_color' => '',
'prefsuf_font_family' => '',
'prefsuf_font_style' => '',
'prefix_suffix_font_size' =>'',
'prefix_suffix_line_height' =>'',
'sufpref_bg_color' => '',
'ex_class' => '',
'css_fancy_design' =>'',
'fancypre_trans' => 'unset',
'fancytext_trans' => 'unset',
),$atts));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$string_inline_style = $vticker_inline = $valign = $prefsuf_style = $css_design_style = '';
$css_design_style = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_fancy_design, ' ' ), "ultimate_fancytext", $atts );
$css_design_style = esc_attr( $css_design_style );
if($strings_font_family != '')
{
$font_family = get_ultimate_font_family($strings_font_family);
if($font_family !== '')
$string_inline_style .= 'font-family:\''.$font_family.'\';';
}
$string_inline_style .= get_ultimate_font_style($strings_font_style);
if($prefsuf_font_family != ''){
$font_family = get_ultimate_font_family($prefsuf_font_family);
if($font_family !== '')
$prefsuf_style .= 'font-family:\''.$font_family.'\';';
}
$prefsuf_style .= get_ultimate_font_style($prefsuf_font_style);
// if($strings_font_size != '')
// $string_inline_style .= 'font-size:'.$strings_font_size.'px;';
// if($strings_line_height != '')
// $string_inline_style .= 'line-height:'.$strings_line_height.'px;';
$fancy_text_id = 'uvc-type-wrap-'.rand(1000, 9999);
if (is_numeric($strings_font_size)) {
$strings_font_size = 'desktop:'.$strings_font_size.'px;';
}
if (is_numeric($strings_line_height)) {
$strings_line_height = 'desktop:'.$strings_line_height.'px;';
}
$fancy_args = array(
'target' => '#'.$fancy_text_id.
'', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $strings_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $strings_line_height
),
);
$data_list = get_ultimate_vc_responsive_media_css($fancy_args);
if (is_numeric($prefix_suffix_font_size)) {
$prefix_suffix_font_size = 'desktop:'.$prefix_suffix_font_size.'px !important;';
}
if (is_numeric($prefix_suffix_line_height)) {
$prefix_suffix_line_height = 'desktop:'.$prefix_suffix_line_height.'px !important;';
}
$fancy_prefsuf_args = array(
'target' => '#'.$fancy_text_id.
' .mycustfancy', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $prefix_suffix_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $prefix_suffix_line_height
),
);
$prefsuf_data_list = get_ultimate_vc_responsive_media_css($fancy_prefsuf_args);
if($sufpref_color != '')
$prefsuf_style .= 'color:'.$sufpref_color.';';
if($sufpref_bg_color != '')
$prefsuf_style .= 'background :'.$sufpref_bg_color.';';
if($fancytext_align != '')
$string_inline_style .= 'text-align:'.$fancytext_align.';';
// Order of replacement
$order = array("\r\n", "\n", "\r", "<br/>", "<br>","<br/>");
$replace = '|';
// Processes \r\n's first so they aren't converted twice.
$str = str_replace($order, $replace, $fancytext_strings);
$lines = explode("|", $str);
$count_lines = count($lines);
$ex_class .= ' uvc-type-align-'.$fancytext_align.' ';
if($fancytext_prefix == '')
$ex_class .= 'uvc-type-no-prefix';
if($fancytext_color != '')
$vticker_inline .= 'color:'.$fancytext_color.';';
if($ticker_background != '')
{
$vticker_inline .= 'background:'.$ticker_background.';';
if($fancytext_effect == 'typewriter')
$valign = 'fancytext-typewriter-background-enabled';
else
$valign = 'fancytext-background-enabled';
}
//Fancy Text Transform
if($fancypre_trans != '')
{
$fancy_trans = 'text-transform: '.$fancypre_trans.';';
}
if($fancytext_trans != '')
{
$fancyt_trans = 'text-transform: '.$fancytext_trans.';';
}
$ultimate_js = get_option('ultimate_js');
$output = '<'.$fancytext_tag.' id="'.esc_attr( $fancy_text_id ).'" '.$data_list.' class="uvc-type-wrap '.esc_attr($css_design_style).' '.esc_attr($is_vc_49_plus).' ult-responsive '.esc_attr($ex_class).' uvc-wrap-'.esc_attr($id).'" style="'.esc_attr($string_inline_style).'">';
if(trim($fancytext_prefix) != '')
{
$output .= '<span '.$prefsuf_data_list.' class="ultimate-'.esc_attr($fancytext_effect).'-prefix mycustfancy ult-responsive" style="'.esc_attr($prefsuf_style).' '.esc_attr($fancy_trans).'">'.esc_html(ltrim($fancytext_prefix)).'</span>';
}
if($fancytext_effect == 'ticker' || $fancytext_effect == 'ticker-down')
{
if($ultimate_js != 'enable')
wp_enqueue_script('ultimate-easy-ticker-js');
if($strings_font_size != '')
$inherit_font_size = 'ultimate-fancy-text-inherit';
else
$inherit_font_size = '';
if($ticker_hover_pause != 'true')
$ticker_hover_pause = 0;
else
$ticker_hover_pause = 1;
if($fancytext_effect == 'ticker-down')
$direction = "down";
else
$direction = "up";
$output .= '<div id="vticker-'.esc_attr($id).'" '.$data_list.' class="ultimate-vticker '.esc_attr($fancytext_effect).' '.esc_attr($valign).' '.esc_attr($inherit_font_size).'" style="'.esc_attr($vticker_inline).' '.esc_attr($fancyt_trans).'"><ul>';
foreach($lines as $key => $line)
{
if($key == 0) {
$style = 'style="opacity:1"';
}
else {
$style = 'style="opacity:0"';
}
$output .= '<li '.$style.'>'.strip_tags($line).'</li>';
}
$output .= '</ul></div>';
}
else
{
if($ultimate_js != 'enable')
wp_enqueue_script('ultimate-typed-js');
if($typewriter_loop != 'true')
$typewriter_loop = 'false';
if($typewriter_cursor != 'true')
$typewriter_cursor = 'false';
$strings = '[';
foreach($lines as $key => $line)
{
$strings .= '"'.__(trim(htmlspecialchars_decode(strip_tags($line))),'js_composer').'"';
if($key != ($count_lines-1))
$strings .= ',';
}
$strings .= ']';
$output .= '<span id="typed-'.esc_attr($id).'" class="ultimate-typed-main '.esc_attr($valign).'" style="'.esc_attr($vticker_inline).' '.esc_attr($fancyt_trans).'"></span>';
}
if(trim($fancytext_suffix) != '')
{
$output .= '<span '.$prefsuf_data_list.' class="ultimate-'.esc_attr($fancytext_effect).'-suffix mycustfancy ult-responsive" style="'.esc_attr($prefsuf_style).' '.esc_attr($fancy_trans).'">'.esc_html(rtrim($fancytext_suffix)).'</span>';
}
if($fancytext_effect == 'ticker' || $fancytext_effect == 'ticker-down')
{
$output .= '<script type="text/javascript">
jQuery(function($){
$(document).ready(function(){
if( typeof jQuery("#vticker-'.esc_attr( $id ).'").easyTicker == "function"){
$("#vticker-'.esc_attr( $id ).'").find("li").css("opacity","1");
$("#vticker-'.esc_attr( $id ).'").easyTicker({
direction: "up",
easing: "swing",
speed: '. esc_attr($strings_tickerspeed) .',
interval: '. esc_attr($ticker_wait_time) .',
height: "auto",
visible: '. esc_attr($ticker_show_items) .',
mousePause: '. esc_attr($ticker_hover_pause) .',
controls: {
up: "",
down: "",
toggle: "",
playText: "Play",
stopText: "Stop"
}
});
}
});
});
</script>';
}
else
{
$output .= '<script type="text/javascript">
jQuery(function($){
$(document).ready(function(){
if( typeof jQuery("#typed-'.esc_attr($id).'").typed == "function"){
$("#typed-'.esc_attr($id).'").typed({
strings: '.$strings.',
typeSpeed: '.esc_attr($strings_textspeed).',
backSpeed: '.esc_attr($strings_backspeed).',
startDelay: '.esc_attr($strings_startdelay).',
backDelay: '.esc_attr($strings_backdelay).',
loop: '.esc_attr($typewriter_loop).',
loopCount: false,
showCursor: '.esc_attr($typewriter_cursor).',
cursorChar: "'.esc_attr($typewriter_cursor_text).'",
attr: null
});
}
});
});
</script>';
if($typewriter_cursor_color != '')
{
$output .= '<style>
.uvc-wrap-'.esc_attr($id).' .typed-cursor {
color:'.esc_attr($typewriter_cursor_color).';
}
</style>';
}
}
$output .= '</'.$fancytext_tag.'>';
/*$args = array(
$strings_font_family
);
enquque_ultimate_google_fonts($args);*/
return $output;
}
} // end class
new Ultimate_FancyText;
if(class_exists('WPBakeryShortCode') && !class_exists('WPBakeryShortCode_ultimate_fancytext'))
{
class WPBakeryShortCode_ultimate_fancytext extends WPBakeryShortCode {
}
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,853 @@
<?php
/*
* Add-on Name: Google Font Manager
* Add-on URI: https://www.brainstormforce.com
* Usage:
# VC Params Type: (Note - "ultimate_google_fonts_style" param must be next to "ultimate_google_fonts" param only)
1) ultimate_google_fonts - for dropdown of google fonts in collection
For Ex -
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "smile"),
"param_name" => "heading_font"
),
2) ultimate_google_fonts_style - for respective google font style or default style
For Ex -
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "smile"),
"param_name" => "heading_style"
),
# In respective comoponent shortcode process function
1) Get font family -
For Ex -
$font_family = get_ultimate_font_family($heading_font);
2) Get font style -
For Ex -
$font_style = get_ultimate_font_style($heading_style);
// deprecated since 3.7.0 - automatically detected font and enqueue accordingly
3) Enqueue the respective fonts - Note send number of font param as a parameter in array
For Ex -
$args = array(
$heading_font
);
enquque_ultimate_google_fonts($args);
*/
if(!class_exists('Ultimate_Google_Font_Manager'))
{
class Ultimate_Google_Font_Manager
{
function __construct()
{
add_option('ultimate_google_fonts',array());
//delete_option('ultimate_google_fonts');
add_option('ultimate_selected_google_fonts',array());
//add_action('admin_menu',array($this, 'google_font_manager_menu'));
add_action('wp_ajax_ultimate_google_fonts_refresh', array($this, 'refresh_google_fonts_list'));
add_action('wp_ajax_get_google_fonts', array($this, 'get_google_fonts_list'));
add_action('wp_ajax_add_google_font', array($this, 'add_selected_google_font'));
add_action('wp_ajax_delete_google_font', array($this, 'delete_selected_google_font'));
add_action('wp_ajax_update_google_font', array($this, 'update_selected_google_font'));
add_action('wp_ajax_get_font_variants', array($this, 'get_font_variants_callback'));
add_action('admin_enqueue_scripts', array($this, 'enqueue_selected_ultimate_google_fonts'));
}
function google_font_manager_menu()
{
$current_theme = wp_get_theme();
if($current_theme == "Smile")
$page = add_submenu_page(
"smile_dashboard",
__("Google Font Manager","ultimate_vc"),
__("Google Fonts","ultimate_vc"),
"administrator",
"Ultimate_Font_Manager",
array($this,'ultimate_font_manager_dashboard')
);
else
$page = add_submenu_page(
"bsf-dashboard",
__("Google Font Manager","ultimate_vc"),
__("Google Fonts","ultimate_vc"),
"administrator",
"ultimate-font-manager",
array($this,'ultimate_font_manager_dashboard')
);
add_action( 'admin_print_scripts-' . $page, array($this,'admin_google_font_scripts'));
}
function admin_google_font_scripts()
{
wp_register_script('ultimate-google-fonts-script', UAVC_URL.'admin/js/google-fonts-admin.js',array('jquery'));
wp_enqueue_script('ultimate-google-fonts-script');
wp_localize_script( 'jquery', 'uavc', array(
'google_font_nonce' => wp_create_nonce( 'uavc-google-font-nonce' ),
'get_google_fonts' => wp_create_nonce( 'uavc-get-google-fonts-nonce' ),
'add_google_fonts' => wp_create_nonce( 'uavc-add-google-fonts-nonce' ),
'delete_google_fonts' => wp_create_nonce( 'uavc-delete-google-fonts-nonce' ),
'update_google_fonts' => wp_create_nonce( 'uavc-update-google-fonts-nonce' ),
) );
Ultimate_VC_Addons::ultimate_register_style( 'ultimate-google-fonts-style', UAVC_URL.'admin/css/google-fonts-admin.css', true );
wp_enqueue_style('ultimate-google-fonts-style');
}
function enqueue_selected_ultimate_google_fonts() {
$selected_fonts = get_option('ultimate_selected_google_fonts');
//delete_option('ultimate_selected_google_fonts'); exit;
$subset_main_array = array();
if(!empty($selected_fonts)) {
$count = count($selected_fonts);
$font_call = '';
foreach($selected_fonts as $key => $sfont)
{
$variants_array = array();
if($key != 0) {
$font_call .= '|';
}
$font_call .= $sfont['font_family'];
if(isset($sfont['variants'])) :
$variants = $sfont['variants'];
if(!empty($variants)) {
$font_call .= ':';
foreach($variants as $variant)
{
$variant_selected = $variant['variant_selected'];
if($variant_selected == 'true' || is_admin()) {
array_push($variants_array, $variant['variant_value']);
}
}
$variants_count = count($variants_array);
if($variants_count != 0) {
$font_call .= 'normal,';
}
foreach ($variants_array as $vkey => $variant) {
$font_call .= $variant;
if(($variants_count-1) != $vkey && $variants_count > 0) {
$font_call .= ',';
}
}
}
endif;
if(!empty($sfont['subsets']))
{
$subset_array = array();
foreach($sfont['subsets'] as $tsubset)
{
if($tsubset['subset_selected'] == 'true' || $tsubset['subset_selected'] == true )
array_push($subset_main_array, $tsubset['subset_value']);
}
}
}
$subset_string = '';
if(!empty($subset_main_array))
{
$subset_main_array = array_unique($subset_main_array);
$subset_string = '&subset=';
$subset_count = count($subset_main_array);
$subset_main_array = array_values($subset_main_array);
foreach($subset_main_array as $skey => $subset)
{
if($subset !== '')
{
$subset_string .= $subset;
if(($subset_count-1) != $skey)
$subset_string .= ',';
}
}
}
$font_call = str_replace( '||', '|', $font_call );
$link = 'https://fonts.googleapis.com/css?family='.$font_call;
$font_api_call = $link.$subset_string;
wp_register_style('ultimate-selected-google-fonts-style',$font_api_call, array(), null);
wp_enqueue_style('ultimate-selected-google-fonts-style');
}
}
function ultimate_font_manager_dashboard()
{
?>
<div class="wrap uavc-gfont">
<h2>
<?php _e('Google Fonts Manager','ultimate_vc'); ?>
<input style="cursor:pointer" type="button" class="add-new-h2" id="refresh-google-fonts" value="<?php _e('Refresh Font List','ultimate_vc'); ?>"/>
&nbsp;<span class="spinner"></span>
</h2>
<div id="vc-gf-msg"></div>
<div class="nav">
<input type="text" id="search_gfont" name="search_gfont" placeholder="<?php echo __('Search font..','ultimate_vc') ?>"/>
</div>
<div>
<div class="fonts-list">
<div id="fonts-list-wrapper" style="overflow:auto" data-gstart="0" data-gfetch="20"></div>
<div id="load-more" class="spinner" style="float:left"></div>
</div>
<div class="fonts-selected-list">
<h3><?php echo __('Your Font Collection','ultimate_vc'); ?></h3>
<div id="fonts-selected-wrapper">
<?php
$selected_fonts = get_option('ultimate_selected_google_fonts');
if(!empty($selected_fonts)) {
foreach($selected_fonts as $key => $sfont)
{
?>
<div class="selected-font">
<div class="selected-font-top <?php echo (!empty($sfont['variants']) || !empty($sfont['subsets'])) ? 'have-variants' : ''; ?>">
<div class="font-header" style="font-family:'<?php esc_attr_e($sfont['font_name']); ?>'"><?php esc_html_e($sfont['font_name']); ?></div>
<?php if(!empty($sfont['variants']) || !empty($sfont['subsets'])) : ?>
<i class="dashicons dashicons-arrow-down"></i>
<?php endif; ?>
<div class="clear"></div>
</div>
<span class="font-delete" data-font_name="<?php esc_attr_e( $sfont['font_name'] ) ?>"><i class="dashicons dashicons-no-alt"></i></span>
<?php
$is_varients = false;
if(!empty($sfont['variants']) || !empty($sfont['subsets'])) :
?>
<div class="selected-font-content">
<?php
$lid = str_replace(' ', '-', $sfont['font_name']);
$variant_font = 'font-family:\''.$sfont['font_name'].'\';';
if(!empty($sfont['variants'])) :
$is_varients = true;
?>
<div class="selected-font-varient-wrapper">
<?php
foreach($sfont['variants'] as $svkey => $svariants)
{
$variant_style = $variant_font;
if (preg_match('/italic/i',$svariants['variant_value']))
$variant_style .= 'font-style:italic;';
$weight = 'normal';
if ($weight = preg_replace('/\D/', '', $svariants['variant_value']))
$variant_style .= 'font-weight:'.$weight.';';
$tlid = $lid.'-'.$svkey;
?>
<span class="font-variant">
<input type="checkbox" id="<?php esc_attr_e( $tlid ); ?>" value="<?php esc_attr_e( $svariants['variant_value'] ); ?>" class="selected-variant-checkbox" <?php echo ($svariants['variant_selected'] == 'true') ? 'checked' : ''; ?> />
<label style="<?php esc_attr_e( $variant_style ); ?>" for="<?php esc_attr_e( $tlid ) ?>"><?php echo $svariants['variant_value'] ?></label>
</span>
<?php
}
?>
</div>
<?php
endif;
if(!empty($sfont['subsets'])) :
?>
<div class="<?php echo ($is_varients) ? 'selected-font-subset-wrapper' : '' ?>">
<?php
foreach($sfont['subsets'] as $sbkey => $ssubset)
{
$slid = $lid.'-subset-'.$sbkey;
?>
<span class="font-subset">
<input type="checkbox" id="<?php esc_attr_e( $slid ) ?>" value="<?php esc_attr_e( $ssubset['subset_value'] ); ?>" class="selected-subset-checkbox" <?php echo ($ssubset['subset_selected'] == 'true') ? 'checked' : '' ?> />
<label style="" for="<?php esc_attr_e( $slid ) ?>"><?php echo $ssubset['subset_value'] ?></label>
</span>
<?php
}
?>
</div>
<?php
endif;
?>
<input type="button" class="button alignleft update-google-font-button" value="<?php echo __('Update font','ultimate_vc') ?>" data-font_name="<?php esc_attr_e($sfont['font_name']); ?>" />
<span class="spinner fspinner"></span>
<div class="clear"></div>
</div>
<?php
endif;
?>
</div>
<?php
}
}
?>
</div>
</div>
<div class="clear"></div>
</div>
</div>
<?php
}
function refresh_google_fonts_list()
{
check_ajax_referer( 'uavc-google-font-nonce', 'security' );
$fonts = array();
$temp_count = 0;
$temp = get_option('ultimate_google_fonts');
if(!empty($temp)) {
$temp_count = count($temp);
}
$error = false;
try{
$fonts = file_get_contents($filename = 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyD_6TR2RyX2VRf8bABDRXCcVqdMXB5FQvs');
$fonts = json_decode($fonts);
}
catch(Exception $e) {
$error = true;
}
if($error == true || count($fonts) == 0)
{
$error = false;
try{
$fonts = wp_remote_get($filename = 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyD_6TR2RyX2VRf8bABDRXCcVqdMXB5FQvs');
$fonts = json_decode($fonts['body']);
}
catch(Exception $e) {
$error = true;
}
}
if($error != true || count($fonts) == 0)
{
$google_fonts = $fonts->items;
$google_font_count = count($google_fonts);
update_option('ultimate_google_fonts',$google_fonts);
$response['count'] = ($google_font_count - $temp_count);
$response['message'] = __(($google_font_count - $temp_count).' new fonts added. ','ultimate_vc');
}
else
{
$response['count'] = 0;
$response['message'] = __('Fonts could not be downloaded as there might be some issue with file_get_contents or wp_remote_get due to your server configuration.','ultimate_vc');
}
echo json_encode($response);
die();
}
/* old refresh fonts
function refresh_google_fonts_list()
{
$temp_count = 0;
$temp = get_option('ultimate_google_fonts');
if(!empty($temp)) {
$temp_count = count($temp);
}
set_error_handler(array($this, 'handleFontError'));
try {
$fonts = file_get_contents($filename = 'https://www.googleapis.com/webfonts/v1/webfonts?key=AIzaSyD_6TR2RyX2VRf8bABDRXCcVqdMXB5FQvs');
$fonts = json_decode($fonts);
$google_fonts = $fonts->items;
$google_font_count = count($google_fonts);
update_option('ultimate_google_fonts',$google_fonts);
$response['count'] = ($google_font_count - $temp_count);
$response['message'] = ($google_font_count - $temp_count).' new fonts added.';
}
catch(Exception $e) {
$response['count'] = '';
$response['message'] = 'It seems allow_url_fopen PHP function is disabled on your server. Please contact your hosting service provider to enable it.';
}
echo json_encode($response);
die();
}*/
function get_google_fonts_list()
{
check_ajax_referer( 'uavc-get-google-fonts-nonce', 'security' );
$google_fonts = get_option('ultimate_google_fonts');
$response = $fonts = array();
$search = '';
if(!empty($google_fonts)) :
$selected_google_fonts = get_option('ultimate_selected_google_fonts');
$temp_selected = array();
if(!empty($selected_google_fonts ))
{
foreach($selected_google_fonts as $selected_font)
array_push($temp_selected, $selected_font['font_name']);
}
$start_count = $_POST['start'];
$fetch_count = $_POST['fetch'];
$search = trim($_POST['search']);
$font_slice_array = array();
if($search != '') {
$temp = array();
foreach($google_fonts as $tkey => $tfont){
if(stripos($tfont->family, $search) !== false){
array_push($temp, $google_fonts[$tkey]);
}
}
$font_slice_array = $temp;
}
else {
$font_slice_array = array_slice($google_fonts, $start_count, $fetch_count);
}
$count = count($font_slice_array);
foreach($font_slice_array as $key => $tempfont)
{
$fontinfo = array();
if(in_array($tempfont->family, $temp_selected))
$already_selected = 'true';
else
$already_selected = 'false';
$font_call = str_replace(' ', '+', $tempfont->family);
$variants = $tempfont->variants;
$subsets = $tempfont->subsets;
$fontinfo = array(
'font_name' => $tempfont->family,
'font_call' => $font_call,
'variants' => $variants,
'subsets' => $subsets,
'selected' => $already_selected
);
array_push($fonts, $fontinfo);
}
endif;
$response['fonts'] = $fonts;
$response['fonts_count'] = count($google_fonts);
if($search != '')
$response['is_search'] = 'true';
else
$response['is_search'] = 'false';
echo json_encode($response);
die();
}
function add_selected_google_font()
{
check_ajax_referer( 'uavc-add-google-fonts-nonce', 'security' );
$font_family = $_POST['font_family'];
$font_name = $_POST['font_name'];
$variants = $_POST['variants'];
$subsets = $_POST['subsets'];
$fonts = get_option('ultimate_selected_google_fonts');
if(empty($fonts))
$fonts = array();
$new_font = array(
'font_family' => $font_family,
'font_name' => $font_name,
'variants' => $variants,
'subsets' => $subsets
);
array_push($fonts,$new_font);
update_option('ultimate_selected_google_fonts', $fonts);
echo 'Added';
die();
}
function delete_selected_google_font()
{
check_ajax_referer( 'uavc-delete-google-fonts-nonce', 'security' );
$font_name = $_POST['font_name'];
$fonts = get_option('ultimate_selected_google_fonts');
foreach($fonts as $key => $font)
{
if($font['font_name'] == $font_name)
{
unset($fonts[$key]);
}
}
$fonts = array_values($fonts);
update_option('ultimate_selected_google_fonts', $fonts);
echo 'Deleted';
die();
}
function update_selected_google_font() {
check_ajax_referer( 'uavc-update-google-fonts-nonce', 'security' );
$font_name = $_POST['font_name'];
$variants = $_POST['variants'];
$subsets = $_POST['subsets'];
$fonts = get_option('ultimate_selected_google_fonts');
foreach($fonts as $key => $font)
{
if($font['font_name'] == $font_name)
{
$fonts[$key]['variants'] = $variants;
$fonts[$key]['subsets'] = $subsets;
$x = $key;
}
}
update_option('ultimate_selected_google_fonts', $fonts);
echo 'Updated';
die();
}
function get_font_variants_callback()
{
check_ajax_referer( 'uavc-get-font-variants-nonce', 'security' );
$font_name = $_POST['font_name'];
$fonts = get_option('ultimate_selected_google_fonts');
$font_variants = $json_variants = array();
$default_variant_styles = array(
0 => array(
'label' => 'Underline',
'style' => 'text-decoration:underline;',
'type' => 'checkbox',
'group' => 'ultimate_defaults_styles',
'class' => 'ultimate_defaults_styles'
),
1 => array(
'label' => 'Italic',
'style' => 'font-style:italic;',
'type' => 'checkbox',
'group' => 'ultimate_defaults_styles',
'class' => 'ultimate_defaults_styles'
),
2 => array(
'label' => 'Bold',
'style' => 'font-weight:bold;',
'type' => 'checkbox',
'group' => 'ultimate_defaults_styles',
'class' => 'ultimate_defaults_styles'
)
);
foreach($fonts as $key => $font)
if($font['font_name'] == $font_name)
$font_variants = $fonts[$key]['variants'];
if(!empty($font_variants))
{
$is_italic = $is_weight = false;
$uniq_grp = uniqid('_');
$pre_default_variants = array();
foreach($font_variants as $key => $variant)
{
if($variant['variant_selected'] == 'true') :
$temp_array = array();
$is_weight = $is_italic = false;
if (preg_match('/italic/i',$variant['variant_value']) && $weight = preg_replace('/\D/', '', $variant['variant_value']))
{
$temp_array['label'] = $variant['variant_value'];
$temp_array['style'] = 'font-style:italic;font-weight:'.$weight.';';
$is_italic = true;
$is_weight = true;
}
elseif (preg_match('/italic/i',$variant['variant_value']))
{
$temp_array['label'] = $variant['variant_value'];
$temp_array['style'] = 'font-style:italic;';
$is_italic = true;
}
elseif ($weight = preg_replace('/\D/', '', $variant['variant_value']))
{
$temp_array['label'] = $variant['variant_value'];
$temp_array['style'] = 'font-weight:'.$weight.';';
$is_weight = true;
}
$temp_array['type'] = 'radio';
$temp_array['group'] = 'style_by_google'.$uniq_grp;
$temp_array['class'] = 'style_by_google';
array_push($json_variants, $temp_array);
endif;
}
array_push($pre_default_variants, $default_variant_styles[0]); //2 for bold
if($is_italic == false)
array_push($pre_default_variants, $default_variant_styles[1]); //2 for bold
if($is_weight == false)
array_push($pre_default_variants, $default_variant_styles[2]); //2 for bold
$json_variants = array_merge($pre_default_variants, $json_variants);
}
else
{
$json_variants = $default_variant_styles;
}
echo json_encode($json_variants);
die();
}
}
// Instantiate the Google Font Manager
new Ultimate_Google_Font_Manager;
}
if(!function_exists('enquque_ultimate_google_fonts'))
{
function enquque_ultimate_google_fonts($enqueue_fonts)
{
$selected_fonts = apply_filters( 'enquque_selected_ultimate_google_fonts_optimzed', get_option('ultimate_selected_google_fonts') );
$skip_font_enqueue = apply_filters( 'enquque_ultimate_google_fonts_skip', false );
if ( true == $skip_font_enqueue ) {
return '';
}
$fonts = array();
$subset_call = '';
if(!empty($enqueue_fonts))
{
foreach($enqueue_fonts as $key => $efont)
{
$font_name = $font_call = $font_variant = '';
$font_arr = $font_call_arr = $font_weight_arr = array();
$font_arr = explode('|', $efont);
if(isset($font_arr[1]))
{
$font_call_arr = explode(':',$font_arr[1]);
if(isset($font_arr[2]))
$font_weight_arr = explode(':', $font_arr[2]);
if(isset($font_call_arr[1]) && $font_call_arr[1] != '')
{
$font_call = $font_call_arr[1];
$font_name = $font_call_arr[1];
foreach($selected_fonts as $sfont)
{
if($sfont['font_family'] == $font_name)
{
if(!empty($sfont['subsets']))
{
$subset_array = array();
foreach($sfont['subsets'] as $tsubset)
{
if($tsubset['subset_selected'] == 'true')
array_push($subset_array, $tsubset['subset_value']);
}
if(!empty($subset_array)) :
$subset_call = '&subset=';
$j = count($subset_array);
foreach($subset_array as $subkey => $subset)
{
$subset_call .= $subset;
if(($j-1) != $subkey)
$subset_call .= ',';
}
endif;
}
}
}
if(isset($font_weight_arr[1]) && $font_weight_arr[1] != '')
{
$font_variant = $font_weight_arr[1];
}
$eq_name = str_replace(' ','-',$font_name);
if($font_variant != '' || $font_variant != 'regular')
{
$font_call.= ':'.$font_variant;
$eq_name.= '-'.$font_variant;
}
$link = 'https://fonts.googleapis.com/css?family='.$font_call.$subset_call;
if (!wp_script_is( 'ultimate-'.$eq_name, 'registered' ))
{
wp_register_style('ultimate-'.$eq_name,$link);
wp_enqueue_style('ultimate-'.$eq_name);
}
else if(wp_script_is( 'ultimate-'.$eq_name, 'registered' ))
{
wp_enqueue_style('ultimate-'.$eq_name);
}
}
}
else // font is without varients
{
$eq_name = $font_arr[0];
$link = 'https://fonts.googleapis.com/css?family='.$eq_name;
if($eq_name != '')
{
if (!wp_script_is( 'ultimate-'.$eq_name, 'registered' ))
{
wp_register_style('ultimate-'.$eq_name,$link);
wp_enqueue_style('ultimate-'.$eq_name);
}
else if(wp_script_is( 'ultimate-'.$eq_name, 'registered' ))
{
wp_enqueue_style('ultimate-'.$eq_name);
}
}
}
}
}
}
}
if(!function_exists('get_ultimate_font_family'))
{
function get_ultimate_font_family($font_attributes)
{
if(!empty($font_attributes))
{
$font_family_arr = explode('|', $font_attributes);
$font_family_str = $font_family_arr[0];
$font_family = explode(':', $font_family_str);
if(isset($font_family[1]) && $font_family[1] != '')
{
return $font_family[1];
}
else
{
return '';
}
}
else
return '';
}
}
if(!function_exists('get_ultimate_font_style'))
{
function get_ultimate_font_style($font_style)
{
$weight_match = 0;
$temp = '';
if($font_style != '')
{
$font_styles = explode(',', $font_style); //split by comma<strong></strong>
foreach($font_styles as $fstyle)
{
$temp .= $fstyle; //convert to css
if(preg_match('/font-weight:/i', $fstyle))
$weight_match++;
}
}
// hack to font weight to normal if font weight not available
if($weight_match == 0)
$temp .= 'font-weight:normal;';
return $temp;
}
}
if(!function_exists('enquque_ultimate_google_fonts_optimzed'))
{
function enquque_ultimate_google_fonts_optimzed($enqueue_fonts)
{
$selected_fonts = apply_filters( 'enquque_selected_ultimate_google_fonts', get_option('ultimate_selected_google_fonts') );
$skip_font_enqueue = apply_filters( 'enquque_ultimate_google_fonts_skip', false );
if ( true == $skip_font_enqueue ) {
return '';
}
$main = $subset_main_array = $fonts = array();
$subset_call = '';
if(!empty($enqueue_fonts))
{
$font_count = 0;
foreach($enqueue_fonts as $key => $efont)
{
$font_name = $font_call = $font_variant = '';
$font_arr = $font_call_arr = $font_weight_arr = array();
$font_arr = explode('|', $efont);
$font_name = trim($font_arr[0]);
if(!isset($main[$font_name]))
$main[$font_name] = array();
if(!empty($font_name)):
$font_count++;
if(isset($font_arr[1]))
{
$font_call_arr = explode(':',$font_arr[1]);
if(isset($font_arr[2]))
$font_weight_arr = explode(':', $font_arr[2]);
if(isset($font_call_arr[1]) && $font_call_arr[1] != '')
{
$font_variant = $font_call_arr[1];
$pre_font_call = $font_name;
if($font_variant != '' && $font_variant !== 'regular')
{
$main[$font_name]['varients'][] = $font_variant;
array_push($main[$font_name]['varients'],$font_variant);
if(!empty($main[$font_name]['varients']))
$main[$font_name]['varients'] = array_values(array_unique($main[$font_name]['varients']));
}
}
}
foreach($selected_fonts as $sfont)
{
if($sfont['font_family'] == $font_name)
{
if(!empty($sfont['subsets']))
{
$subset_array = array();
foreach($sfont['subsets'] as $tsubset)
{
if($tsubset['subset_selected'] == 'true')
array_push($subset_array, $tsubset['subset_value']);
}
if(!empty($subset_array)) :
$subset_call = '';
$j = count($subset_array);
foreach($subset_array as $subkey => $subset)
{
$subset_call .= $subset;
if(($j-1) != $subkey)
$subset_call .= ',';
}
array_push($subset_main_array ,$subset_call);
endif;
}
}
}
endif;
}
$link = 'https://fonts.googleapis.com/css?family=';
$main_count = count($main);
$mcount = 0;
foreach($main as $font => $font_data)
{
if($font !== '')
{
$link .= $font;
if($font == 'Open+Sans+Condensed' && empty($font_data['varients']))
$link .= ':300';
if(!empty($font_data['varients']))
{
$link .= ':regular,';
$varient_count = count($font_data['varients']);
foreach($font_data['varients'] as $vkey => $varient)
{
$link .= $varient;
if(($varient_count-1) != $vkey)
$link .= ',';
}
}
if(!empty($font_data['subset']))
$subset_string .= '&subset='.$font_data['subset'];
if($mcount != ($main_count-1))
$link .= '|';
$mcount++;
}
}
$subset_string = '';
if(!empty($subset_array))
{
$subset_main_array = array_unique($subset_main_array);
$subset_string = '&subset=';
$subset_count = count($subset_main_array);
$subset_main_array = array_values($subset_main_array);
foreach($subset_main_array as $skey => $subset)
{
if($subset !== '')
{
$subset_string .= $subset;
if(($subset_count-1) != $skey)
$subset_string .= ',';
}
}
}
$font_api_call = $link.$subset_string;
if($font_count > 0)
wp_enqueue_style('ultimate-google-fonts', $font_api_call, array(), null);
}
}
}
@@ -0,0 +1,276 @@
<?php
if(!function_exists('ultimate_get_icon_position_json')){
function ultimate_get_icon_position_json(){
$json = '{
"Display Text and Icon - Always":{
"Icon_at_Left":"ubtn-sep-icon-at-left",
"Icon_at_Right":"ubtn-sep-icon-at-right"
},
"Display Icon With Text - On_Hover":{
"Bring_in_Icon_from_Left":"ubtn-sep-icon-left",
"Bring_in_Icon_from_Right":"ubtn-sep-icon-right",
"Push_Icon_to_Left":"ubtn-sep-icon-left-rev",
"Push_Icon_to_Right":"ubtn-sep-icon-right-rev"
},
"Replace Text by Icon - On Hover":{
"Push_out_Text_to_Top":"ubtn-sep-icon-bottom-push",
"Push_out_Text_to_Bottom":"ubtn-sep-icon-top-push",
"Push_out_Text_to_Left":"ubtn-sep-icon-right-push",
"Push_out_Text_to_Right‏":"ubtn-sep-icon-left-push"
}
}';
return $json;
}
}
function ultimate_get_banner2_json(){
$json = '{
"Long_Text":{
"Style_1":"style1",
"Style_2":"style5",
"Style_3":"style13"
},
"Medium_Text":{
"Style_4":"style2",
"Style_5":"style4",
"Style_6":"style6",
"Style_7":"style7",
"Style_8":"style10",
"Style_9":"style14"
},
"Short_Description":{
"Style_10":"style9",
"Style_11":"style11",
"Style_12":"style15"
}
}';
return $json;
}
if(!function_exists('ultimate_get_animation_json')){
function ultimate_get_animation_json(){
$json = '{
"attention_seekers": {
"No Animation": true,
"bounce": true,
"flash": true,
"pulse": true,
"rubberBand": true,
"shake": true,
"swing": true,
"tada": true,
"wobble": true
},
"bouncing_entrances": {
"bounceIn": true,
"bounceInDown": true,
"bounceInLeft": true,
"bounceInRight": true,
"bounceInUp": true
},
"bouncing_exits": {
"bounceOut": true,
"bounceOutDown": true,
"bounceOutLeft": true,
"bounceOutRight": true,
"bounceOutUp": true
},
"fading_entrances": {
"fadeIn": true,
"fadeInDown": true,
"fadeInDownBig": true,
"fadeInLeft": true,
"fadeInLeftBig": true,
"fadeInRight": true,
"fadeInRightBig": true,
"fadeInUp": true,
"fadeInUpBig": true
},
"fading_exits": {
"fadeOut": true,
"fadeOutDown": true,
"fadeOutDownBig": true,
"fadeOutLeft": true,
"fadeOutLeftBig": true,
"fadeOutRight": true,
"fadeOutRightBig": true,
"fadeOutUp": true,
"fadeOutUpBig": true
},
"flippers": {
"flip": true,
"flipInX": true,
"flipInY": true,
"flipOutX": true,
"flipOutY": true
},
"lightspeed": {
"lightSpeedIn": true,
"lightSpeedOut": true
},
"rotating_entrances": {
"rotateIn": true,
"rotateInDownLeft": true,
"rotateInDownRight": true,
"rotateInUpLeft": true,
"rotateInUpRight": true
},
"rotating_exits": {
"rotateOut": true,
"rotateOutDownLeft": true,
"rotateOutDownRight": true,
"rotateOutUpLeft": true,
"rotateOutUpRight": true
},
"sliders": {
"slideInDown": true,
"slideInLeft": true,
"slideInRight": true,
"slideOutLeft": true,
"slideOutRight": true,
"slideOutUp": true,
"slideInUp": true,
"slideOutDown": true
},
"specials": {
"hinge": true,
"rollIn": true,
"rollOut": true
},
"zooming_entrances": {
"zoomIn": true,
"zoomInDown": true,
"zoomInLeft": true,
"zoomInRight": true,
"zoomInUp": true
},
"zooming_exits": {
"zoomOut": true,
"zoomOutDown": true,
"zoomOutLeft": true,
"zoomOutRight": true,
"zoomOutUp": true
},
"infinite_animations": {
"InfiniteRotate": true,
"InfiniteRotateCounter": true,
"InfiniteDangle": true,
"InfiniteSwing": true,
"InfinitePulse": true,
"InfiniteHorizontalShake": true,
"InfiniteVericalShake": true,
"InfiniteBounce": true,
"InfiniteFlash": true,
"InfiniteTADA": true,
"InfiniteRubberBand": true,
"InfiniteHorizontalFlip": true,
"InfiniteVericalFlip": true,
"InfiniteHorizontalScaleFlip": true,
"InfiniteVerticalScaleFlip": true
}
}';
return $json;
}
}
function ult_getBrowser()
{
$u_agent = $_SERVER['HTTP_USER_AGENT'];
$bname = 'Unknown';
$platform = 'Unknown';
$version= "";
//First get the platform?
if (preg_match('/linux/i', $u_agent)) {
$platform = 'linux';
}
elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {
$platform = 'mac';
}
elseif (preg_match('/windows|win32/i', $u_agent)) {
$platform = 'windows';
}
// Next get the name of the useragent yes seperately and for good reason
if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent))
{
$bname = 'Internet Explorer';
$ub = "MSIE";
}
elseif(preg_match('/Firefox/i',$u_agent))
{
$bname = 'Mozilla Firefox';
$ub = "Firefox";
}
elseif(preg_match('/Chrome/i',$u_agent))
{
$bname = 'Google Chrome';
$ub = "Chrome";
}
elseif(preg_match('/Safari/i',$u_agent))
{
$bname = 'Apple Safari';
$ub = "Safari";
}
elseif(preg_match('/Opera/i',$u_agent))
{
$bname = 'Opera';
$ub = "Opera";
}
elseif(preg_match('/Netscape/i',$u_agent))
{
$bname = 'Netscape';
$ub = "Netscape";
}
// finally get the correct version number
$known = array('Version', $ub, 'other');
$pattern = '#(?<browser>' . join('|', $known) .
')[/ ]+(?<version>[0-9.|a-zA-Z.]*)#';
if (!preg_match_all($pattern, $u_agent, $matches)) {
// we have no matching number just continue
}
// see how many we have
$i = count($matches['browser']);
if ($i != 1) {
//we will have two since we are not using 'other' argument yet
//see if version is before or after the name
if (strripos($u_agent,"Version") < strripos($u_agent,$ub)){
$version= $matches['version'][0];
}
else {
$version= $matches['version'][1];
}
}
else {
$version= $matches['version'][0];
}
// check if we have a number
if ($version==null || $version=="") {$version="?";}
return array(
// 'userAgent' => $u_agent,
'name' => $bname,
'version' => $version,
// 'platform' => $platform,
// 'pattern' => $pattern
);
}
function ult_prepareAtts( $atts ) {
if ( isset( $atts ) ) {
$return = str_replace( array(
//'`{`',
//'`}`',
'``',
), array(
//'[',
//']',
'"',
), $atts );
}
return $return;
}
@@ -0,0 +1,599 @@
<?php
/*
* Add-on Name: Ultimate Google Maps
* Add-on URI: https://www.brainstormforce.com
*/
if(!class_exists("Ultimate_Google_Maps")){
class Ultimate_Google_Maps{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action("init",array($this,"google_maps_init"));
}
add_shortcode("ultimate_google_map",array($this,"display_ultimate_map"));
add_action('wp_enqueue_scripts', array($this, 'ultimate_google_map_script'),1);
}
function ultimate_google_map_script()
{
$api = 'https://maps.googleapis.com/maps/api/js';
$map_key = bsf_get_option('map_key');
if($map_key != false) {
$arr_params = array(
'key' => $map_key
);
$api = esc_url( add_query_arg( $arr_params , $api ));
}
wp_register_script("googleapis",$api,null,null,false);
}
function google_maps_init(){
if ( function_exists('vc_map'))
{
vc_map( array(
"name" => __("Google Map", "ultimate_vc"),
"base" => "ultimate_google_map",
"class" => "vc_google_map",
"controls" => "full",
"show_settings_on_create" => true,
"icon" => "vc_google_map",
"description" => __("Display Google Maps to indicate your location.", "ultimate_vc"),
"category" => "Ultimate VC Addons",
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __("Width (in %)", "ultimate_vc"),
"param_name" => "width",
"admin_label" => true,
"value" => "100%",
"group" => "General Settings"
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Height (in px)", "ultimate_vc"),
"param_name" => "height",
"admin_label" => true,
"value" => "300px",
"group" => "General Settings"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Map type", "ultimate_vc"),
"param_name" => "map_type",
"admin_label" => true,
"value" => array(__("Roadmap", "ultimate_vc") => "ROADMAP", __("Satellite", "ultimate_vc") => "SATELLITE", __("Hybrid", "ultimate_vc") => "HYBRID", __("Terrain", "ultimate_vc") => "TERRAIN"),
"group" => "General Settings"
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Latitude", "ultimate_vc"),
"param_name" => "lat",
"admin_label" => true,
"value" => "18.591212",
"description" => '<a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank" rel="noopener">'.__('Here is a tool','ultimate_vc').'</a> '.__('where you can find Latitude & Longitude of your location', 'ultimate_vc'),
"group" => "General Settings"
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Longitude", "ultimate_vc"),
"param_name" => "lng",
"admin_label" => true,
"value" => "73.741261",
"description" => '<a href="http://universimmedia.pagesperso-orange.fr/geo/loc.htm" target="_blank" rel="noopener">'.__('Here is a tool','ultimate_vc').'</a> '.__('where you can find Latitude & Longitude of your location', "ultimate_vc"),
"group" => "General Settings"
),
array(
"type" => "dropdown",
"heading" => __("Map Zoom", "ultimate_vc"),
"param_name" => "zoom",
"value" => array(
__("18 - Default", "ultimate_vc") => 12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 20
),
"group" => "General Settings"
),
array(
"type" => "checkbox",
"heading" => "",
"param_name" => "scrollwheel",
"value" => array(
__("Disable map zoom on mouse wheel scroll", "ultimate_vc") => "disable",
),
"group" => "General Settings"
),
array(
"type" => "textarea_html",
"class" => "",
"heading" => __("Info Window Text", "ultimate_vc"),
"param_name" => "content",
"value" => "",
"group" => "Info Window",
"edit_field_class" => "ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param",
),
array(
"type" => "ult_switch",
"heading" => __("Open on Marker Click","ultimate_vc"),
"param_name" => "infowindow_open",
"options" => array(
"infowindow_open_value" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
)
),
"value" => "infowindow_open_value",
"default_set" => true,
"group" => "Info Window",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Marker/Point icon", "ultimate_vc"),
"param_name" => "marker_icon",
"value" => array(__("Use Google Default", "ultimate_vc") => "default", __("Use Plugin's Default", "ultimate_vc") => "default_self", __("Upload Custom", "ultimate_vc") => "custom"),
"group" => "Marker"
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"admin_label" => true,
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "marker_icon","value" => array("custom")),
"group" => "Marker"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Marker Animation", "ultimate_vc"),
"param_name" => "marker_animation",
"value" =>
array(__("Yes", "ultimate_vc") => "yes",
__("No", "ultimate_vc") => "no"),
"group" => "Marker"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Street view control", "ultimate_vc"),
"param_name" => "streetviewcontrol",
"value" => array(__("Disable", "ultimate_vc") => "false", __("Enable", "ultimate_vc") => "true"),
"group" => "Advanced"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Map type control", "ultimate_vc"),
"param_name" => "maptypecontrol",
"value" => array(__("Disable", "ultimate_vc") => "false", __("Enable", "ultimate_vc") => "true"),
"group" => "Advanced"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Zoom control", "ultimate_vc"),
"param_name" => "zoomcontrol",
"value" => array(__("Disable", "ultimate_vc") => "false", __("Enable", "ultimate_vc") => "true"),
"group" => "Advanced"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Zoom Control Position", "ultimate_vc"),
"param_name" => "zoomcontrolposition",
"value" => array(
__("Right Bottom", "ultimate_vc") => "RIGHT_BOTTOM",
__("Right Top", "ultimate_vc") => "RIGHT_TOP",
__("Right Center", "ultimate_vc") => "RIGHT_CENTER",
__("Left Top", "ultimate_vc") => "LEFT_TOP",
__("Left Center", "ultimate_vc") => "LEFT_CENTER",
__("Left Bottom", "ultimate_vc") => "LEFT_BOTTOM",
),
"dependency" => Array("element" => "zoomcontrol", "value" => 'true'),
"group" => "Advanced"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Dragging on Mobile", "ultimate_vc"),
"param_name" => "dragging",
"value" => array( __("Enable", "ultimate_vc") => "true", __("Disable", "ultimate_vc") => "false"),
"group" => "Advanced"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Dragging on Desktop", "ultimate_vc"),
"param_name" => "dragging_desktop",
"value" => array( __("Enable", "ultimate_vc") => "true", __("Disable", "ultimate_vc") => "false"),
"group" => "Advanced"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Top margin", "ultimate_vc"),
"param_name" => "top_margin",
"value" => array(
__("Page (small)", "ultimate_vc") => "page_margin_top",
__("Section (large)", "ultimate_vc") => "page_margin_top_section",
__("None", "ultimate_vc") => "none"
),
"group" => "General Settings"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Map Width Override", "ultimate_vc"),
"param_name" => "map_override",
"value" =>array(
"Default Width"=>"0",
"Apply 1st parent element's width"=>"1",
"Apply 2nd parent element's width"=>"2",
"Apply 3rd parent element's width"=>"3",
"Apply 4th parent element's width"=>"4",
"Apply 5th parent element's width"=>"5",
"Apply 6th parent element's width"=>"6",
"Apply 7th parent element's width"=>"7",
"Apply 8th parent element's width"=>"8",
"Apply 9th parent element's width"=>"9",
"Full Width "=>"full",
"Maximum Full Width"=>"ex-full",
),
"description" => __("By default, the map will be given to the WPBakery Page Builder row. However, in some cases depending on your theme's CSS - it may not fit well to the container you are wishing it would. In that case you will have to select the appropriate value here that gets you desired output..", "ultimate_vc"),
"group" => "General Settings"
),
array(
"type" => "textarea_raw_html",
"class" => "",
"heading" => __("Google Styled Map JSON","ultimate_vc"),
"param_name" => "map_style",
"value" => "",
"description" => "<a target='_blank' rel='noopener' href='http://googlemaps.github.io/js-samples/styledmaps/wizard/index.html'>".__("Click here","ultimate_vc")."</a> ".__("to get the style JSON code for styling your map.","ultimate_vc"),
"group" => "Styling",
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc"),
"group" => "General Settings"
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/f57sh' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
"group" => "General Settings"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("MapBorder Style", "ultimate_vc"),
"param_name" => "map_border_style",
"value" => array(
"None"=> "",
"Solid"=> "solid",
"Dashed" => "dashed",
"Dotted" => "dotted",
"Double" => "double",
"Inset" => "inset",
"Outset" => "outset",
),
"description" => "",
"group" => "Border"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "map_color_border",
"value" => "",
"description" => "",
"dependency" => Array("element" => "map_border_style", "not_empty" => true),
"group" => "Border"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "map_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "map_border_style", "not_empty" => true),
"group" => "Border"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius","ultimate_vc"),
"param_name" => "map_radius",
"value" => 3,
"min" => 0,
"max" => 500,
"suffix" => "px",
"description" => "",
"dependency" => Array("element" => "map_border_style", "not_empty" => true),
"group" => "Border"
),
array(
"type" => "ultimate_spacing",
"heading" => " Map Margin ",
"param_name" => "gmap_margin",
"mode" => "margin", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
"Top" => "",
"Right" => "",
"Bottom" => "",
"Left" => "",
),
'group' => __( 'Styling', 'ultimate_vc' ),
"description" => __("Add spacing from outside to the map.", "ultimate_vc"),
),
array(
"type" => "ultimate_spacing",
"heading" => " Map padding ",
"param_name" => "gmap_padding",
"mode" => "padding", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
"Top" => "",
"Right" => "",
"Bottom" => "",
"Left" => "",
),
'group' => __( 'Styling', 'ultimate_vc' ),
"description" => __("Add spacing from outside to the map.", "ultimate_vc"),
),
)
));
}
}
function display_ultimate_map($atts,$content = null){
$width = $height = $map_type = $lat = $lng = $zoom = $streetviewcontrol = $maptypecontrol = $top_margin = $pancontrol = $zoomcontrol = $zoomcontrolposition = $dragging = $dragging_desktop = $marker_icon = $icon_img = $map_override = $output = $map_style = $scrollwheel = $el_class = $map_border_style = $map_color_border = $map_border_size = $marker_animation = $map_radius ='';
extract(shortcode_atts(array(
//"id" => "map",
"width" => "100%",
"height" => "300px",
"map_type" => "ROADMAP",
"lat" => "18.591212",
"lng" => "73.741261",
"zoom" => "14",
"scrollwheel" => "",
"streetviewcontrol" => "false",
"maptypecontrol" => "false",
"pancontrol" => "false",
"zoomcontrol" => "false",
"zoomcontrolposition" => "RIGHT_BOTTOM",
"dragging" => "true",
"dragging_desktop" => "true",
"marker_icon" => "default",
"icon_img" => "",
"top_margin" => "page_margin_top",
"map_override" => "0",
"map_style" => "",
"el_class" => "",
"infowindow_open" => "infowindow_open_value",
"map_vc_template" => "",
"map_border_style" => "",
"map_color_border" => "",
"map_border_size" => "",
"map_radius" => "",
"gmap_margin" => "",
"gmap_padding" => "",
"marker_animation" => "yes",
), $atts));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$border_css= $gmap_design_css ='';
$gmap_design_css = $gmap_margin;
$gmap_design_css .=$gmap_padding;
$marker_lat = $lat;
$marker_lng = $lng;
if($marker_icon == "default_self"){
$icon_url = UAVC_URL.'assets/img/icon-marker-pink.png';
} elseif($marker_icon == "default"){
$icon_url = "";
} else {
$icon_url = apply_filters('ult_get_img_single', $icon_img, 'url');
}
$id = "map_".uniqid();
$wrap_id = "wrap_".$id;
$map_type = strtoupper($map_type);
$width = (substr($width, -1)!="%" && substr($width, -2)!="px" ? $width . "px" : $width);
$map_height = (substr($height, -1)!="%" && substr($height, -2)!="px" ? $height . "px" : $height);
$margin_css = '';
if($top_margin != 'none')
{
$margin_css = $top_margin;
}
if($map_border_style !='')
$border_css .='border-style:'.$map_border_style.';';
if($map_color_border != '')
$border_css .= 'border-color:'.$map_color_border.';';
if($map_border_size != '')
$border_css .= 'border-width:'.$map_border_size.'px;';
if($map_radius !='')
$border_css .='border-radius:'.$map_radius.'px;';
if($map_vc_template == 'map_vc_template_value')
$el_class .= 'uvc-boxed-layout';
$output .= "<div id='".esc_attr($wrap_id)."' class='ultimate-map-wrapper ".esc_attr($is_vc_49_plus)." ".esc_attr($el_class)."' style='".esc_attr($gmap_design_css)." ".($map_height!="" ? "height:" . $map_height . ";" : "")."'><div id='" . esc_attr($id) . "' data-map_override='".esc_attr($map_override)."' class='ultimate_google_map wpb_content_element ".esc_attr($margin_css)."'" . ($width!="" || $map_height!="" ? " style='".esc_attr($border_css) . ($width!="" ? "width:" . esc_attr($width) . ";" : "") . ($map_height!="" ? "height:" . esc_attr($map_height) . ";" : "") . "'" : "") . "></div></div>";
if($scrollwheel == "disable"){
$scrollwheel = 'false';
} else {
$scrollwheel = 'true';
}
$output .= "<script type='text/javascript'>
(function($) {
'use strict';
var map_$id = null;
var coordinate_$id;
var isDraggable = $(document).width() > 641 ? $dragging_desktop : $dragging;
try
{
var map_$id = null;
var coordinate_$id;
coordinate_$id=new google.maps.LatLng($lat, $lng);
var mapOptions=
{
zoom: $zoom,
center: coordinate_$id,
scaleControl: true,
streetViewControl: $streetviewcontrol,
mapTypeControl: $maptypecontrol,
panControl: $pancontrol,
zoomControl: $zoomcontrol,
scrollwheel: $scrollwheel,
draggable: isDraggable,
zoomControlOptions: {
position: google.maps.ControlPosition.$zoomcontrolposition
},";
if($map_style == ""){
$output .= "mapTypeId: google.maps.MapTypeId.$map_type,";
} else {
$output .= " mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.$map_type, 'map_style']
}";
}
$output .= "};";
if($map_style !== ""){
$output .= 'var styles = '.rawurldecode(base64_decode(strip_tags($map_style))).';
var styledMap = new google.maps.StyledMapType(styles,
{name: "Styled Map"});';
}
$output .= "var map_$id = new google.maps.Map(document.getElementById('$id'),mapOptions);";
if($map_style !== ""){
$output .= "map_$id.mapTypes.set('map_style', styledMap);
map_$id.setMapTypeId('map_style');";
}
if($marker_lat!="" && $marker_lng!="")
{
$output .= "
var x = '".esc_attr($infowindow_open)."';
var marker_$id = new google.maps.Marker({
position: new google.maps.LatLng($marker_lat, $marker_lng),
animation: google.maps.Animation.DROP,
map: map_$id,
icon: '".esc_url($icon_url)."'
});";
if($marker_animation == 'yes'){
$output .= " google.maps.event.addListener(marker_$id, 'click', toggleBounce);"; }
if(trim($content) !== ""){
$output .= "var infowindow = new google.maps.InfoWindow();
infowindow.setContent('<div class=\"map_info_text\" style=\'color:#000;\'>".trim(preg_replace('/\s+/', ' ', do_shortcode($content)))."</div>');";
if($infowindow_open == 'off')
{
$output .= "infowindow.open(map_$id,marker_$id);";
}
$output .= "google.maps.event.addListener(marker_$id, 'click', function() {
infowindow.open(map_$id,marker_$id);
});";
}
}
$output .= "}
catch(e){};
jQuery(document).ready(function($){
google.maps.event.trigger(map_$id, 'resize');
$(window).resize(function(){
google.maps.event.trigger(map_$id, 'resize');
if(map_$id!=null)
map_$id.setCenter(coordinate_$id);
});
$('.ui-tabs').bind('tabsactivate', function(event, ui) {
if($(this).find('.ultimate-map-wrapper').length > 0)
{
setTimeout(function(){
$(window).trigger('resize');
},200);
}
});
$('.ui-accordion').bind('accordionactivate', function(event, ui) {
if($(this).find('.ultimate-map-wrapper').length > 0)
{
setTimeout(function(){
$(window).trigger('resize');
},200);
}
});
$(window).load(function(){
setTimeout(function(){
$(window).trigger('resize');
},200);
});
$('.ult_exp_section').select(function(){
if($(map_$id).parents('.ult_exp_section'))
{
setTimeout(function(){
$(window).trigger('resize');
},200);
}
});
$(document).on('onUVCModalPopupOpen', function(){
if($(map_$id).parents('.ult_modal-content'))
{
setTimeout(function(){
$(window).trigger('resize');
},200);
}
});
$(document).on('click','.ult_tab_li',function(){
$(window).trigger('resize');
setTimeout(function(){
$(window).trigger('resize');
},200);
});
});
function toggleBounce() {
if (marker_$id.getAnimation() != null) {
marker_$id.setAnimation(null);
} else {
marker_$id.setAnimation(google.maps.Animation.BOUNCE);
}
}
})(jQuery);
</script>";
$is_preset = false; //Retrieve preset Code
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>'; // remove backslash once copied
}
return $output;
}
}
new Ultimate_Google_Maps;
if(class_exists('WPBakeryShortCode') && !class_exists('WPBakeryShortCode_ultimate_google_map'))
{
class WPBakeryShortCode_ultimate_google_map extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,255 @@
<?php
/*
* Add-on Name: Ultimate Google Trends
* Add-on URI: https://www.brainstormforce.com
*/
if(!class_exists("Ultimate_Google_Trends")){
class Ultimate_Google_Trends{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action("init",array($this,"google_trends_init"));
}
add_shortcode("ultimate_google_trends",array($this,"display_ultimate_trends"));
}
function google_trends_init(){
if ( function_exists('vc_map'))
{
vc_map( array(
"name" => __("Google Trends", "ultimate_vc"),
"base" => "ultimate_google_trends",
"class" => "vc_google_trends",
"controls" => "full",
"show_settings_on_create" => true,
"icon" => "vc_google_trends",
"description" => __("Display Google Trends to show insights.", "ultimate_vc"),
"category" => "Ultimate VC Addons",
"params" => array(
/*array(
"type" => "dropdown",
"class" => "",
"heading" => __("Compare", "smile"),
"param_name" => "search_by",
"admin_label" => true,
"value" => array(
__("Multiple Search Terms", "smile") => "q",
//__("Search Term at Location", "smile") => "geo",
//__("Search Term over Time Range", "smile") => "date"
)
),*/
array(
"type" => "textarea",
"class" => "",
"heading" => __("Comparison Terms", "ultimate_vc"),
"param_name" => "gtrend_query",
"value" => "",
"description" => __("Enter maximum 5 terms separated by comma. Example:","ultimate_vc")." <em>".__("Google, Facebook, LinkedIn","ultimate_vc")."</em>",
//"dependency" => Array("element" => "search_by","value" => array("q")),
),
/*array(
"type" => "textfield",
"class" => "",
"heading" => __("Comparison Term", "smile"),
"param_name" => "gtrend_query_2",
"value" => "",
"description" => __("Enter single term. Example: <em>Love</em>", "smile"),
"dependency" => Array("element" => "search_by","value" => array("geo","date")),
),*/
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Location", "ultimate_vc"),
"param_name" => "location_by",
"admin_label" => true,
"value" => array(
__("Worldwide", "ultimate_vc") => "",
__("Argentina", "ultimate_vc") => "AR",
__("Australia", "ultimate_vc") => "AU",
__("Austria", "ultimate_vc") => "AT",
__("Bangladesh", "ultimate_vc") => "BD",
__("Belgium", "ultimate_vc") => "BE",
__("Brazil", "ultimate_vc") => "BR",
__("Bulgaria", "ultimate_vc") => "BG",
__("Canada", "ultimate_vc") => "CA",
__("Chile", "ultimate_vc") => "CL",
__("China", "ultimate_vc") => "CN",
__("Colombia", "ultimate_vc") => "CO",
__("Costa Rica", "ultimate_vc") => "CR",
__("Croatia", "ultimate_vc") => "HR",
__("Czech Republic", "ultimate_vc") => "CZ",
__("Denmark", "ultimate_vc") => "DK",
__("Dominican Republic", "ultimate_vc") => "DO",
__("Ecuador", "ultimate_vc") => "EC",
__("Egypt", "ultimate_vc") => "EG",
__("El Salvador", "ultimate_vc") => "SV",
__("Estonia", "ultimate_vc") => "EE",
__("Finland", "ultimate_vc") => "FI",
__("France", "ultimate_vc") => "FR",
__("Germany", "ultimate_vc") => "DE",
__("Ghana", "ultimate_vc") => "GH",
__("Greece",'ultimate_vc') => "GR",
__("Guatemala", "ultimate_vc") => "GT",
__("Honduras", "ultimate_vc") => "HN",
__("Hong Kong", "ultimate_vc") => "HK",
__("Hungary", "ultimate_vc") => "HU",
__("India", "ultimate_vc") => "IN",
__("Indonesia", "ultimate_vc") => "ID",
__("Ireland", "ultimate_vc") => "IE",
__("Israel", "ultimate_vc") => "IL",
__("Italy", "ultimate_vc") => "IT",
__("Japan", "ultimate_vc") => "JP",
__("Kenya", "ultimate_vc") => "KE",
__("Latvia", "ultimate_vc") => "LV",
__("Lithuania", "ultimate_vc") => "LT",
__("Malaysia", "ultimate_vc") => "MY",
__("Mexico", "ultimate_vc") => "MX",
__("Netherlands", "ultimate_vc") => "NL",
__("New Zealand", "ultimate_vc") => "NZ",
__("Nigeria", "ultimate_vc") => "NG",
__("Norway", "ultimate_vc") => "NO",
__("Pakistan", "ultimate_vc") => "PK",
__("Panama", "ultimate_vc") => "PA",
__("Peru", "ultimate_vc") => "PE",
__("Philippines", "ultimate_vc") => "PH",
__("Poland", "ultimate_vc") => "PL",
__("Portugal", "ultimate_vc") => "PT",
__("Puerto Rico", "ultimate_vc") => "PR",
__("Romania", "ultimate_vc") => "RO",
__("Russia", "ultimate_vc") => "RU",
__("Saudi Arabia", "ultimate_vc") => "SA",
__("Senegal", "ultimate_vc") => "SN",
__("Serbia", "ultimate_vc") => "RS",
__("Singapore", "ultimate_vc") => "SG",
__("Slovakia", "ultimate_vc") => "SK",
__("Slovenia", "ultimate_vc") => "SI",
__("South Africa", "ultimate_vc") => "ZA",
__("South Korea", "ultimate_vc") => "KR",
__("Spain", "ultimate_vc") => "ES",
__("Sweden", "ultimate_vc") => "SE",
__("Switzerland", "ultimate_vc") => "CH",
__("Taiwan", "ultimate_vc") => "TW",
__("Thailand", "ultimate_vc") => "TH",
__("Turkey", "ultimate_vc") => "TR",
__("Uganda", "ultimate_vc") => "UG",
__("Ukraine", "ultimate_vc") => "UA",
__("United Arab Emirates", "ultimate_vc") => "AE",
__("United Kingdom", "ultimate_vc") => "GB",
__("United States", "ultimate_vc") => "US",
__("Uruguay", "ultimate_vc") => "UY",
__("Venezuela", "ultimate_vc") => "VE",
__("Vietnam", "ultimate_vc") => "VN",
)
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Graph type", "ultimate_vc"),
"param_name" => "graph_type",
"admin_label" => true,
"value" => array(__("Interest over time", "ultimate_vc") => "TIMESERIES_GRAPH_0", __("Interest over time with average", "ultimate_vc") => "TIMESERIES_GRAPH_AVERAGES_CHART", __("Regional interest in map", "ultimate_vc") => "GEO_MAP_0_0", __("Regional interest in table", "ultimate_vc") => "GEO_TABLE_0_0", __("Related searches (Topics)", "ultimate_vc") => "TOP_ENTITIES_0_0", __("Related searches (Queries)", "ultimate_vc") => "TOP_QUERIES_0_0"),
//"dependency" => Array("element" => "search_by","value" => array("q"))
),
/*array(
"type" => "dropdown",
"class" => "",
"heading" => __("Graph type", "smile"),
"param_name" => "graph_type_2",
"admin_label" => true,
"value" => array(__("Top Entities", "smile") => "TOP_ENTITIES_0_0", __("Top Queries", "smile") => "TOP_QUERIES_0_0"),
"dependency" => Array("element" => "search_by","value" => array("geo", "date"))
),*/
array(
"type" => "textfield",
"class" => "",
"heading" => __("Frame Width (optional)", "ultimate_vc"),
"param_name" => "gtrend_width",
"value" => "",
"description" => __("For Example: 500", "ultimate_vc")
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Frame Height (optional)", "ultimate_vc"),
"param_name" => "gtrend_height",
"value" => "",
"description" => __("For Example: 350", "ultimate_vc")
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc")
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/skwuz' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_gtrend_design',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)
));
}
}
function display_ultimate_trends($atts,$content = null){
$width = $height = $graph_type = $graph_type_2 = $search_by = $location_by = $gtrend_query = $gtrend_query_2 = $el_class = '';
$css_design_style = '';
extract(shortcode_atts(array(
//"id" => "map",
"gtrend_width" => "",
"gtrend_height" => "",
"graph_type" => "TIMESERIES_GRAPH_0",
"graph_type_2" => "",
"search_by" => "q",
"location_by" => "",
"gtrend_query" => "",
"gtrend_query_2" => "",
"el_class" => "",
"css_gtrend_design" => "",
), $atts));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$css_design_style = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_gtrend_design, ' ' ), "ultimate_google_trends", $atts );
$css_design_style = esc_attr( $css_design_style );
if($search_by === 'q')
{
$graph_type_new = $graph_type;
$gtrend_query_new = $gtrend_query;
}
else
{
$graph_type_new = $graph_type_2;
$gtrend_query_new = $gtrend_query_2;
}
if($gtrend_width != '')
{
$width = $gtrend_width;
$width = '&amp;w='.$width;
}
if($gtrend_height != '')
{
$height = $gtrend_height;
$height = '&amp;h='.$height;
}
$id = uniqid('vc-trends-');
$output = '<div id="'.esc_attr($id).'" class="ultimate-google-trends '.esc_attr($is_vc_49_plus).' '.esc_attr($el_class).' '.esc_attr($css_design_style).'">
<script type="text/javascript" src="//www.google.com/trends/embed.js?hl=en-US&amp;q='.esc_attr($gtrend_query_new).'&cmpt='.esc_attr($search_by).'&amp;geo='.esc_attr($location_by).'&amp;content=1&amp;cid='.esc_attr($graph_type_new).'&amp;export=5'.esc_attr($width).esc_attr($height).'"></script>
</div>';
return $output;
}
}
new Ultimate_Google_Trends;
if(class_exists('WPBakeryShortCode') && !class_exists('WPBakeryShortCode_ultimate_google_trends'))
{
class WPBakeryShortCode_ultimate_google_trends extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,774 @@
<?php
/*
* Add-on Name: Ultimate Headings
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists("Ultimate_Headings")){
class Ultimate_Headings{
static $add_plugin_script;
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action("init",array($this,"ultimate_headings_init"));
}
add_shortcode("ultimate_heading",array($this,"ultimate_headings_shortcode"));
add_action("wp_enqueue_scripts", array($this, "register_headings_assets"),1);
}
function register_headings_assets()
{
Ultimate_VC_Addons::ultimate_register_style( 'ultimate-headings-style', 'headings' );
Ultimate_VC_Addons::ultimate_register_script( 'ultimate-headings-script', 'headings', false, array( 'jquery' ), ULTIMATE_VERSION, false );
}
function ultimate_headings_init(){
if(function_exists("vc_map")){
vc_map(
array(
"name" => __("Headings","ultimate_vc"),
"base" => "ultimate_heading",
"class" => "vc_ultimate_heading",
"icon" => "vc_ultimate_heading",
"category" => "Ultimate VC Addons",
"description" => __("Awesome heading styles.","ultimate_vc"),
"params" => array(
array(
'type' => 'dropdown',
'heading' => __( 'Text source', 'ultimate_vc' ),
'param_name' => 'source',
'value' => array(
__( 'Custom text', 'ultimate_vc' ) => '',
__( 'Post or Page Title', 'ultimate_vc' ) => 'post_title',
),
'std' => '',
'description' => __( 'Select text source.', 'ultimate_vc' ),
),
array(
'type' => 'textfield',
'heading' => __( 'Title', 'ultimate_vc' ),
'param_name' => 'main_heading',
'holder' => 'div',
'value' => '',
'dependency' => array(
'element' => 'source',
'is_empty' => true,
),
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h2",
__("H1","ultimate_vc") => "h1",
__("H3","ultimate_vc") => "h3",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H2", "ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"text" => __("Heading Settings","ultimate_vc"),
"param_name" => "main_heading_typograpy",
//"dependency" => Array("element" => "main_heading", "not_empty" => true),
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "main_heading_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
//"dependency" => Array("element" => "main_heading", "not_empty" => true),
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "main_heading_style",
//"description" => __("Main heading font style", "smile"),
//"dependency" => Array("element" => "main_heading", "not_empty" => true),
"group" => "Typography"
),
// Responsive Param
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "main_heading_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "main_heading_color",
"value" => "",
//"description" => __("Main heading color", "smile"),
//"dependency" => Array("element" => "main_heading", "not_empty" => true),
"group" => "Typography"
),
// responsive
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "main_heading_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "text",
"heading" => "<h4>".__("Enter values with respective unites. Example - 10px, 10em, 10%, etc.","ultimate_vc")."</h4>",
"param_name" => "margin_design_tab_text",
"group" => "Design",
),
array(
"type" => "ultimate_margins",
"heading" => __("Heading Margins","ultimate_vc"),
"param_name" => "main_heading_margin",
"positions" => array(
"Top" => "top",
"Bottom" => "bottom"
),
//"dependency" => Array("element" => "main_heading", "not_empty" => true),
"group" => "Design"
),
array(
"type" => "textarea_html",
"edit_field_class" => "ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param",
"heading" => __("Sub Heading (Optional)", "ultimate_vc"),
"param_name" => "content",
"value" => "",
//"description" => __("Sub heading text", "smile"),
),
array(
"type" => "ult_param_heading",
"text" => __("Sub Heading Settings","ultimate_vc"),
"param_name" => "sub_heading_typograpy",
//"dependency" => Array("element" => "content", "not_empty" => true),
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "sub_heading_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
//"dependency" => Array("element" => "content", "not_empty" => true),
"group" => "Typography",
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "sub_heading_style",
//"description" => __("Sub heading font style", "smile"),
//"dependency" => Array("element" => "content", "not_empty" => true),
"group" => "Typography",
),
// responsive font size
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font Size", 'ultimate_vc'),
"param_name" => "sub_heading_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "sub_heading_color",
"value" => "",
//"description" => __("Sub heading color", "smile"),
//"dependency" => Array("element" => "content", "not_empty" => true),
"group" => "Typography",
),
// responsive
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "sub_heading_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "ultimate_margins",
"heading" => "Sub Heading Margins",
"param_name" => "sub_heading_margin",
"positions" => array(
__("Top","ultimate_vc") => "top",
__("Bottom","ultimate_vc") => "bottom"
),
//"dependency" => Array("element" => "sub_heading", "not_empty" => true),
"group" => "Design"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Alignment", "ultimate_vc"),
"param_name" => "alignment",
"value" => array(
__("Center","ultimate_vc") => "center",
__("Left","ultimate_vc") => "left",
__("Right","ultimate_vc") => "right"
),
//"description" => __("Text alignment", "smile"),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Separator", "ultimate_vc"),
"param_name" => "spacer",
"value" => array(
__("No Separator","ultimate_vc") => "no_spacer",
__("Line","ultimate_vc") => "line_only",
__("Icon","ultimate_vc") => "icon_only",
__("Image","ultimate_vc") => "image_only",
__("Line with icon/image","ultimate_vc") => "line_with_icon",
),
"description" => __("Horizontal line, icon or image to divide sections", "ultimate_vc"),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Separator Position", "ultimate_vc"),
"param_name" => "spacer_position",
"value" => array(
__("Top","ultimate_vc") => "top",
__("Between Heading & Sub-Heading","ultimate_vc") => "middle",
__("Bottom","ultimate_vc") => "bottom"
),
//"description" => __("Alignment of separator", "smile"),
"dependency" => Array("element" => "spacer", "value" => array("line_with_icon","line_only","icon_only","image_only")),
),
array(
"type" => "ult_img_single",
"heading" => __("Select Image", "ultimate_vc"),
"param_name" => "spacer_img",
//"description" => __("Alignment of spacer", "smile"),
"dependency" => Array("element" => "spacer", "value" => array("image_only")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "spacer_img_width",
"value" => 48,
"suffix" => "px",
"description" => __("Provide image width (optional)", "ultimate_vc"),
"dependency" => Array("element" => "spacer", "value" => array("image_only")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Line Style", "ultimate_vc"),
"param_name" => "line_style",
"value" => array(
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
//"description" => __("Select the line style.","smile"),
"dependency" => Array("element" => "spacer", "value" => array("line_with_icon","line_only")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Line Width (optional)", "ultimate_vc"),
"param_name" => "line_width",
//"value" => 250,
//"min" => 150,
//"max" => 500,
"suffix" => "px",
//"description" => __("Set line width", "smile"),
"dependency" => Array("element" => "spacer", "value" => array("line_with_icon","line_only")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Line Height", "ultimate_vc"),
"param_name" => "line_height",
"value" => 1,
"min" => 1,
"max" => 500,
"suffix" => "px",
//"description" => __("Set line height", "smile"),
"dependency" => Array("element" => "spacer", "value" => array("line_with_icon","line_only")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Line Color", "ultimate_vc"),
"param_name" => "line_color",
"value" => "#333333",
//"description" => __("Select color for line.", "smile"),
"dependency" => Array("element" => "spacer", "value" => array("line_with_icon","line_only")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use an existing font icon or upload a custom image.", "ultimate_vc"),
"dependency" => Array("element" => "spacer", "value" => array("line_with_icon","icon_only")),
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "img_width",
"value" => 48,
"min" => 16,
"max" => 512,
"suffix" => "px",
"description" => __("Provide image width", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "ultimate_margins",
"heading" => "Separator Margins",
"param_name" => "spacer_margin",
"positions" => array(
__("Top","ultimate_vc") => "top",
__("Bottom","ultimate_vc") => "bottom"
),
"dependency" => Array("element" => "spacer", "value" => array("line_with_icon","line_only","icon_only","image_only")),
"group" => "Design"
),
array(
"type" => "number",
"heading" => __("Space between Line & Icon/Image","ultimate_vc"),
"param_name" => "line_icon_fixer",
"value" => "10",
"suffix" => "px",
"dependency" => Array("element" => "spacer", "value" => array("line_with_icon")),
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc")
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/8v9sy' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
)
)
);
}
}
function ultimate_headings_shortcode($atts, $content = null){
$wrapper_style = $main_heading_style_inline = $sub_heading_style_inline = $line_style_inline = $icon_inline = $output = $el_class = '';
extract(shortcode_atts(array(
'source' => "",
'main_heading' => "",
"main_heading_font_size" => "",
"main_heading_line_height" => "",
"main_heading_font_family" => "",
"main_heading_style" => "",
"main_heading_color" => "",
"main_heading_margin" => "",
"sub_heading" => "",
"sub_heading_font_size" => "",
"sub_heading_line_height" => "",
"sub_heading_font_family" => "",
"sub_heading_style" => "",
"sub_heading_color" => "",
"sub_heading_margin" => "",
"spacer" => "no_spacer",
"spacer_position" => "top",
"spacer_img" => "",
"spacer_img_width" => "",
"line_style" => "solid",
"line_width" => "auto",
"line_height" => "1",
"line_color" => "#ccc",
"icon_type" => "selector",
"icon" => "",
"icon_color" => "",
"icon_style" => "none",
"icon_color_bg" => "",
"icon_border_style" => "",
"icon_color_border" => "#333333",
"icon_border_size" => "1",
"icon_border_radius" => "",
"icon_border_spacing" => "",
"icon_img" => "",
"img_width" => "48",
"icon_size" => "32",
"alignment" => "center",
"spacer_margin" => "top",
"line_icon_fixer" => "10",
"heading_tag" => "",
"el_class" => "",
),$atts));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$wrapper_class = $spacer;
if($heading_tag == '')
$heading_tag = 'h2';
if( $source == 'post_title' ){
global $post;
$main_heading = $post->post_title;
}
/* ---- main heading styles ---- */
if($main_heading_font_family != '')
{
$mhfont_family = get_ultimate_font_family($main_heading_font_family);
if($mhfont_family)
$main_heading_style_inline .= 'font-family:\''.$mhfont_family.'\';';
}
// main heading font style
$main_heading_style_inline .= get_ultimate_font_style($main_heading_style);
//attach font size if set
//attach font color if set
if($main_heading_color != '')
$main_heading_style_inline .= 'color:'.$main_heading_color.';';
//attach margins for main heading
if($main_heading_margin != '')
$main_heading_style_inline .= $main_heading_margin;
/* ----- sub heading styles ----- */
if($sub_heading_font_family != '')
{
$shfont_family = get_ultimate_font_family($sub_heading_font_family);
if($shfont_family != '')
$sub_heading_style_inline .= 'font-family:\''.$shfont_family.'\';';
}
//sub heaing font style
$sub_heading_style_inline .= get_ultimate_font_style($sub_heading_style);
//attach font color if set
if($sub_heading_color != '')
$sub_heading_style_inline .= 'color:'.$sub_heading_color.';';
//attach margins for sub heading
if($sub_heading_margin != '')
$sub_heading_style_inline .= $sub_heading_margin;
if($spacer != '')
$wrapper_style .= $spacer_margin;
if($spacer == 'line_with_icon')
{
if($line_width < $icon_size)
$wrap_width = $icon_size;
else
$wrap_width = $line_width;
if($icon_type == 'selector')
{
if($icon_style == 'advanced')
{
//if($icon_border_spacing != '')
//$wrapper_style .= 'padding:'.$icon_border_spacing.'px 0;';
}
else
{
$wrapper_style .= 'height:'.$icon_size.'px;';
}
}
$icon_style_inline = 'font-size:'.$icon_size.'px;';
}
else if($spacer == 'line_only')
{
$wrap_width = $line_width;
$line_style_inline = 'border-style:'.$line_style.';';
$line_style_inline .= 'border-bottom-width:'.$line_height.'px;';
$line_style_inline .= 'border-color:'.$line_color.';';
$line_style_inline .= 'width:'.$wrap_width.'px;';
$wrapper_style .= 'height:'.$line_height.'px;';
$line = '<span class="uvc-headings-line" style="'.esc_attr( $line_style_inline ).'"></span>';
$icon_inline = $line;
}
else if($spacer == 'icon_only')
{
$icon_style_inline = 'font-size:'.$icon_size.'px;';
}
else if($spacer == 'image_only')
{
if(!empty($spacer_img_width))
$siwidth = array($spacer_img_width, $spacer_img_width);
else
$siwidth = 'full';
$spacer_inline = '';
//$icon_inline = wp_get_attachment_image( $spacer_img, $siwidth, false, array("class"=>"ultimate-headings-icon-image") );
$icon_inline = apply_filters('ult_get_img_single', $spacer_img, 'url');
$alt = apply_filters('ult_get_img_single', $spacer_img, 'alt');
if($spacer_img_width !== '')
$spacer_inline = 'width:'.$spacer_img_width.'px';
$icon_inline = '<img src="'.esc_url(apply_filters('ultimate_images', $icon_inline)).'" class="ultimate-headings-icon-image" alt="'.esc_attr($alt).'" style="'.esc_attr($spacer_inline).'"/>';
}
//if spacer type is line with icon or only icon show icon or image respectively
if($spacer == 'line_with_icon' || $spacer == 'icon_only')
{
$icon_animation = '';
$icon_inline = do_shortcode('[just_icon icon_align="'.esc_attr($alignment).'" icon_type="'.esc_attr($icon_type).'" icon="'.esc_attr($icon).'" icon_img="'.esc_attr($icon_img).'" img_width="'.esc_attr($img_width).'" icon_size="'.esc_attr($icon_size).'" icon_color="'.esc_attr($icon_color).'" icon_style="'.esc_attr($icon_style).'" icon_color_bg="'.esc_attr($icon_color_bg).'" icon_color_border="'.esc_attr($icon_color_border).'" icon_border_style="'.esc_attr($icon_border_style).'" icon_border_size="'.esc_attr($icon_border_size).'" icon_border_radius="'.esc_attr($icon_border_radius).'" icon_border_spacing="'.esc_attr($icon_border_spacing).'" icon_animation="'.esc_attr($icon_animation).'"]');
}
if($spacer == 'line_with_icon')
{
$data = 'data-hline_width="'.esc_attr($wrap_width).'" data-hicon_type="'.esc_attr($icon_type).'" data-hborder_style="'.esc_attr($line_style).'" data-hborder_height="'.esc_attr($line_height).'" data-hborder_color="'.esc_attr($line_color).'"';
if($icon_type == 'selector')
$data .= ' data-icon_width="'.esc_attr($icon_size).'"';
else
$data .= ' data-icon_width="'.esc_attr($img_width).'"';
if($line_icon_fixer != '')
$data .= ' data-hfixer="'.esc_attr($line_icon_fixer).'" ';
}
else
$data = '';
$micro = rand(0000,9999);
$id = uniqid('ultimate-heading-'.$micro);
$uid = 'uvc-'.rand(0000,9999);
// FIX: set old font size before implementing responsive param
if(is_numeric($main_heading_font_size)) { $main_heading_font_size = 'desktop:'.$main_heading_font_size.'px;'; }
if(is_numeric($main_heading_line_height)) { $main_heading_line_height = 'desktop:'.$main_heading_line_height.'px;'; }
// responsive {main} heading styles
$args = array(
'target' => '.uvc-heading.'.$id.' '.$heading_tag,
'media_sizes' => array(
'font-size' => $main_heading_font_size,
'line-height' => $main_heading_line_height,
),
);
$main_heading_responsive = get_ultimate_vc_responsive_media_css($args);
// FIX: set old font size before implementing responsive param
if(is_numeric($sub_heading_font_size)) { $sub_heading_font_size = 'desktop:'.$sub_heading_font_size.'px;'; }
if(is_numeric($sub_heading_line_height)) { $sub_heading_line_height = 'desktop:'.$sub_heading_line_height.'px;'; }
// responsive {sub} heading styles
$args = array(
'target' => '.uvc-heading.'.$id.' .uvc-sub-heading ',
'media_sizes' => array(
'font-size' => $sub_heading_font_size,
'line-height' => $sub_heading_line_height,
),
);
$sub_heading_responsive = get_ultimate_vc_responsive_media_css($args);
$output = '<div id="'.esc_attr( $id ).'" class="uvc-heading '.esc_attr( $is_vc_49_plus ).' '.esc_attr( $id ).' '.esc_attr( $uid ).' '.esc_attr( $el_class ).'" data-hspacer="'.esc_attr( $spacer ).'" '.$data.' data-halign="'.esc_attr( $alignment ).'" style="text-align:'.esc_attr($alignment).'">';
if($spacer_position == 'top')
$output .= $this->ultimate_heading_spacer($wrapper_class, $wrapper_style, $icon_inline);
if($main_heading != '')
$output .= '<div class="uvc-main-heading ult-responsive" '.$main_heading_responsive.'><'.$heading_tag.' style="'.esc_attr($main_heading_style_inline).'">'.$main_heading.'</'.$heading_tag.'></div>';
if($spacer_position == 'middle')
$output .= $this->ultimate_heading_spacer($wrapper_class, $wrapper_style, $icon_inline);
if($content != '')
$output .= '<div class="uvc-sub-heading ult-responsive" '.$sub_heading_responsive.' style="'.esc_attr($sub_heading_style_inline).'">'.do_shortcode($content).'</div>';
if($spacer_position == 'bottom')
$output .= $this->ultimate_heading_spacer($wrapper_class, $wrapper_style, $icon_inline);
$output .= '</div>';
$is_preset = false; //Display settings for Preset
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
}
function ultimate_heading_spacer($wrapper_class, $wrapper_style, $icon_inline)
{
$spacer = '<div class="uvc-heading-spacer '.$wrapper_class.'" style="'.$wrapper_style.'">'.$icon_inline.'</div>';
return $spacer;
}
} // end class
new Ultimate_Headings;
if(class_exists('WPBakeryShortCode') && !class_exists('WPBakeryShortCode_ultimate_heading'))
{
class WPBakeryShortCode_ultimate_heading extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,553 @@
<?php
/*
* Add-on Name: Highlight Box.
*/
if(!class_exists('Ultimate_Highlight_Box'))
{
class Ultimate_Highlight_Box{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'ctaction_init'));
}
add_shortcode('ultimate_ctation',array($this,'call_to_action_shortcode'));
add_action('wp_enqueue_scripts', array($this, 'register_cta_assets'),1);
}
function register_cta_assets()
{
Ultimate_VC_Addons::ultimate_register_style( 'utl-ctaction-style', 'highlight-box' );
Ultimate_VC_Addons::ultimate_register_script( 'utl-ctaction-script', 'highlight-box', false, array( 'jquery' ), ULTIMATE_VERSION, false );
}
function ctaction_init(){
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Hightlight Box","ultimate_vc"),
"base" => "ultimate_ctation",
"class" => "vc_ctaction_icon",
"icon" => "vc_icon_ctaction",
"category" => "Ultimate VC Addons",
//"description" => __("Displays the banner image with Information","smile"),
"params" => array(
array(
"type" => "textarea_html",
"class" => "",
"heading" => __("Text ","ultimate_vc"),
"param_name" => "content",
"admin_label" => true,
"value" => "",
"edit_field_class" => "ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param",
//"description" => __("Give a title to this banner","smile")
),
array(
"type" => "dropdown",
"heading" => __("Alignment", "ultimate_vc"),
"param_name" => "content_alignment",
"value" => array(
__("Center", "ultimate_vc") => "ctaction-text-center",
__("Left", "ultimate_vc") => "ctaction-text-left",
__("Right", "ultimate_vc") => "ctaction-text-right"
)
),
array(
"type" => "colorpicker",
"heading" => __("Background","ultimate_vc"),
"param_name" => "ctaction_background",
"value" => "#e74c3c",
"group" => "Background"
),
array(
"type" => "colorpicker",
"heading" => __("Background Hover","ultimate_vc"),
"param_name" => "ctaction_background_hover",
"value" => "#c0392b",
"group" => "Background"
),
array(
"type" => "vc_link",
"param_name" => "ctaction_link",
"heading" => __("Link","ultimate_vc")
),
array(
"type" => "ult_switch",
"heading" => __("Enable Icon","ultimate_vc"),
"param_name" => "enable_icon",
"value" => "",
"options" => array(
"enable_icon_value" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc")
)
),
"group" => "Icon"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Effect", "ultimate_vc"),
"param_name" => "effect",
"value" => array(
__("Slide Left","ultimate_vc") => "right-push",
__("Slide Right","ultimate_vc") => "left-push",
__("Slide Top","ultimate_vc") => "bottom-push",
__("Slide Bottom","ultimate_vc") => "top-push",
),
"description" => __("Select an effect for highlight box.", "ultimate_vc"),
"dependency" => Array("element" => "enable_icon", "value" => array("enable_icon_value")),
"group" => "Icon"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use an existing font icon or upload a custom image.", "ultimate_vc"),
"dependency" => Array("element" => "enable_icon", "value" => array("enable_icon_value")),
"group" => "Icon"
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"group" => "Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"group" => "Icon"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"group" => "Icon"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"group" => "Icon"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
"group" => "Icon"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
"group" => "Icon"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
"group" => "Icon"
),
array(
"type" => "attach_image",
"class" => "",
"heading" => __("Upload Image Icon:", "smile"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
"group" => "Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "img_width",
"value" => 48,
"min" => 16,
"max" => 512,
"suffix" => "px",
"description" => __("Provide image width", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
"group" => "Icon"
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "text_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "text_font_style",
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "text_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "text_color",
"value" => "#ffffff",
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "text_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Width Override", "ultimate_vc"),
"param_name" => "ctaction_override",
"value" =>array(
__("Default Width","ultimate_vc") =>"0",
__("Apply 1st parent element's width","ultimate_vc")=>"1",
__("Apply 2nd parent element's width","ultimate_vc")=>"2",
__("Apply 3rd parent element's width","ultimate_vc")=>"3",
__("Apply 4th parent element's width","ultimate_vc")=>"4",
__("Apply 5th parent element's width","ultimate_vc")=>"5",
__("Apply 6th parent element's width","ultimate_vc")=>"6",
__("Apply 7th parent element's width","ultimate_vc")=>"7",
__("Apply 8th parent element's width","ultimate_vc")=>"8",
__("Apply 9th parent element's width","ultimate_vc")=>"9",
__("Full Width","ultimate_vc")=>"full",
__("Maximum Full Width","ultimate_vc")=>"ex-full",
),
"description" => __("By default, the map will be given to the WPBakery Page Builder row. However, in some cases depending on your theme's CSS - it may not fit well to the container you are wishing it would. In that case you will have to select the appropriate value here that gets you desired output..", "ultimate_vc"),
),
array(
"type" => "number",
"heading" => __("Top Padding", "ultimate_vc"),
"param_name" => "ctaction_padding_top",
"edit_field_class" => "vc_column vc_col-sm-3",
"value" => "20",
"suffix" => "px",
"group" => "Background"
),
array(
"type" => "number",
"heading" => __("Bottom Padding", "ultimate_vc"),
"param_name" => "ctaction_padding_bottom",
"edit_field_class" => "vc_column vc_col-sm-3",
"value" => "20",
"suffix" => "px",
"group" => "Background"
),
array(
"type" => "number",
"heading" => __("Left Padding", "ultimate_vc"),
"param_name" => "ctaction_padding_left",
"edit_field_class" => "vc_column vc_col-sm-3",
"value" => "",
"suffix" => "px",
"group" => "Background"
),
array(
"type" => "number",
"heading" => __("Right Padding", "ultimate_vc"),
"param_name" => "ctaction_padding_right",
"edit_field_class" => "vc_column vc_col-sm-3",
"value" => "",
"suffix" => "px",
"group" => "Background"
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc")
),
array(
"type" => "ultimate_spacing",
"heading" => "Margin ",
"param_name" => "highlight_margin",
"mode" => "margin", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
"Top" => "",
"Right" => "",
"Bottom" => "",
"Left" => "",
),
'group' => __( 'Design ', 'ultimate_vc' ),
"description" => __("Add spacing to FlipBox.", "ultimate_vc"),
),
),
)
);
}
}
// Shortcode handler function for stats banner
function call_to_action_shortcode($atts, $content)
{
//wp_enqueue_script('utl-ctaction-script');
$output = $el_class = $style = $data = $text_style_inline = $ctaction_link_html = $icon_inline = $effect = $highlight_margin = $target = $link_title = $rel = '';
extract(shortcode_atts( array(
'content_alignment' => 'ctaction-text-center',
'ctaction_background' => '#e74c3c',
'ctaction_background_hover' => '#c0392b',
'text_font_family' => '',
'text_font_style' => '',
'text_font_size' => '32',
'text_color' => '#ffffff',
'text_line_height' => '',
'ctaction_link' => '',
'ctaction_override' => '0',
'ctaction_padding_top' => '20',
'ctaction_padding_bottom' => '20',
'ctaction_padding_left' => '',
'ctaction_padding_right' => '',
'enable_icon' => '',
"icon_type" => "selector",
"icon" => "",
"icon_color" => "",
"icon_style" => "none",
"icon_color_bg" => "",
"icon_border_style" => "",
"icon_color_border" => "#333333",
"icon_border_size" => "1",
"icon_border_radius" => "500",
"icon_border_spacing" => "50",
"icon_img" => "",
"img_width" => "48",
"icon_size" => "32",
'effect' => 'right-push',
'el_class' => '',
'highlight_margin' => ''
),$atts));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$el_class .= ' '.$content_alignment;
/* typography */
if($text_font_family != '')
{
$temp = get_ultimate_font_family($text_font_family);
$text_style_inline .= 'font-family:'.$temp.';';
}
$text_style_inline .= get_ultimate_font_style($text_font_style);
// responsive param
if (is_numeric($text_font_size)) {
$text_font_size = 'desktop:'.$text_font_size.'px;';
}
if (is_numeric($text_line_height)) {
$text_line_height = 'desktop:'.$text_line_height.'px;';
}
$highlight_box_id = 'highlight-box-wrap-'.rand(1000, 9999);
$highlight_box_args = array(
'target' => '#'.$highlight_box_id.
'', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $text_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $text_line_height
),
);
$data_list = get_ultimate_vc_responsive_media_css($highlight_box_args);
if($text_color != '')
$text_style_inline .= 'color:'.$text_color.';';
if($ctaction_background != '')
{
$data .= ' data-background="'.esc_attr($ctaction_background).'" ';
$text_style_inline .= 'background:'.$ctaction_background.';';
}
if($ctaction_background_hover != '')
$data .= ' data-background-hover="'.esc_attr($ctaction_background_hover).'" ';
$data .= ' data-override="'.esc_attr($ctaction_override).'" ';
if($ctaction_padding_top != '')
$text_style_inline .= 'padding-top:'.$ctaction_padding_top.'px;';
if($ctaction_padding_bottom != '')
$text_style_inline .= 'padding-bottom:'.$ctaction_padding_bottom.'px;';
if($ctaction_padding_left != '')
$text_style_inline .= 'padding-left:'.$ctaction_padding_left.'px;';
if($ctaction_padding_right != '')
$text_style_inline .= 'padding-right:'.$ctaction_padding_right.'px;';
$text_style_inline .= $highlight_margin;
if($ctaction_link != '')
{
$href = vc_build_link($ctaction_link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
if($url != '')
{
$ctaction_link_html = '<a class="ulimate-call-to-action-link" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'></a>';
}
}
if($enable_icon == 'enable_icon_value')
{
$icon_inline = do_shortcode('[just_icon icon_align="center" icon_type="'.esc_attr($icon_type).'" icon="'.esc_attr($icon).'" icon_img="'.esc_attr($icon_img).'" img_width="'.esc_attr($img_width).'" icon_size="'.esc_attr($icon_size).'" icon_color="'.esc_attr($icon_color).'" icon_style="'.esc_attr($icon_style).'" icon_color_bg="'.esc_attr($icon_color_bg).'" icon_color_border="'.esc_attr($icon_color_border).'" icon_border_style="'.esc_attr($icon_border_style).'" icon_border_size="'.esc_attr($icon_border_size).'" icon_border_radius="'.esc_attr($icon_border_radius).'" icon_border_spacing="'.esc_attr($icon_border_spacing).'"]');
}
else
$effect = 'no-effect';
$output .= '<div id="'.esc_attr($highlight_box_id).'" '.$data_list.' class="ultimate-call-to-action '.esc_attr($is_vc_49_plus).' '.esc_attr($el_class).' ult-responsive" style="'.esc_attr($text_style_inline).'" '.$data.'>';
if($icon_inline != '')
$output .= '<div class="ultimate-ctaction-icon ctaction-icon-'.esc_attr($effect).'">'.$icon_inline.'</div>';
$output .= '<div class="uvc-ctaction-data uvc-ctaction-data-'.esc_attr($effect).' ult-responsive">'.do_shortcode($content).'</div>';
$output .= $ctaction_link_html.'</div>';
$is_preset = false; //Display settings for Preset
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
}
}
}
if(class_exists('Ultimate_Highlight_Box'))
{
$Ultimate_Highlight_Box = new Ultimate_Highlight_Box;
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ultimate_ctation' ) ) {
class WPBakeryShortCode_ultimate_ctation extends WPBakeryShortCode {
}
}
?>
@@ -0,0 +1,873 @@
<?php
if(!class_exists('ULT_HotSpot')) {
class ULT_HotSpot {
function __construct() {
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
// We safely integrate with VC with this hook
add_action( 'init', array( $this, 'ult_hotspot_init' ),99 );
}
// Use this when creating a shortcode addon
add_shortcode( 'ult_hotspot', array( $this, 'ult_hotspot_callback' ) );
add_shortcode( 'ult_hotspot_items', array($this, 'ult_hotspot_items_callback' ) );
add_action('admin_enqueue_scripts',array($this, 'enqueue_admin_assets'),999);
// Register CSS and JS
add_action( 'wp_enqueue_scripts', array( $this, 'ult_hotspot_scripts' ), 1 );
if(defined('WPB_VC_VERSION') && version_compare(WPB_VC_VERSION, 4.8) >= 0) {
if(function_exists('vc_add_shortcode_param'))
{
vc_add_shortcode_param('ultimate_hotspot_param', array($this, 'ultimate_hotspot_param_callback'), UAVC_URL.'admin/vc_extend/js/vc-hotspot-param.js');
}
}
else {
if(function_exists('add_shortcode_param'))
{
add_shortcode_param('ultimate_hotspot_param', array($this, 'ultimate_hotspot_param_callback'), UAVC_URL.'admin/vc_extend/js/vc-hotspot-param.js');
}
}
}
function ultimate_hotspot_param_callback($settings, $value)
{
$dependency = '';
$class = isset($settings['class']) ? $settings['class'] : '';
$output = '<div class="ult-hotspot-image-wrapper '.esc_attr($class).'">';
$output .= '<img src="" class="ult-hotspot-image" alt="image"/>';
$output .= '<div class="ult-hotspot-draggable"></div>';
$output .= '<input type="hidden" name="'.esc_attr($settings['param_name']).'" value="'.esc_attr($value).'" class="ult-hotspot-positions wpb_vc_param_value" '.$dependency.'/>';
$output .= '</div>';
return $output;
}
function enqueue_admin_assets($hook)
{
if($hook == "post.php" || $hook == "post-new.php" || $hook == "edit.php"){
$bsf_dev_mode = bsf_get_option('dev_mode');
if($bsf_dev_mode === 'enable') {
wp_register_script('hotspt-admin-js', UAVC_URL.'admin/vc_extend/js/admin_enqueue_js.js',array( 'jquery', 'jquery-ui-core', 'jquery-ui-draggable', 'jquery-ui-slider', 'jquery-touch-punch' ),ULTIMATE_VERSION,true);
wp_enqueue_script('hotspt-admin-js');
}
}
}
function ult_hotspot_callback( $atts, $content = null ) {
global $tooltip_continuous_animation;
extract( shortcode_atts( array(
'main_img' => '',
'main_img_size' => '',
'main_img_width' => '',
'el_class' => '',
), $atts ) );
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$content = wpb_js_remove_wpautop($content, true); // fix unclosed/unwanted paragraph tags in $content
$mnimg = $alt = '';
if( $main_img !== '' ) {
$mnimg = apply_filters('ult_get_img_single', $main_img, 'url');
$alt = apply_filters('ult_get_img_single', $main_img, 'alt');
}
$cust_size = '';
if( $main_img_size== 'main_img_custom'){
if($main_img_width!='') {
$cust_size .= "width:".$main_img_width."px;";
}
}
$output = "<div class='ult_hotspot_container ".esc_attr($is_vc_49_plus)." ult-hotspot-tooltip-wrapper ".esc_attr($el_class)."' style=".esc_attr($cust_size).">";
$output .= " <img class='ult_hotspot_image' src=".esc_url(apply_filters('ultimate_images', $mnimg))." alt='".esc_attr($alt)."'/>";
$output .= " <div class='utl-hotspot-items ult-hotspot-item'>".do_shortcode($content)."</div>";
$output .= " <div style='color:#000;' data-image='".esc_attr($GLOBALS['hotspot_icon'])." ".esc_attr($GLOBALS['hotspot_icon_bg_color'])." ".esc_attr($GLOBALS['hotspot_icon_color'])." ".esc_attr($GLOBALS['hotspot_icon_size'])." ".esc_attr($GLOBALS['tooltip_continuous_animation'])."'></div>";
$output .= "</div>";
return $output;
}
function ult_hotspot_items_callback( $atts, $content = null ){
global $hotspot_icon, $hotspot_icon_bg_color, $hotspot_icon_color, $hotspot_icon_size;
extract( shortcode_atts( array(
'hotspot_content' => '',
'hotspot_label' => '',
'hotspot_position' => '0,0',
'tooltip_content' => '',
'tooltip_width' => '300',
'tooltip_padding' => '',
'tooltip_position' => '',
"icon_type" => '',
'icon' => 'Defaults-map-marker',
'icon_color' => '',
'icon_style' => '',
'icon_color_bg' => '',
'icon_border_style' => '',
'icon_color_border' => '',
'icon_border_size' => '',
'icon_border_radius' => '',
'icon_border_spacing' => '',
'icon_img' => '',
'img_width' => '60',
'link_style' => '',
'icon_link' => '',
'icon_size' => '',
"alignment" => "center",
'tooltip_trigger' => '',
'tooltip_animation' => '',
'tooltip_continuous_animation' => '',
'glow_color' => '',
'enable_bubble_arrow' => 'on',
'tooltip_custom_bg_color' => '#fff',
'tooltip_custom_color' => '#4c4c4c',
'tooltip_font' => '',
'tooltip_font_style' => '',
'tooltip_font_size' => '',
'tooltip_font_line_height' => '',
'tooltip_custom_border_size' => '',
'tooltip_align' => '',
), $atts ) );
//$content = wpb_js_remove_wpautop($content, false); // fix unclosed/unwanted paragraph tags in $content
// Animation effects
$glow = $pulse = '';
if( $tooltip_continuous_animation!='' ) {
switch( $tooltip_continuous_animation ) {
case "on":
$pulse = "ult-pulse";
break;
case "glow":
if($glow_color !== '')
$glow_color = 'style="background-color:'.$glow_color.'"';
else
$glow_color = '';
$glow = " <div class='ult-glow' ".esc_attr($glow_color)."></div>";
break;
}
}
if(trim($content) !== '')
$hotspot_content = $content;
/** Tooltip [Content] Styling
*--------------------------------------*/
$font_args = array();
$tooltip_content_style = '';
$tooltip_base_style = '';
$hotspot_tooltip_id = '';
if($tooltip_font != '') {
$font_family = get_ultimate_font_family($tooltip_font);
$tooltip_content_style .= 'font-family:'.$font_family.';';
array_push($font_args, $tooltip_font);
}
if($tooltip_font_style != '') { $tooltip_content_style .= get_ultimate_font_style($tooltip_font_style); }
// if($tooltip_font_size != '') { $tooltip_content_style .= 'font-size:'.$tooltip_font_size.'px;'; }
// if($tooltip_font_line_height != '') { $tooltip_content_style .= 'line-height:'.$tooltip_font_line_height.'px;'; }
if(is_numeric($tooltip_font_size)){
$tooltip_font_size = 'desktop:'.$tooltip_font_size.'px;';
}
if(is_numeric($tooltip_font_line_height)){
$tooltip_font_line_height = 'desktop:'.$tooltip_font_line_height.'px;';
}
$hotspot_tooltip_id = 'hotspot-tooltip-'.rand(1000, 9999);
$hotspot_tooltip_args = array(
'target' => '#'.$hotspot_tooltip_id.' .ult-tooltipster-content', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $tooltip_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $tooltip_font_line_height
),
);
$hotspot_tooltip_data_list = get_ultimate_vc_responsive_media_css($hotspot_tooltip_args);
// Width
if($tooltip_width!=''){ $tooltip_content_style .= 'width:' .$tooltip_width. 'px;'; }
// Padding
if($tooltip_padding!=''){ $tooltip_content_style .= $tooltip_padding; }
/**
* Tooltip [Base] Styling options
*
*/
// Background
if($tooltip_custom_bg_color!=''){ $tooltip_base_style .= 'background-color:' .$tooltip_custom_bg_color. ';'; }
/*if($tooltip_theme == 'custom' ) {*/
if($tooltip_custom_color!=''){ $tooltip_base_style .= 'color:' .$tooltip_custom_color. ';'; }
// Border Styling
if($tooltip_custom_border_size!=''){
$bstyle = str_replace( '|', '', $tooltip_custom_border_size );
$tooltip_base_style .= $bstyle;
}
if($tooltip_align!=''){
$tooltip_base_style .= 'text-align:'.$tooltip_align.';';
}
$data = '';
if($hotspot_tooltip_id !='') { $data .= 'data-mycust-id="'.esc_attr($hotspot_tooltip_id).'" ';}
if($hotspot_tooltip_data_list !='') { $data .=$hotspot_tooltip_data_list;}
if($tooltip_content_style!='') { $data .= 'data-tooltip-content-style="'.esc_attr($tooltip_content_style). '"'; }
if($tooltip_base_style!='') { $data .= 'data-tooltip-base-style="'.esc_attr($tooltip_base_style). '"'; }
if($enable_bubble_arrow!='' && $enable_bubble_arrow == 'on') {
$data .= ' data-bubble-arrow="true" ';
} else {
$data .= ' data-bubble-arrow="false" ';
}
$hotspot_position = explode(',', $hotspot_position);
if($icon_type == 'custom')
$temp_icon_size = ($img_width/2);
else
$temp_icon_size = ($icon_size/2);
//$temp_icon_size = 0;
$hotspot_x_position = $hotspot_position[0];
$hotspot_y_position = (isset($hotspot_position[1])) ? $hotspot_position[1] : '0';
$tooltip_offsetY = '';
//if($icon_size != '') {
// set offsetY for tooltip
$tooltip_offsetY = $temp_icon_size;
//}
if($tooltip_animation!='') { $data .= 'data-tooltipanimation="'.esc_attr($tooltip_animation).'"';}
if($tooltip_trigger!='') { $data .= 'data-trigger="'.esc_attr($tooltip_trigger).'"';}
if($tooltip_offsetY!='') { $data .= 'data-tooltip-offsety="'.esc_attr($tooltip_offsetY).'"';}
if($tooltip_position!='') { $data .= 'data-arrowposition="'.esc_attr($tooltip_position).'"';}
$icon_animation = '';
$icon_inline = do_shortcode('[just_icon icon_align="'.esc_attr($alignment).'" icon_type="'.esc_attr($icon_type).'" icon="'.esc_attr($icon).'" icon_img="'.esc_attr($icon_img).'" img_width="'.esc_attr($img_width).'" icon_size="'.esc_attr($icon_size).'" icon_color="'.esc_attr($icon_color).'" icon_style="'.esc_attr($icon_style).'" icon_color_bg="'.esc_attr($icon_color_bg).'" icon_color_border="'.esc_attr($icon_color_border).'" icon_border_style="'.esc_attr($icon_border_style).'" icon_border_size="'.esc_attr($icon_border_size).'" icon_border_radius="'.esc_attr($icon_border_radius).'" icon_border_spacing="'.esc_attr($icon_border_spacing).'" icon_animation="'.esc_attr($icon_animation).'"]');
$url = $link_title = $target = $rel = '';
// Hotspot has simple link
if( $link_style == 'link' && $icon_link !='' ){
$href = vc_build_link($icon_link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
}
$output = "<div class='ult-hotspot-item ".esc_attr($pulse)."' style='top:-webkit-calc(".esc_attr($hotspot_x_position)."% - ".esc_attr($temp_icon_size)."px);top:-moz-calc(".esc_attr($hotspot_x_position)."% - ".esc_attr($temp_icon_size)."px);top:calc(".esc_attr($hotspot_x_position)."% - ".esc_attr($temp_icon_size)."px);left: -webkit-calc(".esc_attr($hotspot_y_position)."% - ".esc_attr($temp_icon_size)."px);left: -moz-calc(".esc_attr($hotspot_y_position)."% - ".esc_attr($temp_icon_size)."px);left: calc(".esc_attr($hotspot_y_position)."% - ".esc_attr($temp_icon_size)."px);' >";
$output .= " <div style='z-index: 39;position: relative;'>";
if($link_style == 'link'){
$output .= " <a data-link_style='simple' class='ult-tooltipstered ult-hotspot-tooltip' ". Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel )." data-status='hide'>";
$output .= $icon_inline;
$output .= " </a>";
} else {
$output .= " <a data-link_style='tootip' ".$data." class='ult-tooltipstered ult-hotspot-tooltip' href='#' data-status='show'>";
$output .= $icon_inline;
$output .= "<span class='hotspot-tooltip-content'>".esc_html( str_replace('"', '\'', $hotspot_content ) )."</span>";
$output .= " </a>";
}
$output .= " </div><!-- ICON WRAP -->";
$output .= $glow;
$output .= "</div>";
return $output;
}
function ult_hotspot_init() {
if(function_exists("vc_map")){
vc_map( array(
"name" => __("Hotspot", 'ultimate_vc'),
"base" => "ult_hotspot",
"as_parent" => array('only' => 'ult_hotspot_items'),
"content_element" => true,
"show_settings_on_create" => true,
"category" => 'Ultimate VC Addons',
"icon" => "ult_hotspot",
"class" => "ult_hotspot",
"description" => __("Display Hotspot on Image.", 'ultimate_vc'),
//"is_container" => true,
"params" => array(
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Select Hotspot Image", 'ultimate_vc'),
"param_name" => "main_img",
"value" =>"",
/*"description" => __("Add Hotspot image.", 'ultimate'),*/
/*"holder" =>"div"*/
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Image Size", 'ultimate_vc'),
"param_name" => "main_img_size",
"value" => array(
"Default / Full Size" => "main_img_original",
"Custom" => "main_img_custom",
),
/*"description" => __("Select Hotspot image size.", 'ultimate')*/
),
array(
"type" => "number",
"heading" => __("Image Width", 'ultimate_vc'),
"class" => "",
"value" => "",
"suffix" => "px",
"param_name" => "main_img_width",
/*"description" => __("Enter image Width, Height will calculate automatically.", 'ultimate'),*/
"dependency" => array("element" => "main_img_size", "value" => "main_img_custom" ),
),
array(
"type" => "textfield",
"heading" => __("Extra Class Name", "ultimate_vc"),
"param_name" => "el_class",
"description" => __("Ran out of options? Need more styles? Write your own CSS and mention the class name here.", "ultimate_vc")
)
),
"js_view" => 'ULTHotspotContainerView'
) );
global $ultimate_hostspot_image;
vc_map( array(
"name" => __("Hotspot Item", 'ultimate_vc'),
"base" => "ult_hotspot_items",
"content_element" => true,
"as_child" => array('only' => 'ult_hotspot'),
"icon" => "ult_hotspot",
"class" => "ult_hotspot",
"js_view" => "ULTHotspotSingleView",
"is_container" => false,
"params" => array(
array(
'type' => 'ultimate_hotspot_param',
'heading' => 'Position',
'param_name' => 'hotspot_position',
//'admin_label' => true
),
/*array(
"type" => "number",
"class" => "",
"heading" => __("Horizontal Position", 'ultimate'),
"param_name" => "hotspot_x_position",
"value" => "50",
"admin_label" => true,
),
array(
"type" => "number",
"class" => "",
"admin_label" => true,
"heading" => __("Vertical Position", 'ultimate'),
"param_name" => "hotspot_y_position",
"value" => "50",
"suffix" => "%",
),*/
// Hotspot Icon
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use an existing font icon or upload a custom image.", "ultimate_vc"),
//"dependency" => Array("element" => "spacer", "value" => array("line_with_icon","icon_only")),
"group" => "Icon",
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"group" => "Icon",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"group" => "Icon",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"group" => "Icon",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"group" => "Icon",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
"group" => "Icon",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
"group" => "Icon",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Icon",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Icon",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Icon",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
"group" => "Icon",
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
"group" => "Icon",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "img_width",
"value" => 48,
"min" => 16,
"max" => 512,
"suffix" => "px",
"description" => __("Provide image width", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
"group" => "Icon",
),
// link style
array(
"type" => "dropdown",
"class" => "",
"heading" => __("On Click HotSpot Item:", "ultimate_vc"),
"param_name" => "link_style",
"value" => array(
__("Tooltip","ultimate_vc") => "tooltip",
__("Simple Link","ultimate_vc") => "link",
),
"description" => __("Display tooltip or just link for the hotspot icon.", "ultimate_vc"),
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Link ","ultimate_vc"),
"param_name" => "icon_link",
"value" => "",
"description" => __("Add a custom link or select existing page. You can remove existing link as well.","ultimate_vc"),
"dependency" => Array("element" => "link_style","value" => "link"),
),
// Link style
// TOOLTIP
array(
"type" => "textarea_html",
"class" => "",
"value" => "Tooltip content goes here!",
"heading" => __("Hotspot Tooltip Content", 'ultimate_vc'),
"param_name" => "content",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
'admin_label' => true,
"edit_field_class" => "ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param",
),
/*array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Continuous Pulse Animation For Hotspot", "ultimate_vc"),
"param_name" => "tooltip_continuous_animation",
// "admin_label" => true,
"value" => "on",
"default_set" => true,
"options" => array(
"on" => array(
"label" => __("Enable Pulse Animation?","ultimate_vc"),
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
),
),
"description" => __("Animate tooltip continuously or not", 'ultimate_vc'),
),*/
// Tooltip
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Tooltip Text Color", "ultimate_vc"),
"param_name" => "tooltip_custom_color",
/*"edit_field_class" => "vc_col-sm-6",*/
"value" => "#4c4c4c",
/*"dependency" => array("element" => "tooltip_theme", "value" => "custom"),*/
"group" => "Tooltip",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
/*"description" => __("Select the color for tooltip text.", "smile"), */
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "tooltip_custom_bg_color",
/*"edit_field_class" => "vc_col-sm-6",*/
"value" => "#fff",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
"group" => "Tooltip",
),
array(
"type" => "number",
"class" => "",
"value" => "300",
"heading" => __("Width", 'ultimate_vc'),
"param_name" => "tooltip_width",
"group" => "Tooltip",
"suffix" => "px",
"description" => __("Tooltip Default width: auto.", 'ultimate'),
"dependency" => Array("element" => "link_style","value" => "tooltip"),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Trigger On", 'ultimate_vc'),
"param_name" => "tooltip_trigger",
"value" => array("Hover" => "hover", "Click" => "click"),
"group" => "Tooltip",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
/*"description" => __("When to display the tooltip onclick or hover", 'ultimate')*/
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Position", 'ultimate_vc'),
"param_name" => "tooltip_position",
"value" => array(
__("Top","ultimate_vc") => "top",
__("Bottom","ultimate_vc") => "bottom",
__("Left","ultimate_vc") => "left",
__("Right","ultimate_vc") => "right"
),
"group" => "Tooltip",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
/*"description" => __("Set position of tooltip.", 'ultimate')*/
),
array(
"type" => "ultimate_border",
"heading" => __("Border","ultimate_vc"),
"param_name" => "tooltip_custom_border_size",
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array(
__("Top","ultimate_vc") => "1",
__("Right","ultimate_vc") => "1",
__("Bottom","ultimate_vc") => "1",
__("Left","ultimate_vc") => "1"
),
//"enable_radius" => false, // Enable border-radius. default true
"radius" => array(
__("Top Left","ultimate_vc") => "3", // use 'Top Left'
__("Top Right","ultimate_vc") => "3", // use 'Top Right'
__("Bottom Right","ultimate_vc") => "3", // use 'Bottom Right'
__("Bottom Left","ultimate_vc") => "3" // use 'Bottom Left'
),
"label_color" => __("Border Color","ultimate_vc"), // label for 'border color' default 'Border Color'
"label_radius" => __("Border Radius","ultimate_vc"), // label for 'radius' default 'Border Redius'
//"label_border" => "Border Style", // label for 'style' default 'Border Style'
"group" => "Tooltip",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Arrow", "ultimate_vc"),
"param_name" => "enable_bubble_arrow",
// "admin_label" => true,
"value" => "on",
"default_set" => true,
"options" => array(
"on" => array(
"label" => __("Enable Tooltip Arrow?","ultimate_vc"),
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
),
),
/*"description" => __("", "smile"),*/
/*"description" => __("Hide or Show Tooltip Arrow. Default: Hide. ", 'ultimate'),*/
"group" => "Tooltip",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Appear Animation", 'ultimate_vc'),
"param_name" => "tooltip_animation",
"value" => array(
__("Fade","ultimate_vc")=>"fade",
__("Grow","ultimate_vc")=>"glow",
__("Swing","ultimate_vc")=>"swing",
__("Slide","ultimate_vc")=>"slide",
__("Fall","ultimate_vc")=>"fall",
__("Euclid","ultimate_vc")=>"euclid"
),
"group" => "Tooltip",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
),
array(
"type" => "ultimate_spacing",
"heading" => __("Padding", "ultimate_vc"),
"param_name" => "tooltip_padding",
"mode" => "padding", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
__("Top","ultimate_vc") => "",
__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
__("Left","ultimate_vc") => ""
),
"group" => "Tooltip",
"dependency" => Array("element" => "link_style","value" => "tooltip"),
/*"description" => __("Thickness of the Tooltip Border. E.g. 5px 10px 5px 10px or 5px 10px etc.", "ultimate"),*/
/*"dependency" => array("element" => "tooltip_custom_border_style", "not_empty" => true),*/
),
// Typography
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "tooltip_font",
"value" => "",
"group" => "Typography",
//"dependency" => Array("element" => "link_style","value" => "tooltip"),
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "tooltip_font_style",
"value" => "",
"group" => "Typography",
//"dependency" => Array("element" => "link_style","value" => "tooltip"),
),
// array(
// "type" => "number",
// "param_name" => "tooltip_font_size",
// "heading" => __("Font size","ultimate_vc"),
// "value" => "12",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography",
// "dependency" => Array("element" => "link_style","value" => "tooltip"),
// ),
// array(
// "type" => "number",
// "param_name" => "tooltip_font_line_height",
// "heading" => __("Line Height","ultimate_vc"),
// "value" => "18",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography",
// "dependency" => Array("element" => "link_style","value" => "tooltip"),
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "tooltip_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "tooltip_font_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Text Align", 'ultimate_vc'),
"param_name" => "tooltip_align",
"value" => array(
__("Left","ultimate_vc") => "left",
__("Center","ultimate_vc") => "center",
__("Right","ultimate_vc") => "right",
__("Justify","ultimate_vc") => "justify"
),
"group" => "Typography",
//"dependency" => Array("element" => "link_style","value" => "tooltip"),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Animation For Hotspot", 'ultimate_vc'),
"param_name" => "tooltip_continuous_animation",
"value" => array(
__("None","ultimate_vc") => "",
__("Pulse","ultimate_vc") => "on",
__("Glow","ultimate_vc") => "glow",
),
"description" => __("Select animation effect for hotspot icon/image.", 'ultimate_vc'),
"group" => "Animation"
),
array(
"type" => "colorpicker",
"heading" => __("Glow Color", "ultimate_vc"),
"param_name" => "glow_color",
"value" => "",
"group" => "Animation",
"dependency" => Array("element" => "tooltip_continuous_animation","value" => "glow"),
),
)
) );
}
}
function ult_hotspot_scripts() {
$bsf_dev_mode = bsf_get_option('dev_mode');
if($bsf_dev_mode === 'enable') {
$js_path = '../assets/js/';
$css_path = '../assets/css/';
$ext = '';
}
else {
$js_path = '../assets/min-js/';
$css_path = '../assets/min-css/';
$ext = '.min';
}
// css
Ultimate_VC_Addons::ultimate_register_style( 'ult_hotspot_css', 'hotspot' );
Ultimate_VC_Addons::ultimate_register_style( 'ult_hotspot_tooltipster_css', 'hotspot-tooltipster' );
// js
Ultimate_VC_Addons::ultimate_register_script( 'ult_hotspot_js', 'hotspot', false, array( 'jquery' ), ULTIMATE_VERSION, false );
Ultimate_VC_Addons::ultimate_register_script( 'ult_hotspot_tooltipster_js', 'hotspot-tooltipster', false, array( 'jquery' ), ULTIMATE_VERSION, false );
}
}
new ULT_HotSpot;
if ( class_exists( 'WPBakeryShortCodesContainer' ) && !class_exists( 'WPBakeryShortCode_ult_hotspot' ) ) {
class WPBakeryShortCode_ult_hotspot extends WPBakeryShortCodesContainer {
}
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ult_hotspot_items' ) ) {
class WPBakeryShortCode_ult_hotspot_items extends WPBakeryShortCode {
}
}
}
?>
@@ -0,0 +1,678 @@
<?php
/*
* Add-on Name: Icon Manager
* Add-on URI: https://www.brainstormforce.com
*/
if ( ! class_exists( 'AIO_Icon_Manager' ) ) {
class AIO_Icon_Manager {
var $paths = array();
var $svg_file;
var $json_file;
var $vc_fonts;
var $vc_fonts_dir;
var $font_name = 'unknown';
var $unicode = '';
var $svg_config = array();
var $json_config = array();
static $charlist = array();
static $charlist_fallback = array();
static $iconlist = array();
var $assets_js;
var $assets_css;
var $admin_js;
var $admin_css;
function __construct() {
$this->assets_js = UAVC_URL.'assets/js/';
$this->assets_css = UAVC_URL.'assets/css/';
$this->admin_js = UAVC_URL.'admin/js/';
$this->admin_css = UAVC_URL.'admin/css/';
$this->paths = wp_upload_dir();
$this->paths['fonts'] = 'smile_fonts';
$this->paths['temp'] = trailingslashit( $this->paths['fonts'] ) . 'smile_temp';
$this->paths['fontdir'] = trailingslashit( $this->paths['basedir'] ) . $this->paths['fonts'];
$this->paths['tempdir'] = trailingslashit( $this->paths['basedir'] ) . $this->paths['temp'];
$this->paths['fonturl'] = set_url_scheme( trailingslashit( $this->paths['baseurl'] ) . $this->paths['fonts'] );
$this->paths['tempurl'] = trailingslashit( $this->paths['baseurl'] ) . trailingslashit( $this->paths['temp'] );
$this->paths['config'] = 'charmap.php';
$this->vc_fonts = trailingslashit( $this->paths['basedir'] ) . $this->paths['fonts'] . '/Defaults';
$this->vc_fonts_dir = plugin_dir_path( __FILE__ ) . '../assets/fonts/';
//font file extract by ajax function
add_action( 'wp_ajax_smile_ajax_add_zipped_font', array( $this, 'add_zipped_font' ) );
add_action( 'wp_ajax_smile_ajax_remove_zipped_font', array( $this, 'remove_zipped_font' ) );
if ( isset( $_GET['delete-bsf-fonts'] ) ) {
$this->delete_all_fonts();
}
//add_action('admin_menu',array($this,'icon_manager_menu'));
$defaults = get_option( 'smile_fonts' );
if ( ! $defaults ) {
add_action( 'admin_init', array( $this, 'AIO_move_fonts' ) );
} else if ( ( isset($defaults['Defaults'] ) && $defaults['Defaults'] == 'Array' ) ) {
delete_option( 'smile_fonts' );
add_action( 'admin_init', array( $this, 'AIO_move_fonts' ) );
}
}
// Icon font manager
public function get_icon_manager( $input_name, $icon ) {
$font_manager = self::get_font_manager( $id );
$output = '<div class="my_param_block">';
$output .= '<input name="' . esc_attr( $input_name ) . '" class="textinput ' . esc_attr($input_name) . ' text_field" type="text" value="' . esc_attr($icon) . '"/>';
$output .= '</div>';
$output .= '<script type="text/javascript">
jQuery(document).ready(function(){
//debugger;
//alert("' . esc_attr($id) . '");
jQuery(".preview-icon-' . esc_attr($id) . '").html("<i class=\'' . esc_attr($icon) . '\'></i>");
jQuery(".icons-list-' . esc_attr($id) . ' li[data-icons=\'' . esc_attr($icon) . '\']").addClass("selected");
});
jQuery(".icons-list-' . esc_attr($id) . ' li").click(function() {
jQuery(this).attr("class","selected").siblings().removeAttr("class");
var icon = jQuery(this).attr("data-icons");
jQuery("input[name=\'' . esc_attr($input_name) . '\']").val(icon);
jQuery(".preview-icon-' . esc_attr($id) . '").html("<i class=\'"+icon+"\'></i>");
});
</script>';
$output .= $font_manager;
return $output;
}
function icon_manager_menu() {
$page = add_submenu_page(
"bsf-dashboard",
__( "Icon Manager", "ultimate_vc" ),
__( "Icon Manager", "ultimate_vc" ),
"administrator",
"font-icon-Manager",
array( $this, 'icon_manager_dashboard' )
);
add_action( 'admin_print_scripts-' . $page, array( $this, 'admin_scripts' ) );
}
function admin_scripts() {
// enqueue js files on backend
wp_enqueue_script( 'aio-admin-media', $this->admin_js . 'admin-media.js', array( 'jquery' ) );
wp_enqueue_script( 'media-upload' );
wp_enqueue_media();
wp_enqueue_style( 'aio-icon-manager-admin', $this->admin_css . 'icon-manager-admin.css' );
$fonts = get_option( 'smile_fonts' );
if ( is_array( $fonts ) ) {
foreach ( $fonts as $font => $info ) {
if ( strpos( $info['style'], 'http://' ) !== false ) {
wp_enqueue_style( 'bsf-' . $font, $info['style'] );
} else {
wp_enqueue_style( 'bsf-' . $font, trailingslashit( $this->paths['fonturl'] ) . $info['style'] );
}
}
}
}// end AIO_admin_scripts
function icon_manager_dashboard() {
?>
<div class="wrap">
<h2>
<?php _e( 'Icon Fonts Manager', 'ultimate_vc' ); ?>
<a href="#smile_upload_icon" class="add-new-h2 smile_upload_icon" data-target="iconfont_upload"
data-title="<?php echo __( "Upload/Select Fontello Font Zip", "ultimate_vc" ) ?>"
data-type="application/zip" data-button="<?php echo __( "Insert Fonts Zip File", "ultimate_vc" ); ?>"
data-trigger="smile_insert_zip" data-class="media-frame ">
<?php _e( 'Upload New Icons', 'ultimate_vc' ); ?>
</a> &nbsp;<span class="spinner"></span></h2>
<div id="msg"></div>
<?php
$fonts = get_option( 'smile_fonts' );
if ( is_array( $fonts ) ) :
?>
<div class="metabox-holder meta-search">
<div class="postbox">
<h3>
<input class="search-icon" type="text" placeholder="Search"/>
<span class="search-count"></span></h3>
</div>
</div>
<?php self::get_font_set(); ?>
</div>
<?php else: ?>
<div class="error">
<p>
<?php _e( 'No font icons uploaded. Upload some font icons to display here.', 'ultimate_vc' ); ?>
</p>
</div>
<?php
endif;
}
public function get_font_manager( $id ) {
$fonts = get_option( 'smile_fonts' );
$fonts = get_option( 'smile_fonts' );
$output = '<p><div class="preview-icon preview-icon-' . esc_attr($id) . '"><i class=""></i></div><input class="search-icon" type="text" placeholder="Search for a suitable icon.." /></p>';
$output .= '<div id="smile_icon_search">';
$output .= '<ul class="icons-list smile_icon icon-list-' . esc_attr($id) . '">';
foreach ( $fonts as $font => $info ) {
$icon_set = array();
$icons = array();
$upload_dir = wp_upload_dir();
$path = trailingslashit( $upload_dir['basedir'] );
$file = $path . $info['include'] . '/' . $info['config'];
include( $file );
if ( ! empty( $icons ) ) {
$icon_set = array_merge( $icon_set, $icons );
}
if ( $font == "smt" ) {
$set_name = 'Default Icons';
} else {
$set_name = ucfirst( $font );
}
if ( ! empty( $icon_set ) ) {
$output .= '<p><strong>' . esc_html($set_name) . '</strong></p>';
$output .= '<li title="no-icon" data-icons="none" data-icons-tag="none,blank" style="cursor: pointer;" id="' . esc_attr($id) . '"></li>';
foreach ( $icon_set as $icons ) {
foreach ( $icons as $icon ) {
$output .= '<li title="' . esc_attr($icon['class']) . '" data-icons="' . esc_attr($font) . '-' . esc_attr($icon['class']) . '" data-icons-tag="' . esc_attr($icon['tags']) . '" id="' . esc_attr($id) . '">';
$output .= '<i class="icon ' . esc_attr($font) . '-' . esc_attr($icon['class']) . '"></i><label class="icon">' . esc_html($icon['class']) . '</label></li>';
}
}
}
}
$output . '</ul>';
$output .= '<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".search-icon").keyup(function(){
// Retrieve the input field text and reset the count to zero
var filter = jQuery(this).val(), count = 0;
// Loop through the icon list
jQuery(".icons-list li").each(function(){
// If the list item does not contain the text phrase fade it out
if (jQuery(this).attr("data-icons-tag").search(new RegExp(filter, "i")) < 0) {
jQuery(this).fadeOut();
} else {
jQuery(this).show();
count++;
}
});
});
});
</script>';
$output .= '</div>';
return $output;
}
// Generate Icon Set Preview and settings page
static function get_font_set() {
$fonts = get_option( 'smile_fonts' );
$n = count( $fonts );
foreach ( $fonts as $font => $info ) {
$icon_set = array();
$icons = array();
$upload_dir = wp_upload_dir();
$path = trailingslashit( $upload_dir['basedir'] );
$file = $path . $info['include'] . '/' . $info['config'];
$output = '<div class="icon_set-' . esc_attr($font) . ' metabox-holder">';
$output .= '<div class="postbox">';
include( $file );
if ( ! empty( $icons ) ) {
$icon_set = array_merge( $icon_set, $icons );
}
if ( ! empty( $icon_set ) ) {
foreach ( $icon_set as $icons ) {
$count = count( $icons );
}
if ( $font == 'smt' || $font == 'Defaults' ) {
$output .= '<h3 class="icon_font_name"><strong>' . __( "Default Icons", "smile" ) . '</strong>';
} else {
$output .= '<h3 class="icon_font_name"><strong>' . esc_html(ucfirst( $font )) . '</strong>';
}
$output .= '<span class="fonts-count count-' . esc_attr($font) . '">' . $count . '</span>';
if ( $n != 1 ) {
$output .= '<button class="button button-secondary button-small smile_del_icon" data-delete=' . esc_attr($font) . ' data-title="Delete This Icon Set">Delete Icon Set</button>';
}
$output .= '</h3>';
$output .= '<div class="inside"><div class="icon_actions">';
$output .= '</div>';
$output .= '<div class="icon_search"><ul class="icons-list fi_icon">';
foreach ( $icon_set as $icons ) {
foreach ( $icons as $icon ) {
$output .= '<li title="' . esc_attr($icon['class']) . '" data-icons="' . esc_attr($icon['class']) . '" data-icons-tag="' . esc_attr($icon['tags']) . '">';
$output .= '<i class="' . esc_attr($font) . '-' . esc_attr($icon['class']) . '"></i><label class="icon">' . esc_html($icon['class']) . '</label></li>';
}
}
$output . '</ul>';
$output .= '</div><!-- .icon_search-->';
$output .= '</div><!-- .inside-->';
$output .= '</div><!-- .postbox-->';
$output .= '</div><!-- .icon_set-' . esc_html($font) . ' -->';
echo $output;
}
}
$script = '<script type="text/javascript">
jQuery(document).ready(function(){
jQuery(".search-icon").keyup(function(){
jQuery(".fonts-count").hide();
// Retrieve the input field text and reset the count to zero
var filter = jQuery(this).val(), count = 0;
// Loop through the icon list
jQuery(".icons-list li").each(function(){
// If the list item does not contain the text phrase fade it out
if (jQuery(this).attr("data-icons-tag").search(new RegExp(filter, "i")) < 0) {
jQuery(this).fadeOut();
} else {
jQuery(this).show();
count++;
}
if(count == 0)
jQuery(".search-count").html(" Can\'t find the icon? <a href=\'#smile_upload_icon\' class=\'add-new-h2 smile_upload_icon\' data-target=\'iconfont_upload\' data-title=\'Upload/Select Fontello Font Zip\' data-type=\'application/octet-stream, application/zip\' data-button=\'Insert Fonts Zip File\' data-trigger=\'smile_insert_zip\' data-class=\'media-frame\'>Click here to upload</a>");
else
jQuery(".search-count").html(count+" Icons found.");
if(filter == "")
jQuery(".fonts-count").show();
});
});
});
</script>';
echo $script;
}
public function add_zipped_font() {
//check if referer is ok
check_ajax_referer( 'smile-add-zipped-fonts-nonce', 'security' );
//check if capability is ok
$cap = apply_filters( 'avf_file_upload_capability', 'update_plugins' );
if ( ! current_user_can( $cap ) ) {
die( __( "Using this feature is reserved for Super Admins. You unfortunately don't have the necessary permissions.", "ultimate_vc" ) );
}
//get the file path of the zip file
$attachment = $_POST['values'];
$path = realpath( get_attached_file( $attachment['id'] ) );
$unzipped = $this->zip_flatten( $path, array( '\.eot', '\.svg', '\.ttf', '\.woff', '\.json', '\.css' ) );
// if we were able to unzip the file and save it to our temp folder extract the svg file
if ( $unzipped ) {
$this->create_config();
}
//if we got no name for the font dont add it and delete the temp folder
if ( $this->font_name == 'unknown' ) {
$this->delete_folder( $this->paths['tempdir'] );
die( __( 'Was not able to retrieve the Font name from your Uploaded Folder', 'ultimate_vc' ) );
}
die( __( 'smile_font_added:', 'ultimate_vc' ) . $this->font_name );
}
public function remove_zipped_font() {
check_ajax_referer( 'smile-remove-zipped-fonts-nonce', 'security' );
//get the file path of the zip file
$font = sanitize_text_field( $_POST['del_font'] );
$list = self::load_iconfont_list();
$delete = isset( $list[ $font ] ) ? $list[ $font ] : false;
if ( $delete ) {
$this->delete_folder( $delete['include'] );
$this->remove_font( $font );
die( __( 'smile_font_removed', 'ultimate_vc' ) );
}
die( __( 'Was not able to remove Font', 'ultimate_vc' ) );
}
//extract the zip file to a flat folder and remove the files that are not needed
function zip_flatten( $zipfile, $filter ) {
@ini_set( 'memory_limit', apply_filters( 'admin_memory_limit', WP_MAX_MEMORY_LIMIT ) );
if ( is_dir( $this->paths['tempdir'] ) ) {
$this->delete_folder( $this->paths['tempdir'] );
$tempdir = smile_backend_create_folder( $this->paths['tempdir'], false );
} else {
$tempdir = smile_backend_create_folder( $this->paths['tempdir'], false );
}
//$fontdir = smile_backend_create_folder($this->paths['fontdir'], false);
if ( ! $tempdir ) {
die( __( 'Wasn\'t able to create temp folder', 'ultimate_vc' ) );
}
if ( class_exists( 'ZipArchive' ) ) {
$zip = new ZipArchive;
if ( $zip->open( $zipfile ) ) {
for ( $i = 0; $i < $zip->numFiles; $i ++ ) {
$entry = $zip->getNameIndex( $i );
if ( ! empty( $filter ) ) {
$delete = true;
$matches = array();
foreach ( $filter as $regex ) {
preg_match( "!" . $regex . "$!", $entry, $matches );
if ( ! empty( $matches ) ) {
$delete = false;
break;
}
}
}
if ( substr( $entry, - 1 ) == '/' || ! empty( $delete ) ) {
continue;
} // skip directories and non matching files
$fp = $zip->getStream( $entry );
$ofp = fopen( $this->paths['tempdir'] . '/' . basename( $entry ), 'w' );
if ( ! $fp ) {
die( __( 'Unable to extract the file.', 'ultimate_vc' ) );
}
while ( ! feof( $fp ) ) {
fwrite( $ofp, fread( $fp, 8192 ) );
}
fclose( $fp );
fclose( $ofp );
}
$zip->close();
}
} else {
die( __( "Wasn't able to work with Zip Archive", 'ultimate_vc' ) );
}
return true;
}
//iterate over xml file and extract the glyphs for the font
function create_config() {
$this->json_file = $this->find_json();
$this->svg_file = $this->find_svg();
if ( empty( $this->json_file ) || empty( $this->svg_file ) ) {
$this->delete_folder( $this->paths['tempdir'] );
die( __( 'selection.json or SVG file not found. Was not able to create the necessary config files', 'ultimate_vc' ) );
}
$json = '';
$response = '';
global $wp_filesystem;
if ( empty( $wp_filesystem ) ) {
require_once( ABSPATH . '/wp-admin/includes/file.php' );
WP_Filesystem();
}
if ( file_exists( trailingslashit( $this->paths['tempdir'] ) . $this->svg_file ) ) {
$response = $wp_filesystem->get_contents( trailingslashit( $this->paths['tempdir'] ) . $this->svg_file );
}
if ( file_exists( trailingslashit( $this->paths['tempdir'] ) . $this->svg_file ) ) {
$json = $wp_filesystem->get_contents( trailingslashit( $this->paths['tempdir'] ) . $this->json_file );
}
if ( '' !== $json && '' !== $response ) {
$xml = simplexml_load_string( $response );
$font_attr = $xml->defs->font->attributes();
$glyphs = $xml->defs->font->children();
$this->font_name = (string) $font_attr['id'];
$unicodes = array();
foreach ( $glyphs as $item => $glyph ) {
if ( $item == 'glyph' ) {
$attributes = $glyph->attributes();
$unicode = (string) $attributes['unicode'];
array_push( $unicodes, $unicode );
}
}
$font_folder = trailingslashit( $this->paths['fontdir'] ) . $this->font_name;
if ( is_dir( $font_folder ) ) {
$this->delete_folder( $this->paths['tempdir'] );
die( __( "It seems that the font with the same name is already exists! Please upload the font with different name.", "ultimate_vc" ) );
}
$file_contents = json_decode( $json );
if ( ! isset( $file_contents->IcoMoonType ) ) {
$this->delete_folder( $this->paths['tempdir'] );
die( __( 'Uploaded font is not from IcoMoon. Please upload fonts created with the IcoMoon App Only.', 'ultimate_vc' ) );
}
$icons = $file_contents->icons;
unset( $unicodes[0] );
$n = 1;
foreach ( $icons as $icon ) {
$icon_name = $icon->properties->name;
$icon_class = str_replace( ' ', '', $icon_name );
$icon_class = str_replace( ',', ' ', $icon_class );
$tags = implode( ",", $icon->icon->tags );
$this->json_config[ $this->font_name ][ $icon_name ] = array(
"class" => $icon_class,
"tags" => $tags,
"unicode" => $unicodes[ $n ]
);
$n ++;
}
if ( ! empty( $this->json_config ) && $this->font_name != 'unknown' ) {
$this->write_config();
$this->re_write_css();
$this->rename_files();
$this->rename_folder();
$this->add_font();
}
}
return false;
}
//writes the php config file for the font
function write_config() {
$charmap = $this->paths['tempdir'] . '/' . $this->paths['config'];
$handle = @fopen( $charmap, 'w' );
if ( $handle ) {
fwrite( $handle, '<?php $icons = array();' );
foreach ( $this->json_config[ $this->font_name ] as $icon => $info ) {
if ( ! empty( $info ) ) {
$delimiter = "'";
fwrite( $handle, "\r\n" . '$icons[\'' . $this->font_name . '\'][' . $delimiter . $icon . $delimiter . '] = array("class"=>' . $delimiter . $info["class"] . $delimiter . ',"tags"=>' . $delimiter . $info["tags"] . $delimiter . ',"unicode"=>' . $delimiter . $info["unicode"] . $delimiter . ');' );
} else {
$this->delete_folder( $this->paths['tempdir'] );
die( __( 'Was not able to write a config file', 'ultimate_vc' ) );
}
}
fclose( $handle );
} else {
$this->delete_folder( $this->paths['tempdir'] );
die( __( 'Was not able to write a config file', 'ultimate_vc' ) );
}
}
//re-writes the php config file for the font
function re_write_css() {
$style = $this->paths['tempdir'] . '/style.css';
$file = @file_get_contents( $style );
if ( $file ) {
$str = str_replace( 'fonts/', '', $file );
$str = str_replace( 'icon-', $this->font_name . '-', $str );
$str = str_replace( '.icon {', '[class^="' . $this->font_name . '-"], [class*=" ' . $this->font_name . '-"] {', $str );
$str = str_replace( 'i {', '[class^="' . $this->font_name . '-"], [class*=" ' . $this->font_name . '-"] {', $str );
/* remove comments */
$str = preg_replace( '!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $str );
/* remove tabs, spaces, newlines, etc. */
$str = str_replace( array( "\r\n", "\r", "\n", "\t", ' ', ' ', ' ' ), '', $str );
@file_put_contents( $style, $str );
} else {
die( __( 'Unable to write css. Upload icons downloaded only from icomoon', 'ultimate_vc' ) );
}
}
function rename_files() {
$extensions = array( 'eot', 'svg', 'ttf', 'woff', 'css' );
$folder = trailingslashit( $this->paths['tempdir'] );
foreach ( glob( $folder . '*' ) as $file ) {
$path_parts = pathinfo( $file );
if ( strpos( $path_parts['filename'], '.dev' ) === false && in_array( $path_parts['extension'], $extensions ) ) {
if ( $path_parts['filename'] !== $this->font_name ) {
rename( $file, trailingslashit( $path_parts['dirname'] ) . $this->font_name . '.' . $path_parts['extension'] );
}
}
}
}
//rename the temp folder and all its font files
function rename_folder() {
$new_name = trailingslashit( $this->paths['fontdir'] ) . $this->font_name;
//delete folder and contents if they already exist
$this->delete_folder( $new_name );
if ( rename( $this->paths['tempdir'], $new_name ) ) {
return true;
} else {
$this->delete_folder( $this->paths['tempdir'] );
die( __( "Unable to add this font. Please try again.", "ultimate_vc" ) );
}
}
//delete a folder
function delete_folder( $new_name ) {
//delete folder and contents if they already exist
if ( is_dir( $new_name ) ) {
$objects = scandir( $new_name );
foreach ( $objects as $object ) {
if ( $object != "." && $object != ".." ) {
unlink( $new_name . "/" . $object );
}
}
reset( $objects );
rmdir( $new_name );
} else {
echo $new_name . ' no found<br/>';
}
}
// delete_all_fonts
function delete_all_fonts() {
$new_name = $this->paths['fontdir'];
$objects = scandir( $new_name );
foreach ( $objects as $object ) {
if ( $object != "." && $object != ".." ) {
$this->delete_folder( $new_name . '/' . $object );
}
}
delete_option( 'smile_fonts' );
wp_redirect( admin_url( 'admin.php?page=bsf-font-icon-manager' ) );
exit;
}
function add_font() {
$fonts = get_option( 'smile_fonts' );
if ( empty( $fonts ) ) {
$fonts = array();
}
$fonts[ $this->font_name ] = array(
'include' => trailingslashit( $this->paths['fonts'] ) . $this->font_name,
'folder' => trailingslashit( $this->paths['fonts'] ) . $this->font_name,
'style' => $this->font_name . '/' . $this->font_name . '.css',
'config' => $this->paths['config']
);
update_option( 'smile_fonts', $fonts );
}
function remove_font( $font ) {
$fonts = get_option( 'smile_fonts' );
if ( isset( $fonts[ $font ] ) ) {
unset( $fonts[ $font ] );
update_option( 'smile_fonts', $fonts );
}
}
//finds the json file we need to create the config
function find_json() {
$files = scandir( $this->paths['tempdir'] );
foreach ( $files as $file ) {
if ( strpos( strtolower( $file ), '.json' ) !== false && $file[0] != '.' ) {
return $file;
}
}
}
//finds the svg file we need to create the config
function find_svg() {
$files = scandir( $this->paths['tempdir'] );
foreach ( $files as $file ) {
if ( strpos( strtolower( $file ), '.svg' ) !== false && $file[0] != '.' ) {
return $file;
}
}
}
static function load_iconfont_list() {
if ( ! empty( self::$iconlist ) ) {
return self::$iconlist;
}
$extra_fonts = get_option( 'smile_fonts' );
if ( empty( $extra_fonts ) ) {
$extra_fonts = array();
}
$font_configs = $extra_fonts;//array_merge(SmileBuilder::$default_iconfont, $extra_fonts);
//if we got any include the charmaps and add the chars to an array
$upload_dir = wp_upload_dir();
$path = trailingslashit( $upload_dir['basedir'] );
$url = trailingslashit( $upload_dir['baseurl'] );
foreach ( $font_configs as $key => $config ) {
if ( empty( $config['full_path'] ) ) {
$font_configs[ $key ]['include'] = $path . $font_configs[ $key ]['include'];
$font_configs[ $key ]['folder'] = $url . $font_configs[ $key ]['folder'];
}
}
//cache the result
self::$iconlist = $font_configs;
return $font_configs;
}
function AIO_move_fonts() {
// Make destination directory
if ( ! is_dir( $this->vc_fonts ) ) {
wp_mkdir_p( $this->vc_fonts );
}
@chmod( $this->vc_fonts, 0777 );
foreach ( glob( $this->vc_fonts_dir . '*' ) as $file ) {
$new_file = basename( $file );
@copy( $file, $this->vc_fonts . '/' . $new_file );
}
$fonts['Defaults'] = array(
'include' => sanitize_text_field( trailingslashit( $this->paths['fonts'] ) ) . 'Defaults',
'folder' => sanitize_text_field( trailingslashit( $this->paths['fonts'] ) ) . 'Defaults',
'style' => 'Defaults' . '/' . 'Defaults' . '.css',
'config' => sanitize_text_field( $this->paths['config'] )
);
$defaults = get_option( 'smile_fonts' );
if ( ! $defaults ) {
update_option( 'smile_fonts', $fonts );
}
}// end AIO_move_fonts
}// End class
/*
* creates a folder for the theme framework
*/
if ( ! function_exists( 'smile_backend_create_folder' ) ) {
function smile_backend_create_folder( &$folder, $addindex = true ) {
if ( is_dir( $folder ) && $addindex == false ) {
return true;
}
$created = wp_mkdir_p( trailingslashit( $folder ) );
@chmod( $folder, 0777 );
if ( $addindex == false ) {
return $created;
}
$index_file = trailingslashit( $folder ) . 'index.php';
if ( file_exists( $index_file ) ) {
return $created;
}
$handle = @fopen( $index_file, 'w' );
if ( $handle ) {
fwrite( $handle, "<?php\r\necho 'Sorry, browsing the directory is not allowed!';\r\n?>
" );
fclose( $handle );
}
return $created;
}
}
// Instantiate the Icon Manager
}
$AIO_Icon_Manager = new AIO_Icon_Manager;
add_action( 'wp_ajax_smile_ajax_add_zipped_font', array( $AIO_Icon_Manager, 'add_zipped_font' ) );
add_action( 'wp_ajax_smile_ajax_remove_zipped_font', array( $AIO_Icon_Manager, 'remove_zipped_font' ) );
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,410 @@
<?php
/*
* Add-on Name: Icons Block for WPBakery Page Builder
*/
if(!class_exists('Ultimate_Icons'))
{
class Ultimate_Icons
{
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'ultimate_icon_init'));
}
add_shortcode('ultimate_icons',array($this,'ultimate_icons_shortcode'));
add_shortcode('single_icon',array($this,'single_icon_shortcode'));
}
function ultimate_icon_init()
{
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Icons","ultimate_vc"),
"base" => "ultimate_icons",
"class" => "ultimate_icons",
"icon" => "ultimate_icons",
"category" => "Ultimate VC Addons",
"description" => __("Add a set of multiple icons and give some custom style.","ultimate_vc"),
"as_parent" => array('only' => 'single_icon'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma)
"content_element" => true,
"show_settings_on_create" => true,
//"is_container" => true,
"js_view" => 'VcColumnView',
"params" => array(
// Play with icon selector
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Alignment","ultimate_vc"),
"param_name" => "align",
"value" => array(
__("Left Align","ultimate_vc") => "uavc-icons-left",
__("Right Align","ultimate_vc") => "uavc-icons-right",
__("Center Align","ultimate_vc") => "uavc-icons-center"
),
//"description" => __("", "smile"),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class","ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Write your own CSS and mention the class name here.", "ultimate_vc"),
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_icon',
'group' => __( 'Design', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)
)
);
vc_map(
array(
"name" => __("Icon Item"),
"base" => "single_icon",
"class" => "vc_simple_icon",
"icon" => "vc_just_icon",
"category" => __("Ultimate VC Addons","ultimate_vc"),
"description" => __("Add a set of multiple icons and give some custom style.","ultimate_vc"),
"as_child" => array('only' => 'ultimate_icons'), // Use only|except attributes to limit child shortcodes (separate multiple values with comma)
"show_settings_on_create" => true,
"is_container" => false,
"params" => array(
// Play with icon selector
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"admin_label" => true,
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"group"=> "Select Icon",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"group"=> "Select Icon",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Space after Icon", "ultimate_vc"),
"param_name" => "icon_margin",
"value" => 5,
"min" => 0,
"max" => 100,
"suffix" => "px",
"description" => __("How much distance would you like in two icons?", "ultimate_vc"),
"group" => "Other Settings"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "#333333",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"group"=> "Select Icon",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
"group" => "Select Icon"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "#ffffff",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
"group" => "Select Icon"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc")=> "",
__("Solid","ultimate_vc")=> "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
"group" => "Select Icon"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Select Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Select Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Select Icon"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
"group" => "Select Icon"
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Link ","ultimate_vc"),
"param_name" => "icon_link",
"value" => "",
"description" => __("Add a custom link or select existing page. You can remove existing link as well.","ultimate_vc"),
"group" => "Other Settings"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Animation","ultimate_vc"),
"param_name" => "icon_animation",
"value" => array(
__("No Animation","ultimate_vc") => "",
__("Swing","ultimate_vc") => "swing",
__("Pulse","ultimate_vc") => "pulse",
__("Fade In","ultimate_vc") => "fadeIn",
__("Fade In Up","ultimate_vc") => "fadeInUp",
__("Fade In Down","ultimate_vc") => "fadeInDown",
__("Fade In Left","ultimate_vc") => "fadeInLeft",
__("Fade In Right","ultimate_vc") => "fadeInRight",
__("Fade In Up Long","ultimate_vc") => "fadeInUpBig",
__("Fade In Down Long","ultimate_vc") => "fadeInDownBig",
__("Fade In Left Long","ultimate_vc") => "fadeInLeftBig",
__("Fade In Right Long","ultimate_vc") => "fadeInRightBig",
__("Slide In Down","ultimate_vc") => "slideInDown",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Bounce In","ultimate_vc") => "bounceIn",
__("Bounce In Up","ultimate_vc") => "bounceInUp",
__("Bounce In Down","ultimate_vc") => "bounceInDown",
__("Bounce In Left","ultimate_vc") => "bounceInLeft",
__("Bounce In Right","ultimate_vc") => "bounceInRight",
__("Rotate In","ultimate_vc") => "rotateIn",
__("Light Speed In","ultimate_vc") => "lightSpeedIn",
__("Roll In","ultimate_vc") => "rollIn",
),
"description" => __("Like CSS3 Animations? We have several options for you!","ultimate_vc"),
"group" => "Other Settings"
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Tooltip", "ultimate_vc"),
"param_name" => "tooltip_disp",
"value" => array(
__("None","ultimate_vc")=> "",
__("Tooltip from Left","ultimate_vc") => "left",
__("Tooltip from Right","ultimate_vc") => "right",
__("Tooltip from Top","ultimate_vc") => "top",
__("Tooltip from Bottom","ultimate_vc") => "bottom",
),
"description" => __("Select the tooltip position","ultimate_vc"),
"group" => "Other Settings"
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Tooltip Text", "ultimate_vc"),
"param_name" => "tooltip_text",
"value" => "",
"description" => __("Enter your tooltip text here.", "ultimate_vc"),
"dependency" => Array("element" => "tooltip_disp", "not_empty" => true),
"group" => "Other Settings"
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Custom CSS Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Ran out of options? Need more styles? Write your own CSS and mention the class name here.", "ultimate_vc"),
"group" => "Select Icon"
),
),
)
);
}
}
// Shortcode handler function for stats Icon
function ultimate_icons_shortcode($atts,$content = null)
{
$align = $el_class = '';
extract(shortcode_atts(array(
'align' => '',
'el_class' => '',
'css_icon' =>'',
),$atts));
$icon_design_css = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_icon, ' ' ), "ultimate_icons", $atts );
$output = '<div class="'.esc_attr($icon_design_css).' '.esc_attr($align).' uavc-icons '.esc_attr($el_class).'">';
$output .= do_shortcode($content);
$output .= '</div>';
return $output;
}
function single_icon_shortcode($atts){
$icon_type = $icon_img = $img_width = $icon = $icon_color = $icon_color_bg = $icon_size = $icon_style = $icon_border_style = $icon_border_radius = $icon_color_border = $icon_border_size = $icon_border_spacing = $icon_link = $el_class = $icon_animation = $tooltip_disp = $tooltip_text = $icon_margin = $target = $link_title = $rel = '';
extract(shortcode_atts( array(
'icon'=> '',
'icon_size' => '',
'icon_color' => '',
'icon_style' => '',
'icon_color_bg' => '',
'icon_color_border' => '',
'icon_border_style' => '',
'icon_border_size' => '',
'icon_border_radius' => '',
'icon_border_spacing' => '',
'icon_link' => '',
'icon_margin' => '',
'icon_animation' => '',
'tooltip_disp' => '',
'tooltip_text' => '',
'el_class'=>'',
),$atts));
$ultimate_js = get_option('ultimate_js');
if(isset($tooltip_disp) && $tooltip_disp != '' && $ultimate_js != 'enable')
wp_enqueue_script('ultimate-tooltip');
if($icon_animation !== 'none')
{
$css_trans = 'data-animation="'.esc_attr($icon_animation).'" data-animation-delay="03"';
}
$output = $style = $link_sufix = $link_prefix = $target = $href = $icon_align_style = '';
$uniqid = uniqid();
$href = vc_build_link($icon_link);
if($icon_link !== ''){
if( $href['url'] != NULL ){
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
$link_prefix .= '<a class="aio-tooltip '.esc_attr($uniqid).'" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).' data-toggle="tooltip" data-placement="'.esc_attr($tooltip_disp).'" title="'.esc_attr($tooltip_text).'">';
$link_sufix .= '</a>';
}
}
if($tooltip_disp !== '' && $href['url'] == NULL ){
$link_prefix .= '<span class="aio-tooltip '.esc_attr($uniqid).'" data-toggle="tooltip" data-placement="'.esc_attr($tooltip_disp).'" title="'.esc_attr($tooltip_text).'">';
$link_sufix .= '</span>';
}
if($icon_color !== '')
$style .= 'color:'.$icon_color.';';
if($icon_style !== 'none'){
if($icon_color_bg !== '')
$style .= 'background:'.$icon_color_bg.';';
}
if($icon_style == 'advanced'){
$style .= 'border-style:'.$icon_border_style.';';
$style .= 'border-color:'.$icon_color_border.';';
$style .= 'border-width:'.$icon_border_size.'px;';
$style .= 'width:'.$icon_border_spacing.'px;';
$style .= 'height:'.$icon_border_spacing.'px;';
$style .= 'line-height:'.$icon_border_spacing.'px;';
$style .= 'border-radius:'.$icon_border_radius.'px;';
}
if($icon_size !== '')
$style .='font-size:'.$icon_size.'px;';
if($icon_margin !== '')
$style .= 'margin-right:'.$icon_margin.'px;';
if($icon !== ""){
$output .= "\n".$link_prefix.'<div class="aio-icon '.esc_attr($icon_style).' '.esc_attr($el_class).'" '.$css_trans.' style="'.esc_attr($style).'">';
$output .= "\n\t".'<i class="'.esc_attr($icon).'"></i>';
$output .= "\n".'</div>'.$link_sufix;
}
//$output .= do_shortcode($content);
if($tooltip_disp !== ""){
$output .= '<script>
jQuery(function () {
jQuery(".'.esc_attr($uniqid).'").bsf_tooltip("hide");
})
</script>';
}
return $output;
}
}
}
if(class_exists('Ultimate_Icons'))
{
$Ultimate_Icons = new Ultimate_Icons;
}
//Extend WPBakeryShortCodesContainer class to inherit all required functionality
if ( class_exists( 'WPBakeryShortCodesContainer' ) && !class_exists( 'WPBakeryShortCode_ultimate_icons' ) ) {
class WPBakeryShortCode_ultimate_icons extends WPBakeryShortCodesContainer {
}
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_single_icon' ) ) {
class WPBakeryShortCode_single_icon extends WPBakeryShortCode {
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,318 @@
<?php
/*
* Add-on Name: Image Separator
*/
if(!class_exists('Ultimate_Image_Separator'))
{
class Ultimate_Image_Separator{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'ultimate_img_separator_init'));
}
add_shortcode('ultimate_img_separator',array($this,'ultimate_img_separator_shortcode'));
add_action('wp_enqueue_scripts', array($this, 'register_easy_separator_assets'),1);
}
function register_easy_separator_assets()
{
Ultimate_VC_Addons::ultimate_register_style( 'ult-easy-separator-style', 'image-separator' );
Ultimate_VC_Addons::ultimate_register_script( 'ult-easy-separator-script', 'image-separator', false, array( 'jquery' ), ULTIMATE_VERSION, false );
}
function ultimate_img_separator_init(){
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Image Separator","ultimate_vc"),
"base" => "ultimate_img_separator",
"class" => "vc_img_separator_icon",
"icon" => "vc_icon_img_separator",
"category" => "Ultimate VC Addons",
"description" => __("Add image as row seperator","ultimate_vc"),
"params" => array(
array(
'type' => 'ult_img_single',
'heading' => __('Image','ultimate_vc'),
'param_name' => 'img_separator',
),
array(
"type" => "animator",
"class" => "",
"heading" => __("Animation","ultimate_vc"),
"param_name" => "animation",
"value" => "",
"group" => "Animation"
//"description" => __("","smile"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Animation Duration","ultimate_vc"),
"param_name" => "animation_duration",
"value" => 3,
"min" => 1,
"max" => 100,
"suffix" => "s",
"description" => __("How long the animation effect should last. Decides the speed of effect.","ultimate_vc"),
"group" => "Animation",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Animation Delay","ultimate_vc"),
"param_name" => "animation_delay",
"value" => 0,
"min" => 1,
"max" => 100,
"suffix" => "s",
"description" => __("Delays the animation effect for seconds you enter above.","ultimate_vc"),
"group" => "Animation"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Animation Repeat Count","ultimate_vc"),
"param_name" => "animation_iteration_count",
"value" => 1,
"min" => 0,
"max" => 100,
"suffix" => "",
"description" => __("The animation effect will repeat to the count you enter above. Enter 0 if you want to repeat it infinitely.","ultimate_vc"),
"group" => "Animation"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Viewport Position", "ultimate_vc"),
"param_name" => "opacity_start_effect",
"suffix" => "%",
//"admin_label" => true,
"value" => "90",
"description" => __("The area of screen from top where animation effects will start working.", "ultimate_vc"),
"group" => "Animation"
),
array(
'type' => 'ultimate_responsive',
'heading' => __('Image Size (px)','ultimate_vc'),
'unit' => 'px', // use '%' or 'px'
'media' => array(
'Desktop' => '', // Here '28' is default value set for 'Desktop'
'Tablet' => '',
'Tablet Portrait' => '',
'Mobile Landscape' => '',
'Mobile' => '',
),
'param_name' => 'img_separator_width'
),
array(
'type' => 'dropdown',
'heading' => __('Image Position','ultimate_vc'),
'param_name' => 'img_separator_position',
'value' => array(
__('Top','ultimate_vc') => 'ult-top-easy-separator',
__('Bottom','ultimate_vc') => 'ult-bottom-easy-separator',
)
),
array(
'type' => 'number',
'heading' => __('Gutter','ultimate_vc'),
'param_name' => 'img_separator_gutter',
'suffix' => '%',
'description' => __('50% is default. Increase to push the image outside or decrease to pull the image inside.','ultimate_vc')
),
array(
'type' => 'dropdown',
'heading' => __('Image Alignment','ultimate_vc'),
'param_name' => 'img_separator_alignment',
'value' => array(
__('Center','ultimate_vc') => 'ult-center-img',
__('Left','ultimate_vc') => 'ult-left-img',
__('Right','ultimate_vc') => 'ult-right-img',
)
),
array(
'type' => 'number',
'heading' => __('Image Position from Left','ultimate_vc'),
'param_name' => 'img_position_left',
'suffix' => '%',
// 'description' => __('50% is default. Increase to push the image outside or decrease to pull the image inside.','ultimate_vc')
"dependency"=>Array("element"=>"img_separator_alignment","value"=>array("ult-left-img")),
),
array(
'type' => 'number',
'heading' => __('Image Position from right','ultimate_vc'),
'param_name' => 'img_position_right',
'suffix' => '%',
// 'description' => __('50% is default. Increase to push the image outside or decrease to pull the image inside.','ultimate_vc')
"dependency"=>Array("element"=>"img_separator_alignment","value"=>array("ult-right-img")),
),
array(
"type" => "vc_link",
"heading" => __("Link ","ultimate_vc"),
"param_name" => "sep_link",
"value" => "",
"description" => __("Add a custom link or select existing page. You can remove existing link as well.","ultimate_vc")
),
),
)
);
}
}
// Shortcode handler function for stats banner
function ultimate_img_separator_shortcode($atts, $content)
{
$output = $wrapper_class = $custom_position = $opacity_start_effect_data = $animation_style = $animation_el_class = $animation_data = $href = $url = $link_title = $target = $target = $link_title = $rel = '';
$is_animation = false;
extract(shortcode_atts( array(
'img_separator' => '',
'animation' => '',
'img_separator_width' => '',
'img_separator_position' => 'ult-top-easy-separator',
'img_separator_alignment' => 'ult-center-img',
'img_separator_gutter' => '',
'img_position_left' => '',
'img_position_right' => '',
'opacity' => 'set',
'opacity_start_effect' => '',
'animation_duration' => '',
'animation_delay' => '',
'animation_iteration_count' => '',
'sep_link' => ''
),$atts));
$ultimate_custom_vc_row = get_option('ultimate_custom_vc_row');
if($ultimate_custom_vc_row == '')
$ultimate_custom_vc_row = 'wpb_row';
$img = apply_filters('ult_get_img_single', $img_separator, 'url');
$alt = apply_filters('ult_get_img_single', $img_separator, 'alt');
$id = 'ult-easy-separator-'.uniqid(rand());
if( $sep_link !='' ){
$href = vc_build_link($sep_link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
}
$args = array(
'target' => '#'.$id, // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'width' => $img_separator_width
),
);
$data_list = get_ultimate_vc_responsive_media_css($args);
$trans = '-50%';
if ( is_rtl() ) {
$trans = '50%';
}
if( $img_separator_alignment == 'ult-left-img' || $img_separator_alignment == 'ult-right-img' ){
$trans = '0';
}
if($img_separator_gutter != '')
{
$wrapper_class = 'ult-easy-separator-no-default';
if($img_separator_position == 'ult-top-easy-separator' )
{
$img_separator_gutter = '-'.$img_separator_gutter;
//$custom_position = 'top:'.$img_separator_gutter.'%;';
$custom_position .= 'transform: translate('. $trans .','.$img_separator_gutter.'%)!important;';
$custom_position .= '-ms-transform: translate('. $trans .','.$img_separator_gutter.'%)!important;';
$custom_position .= '-webkit-transform: translate('. $trans .','.$img_separator_gutter.'%)!important;';
}
else if($img_separator_position == 'ult-bottom-easy-separator' )
{
//$custom_position = 'bottom:'.$img_separator_gutter.'%;';
$custom_position .= 'transform: translate('. $trans .','.$img_separator_gutter.'%)!important;';
$custom_position .= '-ms-transform: translate('. $trans .','.$img_separator_gutter.'%)!important;';
$custom_position .= '-webkit-transform: translate('. $trans .','.$img_separator_gutter.'%)!important;';
}
}
$img_alignment = '';
if($img_separator_alignment == 'ult-left-img' && ! wp_is_mobile() )
{
$img_alignment = 'ult-left-img';
}
else if($img_separator_alignment == 'ult-right-img' && ! wp_is_mobile() )
{
$img_alignment = 'ult-right-img';
}
else {
$img_alignment = '';
}
$img_alignment_position = $img_separator_gutter_value = '';
if($img_separator_gutter != ''){
$img_separator_gutter_value = esc_attr($img_separator_gutter);
}
else {
$img_separator_gutter_value = '50';
}
if($img_separator_alignment == 'ult-left-img' && $img_position_left != '' && ! wp_is_mobile() )
{
$img_alignment_position = 'left:'.$img_position_left.'%;';
$img_alignment_position .= 'transform: translate(-'.$img_position_left.'%,'.$img_separator_gutter_value.'%);';
$img_alignment_position .= '-ms-transform: translate(-'.$img_position_left.'%,'.$img_separator_gutter_value.'%);';
$img_alignment_position .= '-webkit-transform: translate(-'.$img_position_left.'%,'.$img_separator_gutter_value.'%);';
}
else if($img_separator_alignment == 'ult-right-img' && $img_position_right != '' && ! wp_is_mobile() ){
$img_alignment_position = 'right:'.$img_position_right.'%;';
$img_alignment_position .= 'transform: translate('.$img_position_right.'%,'.$img_separator_gutter_value.'%);';
$img_alignment_position .= '-ms-transform: translate('.$img_position_right.'%,'.$img_separator_gutter_value.'%);';
$img_alignment_position .= '-webkit-transform: translate('.$img_position_right.'%,'.$img_separator_gutter_value.'%);';
}
else{
$img_alignment_position = '';
}
$animation_style .= 'opacity:0;';
if( strtolower($animation) !== strtolower('No Animation')) {
$is_animation = true;
$inifinite_arr = array("InfiniteRotate", "InfiniteDangle","InfiniteSwing","InfinitePulse","InfiniteHorizontalShake","InfiniteBounce","InfiniteFlash","InfiniteTADA");
if($animation_iteration_count == 0 || in_array($animation,$inifinite_arr)){
$animation_iteration_count = 'infinite';
$animation = 'infinite '.$animation;
}
if($opacity == "set"){
$animation_el_class .= ' ult-animation ult-animate-viewport ';
$opacity_start_effect_data = 'data-opacity_start_effect="'.esc_attr($opacity_start_effect).'"';
}
$animation_data .= ' data-animate="'.esc_attr($animation).'" ';
$animation_data .= ' data-animation-delay="'.esc_attr($animation_delay).'" ';
$animation_data .= ' data-animation-duration="'.esc_attr($animation_duration).'" ';
$animation_data .= ' data-animation-iteration="'.esc_attr($animation_iteration_count).'" ';
}
else
$animation_el_class .= 'ult-no-animation';
$output = '<div id="'.esc_attr($id).'" class="ult-easy-separator-wrapper ult-responsive '.esc_attr($img_separator_position).' '.esc_attr($wrapper_class).' '.esc_attr($img_alignment).'" style="'.esc_attr($custom_position).''.esc_attr($img_alignment_position).'" data-vc-row="'.esc_attr($ultimate_custom_vc_row).'" '.$data_list.'>';
$output .= '<div class="ult-easy-separator-inner-wrapper">';
$output .= '<div class="'.esc_attr($animation_el_class).'" style="'.esc_attr($animation_style).'" '.$animation_data.' '.$opacity_start_effect_data.'>';
$output .= '<img class="ult-easy-separator-img" alt="'.esc_attr($alt).'" src="'.esc_url(apply_filters('ultimate_images', $img)).'" />';
if($url != '') {
$output .= '<a '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'></a>';
}
$output .= '</div>';
$output .= '</div>';
$output .= '</div>';
return $output;
}
}
}
if(class_exists('Ultimate_Image_Separator'))
{
$Ultimate_Image_Separator = new Ultimate_Image_Separator;
}
?>
@@ -0,0 +1,862 @@
<?php
/*
* Add-on Name: Info Banner
*/
if(!class_exists('Ultimate_Info_Banner'))
{
class Ultimate_Info_Banner{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'banner_init'));
}
add_shortcode('ultimate_info_banner',array($this,'banner_shortcode'));
add_action('wp_enqueue_scripts', array($this, 'register_info_banner_assets'),1);
}
function register_info_banner_assets()
{
Ultimate_VC_Addons::ultimate_register_style( 'utl-info-banner-style', 'info-banner' );
Ultimate_VC_Addons::ultimate_register_script( 'utl-info-banner-script', 'info-banner', false, array( 'jquery' ), ULTIMATE_VERSION, false );
}
function banner_init(){
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Info Banner","ultimate_vc"),
"base" => "ultimate_info_banner",
"class" => "vc_info_banner_icon",
"icon" => "vc_icon_info_banner",
"category" => "Ultimate VC Addons",
"description" => __("Displays the banner information","ultimate_vc"),
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __("Title ","ultimate_vc"),
"param_name" => "banner_title",
"admin_label" => true,
"value" => "",
"description" => __("Give a title to this banner","ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "Div",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H3","ultimate_vc") => "h3",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is Div", "ultimate_vc"),
'edit_field_class' => 'ult-param-padding-remove vc_col-sm-4',
),
array(
"type" => "textarea",
"class" => "",
"heading" => __("Description","ultimate_vc"),
"param_name" => "banner_desc",
"value" => "",
"description" => __("Text that comes on mouse hover.","ultimate_vc")
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Button Text","ultimate_vc"),
"param_name" => "button_text",
"admin_label" => true,
"value" => "",
//"description" => __("Give a title to this banner","smile")
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Link ","ultimate_vc"),
"param_name" => "button_link",
"value" => "",
"description" => __("Add link / select existing page to link to this banner","ultimate_vc"),
),
array(
"type" => "dropdown",
"heading" => __("Information Alignment","ultimate_vc"),
"param_name" => "info_alignment",
"value" => array(
__("Center","ultimate_vc") => "ib3-info-center",
__("Left","ultimate_vc") => "ib3-info-left",
__("Right","ultimate_vc") => "ib3-info-right"
)
),
array(
"type" => "dropdown",
"heading" => __("Animation Effect","ultimate_vc"),
"param_name" => "info_effect",
"value" => array(
__("No Effect","ultimate_vc") => "",
__("Fade-In","ultimate_vc") => "fadeIn",
__("Fade-In Left","ultimate_vc") => "fadeInLeft",
__("Fade-In Right","ultimate_vc") => "fadeInRight",
__("Fade-In Up","ultimate_vc") => "fadeInUp",
__("Fade-In Down","ultimate_vc") => "fadeInDown",
__("Flip","ultimate_vc") => "flipInX",
__("Zoom","ultimate_vc") => "zoomIn"
)
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Banner Image","ultimate_vc"),
"param_name" => "banner_image",
"value" => "",
"description" => __("Upload the image for this banner","ultimate_vc"),
"group" => "Image",
),
array(
"type" => "number",
"param_name" => "banner_size",
"heading" => __("Banner Min Height","ultimate_vc"),
"value" => "50",
"min" => "50",
"suffix" => "px",
"group" => "Design"
),
array(
"type" => "dropdown",
"heading" => __("Image Alignment","ultimate_vc"),
"param_name" => "ib3_alignment",
"value" => array(
__("Top Left","ultimate_vc") => "ultb3-img-top-left",
__("Top Center","ultimate_vc") => "ultb3-img-top-center",
__("Top Right","ultimate_vc") => "ultb3-img-top-right",
__("Center Left","ultimate_vc") => "ultb3-img-center-left",
__("Center","ultimate_vc") => "ultb3-img-center",
__("Center Right","ultimate_vc") => "ultb3-img-center-right",
__("Bottom Left","ultimate_vc") => "ultb3-img-bottom-left",
__("Bottom Center","ultimate_vc") => "ultb3-img-bottom-center",
__("Bottom Right","ultimate_vc") => "ultb3-img-bottom-right",
),
"group" => "Image",
),
array(
"type" => "dropdown",
"heading" => __("Effect","ultimate_vc"),
"param_name" => "ib3_effect",
"value" => array(
__("No Effect","ultimate_vc") => "",
__("Slide Down","ultimate_vc") => "ultb3-hover-1",
__("Slide Up","ultimate_vc") => "ultb3-hover-2",
__("Slide Left","ultimate_vc") => "ultb3-hover-3",
__("Slide Right","ultimate_vc") => "ultb3-hover-4",
__("Pan","ultimate_vc") => "ultb3-hover-5",
__("Zoom Out","ultimate_vc") => "ultb3-hover-6"
),
"group" => "Image",
),
array(
"type" => "colorpicker",
"heading" => __("Overlay Color on Image","ultimate_vc"),
"param_name" => "overlay_color",
"value" => "",
"group" => "Image",
// "dependency" => array("element" => "enable_overlay", "value" => array("enable_overlay_value"))
),
array(
"type" => "ult_param_heading",
"text" => __("Image Height","ultimate_vc"),
"param_name" => "image_height_typography",
"class" => "ult-param-heading",
"group" => "Image",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "number",
"param_name" => "banner_img_height_large_screen",
"heading" => "<i class='dashicons dashicons-welcome-view-site'></i> ".__("Large Screen","ultimate_vc"),
"min" => "50",
"value" => "",
"suffix" => "px",
"group" => "Image",
'edit_field_class' => 'vc_column vc_col-sm-4',
),
array(
"type" => "number",
"param_name" => "banner_img_height",
"heading" => "<i class='dashicons dashicons-desktop'></i> ".__("Desktop","ultimate_vc"),
"min" => "50",
"value" => "",
"suffix" => "px",
"group" => "Image",
'edit_field_class' => 'vc_column vc_col-sm-4',
),
array(
"type" => "number",
"heading" => "<i class='dashicons dashicons-tablet' style='transform: rotate(90deg);'></i> ".__("Tablet", "ultimate_vc"),
"param_name" => "banner_img_height_tablet",
"value" => "",
"suffix" => "px",
"group" => "Image",
'edit_field_class' => 'vc_column vc_col-sm-4',
),
array(
"type" => "number",
"heading" => "<i class='dashicons dashicons-tablet'></i> ".__("Tablet Portrait", "ultimate_vc"),
"param_name" => "banner_img_height_tablet_portrait",
"value" => "",
"suffix" => "px",
"group" => "Image",
'edit_field_class' => 'vc_column vc_col-sm-4',
),
array(
"type" => "number",
"heading" => "<i class='dashicons dashicons-smartphone' style='transform: rotate(90deg);'></i> ".__("Mobile Landscape", "ultimate_vc"),
"param_name" => "banner_img_height_mobile_landscape",
"value" => "",
"suffix" => "px",
"group" => "Image",
'edit_field_class' => 'vc_column vc_col-sm-4',
),
array(
"type" => "number",
"heading" => "<i class='dashicons dashicons-smartphone'></i> ".__("Mobile", "ultimate_vc"),
"param_name" => "banner_img_height_mobile",
"value" => "",
"suffix" => "px",
"group" => "Image",
'edit_field_class' => 'vc_column vc_col-sm-4',
),
array(
"type" => "colorpicker",
"heading" => __("Background Color","ultimate_vc"),
"param_name" => "ib3_background",
"group" => "Design"
),
array(
"type" => "dropdown",
"heading" => __("Border","ultimate_vc"),
"param_name" => "ib3_border",
"value" => array(
__("No Border","ultimate_vc") => "no-border",
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double"
),
"group" => "Design"
),
array(
"type" => "number",
"heading" => __("Border Width","ultimate_vc"),
"param_name" => "ib3_border_width",
"suffix" => "px",
"value" => "1",
"group" => "Design",
"dependency" => array("element" => "ib3_border", "value" => array("solid","dashed","dotted","double"))
),
array(
"type" => "colorpicker",
"heading" => __("Border Color","ultimate_vc"),
"param_name" => "ib3_border_color",
"group" => "Design",
"dependency" => array("element" => "ib3_border", "value" => array("solid","dashed","dotted","double"))
),
array(
"type" => "colorpicker",
"heading" => __("Button Color","ultimate_vc"),
"param_name" => "button_color",
"value" => "#1e73be",
"group" => "Button"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Text Color", "ultimate_vc"),
"param_name" => "button_text_color",
"value" => "#898989",
"group" => "Button"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Text Hover Color", "ultimate_vc"),
"param_name" => "button_text_hover_color",
"value" => "#ffffff",
"group" => "Button"
),
array(
"type" => "number",
"heading" => __("Border Width","ultimate_vc"),
"param_name" => "button_border_width",
"value" => "2",
"suffix" => "px",
"group" => "Button"
),
array(
"type" => "number",
"heading" => __("Border Radius","ultimate_vc"),
"param_name" => "button_border_radius",
"value" => "50",
"suffix" => "px",
"group" => "Button"
),
array(
"type" => "ult_param_heading",
"text" => __("Title Settings","ultimate_vc"),
"param_name" => "title_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "title_font_family",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-google-font-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "title_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "title_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "title_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "title_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "title_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "title_color",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"text" => __("Description Settings","ultimate_vc"),
"param_name" => "desc_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "desc_font_family",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "desc_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "desc_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "desc_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "desc_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "desc_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "desc_color",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"text" => __("Button Settings","ultimate_vc"),
"param_name" => "button_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "button_font_family",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "button_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "button_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "button_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "button_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "button_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc")
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_infobanner',
'group' => __( 'Design', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
),
)
);
}
}
// Shortcode handler function for stats banner
function banner_shortcode($atts)
{
$output = $el_class = $style = $img_style = $infobnr_design = $target = $link_title = $rel = $heading_tag ='';
extract(shortcode_atts( array(
'banner_title' => '',
'heading_tag' => 'div',
'banner_desc' => '',
'info_alignment' => 'ib3-info-center',
'banner_image' => '',
'banner_size' => '50',
'ib3_alignment' => 'ultb3-img-top-left',
'button_text' => '',
'button_link' => '',
'info_effect' => '',
'ib3_effect' => '',
'ib3_background' => '',
'ib3_border' => 'no-border',
'ib3_border_width' => '1',
'ib3_border_color' => '',
'title_font_family' => '',
'title_font_style' => '',
'title_font_size' => '',
'title_color' => '',
'title_line_height' => '',
'desc_font_family' => '',
'desc_font_style' => '',
'desc_font_size' => '',
'desc_color' => '',
'desc_line_height' => '',
'button_font_family' => '',
'button_font_style' => '',
'button_font_size' => '',
'button_color' => '#1e73be',
'button_line_height' => '',
'button_border_radius' => '50',
'button_border_width' => '2',
'button_text_color' => '#898989',
'button_text_hover_color' => '#ffffff',
'banner_img_height_large_screen' => '',
'banner_img_height' => '',
'banner_img_height_tablet' => '',
'banner_img_height_tablet_portrait' => '',
'banner_img_height_mobile' => '',
'banner_img_height_mobile_landscape' => '',
'overlay_color' => '',
'el_class' => '',
'css_infobanner' => '',
),$atts));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$infobnr_design = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_infobanner, ' ' ), "ultimate_info_banner", $atts );
$infobnr_design = esc_attr( $infobnr_design );
/* typography */
$title_style_inline = $desc_style_inline = $button_style_inline = '';
if($title_font_family != '')
{
$temp = get_ultimate_font_family($title_font_family);
if($temp != '')
$title_style_inline .= 'font-family:'.$temp.';';
}
$title_style_inline .= get_ultimate_font_style($title_font_style);
// if($title_font_size != '')
// $title_style_inline .= 'font-size:'.$title_font_size.'px;';
// if($title_line_height != '')
// $title_style_inline .= 'line-height:'.$title_line_height.'px;';
if(is_numeric($title_font_size)){
$title_font_size = 'desktop:'.$title_font_size.'px;';
}
if(is_numeric($title_line_height)){
$title_line_height = 'desktop:'.$title_line_height.'px;';
}
$info_banner_id = 'Info-banner-wrap'.rand(1000, 9999);
$info_banner_args = array(
'target' => '#'.$info_banner_id.' .ultb3-title', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $title_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $title_line_height
),
);
$info_banner_data_list = get_ultimate_vc_responsive_media_css($info_banner_args);
if($title_color != '')
$title_style_inline .= 'color:'.$title_color.';';
if($desc_font_family != '')
{
$temp = get_ultimate_font_family($desc_font_family);
if($temp != '')
$desc_style_inline .= 'font-family:'.$temp.';';
}
$desc_style_inline .= get_ultimate_font_style($desc_font_style);
// if($desc_font_size != '')
// $desc_style_inline .= 'font-size:'.$desc_font_size.'px;';
// if($desc_line_height != '')
// $desc_style_inline .= 'line-height:'.$desc_line_height.'px;';
if(is_numeric($desc_font_size)){
$desc_font_size = 'desktop:'.$desc_font_size.'px;';
}
if(is_numeric($desc_line_height)){
$desc_line_height = 'desktop:'.$desc_line_height.'px;';
}
$info_banner_desc_args = array(
'target' => '#'.$info_banner_id.' .ultb3-desc', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $desc_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $desc_line_height
),
);
$info_banner_desc_data_list = get_ultimate_vc_responsive_media_css($info_banner_desc_args);
if($desc_color != '')
$desc_style_inline .= 'color:'.$desc_color.';';
if($button_font_family != '')
{
$temp = get_ultimate_font_family($button_font_family);
if($temp != '')
$button_style_inline .= 'font-family:'.$temp.';';
}
$button_style_inline .= get_ultimate_font_style($button_font_style);
// if($button_font_size != '')
// $button_style_inline .= 'font-size:'.$button_font_size.'px;';
// if($button_line_height != '')
// $button_style_inline .= 'line-height:'.$button_line_height.'px;';
if(is_numeric($button_font_size)){
$button_font_size = 'desktop:'.$button_font_size.'px;';
}
if(is_numeric($button_line_height)){
$button_line_height = 'desktop:'.$button_line_height.'px;';
}
$info_banner_btn_args = array(
'target' => '#'.$info_banner_id.' .ultb3-btn', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $button_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $button_line_height
),
);
$info_banner_btn_data_list = get_ultimate_vc_responsive_media_css($info_banner_btn_args);
$banner_src = apply_filters('ult_get_img_single', $banner_image, 'url', 'full');
$alt = apply_filters('ult_get_img_single', $banner_image, 'alt');
if($ib3_background != '')
$style .= 'background-color: '.$ib3_background.';';
if($ib3_border != 'no-border')
$style .= 'border:'.$ib3_border_width.'px '.$ib3_border.' '.$ib3_border_color.';';
$id = uniqid(rand());
$button_link_main = $title = $target = '';
if($button_link != '')
{
$button_link_temp = vc_build_link($button_link);
$button_link_main = $button_link_temp['url'];
$title = ( isset( $button_link_temp['title'] ) && $button_link_temp['title'] !== '' ) ? esc_attr($button_link_temp['title']) : '';
$target = $button_link_temp['target'];
$rel = ( isset( $button_link_temp['rel'] ) && $button_link_temp['rel'] !== '' ) ? esc_attr($button_link_temp['rel']) : '';
}
if($button_link_main == '') {
$button_link_main = 'javascript:void(0);';
}
$output .= '<div id="ultib3-'.esc_attr($id).'" class="'.esc_attr($infobnr_design).' ultb3-box '.esc_attr($is_vc_49_plus).' '.esc_attr($el_class).' '.esc_attr($ib3_effect).'" style="'.esc_attr($style).'">';
if($overlay_color != '')
$output .= '<div class="ultb3-box-overlay" style="background:'.esc_attr($overlay_color).';"></div>';
if(isset($banner_src) && $banner_src != '')
$output .= '<img src="'.esc_url(apply_filters('ultimate_images', $banner_src)).'" style="'.esc_attr($img_style).'" class="ultb3-img '.esc_attr($ib3_alignment).'" alt="'.esc_attr($alt).'"/>';
$output .= '<div id="'.esc_attr($info_banner_id).'" class="ultb3-info '.esc_attr($info_alignment).'" data-animation="'.esc_attr($info_effect).'" data-animation-delay="03">';
if($banner_title != '')
$output .= '<'. $heading_tag .' class="ultb3-title ult-responsive" '.$info_banner_data_list.' style="'.esc_attr($title_style_inline).'">'.$banner_title.'</'. $heading_tag .'>';
if($banner_desc != '')
$output .= '<div class="ultb3-desc ult-responsive" '.$info_banner_desc_data_list.' style="'.esc_attr($desc_style_inline).'">'.$banner_desc.'</div>';
if($button_text != '')
{
if($target != '')
$target = 'target="'.esc_attr($target).'"';
$output .= '<a '. Ultimate_VC_Addons::uavc_link_init($button_link_main, $target, $title, $rel ).' class="ultb3-btn ult-responsive" '.$info_banner_btn_data_list.' style="'.esc_attr($button_style_inline).'">'.$button_text.'<i class="Defaults-angle-right"></i></a>';
}
$output .= '</div>';
$output .= '</div>';
$global_button_style = $global_button_hover_style = '';
$is_css = false;
if($button_color != '')
{
$global_button_style .= 'border:'.$button_border_width.'px solid '.$button_color.';';
$global_button_hover_style .= 'background:'.$button_color.';';
$is_css = true;
}
if($button_border_radius != '')
{
$global_button_style .= 'border-radius:'.$button_border_radius.'px;';
$is_css = true;
}
if($button_text_color != '')
{
$global_button_style .= 'color:'.$button_text_color.';';
$is_css = true;
}
if($button_text_hover_color != '')
{
$global_button_hover_style .= 'color:'.$button_text_hover_color.';';
$is_css = true;
}
if($is_css)
{
$output .= '<style>
#ultib3-'.esc_attr($id).' {
min-height:'.esc_attr($banner_size).'px;
}
#ultib3-'.esc_attr($id).' img.ultb3-img {
height: '.esc_attr($banner_img_height).'px;
}
#ultib3-'.esc_attr($id).' .ultb3-btn {
'.esc_attr($global_button_style).'
}
#ultib3-'.$id.' .ultb3-btn:hover {
'.esc_attr($global_button_hover_style).'
}
</style>';
if($banner_img_height_large_screen != '')
{
$output .= '<style>
@media (min-width: 1824px) {
#ultib3-'.esc_attr($id).' img.ultb3-img {
height:'.esc_attr($banner_img_height_large_screen).'px;
}
}
</style>';
}
if($banner_img_height_tablet != '')
{
$output .= '<style>
@media (max-width: 1199px) {
#ultib3-'.esc_attr($id).' img.ultb3-img {
height:'.esc_attr($banner_img_height_tablet).'px;
}
}
</style>';
}
if($banner_img_height_tablet_portrait != '')
{
$output .= '<style>
@media (max-width: 991px) {
#ultib3-'.esc_attr($id).' img.ultb3-img {
height:'.esc_attr($banner_img_height_tablet_portrait).'px;
}
}
</style>';
}
if($banner_img_height_mobile_landscape != '')
{
$output .= '<style>
@media (max-width: 767px) {
#ultib3-'.esc_attr($id).' img.ultb3-img {
height:'.esc_attr($banner_img_height_mobile_landscape).'px;
}
}
</style>';
}
if($banner_img_height_mobile != '')
{
$output .= '<style>
@media (max-width: 479px) {
#ultib3-'.esc_attr($id).' img.ultb3-img {
height:'.esc_attr($banner_img_height_mobile).'px;
}
}
</style>';
}
}
return $output;
}
}
}
if(class_exists('Ultimate_Info_Banner'))
{
$Ultimate_Info_Banner = new Ultimate_Info_Banner;
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ultimate_info_banner' ) ) {
class WPBakeryShortCode_ultimate_info_banner extends WPBakeryShortCode {
}
}
@@ -0,0 +1,811 @@
<?php
/*
* Add-on Name: Info Box
* Add-on URI: https://www.brainstormforce.com
*/
if(!class_exists('AIO_Icons_Box'))
{
class AIO_Icons_Box
{
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
// Initialize the icon box component for WPBakery Page Builder
add_action('init', array( &$this, 'icon_box_init' ) );
}
// Add shortcode for icon box
add_shortcode('bsf-info-box', array(&$this, 'icon_boxes' ) );
add_action( 'wp_enqueue_scripts', array( $this, 'icon_box_scripts' ), 1 );
}
// Add shortcode for icon-box
function icon_boxes($atts, $content = null)
{
$icon_type = $icon_img = $img_width = $icon = $icon_color = $icon_color_bg = $icon_size = $icon_style = $icon_border_style = $icon_border_radius = $icon_color_border = $icon_border_size = $icon_border_spacing = $el_class = $icon_animation = $title = $link = $hover_effect = $pos = $read_more= $read_text = $box_border_style = $box_border_width =$box_border_color = $box_bg_color = $pos = $css_class = $desc_font_line_height = $title_font_line_height = $heading_tag = '';
$title_font = $title_font_style = $title_font_size = $title_font_color = $desc_font = $desc_font_style = $desc_font_size = $desc_font_color = $box_min_height = $target = $link_title = $rel = '';
extract(shortcode_atts(array(
'icon_type' => 'selector',
'icon' => 'none',
'icon_img' => '',
'img_width' => '48',
'icon_size' => '32',
'icon_color' => '#333',
'icon_style' => 'none',
'icon_color_bg' => '#ffffff',
'icon_color_border' => '#333333',
'icon_border_style' => '',
'icon_border_size' => '1',
'icon_border_radius' => '500',
'icon_border_spacing' => '50',
'icon_animation' => '',
'title' => '',
'link' => '',
'hover_effect' => 'style_1',
'pos' => 'default',
'box_min_height' => '',
'box_border_style'=>'',
'box_border_width'=>'',
'box_border_color'=>'',
'box_bg_color'=>"",
'read_more' => 'none',
'read_text' => 'Read More',
'heading_tag' => 'h3',
'title_font' => '',
'title_font_style' => '',
'title_font_size' => '',
'title_font_line_height'=> '',
'title_font_color' => '',
'desc_font' => '',
'desc_font_style' => '',
'desc_font_size' => '',
'desc_font_color' => '',
'desc_font_line_height'=> '',
'el_class' => '',
'css_info_box' => '',
),$atts,'bsf-info-box'));
$html = $target = $suffix = $prefix = $title_style = $desc_style = $inf_design_style = '';
$inf_design_style = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_info_box, ' ' ), "bsf-info-box", $atts );
$inf_design_style = esc_attr( $inf_design_style );
$box_icon = do_shortcode('[just_icon icon_type="'.esc_attr($icon_type).'" icon="'.esc_attr($icon).'" icon_img="'.esc_attr($icon_img).'" img_width="'.esc_attr($img_width).'" icon_size="'.esc_attr($icon_size).'" icon_color="'.esc_attr($icon_color).'" icon_style="'.esc_attr($icon_style).'" icon_color_bg="'.esc_attr($icon_color_bg).'" icon_color_border="'.esc_attr($icon_color_border).'" icon_border_style="'.esc_attr($icon_border_style).'" icon_border_size="'.esc_attr($icon_border_size).'" icon_border_radius="'.esc_attr($icon_border_radius).'" icon_border_spacing="'.esc_attr($icon_border_spacing).'" icon_animation="'.esc_attr($icon_animation).'"]');
$prefix .= '<div class="aio-icon-component '.esc_attr($inf_design_style).' '.esc_attr($css_class).' '.esc_attr($el_class).' '.esc_attr($hover_effect).'">';
$suffix .= '</div> <!-- aio-icon-component -->';
$ex_class = $ic_class = '';
if($pos != ''){
$ex_class .= $pos.'-icon';
$ic_class = 'aio-icon-'.$pos;
}
/* title */
if($title_font != '')
{
$font_family = get_ultimate_font_family($title_font);
if($font_family != '')
$title_style .= 'font-family:\''.$font_family.'\';';
}
if($title_font_style != '') {
$title_style .= get_ultimate_font_style($title_font_style);
}
if(is_numeric($title_font_size)){
$title_font_size = 'desktop:'.$title_font_size.'px;';
}
if(is_numeric($title_font_line_height)){
$title_font_line_height = 'desktop:'.$title_font_line_height.'px;';
}
$info_box_id = 'Info-box-wrap-'.rand(1000, 9999);
$info_box_args = array(
'target' => '#'.$info_box_id.' .aio-icon-title', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $title_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $title_font_line_height
),
);
$info_box_data_list = get_ultimate_vc_responsive_media_css($info_box_args);
if($title_font_color != '')
$title_style .= 'color:'.$title_font_color.';';
/* description */
if($desc_font != '')
{
$font_family = get_ultimate_font_family($desc_font);
if($font_family !== '')
$desc_style .= 'font-family:\''.$font_family.'\';';
}
if($desc_font_style != '') {
$desc_style .= get_ultimate_font_style($desc_font_style);
}
if(is_numeric($desc_font_size)){
$desc_font_size = 'desktop:'.$desc_font_size.'px;';
}
if(is_numeric($desc_font_line_height)){
$desc_font_line_height = 'desktop:'.$desc_font_line_height.'px;';
}
$info_box_desc_args = array(
'target' => '#'.$info_box_id.' .aio-icon-description', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $desc_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $desc_font_line_height
),
);
$info_box_desc_data_list = get_ultimate_vc_responsive_media_css($info_box_desc_args);
if($desc_font_color != '')
$desc_style .= 'color:'.$desc_font_color.';';
//enquque_ultimate_google_fonts($font_args);
$box_style = $box_style_data = '';
if($pos=='square_box'){
if($box_min_height!='') {
$box_style_data .="data-min-height='".esc_attr($box_min_height)."px'";
}
if($box_border_color!=''){
$box_style .="border-color:".$box_border_color.";";
}
if($box_border_style!=''){
$box_style .="border-style:".$box_border_style.";";
}
if($box_border_width!=''){
$box_style .="border-width:".$box_border_width."px;";
}
if($box_bg_color!=''){
$box_style .="background-color:".$box_bg_color.";";
}
}
$html .= '<div id="'.esc_attr($info_box_id).'" class="aio-icon-box '.esc_attr($ex_class).'" style="'.esc_attr($box_style).'" '.$box_style_data.' >';
if($pos == "heading-right" || $pos == "right"){
if($pos == "right"){
$html .= '<div class="aio-ibd-block" >';
}
if($title !== ''){
$html .= '<div class="aio-icon-header" >';
$link_prefix = $link_sufix = '';
if($link !== 'none'){
if($read_more == 'title')
{
$href = vc_build_link($link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
$link_prefix = '<a class="aio-icon-box-link" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'>';
$link_sufix = '</a>';
}
}
$html .= $link_prefix.'<'. $heading_tag .' class="aio-icon-title ult-responsive" '.$info_box_data_list.' style="'.esc_attr($title_style).'">'.$title.'</'. $heading_tag .'>'.$link_sufix;
$html .= '</div> <!-- header -->';
}
if($pos !== "right"){
if($icon !== 'none' || $icon_img !== '')
$html .= '<div class="'.esc_attr($ic_class).'" >'.$box_icon.'</div>';
}
if($content !== ''){
$html .= '<div class="aio-icon-description ult-responsive" '.$info_box_desc_data_list.' style="'.esc_attr($desc_style).'">';
$html .= do_shortcode($content);
if($link !== 'none'){
if($read_more == 'more')
{
$href = vc_build_link($link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
$more_link = '<a class="aio-icon-read x" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'>';
$more_link .= $read_text;
$more_link .= '&nbsp;&raquo;';
$more_link .= '</a>';
$html .= $more_link;
}
}
$html .= '</div> <!-- description -->';
}
if($pos == "right"){
$html .= '</div> <!-- aio-ibd-block -->';
if($icon !== 'none' || $icon_img !== '')
$html .= '<div class="'.esc_attr($ic_class).'">'.$box_icon.'</div>';
}
}
else {
if($icon !== 'none' || $icon_img != '')
$html .= '<div class="'.esc_attr($ic_class).'">'.$box_icon.'</div>';
if($pos == "left")
$html .= '<div class="aio-ibd-block">';
if($title !== ''){
$html .= '<div class="aio-icon-header" >';
$link_prefix = $link_sufix = '';
if($link !== 'none'){
if($read_more == 'title')
{
$href = vc_build_link($link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
$link_prefix = '<a class="aio-icon-box-link" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'>';
$link_sufix = '</a>';
}
}
$html .= $link_prefix.'<'. $heading_tag .' class="aio-icon-title ult-responsive" '.$info_box_data_list.' style="'.esc_attr($title_style).'">'.$title.'</'. $heading_tag .'>'.$link_sufix;
$html .= '</div> <!-- header -->';
}
if($content !== ''){
$html .= '<div class="aio-icon-description ult-responsive" '.$info_box_desc_data_list.' style="'.esc_attr($desc_style).'">';
$html .= do_shortcode($content);
if($link !== 'none'){
if($read_more == 'more')
{
$href = vc_build_link($link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
$more_link = '<a class="aio-icon-read xx" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'>';
$more_link .= $read_text;
$more_link .= '&nbsp;&raquo;';
$more_link .= '</a>';
$html .= $more_link;
}
}
$html .= '</div> <!-- description -->';
}
if($pos == "left")
$html .= '</div> <!-- aio-ibd-block -->';
}
$html .= '</div> <!-- aio-icon-box -->';
if($link !== 'none'){
if($read_more == 'box')
{
$href = vc_build_link($link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
$output = $prefix.'<a class="aio-icon-box-link" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'>'.$html.'</a>'.$suffix;
} else {
$output = $prefix.$html.$suffix;
}
} else {
$output = $prefix.$html.$suffix;
}
$is_preset = false; //Display settings for Preset
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
}
/* Add icon box Component*/
function icon_box_init()
{
if ( function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Info Box", "ultimate_vc"),
"base" => "bsf-info-box",
"icon" => "vc_info_box",
"class" => "info_box",
"category" => "Ultimate VC Addons",
"description" => __("Adds icon box with custom font icon","ultimate_vc"),
"controls" => "full",
"show_settings_on_create" => true,
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use an existing font icon or upload a custom image.", "ultimate_vc")
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "img_width",
"value" => 48,
"min" => 16,
"max" => 512,
"suffix" => "px",
"description" => __("Provide image width", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "#333333",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "#ffffff",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Animation","ultimate_vc"),
"param_name" => "icon_animation",
"value" => array(
__("No Animation","ultimate_vc") => "",
__("Swing","ultimate_vc") => "swing",
__("Pulse","ultimate_vc") => "pulse",
__("Fade In","ultimate_vc") => "fadeIn",
__("Fade In Up","ultimate_vc") => "fadeInUp",
__("Fade In Down","ultimate_vc") => "fadeInDown",
__("Fade In Left","ultimate_vc") => "fadeInLeft",
__("Fade In Right","ultimate_vc") => "fadeInRight",
__("Fade In Up Long","ultimate_vc") => "fadeInUpBig",
__("Fade In Down Long","ultimate_vc") => "fadeInDownBig",
__("Fade In Left Long","ultimate_vc") => "fadeInLeftBig",
__("Fade In Right Long","ultimate_vc") => "fadeInRightBig",
__("Slide In Down","ultimate_vc") => "slideInDown",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Bounce In","ultimate_vc") => "bounceIn",
__("Bounce In Up","ultimate_vc") => "bounceInUp",
__("Bounce In Down","ultimate_vc") => "bounceInDown",
__("Bounce In Left","ultimate_vc") => "bounceInLeft",
__("Bounce In Right","ultimate_vc") => "bounceInRight",
__("Rotate In","ultimate_vc") => "rotateIn",
__("Light Speed In","ultimate_vc") => "lightSpeedIn",
__("Roll In","ultimate_vc") => "rollIn",
),
"description" => __("Like CSS3 Animations? We have several options for you!","ultimate_vc")
),
// Icon Box Heading
array(
"type" => "textfield",
"class" => "",
"heading" => __("Title", "ultimate_vc"),
"param_name" => "title",
"admin_label" => true,
"value" => "",
"description" => __("Provide the title for this icon box.", "ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h3",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H3", "ultimate_vc"),
'edit_field_class' => 'vc_col-sm-4',
// "group" => "Typography"
),
// Add some description
array(
"type" => "textarea_html",
"class" => "",
"heading" => __("Description", "ultimate_vc"),
"param_name" => "content",
"value" => "",
"description" => __("Provide the description for this icon box.", "ultimate_vc"),
"edit_field_class" => "ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param",
),
// Select link option - to box or with read more text
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Apply link to:", "ultimate_vc"),
"param_name" => "read_more",
"value" => array(
__("No Link","ultimate_vc") => "none",
__("Complete Box","ultimate_vc") => "box",
__("Box Title","ultimate_vc") => "title",
__("Display Read More","ultimate_vc") => "more",
),
"description" => __("Select whether to use color for icon or not.", "ultimate_vc")
),
// Add link to existing content or to another resource
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Add Link", "ultimate_vc"),
"param_name" => "link",
"value" => "",
"description" => __("Add a custom link or select existing page. You can remove existing link as well.", "ultimate_vc"),
"dependency" => Array("element" => "read_more", "value" => array("box","title","more")),
),
// Link to traditional read more
array(
"type" => "textfield",
"class" => "",
"heading" => __("Read More Text", "ultimate_vc"),
"param_name" => "read_text",
"value" => "Read More",
"description" => __("Customize the read more text.", "ultimate_vc"),
"dependency" => Array("element" => "read_more","value" => array("more")),
),
// Hover Effect type
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Select Hover Effect type", "ultimate_vc"),
"param_name" => "hover_effect",
"value" => array(
__("No Effect","ultimate_vc") => "style_1",
__("Icon Zoom","ultimate_vc") => "style_2",
__("Icon Bounce Up","ultimate_vc") => "style_3",
),
"description" => __("Select the type of effct you want on hover", "smile")
),
// Position the icon box
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Box Style", "ultimate_vc"),
"param_name" => "pos",
"value" => array(
__("Icon at Left with heading","ultimate_vc") => "default",
__("Icon at Right with heading","ultimate_vc") => "heading-right",
__("Icon at Left","ultimate_vc") => "left",
__("Icon at Right","ultimate_vc") => "right",
__("Icon at Top","ultimate_vc") => "top",
__("Boxed Style","ultimate_vc") => "square_box",
),
"description" => __("Select icon position. Icon box style will be changed according to the icon position.", "ultimate_vc")
),
array(
"type" => "number",
"class" => "",
"heading" => __("Box Min Height", "ultimate_vc"),
"param_name" => "box_min_height",
"value" => "",
"suffix" =>"px",
"dependency" => Array("element" => "pos","value" => array("square_box")),
"description" => __("Select Min Height for Box.", "ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Box Border Style", "ultimate_vc"),
"param_name" => "box_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc")=> "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"dependency" => Array("element" => "pos","value" => array("square_box")),
"description" => __("Select Border Style for box border.", "ultimate_vc")
),
array(
"type" => "number",
"class" => "",
"heading" => __("Box Border Width", "ultimate_vc"),
"param_name" => "box_border_width",
"value" => "",
"suffix" =>"",
"dependency" => Array("element" => "pos","value" => array("square_box")),
"description" => __("Select Width for Box Border.", "ultimate_vc")
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Box Border Color", "ultimate_vc"),
"param_name" => "box_border_color",
"value" => "",
"dependency" => Array("element" => "pos","value" => array("square_box")),
"description" => __("Select Border color for border box.", "ultimate_vc")
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Box Background Color", "ultimate_vc"),
"param_name" => "box_bg_color",
"value" => "",
"dependency" => Array("element" => "pos","value" => array("square_box")),
"description" => __("Select Box background color.", "ultimate_vc")
),
// Customize everything
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Add extra class name that will be applied to the icon box, and you can use this class for your customizations.", "ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"param_name" => "title_text_typography",
"heading" => __("Title settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "title_font",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "title_font_style",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "title_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "title_font_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"param_name" => "title_font_color",
"heading" => __("Color","ultimate_vc"),
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"param_name" => "desc_text_typography",
"heading" => __("Description settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "desc_font",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "desc_font_style",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "desc_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "desc_font_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"param_name" => "desc_font_color",
"heading" => __("Color","ultimate_vc"),
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/kqzzi' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_info_box',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
) // end params array
) // end vc_map array
); // end vc_map
} // end function check 'vc_map'
}// end function icon_box_init
function icon_box_scripts() {
Ultimate_VC_Addons::ultimate_register_style( 'info-box-style', 'info-box' );
Ultimate_VC_Addons::ultimate_register_script( 'info_box_js', 'info-box' );
}
}//Class end
}
if(class_exists('AIO_Icons_Box'))
{
$AIO_Icons_Box = new AIO_Icons_Box;
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,963 @@
<?php
/*
* Add-on Name: Info List for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('AIO_Info_list'))
{
class AIO_Info_list
{
var $connector_animate;
var $connect_color_style;
var $icon_font;
var $border_col;
var $icon_style;
// Icon size that will be also added for icon description for equal height.
var $icon_size;
function __construct()
{
$this->connector_animate = '';
$this->connect_color_style = '';
$this->icon_style = '';
$this->icon_style = '';
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init', array($this, 'add_info_list'));
}
if(function_exists('vc_is_inline')){
if(!vc_is_inline()){
add_shortcode( 'info_list', array($this, 'info_list' ) );
add_shortcode( 'info_list_item', array($this, 'info_list_item' ) );
}
} else {
add_shortcode( 'info_list', array($this, 'info_list' ) );
add_shortcode( 'info_list_item', array($this, 'info_list_item' ) );
}
}
function info_list($atts, $content = null)
{
$this->icon_style = $this->connector_animate = $this->icon_font = $this->border_col = '';
$position = $style = $icon_color = $icon_bg_color = $connector_animation = $font_size_icon = $icon_border_style = $icon_border_size = $eg_br_style = $eg_br_width = $connector_color = $border_color = $el_class = $info_list_link_html = '';
extract(shortcode_atts(array(
'position' => 'left',
'style' => 'square with_bg',
'connector_animation' => '',
'icon_color' =>'#333333',
'icon_bg_color' =>'#ffffff',
'eg_br_style'=>'dashed',
'eg_br_width'=>'1',
'connector_color' => '#333333',
'border_color' => '#333333',
'font_size_icon' => '24',
'icon_border_style' => 'none',
'icon_border_size' => '1',
'el_class' => '',
'css_info_list' =>'',
), $atts));
$this->connect_color_style = '';
$css_info_list = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_info_list, ' ' ), "info_list", $atts );
$css_info_list = esc_attr( $css_info_list );
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$eg_br_width_plus = '';
if($position == 'left' && $eg_br_style!='none' && $eg_br_width!='' && $connector_color!='' ){
if ( is_rtl() ) {
$this->connect_color_style = 'border-left-width: '.$eg_br_width.'px;';
$this->connect_color_style .= 'border-left-style: '.$eg_br_style.';';
}
else {
$this->connect_color_style = 'border-right-width: '.$eg_br_width.'px;';
$this->connect_color_style .= 'border-right-style: '.$eg_br_style.';';
}
$this->connect_color_style .= 'border-color: '.$connector_color.';';
if( ( $style == 'square with_bg' || $style == 'circle with_bg' || $style == 'hexagon' ) && (int)$eg_br_width > 1 ) {
$eg_br_width_plus = (($font_size_icon*3)+((int)$icon_border_size*2) - ((int)$eg_br_width))/2;
$this->connect_color_style .= 'left: '.$eg_br_width_plus.'px;';
}
}
if($position == 'right' && $eg_br_style!='none' && $eg_br_width!='' && $connector_color!='' ){
if ( is_rtl() ) {
$this->connect_color_style = 'border-right-width: '.$eg_br_width.'px;';
$this->connect_color_style .= 'border-right-style: '.$eg_br_style.';';
}
else {
$this->connect_color_style = 'border-left-width: '.$eg_br_width.'px;';
$this->connect_color_style .= 'border-left-style: '.$eg_br_style.';';
}
$this->connect_color_style .= 'border-color: '.$connector_color.';';
if( ( $style == 'square with_bg' || $style == 'circle with_bg' || $style == 'hexagon' ) && (int)$eg_br_width > 1 ) {
$eg_br_width_plus = (($font_size_icon*3)+((int)$icon_border_size*2) - ((int)$eg_br_width))/2;
$this->connect_color_style .= 'right: '.$eg_br_width_plus.'px;';
}
}
if($position == 'top' && $eg_br_style!='none' && $eg_br_width!='' && $connector_color!='' ){
$this->connect_color_style = 'border-top-width: '.$eg_br_width.'px;';
$this->connect_color_style .= 'border-top-style: '.$eg_br_style.';';
$this->connect_color_style .= 'border-color: '.$connector_color.';';
if( ( $style == 'square with_bg' || $style == 'circle with_bg' ) && (int)$eg_br_width > 1 ) {
$eg_br_width_plus = (($font_size_icon*3)+((int)$icon_border_size*2) - ((int)$eg_br_width))/2;
$this->connect_color_style .= 'top: '.$eg_br_width_plus.'px;';
}
}
if( $eg_br_style =='none' && ( $position == 'left' || $position == 'right' || $position == 'top' ) ) {
$this->connect_color_style = 'border: none !important;';
}
$this->border_col = $border_color;
if($style == 'square with_bg' || $style == 'circle with_bg' || $style == 'hexagon'){
$this->icon_font = 'font-size:'.($font_size_icon*3).'px;';
if($icon_border_size !== ''){
$this->icon_style .= 'font-size:'.$font_size_icon.'px;';
if($style !== 'hexagon') {
$this->icon_style .= 'border-width:'.$icon_border_size.'px;';
$this->icon_style .= 'border-style:'.$icon_border_style.';';
}
$this->icon_style .= 'background:'.$icon_bg_color.';';
$this->icon_style .= 'color:'.$icon_color.';';
if($style =="hexagon")
$this->icon_style .= 'border-color:'.$icon_bg_color.';';
else
$this->icon_style .= 'border-color:'.$border_color.';';
}
} else {
$big_size = ($font_size_icon*3)+($icon_border_size*2);
if($icon_border_size !== ''){
$this->icon_font = 'font-size:'.$big_size.'px;';
$this->icon_style .= 'font-size:'.$font_size_icon.'px;';
$this->icon_style .= 'border-width:'.$icon_border_size.'px;';
$this->icon_style .= 'border-style:'.$icon_border_style.';';
$this->icon_style .= 'color:'.$icon_color.';';
$this->icon_style .= 'border-color:'.$border_color.';';
}
}
$this->icon_size = $font_size_icon;
if($position == "top")
$this->connector_animate = "fadeInLeft";
else
$this->connector_animate = $connector_animation;
$output = '<div class="smile_icon_list_wrap ult_info_list_container '.esc_attr($is_vc_49_plus).' '.esc_attr($el_class).' '.esc_attr($css_info_list).'">';
$output .= '<ul class="smile_icon_list '.esc_attr($position).' '.esc_attr($style).'">';
$output .= do_shortcode($content);
$output .= '</ul>';
$output .= '</div>';
return $output;
}
function info_list_item($atts,$content = null)
{
// Do nothing
$list_title = $heading_tag = $list_icon = $animation = $icon_color = $icon_bg_color = $icon_img = $icon_type = $desc_font_line_height = $title_font_line_height = '';
$title_font = $title_font_style = $title_font_size = $title_font_color = $desc_font = $desc_font_style = $desc_font_size = $desc_font_color = '';
extract(shortcode_atts(array(
'list_title' => '',
"heading_tag" => 'h3',
'animation' => '',
'list_icon' => '',
'icon_img' => '',
'icon_type' => '',
'title_font' => '',
'title_font_style' => '',
'title_font_size' => '16',
'title_font_line_height'=> '24',
'title_font_color' => '',
'desc_font' => '',
'desc_font_style' => '',
'desc_font_size' => '13',
'desc_font_color' => '',
'desc_font_line_height'=> '18',
'info_list_link' => '',
'info_list_link_apply' => '',
), $atts));
//$content = wpb_js_remove_wpautop($content);
$css_trans = $style = $ico_col = $connector_trans = $icon_html = $title_style = $desc_style = $info_list_link_html = $target = $link_title = $rel = '';
//$font_args = array();
$is_link = false;
if($info_list_link != '')
{
$href = vc_build_link($info_list_link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
if($url != '')
{
$info_list_link_html = '<a class="ulimate-info-list-link" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'></a>';
}
$is_link = true;
}
/* title */
if($title_font != '')
{
$font_family = get_ultimate_font_family($title_font);
$title_style .= 'font-family:\''.$font_family.'\';';
//array_push($font_args, $title_font);
}
if($title_font_style != '')
$title_style .= get_ultimate_font_style($title_font_style);
// if($title_font_size != '')
// $title_style .= 'font-size:'.$title_font_size.'px;';
// if($title_font_line_height != '')
// $title_style .= 'line-height:'.$title_font_line_height.'px;';
if(is_numeric($title_font_size)){
$title_font_size = 'desktop:'.$title_font_size.'px;';
}
if(is_numeric($title_font_line_height)){
$title_font_line_height = 'desktop:'.$title_font_line_height.'px;';
}
$info_list_id = 'Info-list-wrap-'.rand(1000, 9999);
$info_list_args = array(
'target' => '#'.$info_list_id.' '.$heading_tag, // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $title_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $title_font_line_height
),
);
$info_list_data_list = get_ultimate_vc_responsive_media_css($info_list_args);
if($title_font_color != '')
$title_style .= 'color:'.$title_font_color.';';
/* description */
if($desc_font != '')
{
$font_family = get_ultimate_font_family($desc_font);
$desc_style .= 'font-family:\''.$font_family.'\';';
//array_push($font_args, $desc_font);
}
if($desc_font_style != '')
$desc_style .= get_ultimate_font_style($desc_font_style);
// if($desc_font_size != '')
// $desc_style .= 'font-size:'.$desc_font_size.'px;';
// if($desc_font_line_height != '')
// $desc_style .= 'line-height:'.$desc_font_line_height.'px;';
if(is_numeric($desc_font_size)){
$desc_font_size = 'desktop:'.$desc_font_size.'px;';
}
if(is_numeric($desc_font_line_height)){
$desc_font_line_height = 'desktop:'.$desc_font_line_height.'px;';
}
$info_list_desc_args = array(
'target' => '#'.$info_list_id.' .icon_description_text', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $desc_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $desc_font_line_height
),
);
$info_list_desc_data_list = get_ultimate_vc_responsive_media_css($info_list_desc_args);
if($desc_font_color != '')
$desc_style .= 'color:'.$desc_font_color.';';
//enquque_ultimate_google_fonts($font_args);
if($animation !== 'none')
{
$css_trans = 'data-animation="'.$animation.'" data-animation-delay="03"';
}
if($this->connector_animate)
{
$connector_trans = 'data-animation="'.$this->connector_animate.'" data-animation-delay="03"';
}
if($icon_color !=''){
$ico_col = 'style="color:'.$icon_color.'";';
}
if($icon_bg_color != ''){
$style .= 'background:'.$icon_bg_color.'; color:'.$icon_bg_color.';';
}
if($icon_bg_color != ''){
$style .= 'border-color:'.$this->border_col.';';
}
if($icon_type == "custom"){
$img = apply_filters('ult_get_img_single', $icon_img, 'url', 'large');
$alt = apply_filters('ult_get_img_single', $icon_img, 'alt');
if($alt == '')
$alt = 'icon';
//if(!empty($img)){
$icon_html .= '<div class="icon_list_icon" '.$css_trans.' style="'.esc_attr($this->icon_style).'">';
$icon_html .= '<img class="list-img-icon" alt="'.esc_attr($alt).'" src="'.esc_url(apply_filters('ultimate_images', $img)).'"/>';
if($is_link && $info_list_link_apply == 'icon')
$icon_html .= $info_list_link_html;
$icon_html .= '</div>';
// }
}
else {
$icon_html .= '<div class="icon_list_icon" '.$css_trans.' style="'.esc_attr($this->icon_style).'">';
$icon_html .= '<i class="'.esc_attr($list_icon).'" '.$ico_col.'></i>';
if($is_link && $info_list_link_apply == 'icon')
$icon_html .= $info_list_link_html;
$icon_html .= '</div>';
}
$output = '<li class="icon_list_item" style=" '.esc_attr($this->icon_font).'">';
$output .= $icon_html;
$output .= '<div class="icon_description" id="'.esc_attr($info_list_id).'" style="font-size:'.esc_attr($this->icon_size).'px;">';
if($list_title != '')
{
$output .= '<'.$heading_tag.' class="ult-responsive info-list-heading" '.$info_list_data_list.' style="'.esc_attr($title_style).'">';
if($is_link && $info_list_link_apply == 'title')
$output .= '<a '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'>'.$list_title.'</a>';
else
$output .= $list_title;
$output .= '</'.$heading_tag.'>';
}
$output .= '<div class="icon_description_text ult-responsive" '.$info_list_desc_data_list.' style="'.esc_attr($desc_style).'">'.wpb_js_remove_wpautop($content, true).'</div>';
$output .= '</div>';
$output .= '<div class="icon_list_connector" '.$connector_trans.' style="'.esc_attr($this->connect_color_style).'"></div>';
if($is_link && $info_list_link_apply == 'container')
$output .= $info_list_link_html;
$output .= '</li>';
return $output;
}
// Shortcode Functions for frontend editor
function front_info_list($atts, $content = null)
{
// Do nothing
$position = $style = $icon_color = $icon_bg_color = $connector_animation = $font_size_icon = $icon_border_style = $icon_border_size = $eg_br_style = $eg_br_width = $connector_color = $border_color = $el_class = '';
extract(shortcode_atts(array(
'position' => 'left',
'style' => 'square with_bg',
'connector_animation' => '',
'icon_color' =>'#333333',
'icon_bg_color' =>'#ffffff',
'eg_br_style'=>'dashed',
'eg_br_width'=>'1',
'connector_color' => '#333333',
'border_color' => '#333333',
'font_size_icon' => '24',
'icon_border_style' => 'none',
'icon_border_size' => '1',
'el_class' => '',
), $atts));
$eg_br_width_plus = '';
if($position == 'left' && $eg_br_style!='none' && $eg_br_width!='' && $connector_color!='' ){
$this->connect_color_style = 'border-right-width: '.$eg_br_width.'px;';
$this->connect_color_style .= 'border-right-style: '.$eg_br_style.';';
$this->connect_color_style .= 'border-color: '.$connector_color.';';
if( ( $style == 'square with_bg' || $style == 'circle with_bg' || $style == 'hexagon' ) && (int)$eg_br_width > 1 ) {
$eg_br_width_plus = (($font_size_icon*3)+((int)$icon_border_size*2) - ((int)$eg_br_width))/2;
$this->connect_color_style .= 'left: '.$eg_br_width_plus.'px;';
}
}
if($position == 'right' && $eg_br_style!='none' && $eg_br_width!='' && $connector_color!='' ){
$this->connect_color_style = 'border-left-width: '.$eg_br_width.'px;';
$this->connect_color_style .= 'border-left-style: '.$eg_br_style.';';
$this->connect_color_style .= 'border-color: '.$connector_color.';';
if( ( $style == 'square with_bg' || $style == 'circle with_bg' || $style == 'hexagon' ) && (int)$eg_br_width > 1 ) {
$eg_br_width_plus = (($font_size_icon*3)+((int)$icon_border_size*2) - ((int)$eg_br_width))/2;
$this->connect_color_style .= 'right: '.$eg_br_width_plus.'px;';
}
}
if($position == 'top' && $eg_br_style!='none' && $eg_br_width!='' && $connector_color!='' ){
$this->connect_color_style = 'border-top-width: '.$eg_br_width.'px;';
$this->connect_color_style .= 'border-top-style: '.$eg_br_style.';';
$this->connect_color_style .= 'border-color: '.$connector_color.';';
if( ( $style == 'square with_bg' || $style == 'circle with_bg' ) && (int)$eg_br_width > 1 ) {
$eg_br_width_plus = (($font_size_icon*3)+((int)$icon_border_size*2) - ((int)$eg_br_width))/2;
$this->connect_color_style .= 'top: '.$eg_br_width_plus.'px;';
}
}
if( $eg_br_style =='none' && ( $position == 'left' || $position == 'right' || $position == 'top' ) ) {
$this->connect_color_style = 'border: none !important;';
}
$this->border_col = $border_color;
if($style == 'square with_bg' || $style == 'circle with_bg' || $style == 'hexagon'){
$this->icon_font = 'font-size:'.($font_size_icon*3).'px;';
if($icon_border_size !== ''){
$this->icon_style = 'font-size:'.$font_size_icon.'px;';
$this->icon_style .= 'border-width:0px;';
$this->icon_style .= 'border-style:none;';
$this->icon_style .= 'background:'.$icon_bg_color.';';
$this->icon_style .= 'color:'.$icon_color.';';
if($style =="hexagon")
$this->icon_style .= 'border-color:'.$icon_bg_color.';';
else
$this->icon_style .= 'border-color:'.$border_color.';';
}
} else {
$big_size = ($font_size_icon*3)+($icon_border_size*2);
if($icon_border_size !== ''){
$this->icon_font = 'font-size:'.$big_size.'px;';
$this->icon_style = 'font-size:'.$font_size_icon.'px;';
$this->icon_style .= 'border-width:'.$icon_border_size.'px;';
$this->icon_style .= 'border-style:'.$icon_border_style.';';
$this->icon_style .= 'color:'.$icon_color.';';
$this->icon_style .= 'border-color:'.$border_color.';';
}
}
if($position == "top")
$this->connector_animate = "fadeInLeft";
else
$this->connector_animate = $connector_animation;
$output = '<div class="smile_icon_list_wrap '.esc_attr($el_class).''.esc_attr($css_info_list).'">';
$output .= '<ul class="smile_icon_list '.esc_attr($position).' '.esc_attr($style).'" data-style="'.esc_attr($this->icon_style).'" data-fonts="'.esc_attr($this->icon_font).'" data-connector="'.esc_attr($connector_color).'">';
$output .= do_shortcode($content);
$output .= '</ul>';
$output .= '</div>';
return $output;
}
function front_info_list_item($atts,$content = null)
{
// Do nothing
$list_title = $list_icon = $animation = $icon_color = $icon_bg_color = $icon_img = $icon_type = '';
extract(shortcode_atts(array(
'list_title' => '',
'animation' => '',
'list_icon' => '',
'icon_img' => '',
'icon_type' => '',
), $atts));
//$content = wpb_js_remove_wpautop($content);
$css_trans = $style = $ico_col = $connector_trans = $icon_html = '';
if($animation !== 'none')
{
$css_trans = 'data-animation="'.esc_attr($animation).'" data-animation-delay="03"';
}
if($this->connector_animate)
{
$connector_trans = 'data-animation="'.esc_attr($this->connector_animate).'" data-animation-delay="02"';
}
if($icon_color !=''){
$ico_col = 'style="color:'.$icon_color.'";';
}
if($icon_bg_color != ''){
$style .= 'background:'.$icon_bg_color.'; color:'.$icon_bg_color.';';
}
if($icon_bg_color != ''){
$style .= 'border-color:'.$this->border_col.';';
}
if($icon_type == "selector"){
$icon_html .= '<div class="icon_list_icon" '.$css_trans.'>';
$icon_html .= '<i class="'.esc_attr($list_icon).'" '.$ico_col.'></i>';
$icon_html .= '</div>';
} else {
$img = apply_filters('ult_get_img_single', $icon_img, 'url', 'large');
//if(!empty($img)){
$icon_html .= '<div class="icon_list_icon" '.$css_trans.'>';
$icon_html .= '<img class="list-img-icon " alt="icon" src="'.esc_url(apply_filters('ultimate_images', $img)).'"/>';
$img = apply_filters('ult_get_img_single', $icon_img, 'url');
$icon_html .= '<div class="icon_list_icon" '.$css_trans.'>';
$icon_html .= '<img class="list-img-icon" alt="icon" src="'.esc_url(apply_filters('ultimate_images', $img)).'"/>';
$icon_html .= '</div>';
//}
}
$output = '<li class="icon_list_item">';
$output .= $icon_html;
$output .= '<div class="icon_description">';
$output .= '<'.$heading_tag.'>'.$list_title.'</'.$heading_tag.'>';
$output .= wpb_js_remove_wpautop($content, true);
$output .= '</div>';
$output .= '<div class="icon_list_connector" '.$connector_trans.' style="'.esc_attr($this->connect_color_style).';"></div>';
$output .= '</li>';
return $output;
}
function add_info_list()
{
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Info List","ultimate_vc"),
"base" => "info_list",
"class" => "vc_info_list",
"icon" => "vc_icon_list",
"category" => "Ultimate VC Addons",
"as_parent" => array('only' => 'info_list_item'),
"description" => __("Text blocks connected together in one list.","ultimate_vc"),
"content_element" => true,
"show_settings_on_create" => true,
//"is_container" => true,
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon or Image Position","ultimate_vc"),
"param_name" => "position",
"value" => array(
__('Icon to the Left','ultimate_vc') => 'left',
__('Icon to the Right','ultimate_vc') => 'right',
__('Icon at Top','ultimate_vc') => 'top',
),
"description" => __("Select the icon position for icon list.","ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Style of Image or Icon + Color","ultimate_vc"),
"param_name" => "style",
"value" => array(
__('Square With Background','ultimate_vc') => 'square with_bg',
__('Circle With Background','ultimate_vc') => 'circle with_bg',
__('Hexagon With Background','ultimate_vc') => 'hexagon',
),
"description" => __("Select the icon style for icon list.","ultimate_vc")
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Icon Background Color:", "ultimate_vc"),
"param_name" => "icon_bg_color",
"value" => "#ffffff",
"description" => __("Select the color for icon background.", "ultimate_vc"),
"dependency" => Array("element" => "style", "value" => array("square with_bg","circle with_bg","hexagon")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Icon Color:", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "#333333",
"description" => __("Select the color for icon.", "ultimate_vc"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Icon Font Size", "ultimate_vc"),
"param_name" => "font_size_icon",
"value" => 24,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("Enter value in pixels.", "ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "none",
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "style", "value" => array("square with_bg","circle with_bg")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 0,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "value" => array("solid","dashed","dotted","double","inset","outset")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color:", "ultimate_vc"),
"param_name" => "border_color",
"value" => "#333333",
"description" => __("Select the color border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "value" => array("solid","dashed","dotted","double","inset","outset")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Line Style", "ultimate_vc"),
"param_name" => "eg_br_style",
"value" => array(
__("Dashed","ultimate_vc") => "dashed",
__("Solid","ultimate_vc") => "solid",
__("Dotted","ultimate_vc") => "dotted",
__("None","ultimate_vc") => "none",
),
"group" => "Connector"
//"description" => __("Select the style for Thumbnail Connector.","smile"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Line Width", "ultimate_vc"),
"param_name" => "eg_br_width",
"value" => 1,
"min" => 0,
"max" => 10,
"suffix" => "px",
//"description" => __("Thickness of the Thumbnail Connector line.", "smile"),
"dependency" => Array("element" => "eg_br_style","value" => array("solid","dashed","dotted")),
"group" => "Connector"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Line Color:", "ultimate_vc"),
"param_name" => "connector_color",
"value" => "#333333",
"dependency" => Array("element" => "eg_br_style","value" => array("solid","dashed","dotted")),
"description" => __("Select the color for connector line.", "ultimate_vc"),
"group" => "Connector"
),
array(
"type" => "checkbox",
"class" => "",
"heading" => __("Line Animation: ","ultimate_vc"),
"param_name" => "connector_animation",
"value" => array (
__('Enabled','ultimate_vc') => 'fadeInUp',
),
"dependency" => Array("element" => "eg_br_style","value" => array("solid","dashed","dotted")),
"description" => __("Select wheather to animate connector or not","ultimate_vc"),
"group" => "Connector"
),
// Customize everything
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Add extra class name that will be applied to the info list, and you can use this class for your customizations.", "ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/v9k0x' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_info_list',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
),
"js_view" => 'VcColumnView'
));
// Add list item
vc_map(
array(
"name" => __("Info List Item","ultimate_vc"),
"base" => "info_list_item",
"class" => "vc_info_list",
"icon" => "vc_icon_list",
"category" => "Ultimate VC Addons",
"content_element" => true,
"as_child" => array('only' => 'info_list'),
"is_container" => false,
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __("Title","ultimate_vc"),
"admin_label" => true,
"param_name" => "list_title",
"value" => "",
"description" => __("Provide a title for this icon list item.","ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h3",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H3", "ultimate_vc"),
'edit_field_class' => 'ult-param-padding-remove vc_col-sm-4',
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use existing font icon or upload a custom image.", "ultimate_vc")
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select List Icon ","ultimate_vc"),
"param_name" => "list_icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Animation","ultimate_vc"),
"param_name" => "animation",
"value" => array(
__("No Animation","ultimate_vc") => "",
__("Swing","ultimate_vc") => "swing",
__("Pulse","ultimate_vc") => "pulse",
__("Fade In","ultimate_vc") => "fadeIn",
__("Fade In Up","ultimate_vc") => "fadeInUp",
__("Fade In Down","ultimate_vc") => "fadeInDown",
__("Fade In Left","ultimate_vc") => "fadeInLeft",
__("Fade In Right","ultimate_vc") => "fadeInRight",
__("Fade In Up Long","ultimate_vc") => "fadeInUpBig",
__("Fade In Down Long","ultimate_vc") => "fadeInDownBig",
__("Fade In Left Long","ultimate_vc") => "fadeInLeftBig",
__("Fade In Right Long","ultimate_vc") => "fadeInRightBig",
__("Slide In Down","ultimate_vc") => "slideInDown",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Bounce In","ultimate_vc") => "bounceIn",
__("Bounce In Up","ultimate_vc") => "bounceInUp",
__("Bounce In Down","ultimate_vc") => "bounceInDown",
__("Bounce In Left","ultimate_vc") => "bounceInLeft",
__("Bounce In Right","ultimate_vc") => "bounceInRight",
__("Rotate In","ultimate_vc") => "rotateIn",
__("Light Speed In","ultimate_vc") => "lightSpeedIn",
__("Roll In","ultimate_vc") => "rollIn",
),
"description" => __("Select the animation style for icon.","ultimate_vc")
),
array(
"type" => "textarea_html",
"class" => "",
"heading" => __("Description","ultimate_vc"),
"param_name" => "content",
"value" => "",
"description" => __("Description about this list item","ultimate_vc")
),
array(
"type" => "dropdown",
"heading" => __("Apply link To","ultimate_vc"),
"param_name" => "info_list_link_apply",
"value" => array(
__("No Link","ultimate_vc") => "no-link",
__("Complete Container","ultimate_vc") => "container",
__("List Title","ultimate_vc") => "title",
__("Icon","ultimate_vc") => "icon"
)
),
array(
"type" => "vc_link",
"heading" => __("Link","ultimate_vc"),
"param_name" => "info_list_link",
"dependency" => array("element" => "info_list_link_apply", "value" => array("container","title","icon"))
),
array(
"type" => "ult_param_heading",
"param_name" => "title_text_typography",
"text" => __("Title Settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "title_font",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "title_font_style",
"value" => "",
"group" => "Typography"
),
// array(
// "type" => "number",
// "param_name" => "title_font_size",
// "heading" => __("Font size","ultimate_vc"),
// "value" => "16",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "param_name" => "title_font_line_height",
// "heading" => __("Font Line Height","ultimate_vc"),
// "value" => "24",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "title_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font Line Height", 'ultimate_vc'),
"param_name" => "title_font_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"param_name" => "title_font_color",
"heading" => __("Color","ultimate_vc"),
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"param_name" => "desc_text_typography",
"text" => __("Description Settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "desc_font",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "desc_font_style",
"value" => "",
"group" => "Typography"
),
// array(
// "type" => "number",
// "param_name" => "desc_font_size",
// "heading" => __("Font size","ultimate_vc"),
// "value" => "13",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "param_name" => "desc_font_line_height",
// "heading" => __("Font Line Height","ultimate_vc"),
// "value" => "18",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "desc_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font Line Height", 'ultimate_vc'),
"param_name" => "desc_font_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"param_name" => "desc_font_color",
"heading" => __("Color","ultimate_vc"),
"group" => "Typography"
),
)
)
);
}//endif
}
}
}
global $AIO_Info_list; // WPB: Beter to create singleton in AIO_Info_list I think, but it also work
if(class_exists('WPBakeryShortCodesContainer'))
{
if ( ! class_exists( 'WPBakeryShortCode_info_list' ) ) {
class WPBakeryShortCode_info_list extends WPBakeryShortCodesContainer {
function content( $atts, $content = null ) {
global $AIO_Info_list;
return $AIO_Info_list->front_info_list($atts, $content);
}
}
}
if ( ! class_exists( 'WPBakeryShortCode_info_list_item' ) ) {
class WPBakeryShortCode_info_list_item extends WPBakeryShortCode {
function content($atts, $content = null ) {
global $AIO_Info_list;
return $AIO_Info_list->front_info_list_item($atts, $content);
}
}
}
}
if(class_exists('AIO_Info_list'))
{
$AIO_Info_list = new AIO_Info_list;
}
@@ -0,0 +1,727 @@
<?php
/*
* Add-on Name: Info Tables for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists("Ultimate_Info_Table")){
class Ultimate_Info_Table{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action("init",array($this,"ultimate_it_init"));
}
add_shortcode("ultimate_info_table",array($this,"ultimate_it_shortcode"));
add_action( 'wp_enqueue_scripts', array( $this, 'info_table_assets' ), 1 );
}
function info_table_assets() {
Ultimate_VC_Addons::ultimate_register_style( 'ultimate-pricing', 'pricing' );
}
function ultimate_it_init(){
if(function_exists("vc_map")){
vc_map(
array(
"name" => __("Info Tables","ultimate_vc"),
"base" => "ultimate_info_table",
"class" => "vc_ultimate_info_table",
"icon" => "vc_ultimate_info_table",
"category" => "Ultimate VC Addons",
"description" => __("Create nice looking info tables.","ultimate_vc"),
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Select Design Style", "ultimate_vc"),
"param_name" => "design_style",
"value" => array(
__("Design 01","ultimate_vc") => "design01",
__("Design 02","ultimate_vc") => "design02",
__("Design 03","ultimate_vc") => "design03",
__("Design 04","ultimate_vc") => "design04",
__("Design 05","ultimate_vc") => "design05",
__("Design 06","ultimate_vc") => "design06",
),
"description" => __("Select Info table design you would like to use", "ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Select Color Scheme", "ultimate_vc"),
"param_name" => "color_scheme",
"value" => array(
__("Black","ultimate_vc") => "black",
__("Red","ultimate_vc") => "red",
__("Blue","ultimate_vc") => "blue",
__("Yellow","ultimate_vc") => "yellow",
__("Green","ultimate_vc") => "green",
__("Gray","ultimate_vc") => "gray",
__("Design Your Own","ultimate_vc") => "custom",
),
"description" => __("Which color scheme would like to use?", "ultimate_vc")
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Main background Color", "ultimate_vc"),
"param_name" => "color_bg_main",
"value" => "",
"description" => __("Select normal background color.", "ultimate_vc"),
"dependency" => Array("element" => "color_scheme","value" => array("custom")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Main text Color", "ultimate_vc"),
"param_name" => "color_txt_main",
"value" => "",
"description" => __("Select normal background color.", "ultimate_vc"),
"dependency" => Array("element" => "color_scheme","value" => array("custom")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Highlight background Color", "ultimate_vc"),
"param_name" => "color_bg_highlight",
"value" => "",
"description" => __("Select highlight background color.", "ultimate_vc"),
"dependency" => Array("element" => "color_scheme","value" => array("custom")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Highlight text Color", "ultimate_vc"),
"param_name" => "color_txt_highlight",
"value" => "",
"description" => __("Select highlight background color.", "ultimate_vc"),
"dependency" => Array("element" => "color_scheme","value" => array("custom")),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Heading", "ultimate_vc"),
"param_name" => "package_heading",
"admin_label" => true,
"value" => "",
"description" => __("The title of Info Table", "ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h3",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H3", "ultimate_vc"),
'edit_field_class' => 'vc_col-sm-4',
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Sub Heading", "ultimate_vc"),
"param_name" => "package_sub_heading",
"value" => "",
"description" => __(" Describe the info table in one line", "ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "sub_heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h5",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H3","ultimate_vc") => "h3",
__("H4","ultimate_vc") => "h4",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H5", "ultimate_vc"),
'edit_field_class' => 'vc_col-sm-4',
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("No Icon","ultimate_vc") => "none",
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use an existing font icon or upload a custom image.", "ultimate_vc")
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "attach_image",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "img_width",
"value" => "",
"min" => 16,
"max" => 512,
"suffix" => "px",
"description" => __("Provide image width", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => "",
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc")=> "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => "",
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => "",
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => "",
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "textarea_html",
"class" => "",
"heading" => __("Features", "ultimate_vc"),
"param_name" => "content",
"value" => "",
"description" => __("Describe the Info Table in brief.", "ultimate_vc"),
"edit_field_class" => "ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Add link", "ultimate_vc"),
"param_name" => "use_cta_btn",
"value" => array(
__("No Link","ultimate_vc") => "",
__("Call to Action Button","ultimate_vc") => "true",
__("Link to Complete Box","ultimate_vc") => "box",
),
"description" => __("Do you want to display call to action button?","ultimate_vc"),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Call to action button text", "ultimate_vc"),
"param_name" => "package_btn_text",
"value" => "",
"description" => __("Enter call to action button text", "ultimate_vc"),
"dependency" => Array("element" => "use_cta_btn", "value" => array("true")),
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Call to action link", "ultimate_vc"),
"param_name" => "package_link",
"value" => "",
"description" => __("Select / enter the link for call to action button", "ultimate_vc"),
"dependency" => Array("element" => "use_cta_btn", "value" => array("true","box")),
),
/* typoraphy - heading */
array(
"type" => "ult_param_heading",
"text" => __("Heading Settings","ultimate_vc"),
"param_name" => "heading_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "heading_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "heading_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "heading_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "heading_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "heading_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "heading_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "heading_font_color",
"value" => "",
"group" => "Typography"
),
/* typoraphy - sub heading */
array(
"type" => "ult_param_heading",
"text" => __("Sub-Heading Settings","ultimate_vc"),
"param_name" => "subheading_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "subheading_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "subheading_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "subheading_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "subheading_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "subheading_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "subheading_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "subheading_font_color",
"value" => "",
"group" => "Typography"
),
/* typoraphy - feature*/
array(
"type" => "ult_param_heading",
"text" => __("Features Settings","ultimate_vc"),
"param_name" => "features_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "features_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "features_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "features_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "features_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "features_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "features_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "features_font_color",
"value" => "",
"group" => "Typography"
),
/* typoraphy - button */
array(
"type" => "ult_param_heading",
"text" => __("Button Settings","ultimate_vc"),
"param_name" => "button_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "button_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "button_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "button_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "button_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "button_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "button_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "button_font_color",
"value" => "",
"group" => "Typography"
),
array(
"type" => "number",
"class" => "font-size",
"heading" => __("Minimum Height For Info Table", "ultimate_vc"),
"param_name" => "features_min_ht",
"min" => 10,
"suffix" => "px",
"description" => __("Adjust height of your price Info Table.", "ultimate_vc"),
),
// Customize everything
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Add extra class name that will be applied to the icon box, and you can use this class for your customizations.", "ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/t9vlh' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_info_tables',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)// params
));// vc_map
}
}
function ultimate_it_shortcode($atts,$content = null){
$design_style = '';
extract(shortcode_atts(array(
"design_style" => "design01",
),$atts));
$output = '';
require_once(__ULTIMATE_ROOT__.'/templates/info-tables/info-table-'.$design_style.'.php');
$design_func = 'ult_info_table_generate_'.$design_style;
//$design_cls = 'Info_'.ucfirst($design_style);
//$class = new $design_cls;
$output .= $design_func($atts,$content);
$is_preset = false; //Display settings for Preset
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
}
} // class Ultimate_Info_Table
new Ultimate_Info_Table;
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ultimate_info_table' ) ) {
class WPBakeryShortCode_ultimate_info_table extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,587 @@
<?php
/*
* Add-on Name: Interactive Banner - 2
*/
if(!class_exists('Ultimate_Interactive_Banner'))
{
class Ultimate_Interactive_Banner{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'banner_init'));
}
add_shortcode('interactive_banner_2',array($this,'banner_shortcode'));
add_action('wp_enqueue_scripts', array($this, 'register_ib2_banner_assets'),1);
}
function register_ib2_banner_assets() {
Ultimate_VC_Addons::ultimate_register_style( 'ult-ib2-style', 'ib2-style' );
}
function banner_init(){
if(function_exists('vc_map'))
{
$json = ultimate_get_banner2_json();
vc_map(
array(
"name" => __("Interactive Banner 2","ultimate_vc"),
"base" => "interactive_banner_2",
"class" => "vc_interactive_icon",
"icon" => "vc_icon_interactive",
"category" => "Ultimate VC Addons",
"description" => __("Displays the banner image with Information.","ultimate_vc"),
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __("Title ","ultimate_vc"),
"param_name" => "banner_title",
"admin_label" => true,
"value" => "",
"description" => __("Give a title to this banner.","ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h2",
__("H1","ultimate_vc") => "h1",
__("H3","ultimate_vc") => "h3",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H2.", "ultimate_vc"),
'edit_field_class' => 'ult-param-padding-remove vc_col-sm-4',
),
array(
"type" => "textarea",
"class" => "",
"heading" => __("Description","ultimate_vc"),
"param_name" => "banner_desc",
"value" => "",
"description" => __("Text that comes on mouse hover.","ultimate_vc")
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Banner Image","ultimate_vc"),
"param_name" => "banner_image",
"value" => "",
"description" => __("Upload the image for this banner.","ultimate_vc")
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Link ","ultimate_vc"),
"param_name" => "banner_link",
"value" => "",
"description" => __("Add link / select existing page to link to this banner.","ultimate_vc"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Link Delay", "ultimate_vc"),
"param_name" => "delay_seconds",
"value" => "200",
"suffix" => "ms",
"description" => __("Add time delay for redirecting the links on touch devices.","ultimate_vc"),
//"dependency" => Array("element" => "banner_link", "value" => array('banner_link')),
),
array(
"type" => "ult_select2",
"class" => "",
"heading" => __("Styles ","ultimate_vc"),
"param_name" => "banner_style",
"value" => "",
"json" => $json,
"description" => "",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Banner Height","ultimate_vc"),
"param_name" => "banner_min_height_op",
"description" => "",
"value" => array(
__("Default","ultimate_vc") => "default",
__("Custom","ultimate_vc") => "custom",
),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Min Height", "ultimate_vc"),
"param_name" => "banner_min",
"suffix" => "px",
//"description" => __("","ultimate_vc"),
"dependency" => Array("element" => "banner_min_height_op", "value" => array('custom')),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Title Background Color","ultimate_vc"),
"param_name" => "banner_title_bg",
"value" => "",
"description" => "",
"dependency" => Array("element" => "banner_style", "value" => array('style5')),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Add extra class name that will be applied to the icon process, and you can use this class for your customizations.", "ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"heading" => __("Title Settings","ultimate_vc"),
"param_name" => "banner_title_typograpy",
//"dependency" => Array("element" => "banner_title", "not_empty" => true),
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "smile"),
"param_name" => "banner_title_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
//"dependency" => Array("element" => "banner_title", "not_empty" => true),
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" =>__("Font Style", "ultimate_vc"),
"param_name" => "banner_title_style",
//"dependency" => Array("element" => "banner_title", "not_empty" => true),
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "banner_title_font_size",
// "min" => 12,
// "suffix" => "px",
// "dependency" => Array("element" => "banner_title", "not_empty" => true),
// "group" => "Typography",
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "banner_title_font_size",
"unit" => "px",
//"dependency" => Array("element" => "banner_title", "not_empty" => true),
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "banner_title_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ult_param_heading",
"heading" => __("Description Settings","ultimate_vc"),
"param_name" => "banner_desc_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "smile"),
"param_name" => "banner_desc_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
//"dependency" => Array("element" => "banner_desc", "not_empty" => true),
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "banner_desc_style",
//"dependency" => Array("element" => "banner_desc", "not_empty" => true),
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "banner_desc_font_size",
// "min" => 12,
// "suffix" => "px",
// "dependency" => Array("element" => "banner_desc", "not_empty" => true),
// "group" => "Typography",
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "banner_desc_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "banner_desc_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Title Color","ultimate_vc"),
"param_name" => "banner_color_title",
"value" => "",
"description" => "",
"group" => "Color Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Description Color","ultimate_vc"),
"param_name" => "banner_color_desc",
"value" => "",
"description" => "",
"group" => "Color Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color","ultimate_vc"),
"param_name" => "banner_color_bg",
"value" => "",
"description" => "",
"group" => "Color Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Opacity", "ultimate_vc"),
"param_name" => "image_opacity",
"value" => 1,
"min" => 0.0,
"max" => 1.0,
"step" => 0.1,
"suffix" => "",
"description" => __("Enter value between 0.0 to 1 (0 is maximum transparency, while 1 is lowest)","ultimate_vc"),
"group" => "Color Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Opacity on Hover", "ultimate_vc"),
"param_name" => "image_opacity_on_hover",
"value" => 1,
"min" => 0.0,
"max" => 1.0,
"step" => 0.1,
"suffix" => "",
"description" => __("Enter value between 0.0 to 1 (0 is maximum transparency, while 1 is lowest)","ultimate_vc"),
"group" => "Color Settings",
),
array(
"type" => "checkbox",
"class" => "",
"heading" => __("Responsive Nature","ultimate_vc"),
"param_name" => "enable_responsive",
"value" => array("Enable Responsive Behaviour" => "yes"),
"description" => __("If the description text is not suiting well on specific screen sizes, you may enable this option - which will hide the description text.","ultimate_vc"),
"group" => "Responsive",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Minimum Screen Size", "ultimate_vc"),
"param_name" => "responsive_min",
"value" => 768,
"min" => 100,
"max" => 1000,
"suffix" => "px",
"dependency" => Array("element" => "enable_responsive", "value" => "yes"),
"description" => __("Provide the range of screen size where you would like to hide the description text.","ultimate_vc"),
"group" => "Responsive",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Maximum Screen Size", "ultimate_vc"),
"param_name" => "responsive_max",
"value" => 900,
"min" => 100,
"max" => 1000,
"suffix" => "px",
"dependency" => Array("element" => "enable_responsive", "value" => "yes"),
"description" => __("Provide the range of screen size where you would like to hide the description text.","ultimate_vc"),
"group" => "Responsive",
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/n8o33' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_ib2',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
),
)
);
}
}
// Shortcode handler function for stats banner
function banner_shortcode($atts)
{
$banner_title = $banner_desc = $banner_image = $banner_link = $delay_seconds = $banner_style = $el_class = $heading_tag = '';
$banner_title_font_family=$banner_title_style = $banner_title_font_size = $banner_title_line_height = $banner_desc_font_family = $banner_desc_style = $banner_desc_font_size = $banner_desc_line_height = '';
$banner_title_style_inline = $banner_desc_style_inline = $banner_color_bg = $banner_color_title = $banner_color_desc = $banner_title_bg = '';
$image_opacity = $image_opacity_on_hover = $enable_responsive = $responsive_min = $banner_min = $banner_min_height_op = $responsive_max = $target = $link_title = $rel = '';
extract(shortcode_atts( array(
'banner_title' => '',
'banner_desc' => '',
'banner_title_location' => '',
'banner_image' => '',
'image_opacity' => '1',
'image_opacity_on_hover' => '1',
'banner_height'=>'',
'banner_height_val'=>'',
'banner_link' => '',
'delay_seconds' => '200',
/*'banner_link_text' => '',*/
'banner_style' => '',
'banner_title_font_family' => '',
'banner_title_style' => '',
'banner_title_font_size' => '',
'banner_title_line_height' => '',
'banner_desc_font_family' => '',
'banner_desc_style' => '',
'banner_desc_font_size' => '',
'banner_desc_line_height' => '',
'banner_color_bg' => '',
'banner_color_title' => '',
'banner_color_desc' => '',
'banner_title_bg' => 'banner_style',
'enable_responsive' => 'yes',
'responsive_min' => '768',
'responsive_max' => '900',
'banner_min' => '',
'banner_min_height_op' => 'default',
'el_class' =>'',
'heading_tag' => '',
'css_ib2' => '',
),$atts));
$css_ib2_styles = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_ib2, ' ' ), "interactive_banner_2", $atts );
$css_ib2_styles = esc_attr( $css_ib2_styles );
$output = $style = $target = $link = $url = $banner_style_inline = $title_bg = $img_style = $responsive = $target ='';
//$banner_style = 'style01';
if($enable_responsive == "yes"){
$responsive .= 'data-min-width="'.esc_attr( $responsive_min ).'" data-max-width="'.esc_attr( $responsive_max ).'"';
$el_class .= " ult-ib-resp";
}
if($banner_title_bg !== '' && $banner_style == "style5"){
$title_bg .= 'background:'.$banner_title_bg.';';
}
//$img = wp_get_attachment_image_src( $banner_image, 'full');
$img = apply_filters('ult_get_img_single', $banner_image, 'url');
$alt = apply_filters('ult_get_img_single', $banner_image, 'alt');
if($banner_link !== ''){
$href = vc_build_link($banner_link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
} else {
$link = "#";
}
if($banner_title_font_family != '')
{
$bfamily = get_ultimate_font_family($banner_title_font_family);
if($bfamily != '')
$banner_title_style_inline = 'font-family:\''.$bfamily.'\';';
}
$banner_title_style_inline .= get_ultimate_font_style($banner_title_style);
// if($banner_title_font_size != '')
// $banner_title_style_inline .= 'font-size:'.$banner_title_font_size.'px;';
if(is_numeric($banner_title_font_size)){
$banner_title_font_size = 'desktop:'.$banner_title_font_size.'px;';
}
if(is_numeric($banner_title_line_height)){
$banner_title_line_height = 'desktop:'.$banner_title_line_height.'px;';
}
$interactive_banner_id = 'interactive-banner-wrap-'.rand(1000, 9999);
$interactive_banner_args = array(
'target' => '#'.$interactive_banner_id.' .ult-new-ib-title', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $banner_title_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $banner_title_line_height
),
);
$interactive_banner_data_list = get_ultimate_vc_responsive_media_css($interactive_banner_args);
if($banner_desc_font_family != '')
{
$bdfamily = get_ultimate_font_family($banner_desc_font_family);
if($bdfamily != '')
$banner_desc_style_inline = 'font-family:\''.$bdfamily.'\';';
}
$banner_desc_style_inline .= get_ultimate_font_style($banner_desc_style);
// if($banner_desc_font_size != '')
// $banner_desc_style_inline .= 'font-size:'.$banner_desc_font_size.'px;';
if(is_numeric($banner_desc_font_size)){
$banner_desc_font_size = 'desktop:'.$banner_desc_font_size.'px;';
}
if(is_numeric($banner_desc_line_height)){
$banner_desc_line_height = 'desktop:'.$banner_desc_line_height.'px;';
}
$interactive_banner_desc_args = array(
'target' => '#'.$interactive_banner_id.' .ult-new-ib-content', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $banner_desc_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $banner_desc_line_height
),
);
$interactive_banner_desc_data_list = get_ultimate_vc_responsive_media_css($interactive_banner_desc_args);
if($banner_color_bg != '')
$banner_style_inline .= 'background:'.$banner_color_bg.';';
$banner_min_height = $img_min_height = $img_max_height = $min_height_class = '';
if($banner_min_height_op != '' && $banner_min_height_op == 'custom' ) {
if($banner_min != '') {
$banner_min_height = ' data-min-height="'.esc_attr($banner_min).'" ';
$img_min_height = ' data-min-height="'.esc_attr($banner_min).'" ';
//$img_max_height = ' data-max-width="none" ';
$min_height_class = 'ult-ib2-min-height';
$banner_style_inline .= ' opacity:0; ';
}
}
$delay_on_touch_devices = '';
if($delay_seconds !== '' && $delay_seconds !== '200')
$delay_on_touch_devices = 'data-touch-delay="'.$delay_seconds.'"';
if($banner_color_title != '')
$banner_title_style_inline .= 'color:'.$banner_color_title.';';
if($heading_tag == 'span')
$banner_title_style_inline .= 'display: block';
if($banner_color_desc != '')
$banner_desc_style_inline .= 'color:'.$banner_color_desc.';';
if($image_opacity !== ''){
$img_style .= 'opacity:'.$image_opacity.';';
}
if($link !== "#")
$href = 'href="'.esc_url($link).'"';
else
$href = '';
$heading_tag = ( isset($heading_tag) && trim($heading_tag) != "" ) ? $heading_tag : 'h2';
$output .= '<div class="ult-new-ib ult-ib-effect-'.esc_attr($banner_style).' '.esc_attr($el_class).' '.esc_attr($min_height_class).' '.esc_attr($css_ib2_styles).'" '.$responsive.' style="'.esc_attr($banner_style_inline).'" data-opacity="'.esc_attr($image_opacity).'" data-hover-opacity="'.esc_attr($image_opacity_on_hover).'" '.$banner_min_height.'>';
if($img !== '')
$output .= '<img class="ult-new-ib-img" style="'.esc_attr($img_style).'" alt="'.esc_attr($alt).'" src="'.esc_url(apply_filters('ultimate_images', $img)).'" '.$img_min_height.' '.$img_max_height.' />';
$output .= '<div id="'.esc_attr($interactive_banner_id).'" class="ult-new-ib-desc" style="'.esc_attr($title_bg).'">';
$output .= '<'.$heading_tag.' class="ult-new-ib-title ult-responsive" '.$interactive_banner_data_list.' style="'.esc_attr($banner_title_style_inline).'">'.$banner_title.'</'.$heading_tag.'>';
if($banner_desc != ''){
$output .= '<div class="ult-new-ib-content ult-responsive" '.$interactive_banner_desc_data_list.' style="'.esc_attr($banner_desc_style_inline).'"><p>'.$banner_desc.'</p></div>';
}
$output .= '</div>';
if($href != ''){
$output .= '<a class="ult-new-ib-link" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).' '.$delay_on_touch_devices.'></a>';
}
$output .= '</div>';
$is_preset = false; //Display settings for Preset
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
$output .= '<script type="text/javascript">
(function($){
$(document).ready(function(){
$(".ult-new-ib").css("opacity","1");
});
})(jQuery);
</script>';
return $output;
}
}
}
if(class_exists('Ultimate_Interactive_Banner'))
{
$Ultimate_Interactive_Banner = new Ultimate_Interactive_Banner;
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_interactive_banner_2' ) ) {
class WPBakeryShortCode_interactive_banner_2 extends WPBakeryShortCode {
}
}
@@ -0,0 +1,620 @@
<?php
/*
* Add-on Name: Interactive Banners for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('AIO_Interactive_Banners'))
{
class AIO_Interactive_Banners
{
function __construct() {
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'banner_init'));
}
add_shortcode('interactive_banner',array($this,'banner_shortcode'));
add_action('wp_enqueue_scripts', array($this, 'register_ib_banner_assets'),1);
}
function register_ib_banner_assets() {
Ultimate_VC_Addons::ultimate_register_style( 'ult-interactive-banner', 'interactive-styles' );
}
function banner_init()
{
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Interactive Banner","ultimate_vc"),
"base" => "interactive_banner",
"class" => "vc_interactive_icon",
"icon" => "vc_icon_interactive",
"category" => "Ultimate VC Addons",
"description" => __("Displays the banner image with Information","ultimate_vc"),
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __("Interactive Banner Title ","ultimate_vc"),
"param_name" => "banner_title",
"admin_label" => true,
"value" => "",
"description" => __("Give a title to this banner","ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h3",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H3", "ultimate_vc"),
'edit_field_class' => 'ult-param-padding-remove vc_col-sm-4',
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Banner Title Location ","ultimate_vc"),
"param_name" => "banner_title_location",
"value" => array(
__("Title on Center","ultimate_vc")=>'center',
__("Title on Left","ultimate_vc")=>'left',
),
"description" => __("Alignment of the title.","ultimate_vc")
),
array(
"type" => "textarea",
"class" => "",
"heading" => __("Banner Description","ultimate_vc"),
"param_name" => "banner_desc",
"value" => "",
"description" => __("Text that comes on mouse hover.","ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Use Icon", "ultimate_vc"),
"param_name" => "icon_disp",
"value" => array(
__("None","ultimate_vc") => "none",
__("Icon with Heading","ultimate_vc") => "with_heading",
__("Icon with Description","ultimate_vc") => "with_description",
__("Both","ultimate_vc") => "both",
),
"description" => __("Icon can be displayed with title and description.", "ultimate_vc"),
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon","ultimate_vc"),
"param_name" => "banner_icon",
"admin_label" => true,
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_disp","value" => array("with_heading","with_description","both")),
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Banner Image","ultimate_vc"),
"param_name" => "banner_image",
"value" => "",
"description" => __("Upload the image for this banner","ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Banner height Type","ultimate_vc"),
"param_name" => "banner_height",
"value" => array(
__("Auto Height","ultimate_vc") => '',
__("Custom Height","ultimate_vc") => 'ult-banner-block-custom-height'
),
"description" => __("Selct between Auto or Custom height for Banner.","ultimate_vc")
),
array(
"type" => "number",
"class" => "",
"heading" => __("Banner height Value","ultimate_vc"),
"param_name" => "banner_height_val",
"value" => '',
"suffix"=>'px',
"description" => __("Give height in pixels for interactive banner.","ultimate_vc"),
"dependency" => Array("element"=>"banner_height","value"=>array("ult-banner-block-custom-height"))
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Apply link to:", "ultimate_vc"),
"param_name" => "link_opts",
"value" => array(
__("No Link","ultimate_vc") => "none",
__("Complete Box","ultimate_vc") => "box",
__("Display Read More","ultimate_vc") => "more",
),
"description" => __("Select whether to use color for icon or not.", "ultimate_vc"),
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Banner Link ","ultimate_vc"),
"param_name" => "banner_link",
"value" => "",
"description" => __("Add link / select existing page to link to this banner","ultimate_vc"),
"dependency" => Array("element" => "link_opts", "value" => array("box","more")),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Link Text","ultimate_vc"),
"param_name" => "banner_link_text",
"value" => "",
"description" => __("Enter text for button","ultimate_vc"),
"dependency" => Array("element" => "link_opts","value" => array("more")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Button Background Color","ultimate_vc"),
"param_name" => "banner_link_bg_color",
"value" => "#242424",
"description" => __("Select the background color for banner overlay","ultimate_vc"),
"dependency" => Array("element" => "link_opts","value" => array("more")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Button Text Color","ultimate_vc"),
"param_name" => "banner_link_text_color",
"value" => "#ffffff",
"description" => __("Select the background color for banner overlay","ultimate_vc"),
"dependency" => Array("element" => "link_opts","value" => array("more")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Box Hover Effects","ultimate_vc"),
"param_name" => "banner_style",
"value" => array(
__("Appear From Bottom","ultimate_vc") => "style01",
__("Appear From Top","ultimate_vc") => "style02",
__("Appear From Left","ultimate_vc") => "style03",
__("Appear From Right","ultimate_vc") => "style04",
__("Zoom In","ultimate_vc") => "style11",
__("Zoom Out","ultimate_vc") => "style12",
__("Zoom In-Out","ultimate_vc") => "style13",
__("Jump From Left","ultimate_vc") => "style21",
__("Jump From Right","ultimate_vc") => "style22",
__("Pull From Bottom","ultimate_vc") => "style31",
__("Pull From Top","ultimate_vc") => "style32",
__("Pull From Left","ultimate_vc") => "style33",
__("Pull From Right","ultimate_vc") => "style34",
),
"description" => __("Select animation effect style for this block.","ultimate_vc")
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Heading Title Color","ultimate_vc"),
"param_name" => "heading_title_color",
"value" => "#ffffff",
"description" => __("Select the color for banner heading","ultimate_vc"),
"group" => "Color",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Heading Background Color","ultimate_vc"),
"param_name" => "banner_bg_color",
"value" => "#242424",
"description" => __("Select the background color for banner heading","ultimate_vc"),
"group" => "Color",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Descrption Color","ultimate_vc"),
"param_name" => "desc_color",
"value" => "#ffffff",
"description" => __("Select the Description color for banner ","ultimate_vc"),
"group" => "Color",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Icon Color","ultimate_vc"),
"param_name" => "icon_color",
"value" => "#ffffff",
"description" => __("Select the color for icon ","ultimate_vc"),
"group" => "Color",
"dependency" => Array("element" => "icon_disp","value" => array("with_heading","with_description","both")),
),
/*array(
"type" => "dropdown",
"class" => "",
"heading" => __("Background Color Opacity","ultimate_vc"),
"param_name" => "banner_opacity",
"value" => array(
__('Transparent Background','ultimate_vc')=>'opaque',
__('Solid Background','ultimate_vc')=>'solid'
),
"description" => __("Select the background opacity for content overlay","ultimate_vc")
),*/
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Overlay Background Color","ultimate_vc"),
"param_name" => "banner_overlay_bg_color",
"value" => "#242424",
"description" => __("Select the background color for banner overlay","ultimate_vc"),
//"group" => "Color",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Add extra class name that will be applied to the icon process, and you can use this class for your customizations.", "ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"text" => __("Banner Title Settings","ultimate_vc"),
"param_name" => "banner_title_typograpy",
//"dependency" => Array("element" => "banner_title", "not_empty" => true),
"group" => "Typography",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "banner_title_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
//"dependency" => Array("element" => "banner_title", "not_empty" => true),
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "banner_title_style",
//"description" => __("Main heading font style", "smile"),
//"dependency" => Array("element" => "banner_title", "not_empty" => true),
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "banner_title_font_size",
// "min" => 12,
// "suffix" => "px",
// //"description" => __("Sub heading font size", "smile"),
// "dependency" => Array("element" => "banner_title", "not_empty" => true),
// "group" => "Typography",
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "banner_title_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "banner_title_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ult_param_heading",
"text" => __("Banner Description Settings","ultimate_vc"),
"param_name" => "banner_desc_typograpy",
//"dependency" => Array("element" => "banner_desc", "not_empty" => true),
"group" => "Typography",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "banner_desc_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
//"dependency" => Array("element" => "banner_desc", "not_empty" => true),
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "banner_desc_style",
//"description" => __("Main heading font style", "smile"),
//"dependency" => Array("element" => "banner_desc", "not_empty" => true),
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "banner_desc_font_size",
// "min" => 12,
// "suffix" => "px",
// //"description" => __("Sub heading font size", "smile"),
// "dependency" => Array("element" => "banner_desc", "not_empty" => true),
// "group" => "Typography",
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "banner_desc_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "banner_desc_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_spacing",
"heading" => " Margin ",
"param_name" => "ib_wrapper_margin",
"mode" => "margin", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
"Top" => "",
"Right" => "",
"Bottom" => "",
"Left" => "",
),
'group' => __( 'Design ', 'ultimate_vc' ),
"description" => __("Add or remove margin.", "ultimate_vc"),
),
),
)
);
}
}
// Shortcode handler function for stats banner
function banner_shortcode($atts)
{
$banner_title = $heading_tag = $banner_title_line_height = $banner_desc = $banner_desc_line_height = $banner_icon = $banner_image = $banner_link = $banner_link_text = $banner_style = $banner_bg_color = $el_class = $animation = $icon_disp = $link_opts = $banner_title_location = $banner_title_style_inline = $banner_desc_style_inline = $banner_overlay_bg_color = $banner_link_text_color = $banner_link_bg_color = $css_ibanner = $target = $link_title = $rel = '';
extract(shortcode_atts( array(
'banner_title' => '',
'heading_tag' => 'h3',
'banner_desc' => '',
'banner_title_location' => 'center',
'icon_disp' => 'none',
'banner_icon' => '',
'banner_image' => '',
'banner_height'=>'',
'banner_height_val'=>'',
'link_opts' => 'none',
'banner_link' => '',
'banner_link_text' => '',
'banner_style' => 'style01',
'banner_bg_color' => '#242424',
'banner_overlay_bg_color' => '#242424',
'banner_opacity' => 'opaque',
'el_class' =>'',
'animation' => '',
'banner_title_font_family' => '',
'banner_title_style' => '',
'banner_title_font_size' => '',
'banner_title_line_height' =>'',
'banner_desc_font_family' => '',
'banner_desc_style' => '',
'banner_desc_font_size' => '',
'banner_desc_line_height' => '',
'banner_link_text_color' => '#ffffff',
'banner_link_bg_color' => '#242424',
'heading_title_color'=>'#ffffff',
'desc_color'=>'#ffffff',
'icon_color'=>'#ffffff',
'ib_wrapper_margin'=> '',
),$atts));
$css_ibanner_styles = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_ibanner, ' ' ), "interactive_banner", $atts );
$css_ibanner_styles = esc_attr( $css_ibanner_styles );
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$output = $icon = $style = $target = '';
$headerstyle = $ib_wrapper_margin;
if($banner_title_font_family != '')
{
$bfamily = get_ultimate_font_family($banner_title_font_family);
if($bfamily !== '')
$banner_title_style_inline = 'font-family:\''.$bfamily.'\';';
}
$banner_title_style_inline .= get_ultimate_font_style($banner_title_style);
// if($banner_title_font_size != '')
// $banner_title_style_inline .= 'font-size:'.$banner_title_font_size.'px;';
//Responsive param
if(is_numeric($banner_title_font_size)){
$banner_title_font_size = 'desktop:'.$banner_title_font_size.'px;';
}
if(is_numeric($banner_title_line_height)){
$banner_title_line_height = 'desktop:'.$banner_title_line_height.'px;';
}
$interactive_banner_1_id = 'interactive-banner-1-wrap-'.rand(1000, 9999);
$interactive_banner_1_args = array(
'target' => '#'.$interactive_banner_1_id.' .bb-top-title ', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $banner_title_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $banner_title_line_height
),
);
$interactive_banner_1_data_list = get_ultimate_vc_responsive_media_css($interactive_banner_1_args);
if($banner_bg_color != '')
$banner_title_style_inline .= 'background:'.$banner_bg_color.';';
if($heading_title_color != '')
$banner_title_style_inline .= 'color:'.$heading_title_color.';';
if($banner_desc_font_family != '')
{
$bdfamily = get_ultimate_font_family($banner_desc_font_family);
if($bdfamily !== '')
$banner_desc_style_inline = 'font-family:\''.$bdfamily.'\';';
}
$banner_desc_style_inline .= get_ultimate_font_style($banner_desc_style);
// if($banner_desc_font_size != '')
// $banner_desc_style_inline .= 'font-size:'.$banner_desc_font_size.'px;';
//Responsive param
if(is_numeric($banner_desc_font_size)){
$banner_desc_font_size = 'desktop:'.$banner_desc_font_size.'px;';
}
if(is_numeric($banner_desc_line_height)){
$banner_desc_line_height = 'desktop:'.$banner_desc_line_height.'px;';
}
$interactive_banner_desc_1_args = array(
'target' => '#'.$interactive_banner_1_id.' .bb-description', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $banner_desc_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $banner_desc_line_height
),
);
$interactive_banner_desc_1_data_list = get_ultimate_vc_responsive_media_css($interactive_banner_desc_1_args);
if($desc_color != '')
$banner_desc_style_inline .= 'color:'.$desc_color.';';
$icon_style = $css_trans = '';
if($icon_color !=='')
$icon_style.='color:'.$icon_color.';';
if($banner_icon !== '')
$icon = '<i class="'.esc_attr($banner_icon).'" style= "'.esc_attr($icon_style).'"></i>';
$img = apply_filters('ult_get_img_single', $banner_image, 'url');
$alt = apply_filters('ult_get_img_single', $banner_image, 'alt');
$href = vc_build_link($banner_link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
$banner_top_style='';
if($banner_height!='' && $banner_height_val!=''){
$banner_top_style = 'height:'.$banner_height_val.'px;';
}
$heading_tag = ( isset($heading_tag) && trim($heading_tag) != "" ) ? $heading_tag : 'h2';
if($heading_tag == 'p')
$banner_title_style_inline .= 'transform: none;';
$output .= "\n".'<div id="'.esc_attr($interactive_banner_1_id).'" class="ult-banner-block '.esc_attr($is_vc_49_plus).' ult-bb-'.esc_attr($link_opts).' '.esc_attr($banner_height).' banner-'.esc_attr($banner_style).' '.esc_attr($el_class).'" '.$css_trans.' style="'.esc_attr($banner_top_style).''.esc_attr($headerstyle).'">';
if($img !== '')
$output .= "\n\t".'<img src="'.esc_url(apply_filters('ultimate_images', $img)).'" alt="'.esc_attr($alt).'">';
if($banner_title !== ''){
$output .= "\n\t".'<'.$heading_tag.' '.$interactive_banner_1_data_list.' class="title-'.esc_attr($banner_title_location).' bb-top-title ult-responsive" style="'.esc_attr($banner_title_style_inline).'">'.$banner_title;
if($icon_disp == "with_heading" || $icon_disp == "both")
$output .= $icon;
$output .= '</'.$heading_tag.'>';
}
$banner_overlay_bg_color = 'background:'.$banner_overlay_bg_color.';';
$output .= "\n\t".'<div class="mask '.esc_attr($banner_opacity).'-background" style="'.esc_attr($banner_overlay_bg_color).'">';
if($icon_disp == "with_description" || $icon_disp == "both"){
if($banner_icon !== ''){
$output .= "\n\t\t".'<div class="bb-back-icon">'.$icon.'</div>';
$output .= "\n\t\t".'<p class="" style="'.esc_attr($banner_desc_style_inline).'">'.$banner_desc.'</p>';
}
} else {
$output .= "\n\t\t".'<div '.$interactive_banner_desc_1_data_list.' class="bb-description ult-responsive" style="'.esc_attr($banner_desc_style_inline).'">'.$banner_desc.'</div>';
}
if($link_opts == "more"){
$button_style = 'background:'.$banner_link_bg_color.';';
$button_style .= 'color:'.$banner_link_text_color.';';
$output .= "\n\t\t".'<a class="bb-link" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).' style="'.esc_attr($button_style).'">'.$banner_link_text.'</a>';
}
$output .= "\n\t".'</div>';
if($link_opts == "box")
$output .= '<a class="bb-link" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).'></a>';
$output .= "\n".'</div>';
$is_preset = false; //Display settings for Preset
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
//}
}
}
}
if(class_exists('AIO_Interactive_Banners'))
{
$AIO_Interactive_Banners = new AIO_Interactive_Banners;
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_interactive_banner' ) ) {
class WPBakeryShortCode_interactive_banner extends WPBakeryShortCode {
}
}
@@ -0,0 +1,458 @@
<?php
/*
* Add-on Name: Just Icon for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('AIO_Just_Icon'))
{
class AIO_Just_Icon
{
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'just_icon_init'));
}
add_shortcode('just_icon',array($this,'just_icon_shortcode'));
}
function just_icon_init()
{
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Just Icon","ultimate_vc"),
"base" => "just_icon",
"class" => "vc_simple_icon",
"icon" => "vc_just_icon",
"category" => "Ultimate VC Addons",
"description" => __("Add a simple icon and give some custom style.","ultimate_vc"),
"params" => array(
// Play with icon selector
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use existing font icon or upload a custom image.", "ultimate_vc")
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"admin_label" => true,
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "img_width",
"value" => 48,
"min" => 16,
"max" => 512,
"suffix" => "px",
"description" => __("Provide image width", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "#333333",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon or Image Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Hexagon Background","ultimate_vc") => "hexagon",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "#ffffff",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced", "hexagon" )),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc")=> "",
__("Solid","ultimate_vc")=> "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Link ","smile"),
"param_name" => "icon_link",
"value" => "",
"description" => __("Add a custom link or select existing page. You can remove existing link as well.","ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Animation","ultimate_vc"),
"param_name" => "icon_animation",
"value" => array(
__("No Animation","ultimate_vc") => "",
__("Swing","ultimate_vc") => "swing",
__("Pulse","ultimate_vc") => "pulse",
__("Fade In","ultimate_vc") => "fadeIn",
__("Fade In Up","ultimate_vc") => "fadeInUp",
__("Fade In Down","ultimate_vc") => "fadeInDown",
__("Fade In Left","ultimate_vc") => "fadeInLeft",
__("Fade In Right","ultimate_vc") => "fadeInRight",
__("Fade In Up Long","ultimate_vc") => "fadeInUpBig",
__("Fade In Down Long","ultimate_vc") => "fadeInDownBig",
__("Fade In Left Long","ultimate_vc") => "fadeInLeftBig",
__("Fade In Right Long","ultimate_vc") => "fadeInRightBig",
__("Slide In Down","ultimate_vc") => "slideInDown",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Bounce In","ultimate_vc") => "bounceIn",
__("Bounce In Up","ultimate_vc") => "bounceInUp",
__("Bounce In Down","ultimate_vc") => "bounceInDown",
__("Bounce In Left","ultimate_vc") => "bounceInLeft",
__("Bounce In Right","ultimate_vc") => "bounceInRight",
__("Rotate In","ultimate_vc") => "rotateIn",
__("Light Speed In","ultimate_vc") => "lightSpeedIn",
__("Roll In","ultimate_vc") => "rollIn",
),
"description" => __("Like CSS3 Animations? We have several options for you!","ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Tooltip", "ultimate_vc"),
"param_name" => "tooltip_disp",
"value" => array(
__("None","ultimate_vc")=> "",
__("Tooltip from Left","ultimate_vc") => "left",
__("Tooltip from Right","ultimate_vc") => "right",
__("Tooltip from Top","ultimate_vc") => "top",
__("Tooltip from Bottom","ultimate_vc") => "bottom",
),
"description" => __("Select the tooltip position","ultimate_vc"),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Tooltip Text", "ultimate_vc"),
"param_name" => "tooltip_text",
"value" => "",
"description" => __("Enter your tooltip text here.", "ultimate_vc"),
"dependency" => Array("element" => "tooltip_disp", "not_empty" => true),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Alignment", "ultimate_vc"),
"param_name" => "icon_align",
"value" => array(
__("Center","ultimate_vc") => "center",
__("Left","ultimate_vc") => "left",
__("Right","ultimate_vc") => "right"
)
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Custom CSS Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Ran out of options? Need more styles? Write your own CSS and mention the class name here.", "ultimate_vc"),
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_just_icon',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
),
)
);
}
}
// Shortcode handler function for stats Icon
function just_icon_shortcode($atts)
{
$icon_type = $icon_img = $img_width = $icon = $icon_color = $icon_color_bg = $icon_size = $icon_style = $icon_border_style = $icon_border_radius = $icon_color_border = $icon_border_size = $icon_border_spacing = $icon_link = $el_class = $icon_animation = $tooltip_disp = $tooltip_text = $icon_align = '';
extract(shortcode_atts( array(
'icon_type' => 'selector',
'icon' => 'none',
'icon_img' => '',
'img_width' => '48',
'icon_size' => '32',
'icon_color' => '#333',
'icon_style' => 'none',
'icon_color_bg' => '#ffffff',
'icon_color_border' => '#333333',
'icon_border_style' => '',
'icon_border_size' => '1',
'icon_border_radius' => '500',
'icon_border_spacing' => '50',
'icon_link' => '',
'icon_animation' => 'none',
'tooltip_disp' => '',
'tooltip_text' => '',
'el_class'=>'',
'icon_align' => 'center',
'css_just_icon' => '',
),$atts));
$is_preset = false;
if(isset($_GET['preset'])) {
$is_preset = true;
}
$css_just_icon = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_just_icon, ' ' ), "just_icon", $atts );
$css_just_icon = esc_attr( $css_just_icon );
$ultimate_js = get_option('ultimate_js');
if($tooltip_text !== '' && $ultimate_js !== 'enable')
wp_enqueue_script('ultimate-tooltip');
$output = $style = $link_sufix = $link_prefix = $target = $href = $icon_align_style = $css_trans = $target = $link_title = $rel = '';
if(trim($icon_animation) === '')
$icon_animation = 'none';
if($icon_animation !== 'none')
{
$css_trans = 'data-animation="'.esc_attr($icon_animation).'" data-animation-delay="03"';
}
$uniqid = uniqid();
$href = vc_build_link($icon_link);
if($icon_link !== ''){
if( $href['url'] != NULL ){
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$link_title = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
$link_prefix .= '<a class="aio-tooltip '.esc_attr($uniqid).'" '. Ultimate_VC_Addons::uavc_link_init($url, $target, $link_title, $rel ).' data-toggle="tooltip" data-placement="'.esc_attr($tooltip_disp).'">';
$link_sufix .= '</a>';
}
}
if($tooltip_disp !== '' && $link_title == '' ){
$link_prefix .= '<div class="aio-tooltip '.esc_attr($uniqid).'" data-toggle="tooltip" data-placement="'.esc_attr($tooltip_disp).'" title="'.esc_attr($tooltip_text).'">';
$link_sufix .= '</div>';
}
$elx_class = '';
/* position fix */
if($icon_align == 'right')
$icon_align_style .= 'text-align:right;';
elseif($icon_align == 'center')
$icon_align_style .= 'text-align:center;';
elseif($icon_align == 'left')
$icon_align_style .= 'text-align:left;';
if($icon_type == 'custom'){
$img = apply_filters('ult_get_img_single', $icon_img, 'url');
$alt = apply_filters('ult_get_img_single', $icon_img, 'alt');
//$title = apply_filters('ult_get_img_single', $icon_img, 'title');
//$description = apply_filters('ult_get_img_single', $icon_img, 'description');
//$caption = apply_filters('ult_get_img_single', $icon_img, 'caption');
if($icon_style !== 'none'){
if($icon_color_bg !== '')
$style .= 'background:'.$icon_color_bg.';';
}
if($icon_style == 'circle'){
$elx_class.= ' uavc-circle ';
}
if($icon_style == 'square'){
$elx_class.= ' uavc-square ';
}
if($icon_style == 'hexagon'){
$elx_class.= ' uavc-hexagon ';
$style .= 'border-color:'.$icon_color_bg.';';
}
if($icon_style == 'advanced' && $icon_border_style !== '' ){
$style .= 'border-style:'.$icon_border_style.';';
$style .= 'border-color:'.$icon_color_border.';';
$style .= 'border-width:'.$icon_border_size.'px;';
$style .= 'padding:'.$icon_border_spacing.'px;';
$style .= 'border-radius:'.$icon_border_radius.'px;';
}
if(!empty($img)){
if($icon_link == '' || $icon_align == 'center') {
$style .= 'display:inline-block;';
}
$output .= "\n".$link_prefix.'<div class="aio-icon-img '.esc_attr($elx_class).'" style="font-size:'.esc_attr($img_width).'px;'.esc_attr($style).'" '.$css_trans.'>';
$output .= "\n\t".'<img class="img-icon" alt="'.esc_attr($alt).'" src="'.esc_url(apply_filters('ultimate_images', $img)).'"/>';
$output .= "\n".'</div>'.$link_sufix;
}
$output = $output;
} else {
if($icon_color !== '')
$style .= 'color:'.$icon_color.';';
if($icon_style !== 'none'){
if($icon_color_bg !== '')
$style .= 'background:'.$icon_color_bg.';';
}
if($icon_style == 'hexagon'){
$style .= 'border-color:'.$icon_color_bg.';';
}
if($icon_style == 'advanced'){
$style .= 'border-style:'.$icon_border_style.';';
$style .= 'border-color:'.$icon_color_border.';';
$style .= 'border-width:'.$icon_border_size.'px;';
$style .= 'width:'.$icon_border_spacing.'px;';
$style .= 'height:'.$icon_border_spacing.'px;';
$style .= 'line-height:'.$icon_border_spacing.'px;';
$style .= 'border-radius:'.$icon_border_radius.'px;';
}
if($icon_size !== '')
$style .='font-size:'.$icon_size.'px;';
if($icon_align !== 'left'){
$style .= 'display:inline-block;';
}
if($icon !== ""){
$output .= "\n".$link_prefix.'<div class="aio-icon '.esc_attr($icon_style).' '.esc_attr($elx_class).'" '.$css_trans.' style="'.esc_attr($style).'">';
$output .= "\n\t".'<i class="'.esc_attr($icon).'"></i>';
$output .= "\n".'</div>'.$link_sufix;
}
$output = $output;
}
if($tooltip_disp !== "" && $tooltip_text !== "" ){
$output .= '<script>
jQuery(function () {
jQuery(".'.esc_attr($uniqid).'").bsf_tooltip("hide");
})
</script>';
}
/* alignment fix */
if($icon_align_style !== ''){
$output = '<div class="align-icon" style="'.esc_attr($icon_align_style).'">'.$output.'</div>';
}
$output = '<div class="ult-just-icon-wrapper '.esc_attr($el_class).' '.esc_attr($css_just_icon).'">'.$output.'</div>';
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
}
}
}
if(class_exists('AIO_Just_Icon'))
{
$AIO_Just_Icon = new AIO_Just_Icon;
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_just_icon' ) ) {
class WPBakeryShortCode_just_icon extends WPBakeryShortCode {
}
}
@@ -0,0 +1,668 @@
<?php
/*
* Add-on Name: Creatve Link for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('AIO_creative_link'))
{
class AIO_creative_link
{
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'ultimate_createlink'));
}
add_shortcode('ult_createlink',array($this,'ult_createlink_shortcode'));
add_action( 'wp_enqueue_scripts', array( $this, 'creative_link_scripts'), 1 );
}
//enque script
function creative_link_scripts(){
Ultimate_VC_Addons::ultimate_register_style( 'ult_cllink', 'creative-link' );
Ultimate_VC_Addons::ultimate_register_script( 'jquery.ult_cllink', 'creative-link', false, array( 'jquery' ), ULTIMATE_VERSION, false );
}
// Shortcode handler function for stats Icon
function ult_createlink_shortcode($atts)
{
extract(shortcode_atts( array(
'btn_link' => '',
'text_color' => '#333333',
'text_hovercolor' => '#333333',
'background_color' => '#ffffff',
'bghovercolor' => '',
'font_family' => '',
'heading_style' => '',
'title_font_size' => '',
'title_line_ht' => '',
'link_hover_style' =>'',
'border_style' => 'solid',
'border_color' => '#333333',
'border_hovercolor' => '#333333',
'border_size' => '1',
'el_class' => '',
'dot_color' =>'#333333',
'css' =>'',
'title' =>'',
'text_style' =>'',
),$atts));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$href=$target=$text=$url= $alt_text= $rel = "";
if($btn_link !== ''){
$href = vc_build_link($btn_link);
$url = ( isset( $href['url'] ) && $href['url'] !== '' ) ? $href['url'] : '';
$target = ( isset( $href['target'] ) && $href['target'] !== '' ) ? esc_attr( trim( $href['target'] ) ) : '';
$alt_text = ( isset( $href['title'] ) && $href['title'] !== '' ) ? esc_attr($href['title']) : '';
$rel = ( isset( $href['rel'] ) && $href['rel'] !== '' ) ? esc_attr($href['rel']) : '';
if($url==''){
$url="javascript:void(0);";
}
}
else{
$url="javascript:void(0);";
}
/*--- design option---*/
if($title!==''){
$text=$title;
}
else{
$text=$alt_text;
}
$css_class ='';$title_style='';$secondtitle_style=$span_style='';
$css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css, ' ' ), "ult_createlink", $atts );
$css_class = esc_attr( $css_class );
if($link_hover_style=='Style_2'){
$span_style = 'background:'.$background_color.';'; //background-color
}
/*--- hover effect for link-----*/
$data_link='';
if($link_hover_style==''){
$data_link .='data-textcolor="'.esc_attr($text_color).'" ';
$data_link .='data-texthover="'.esc_attr($text_hovercolor).'"';
}
else{
$data_link .='data-textcolor="'.esc_attr($text_color).'" ';
$data_link .='data-texthover="'.esc_attr($text_hovercolor).'"';
}
if($link_hover_style=='Style_2'){
if($text_hovercolor==''){
$text_hovercolor=$text_color;
}
if($bghovercolor==''){
$bghovercolor=$background_color;
}
if($text_hovercolor=='' && $bghovercolor==''){
$data_link .='data-bgcolor="'.esc_attr($background_color).'"';
$data_link .='data-bghover="'.esc_attr($background_color).'"';
//$data_link .='data-texthover="'.$text_color.'"';
}
else{
$data_link .='data-bgcolor="'.esc_attr($background_color).'"';
$data_link .='data-bghover="'.esc_attr($bghovercolor).'"';
}
}
$data_link .='data-style="'.esc_attr($link_hover_style).'"';
/*--- border style---*/
$data_border='';
if($border_style!=''){
$data_border .='border-color:'.$border_color.';';
$data_border .='border-width:'.$border_size.'px;';
$data_border .='border-style:'.$border_style.';';
}
$main_span=$before=$borderhover=$ult_style2css=$ult_style11css='';
$after='';$style=$class=$id=$colorstyle=$borderstyle=$style11_css_class='';
/*---- text typography----*/
if($text_style!=''){
$colorstyle.='float:'.$text_style.';';
}
if (function_exists('get_ultimate_font_family')) {
$mhfont_family = get_ultimate_font_family($font_family); //for font family
if($mhfont_family!=''){
$colorstyle .= 'font-family:'.$mhfont_family.';';
}
//$secondtitle_style .='font-family:'.$mhfont_family.';';
}
if (function_exists('get_ultimate_font_style')) {
//for font style
$colorstyle .= get_ultimate_font_style($heading_style);
//$secondtitle_style .=get_ultimate_font_style($heading_style);
}
//Responsive param
if(is_numeric($title_font_size)){
$title_font_size = 'desktop:'.$title_font_size.'px;';
}
if(is_numeric($title_line_ht)){
$title_line_ht = 'desktop:'.$title_line_ht.'px;';
}
$creative_link_id = 'creative-link-wrap-'.rand(1000, 9999);
$creative_link_args = array(
'target' => '#'.$creative_link_id.' .ult_colorlink', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $title_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $title_line_ht
),
);
$creative_link_data_list = get_ultimate_vc_responsive_media_css($creative_link_args);
//font-size
$title_style .= 'color:'.$text_color.';';//color
/*-- hover style---*/
$id='';
if($link_hover_style=='Style_1'){ //style1
$class .='ult_cl_link_1';
//$id .='ult_cl_link_1';
$colorstyle .='color:'.$text_color.';'; //text color for bracket
if($title_font_size!=''){
//$colorstyle .='font-size:'.$title_font_size.'px;';
}
}
else if($link_hover_style=='Style_2'){ //style2
$class .='ult_cl_link_2';
//$id .='ult_cl_link_2';
}
else if($link_hover_style=='Style_3'){ //style3
$class .='ult_cl_link_3';
//$id .='ult_cl_link_3';
$data_border='';
$data_border .='border-color:'.$border_color.';';
$data_border .='border-bottom-width:'.$border_size.'px;';
$data_border .='border-style:'.$border_style.';';
if($title_font_size!=''){
//$colorstyle .='font-size:'.$title_font_size.'px;';
}
$borderstyle .=$data_border; //text color for btm border
$after .='<span class="ult_link_btm3 " style="'.esc_attr($borderstyle).'"></span>';
}
else if($link_hover_style=='Style_4'){ //style4
$class .='ult_cl_link_4';
//$id .='ult_cl_link_4';
$data_border='';
$data_border .='border-color:'.$border_color.';';
$data_border .='border-bottom-width:'.$border_size.'px;';
$data_border .='border-style:'.$border_style.';';
if($title_font_size!=''){
///$colorstyle .='font-size:'.$title_font_size.'px;';
}
$borderstyle .=$data_border; //text color for btm border
$after .='<span class="ult_link_btm4 " style="'.esc_attr($borderstyle).'"></span>';
}
else if($link_hover_style=='Style_6'){ //style6
$class .='ult_cl_link_6';
//$id .='ult_cl_link_6';//
$colorstyle .='color:'.$text_hovercolor.';';
if($title_font_size!=''){
//$colorstyle .='font-size:'.$title_font_size.'px;';
}
$after .='<span class="ult_btn6_link_top " data-color="'.esc_attr($dot_color).'">•</span>';
}
else if($link_hover_style=='Style_5'){ //style5
$class .='ult_cl_link_5';
//$id .='ult_cl_link_5';//
if($title_font_size!=''){
//$colorstyle .='font-size:'.$title_font_size.'px;';
}
$data_border='';
$data_border .='border-color:'.$border_color.';';
$data_border .='border-bottom-width:'.$border_size.'px;';
$data_border .='border-style:'.$border_style.';';
$borderstyle .=$data_border; //text color for btm border
$before='<span class="ult_link_top" style="'.esc_attr($borderstyle).'"></span>';
$after .='<span class="ult_link_btm " style="'.esc_attr($borderstyle).'"></span>';
}
else if($link_hover_style=='Style_7'){ //style7
$class .='ult_cl_link_7';
//$id .='ult_cl_link_7';//
//$colorstyle .='font-size:'.$title_font_size.'px;';
$borderstyle .='background:'.$border_color.';';
$borderstyle .='height:'.$border_size.'px;';
$before='<span class="ult_link_top btn7_link_top " style="'.esc_attr($borderstyle).'"></span>';
$after .='<span class="ult_link_btm btn7_link_btm" style="'.esc_attr($borderstyle).'"></span>';
}
else if($link_hover_style=='Style_8'){ //style8
$class .='ult_cl_link_8';
//$id .='ult_cl_link_8';//
if($title_font_size!=''){
//$colorstyle .='font-size:'.$title_font_size.'px;';
}
$borderstyle .='outline-color:'.$border_color.';';
$borderstyle .='outline-width:'.$border_size.'px;';
$borderstyle .='outline-style:'.$border_style.';'; //text color for btm border
$borderhover .='outline-color:'.$border_hovercolor.';';
$borderhover .='outline-width:'.$border_size.'px;';
$borderhover .='outline-style:'.$border_style.';'; //text color for btm border
$before='<span class="ult_link_top ult_btn8_link_top " style="'.esc_attr($borderstyle).'"></span>';
$after .='<span class="ult_link_btm ulmt_btn8_link_btm" style="'.esc_attr($borderhover).'"></span>';
}
else if($link_hover_style=='Style_9'){ //style9
$class .='ult_cl_link_9';
//$id .='ult_cl_link_9';//
if($title_font_size!=''){
//$colorstyle .='font-size:'.$title_font_size.'px;';
}
//$borderstyle .='background:'.$border_color.';';
//$borderstyle .='height:'.$border_size.'px;';
$borderstyle .= 'border-top-width:'.$border_size.'px;';
$borderstyle .= 'border-top-style:'.$border_style.';';
$borderstyle .= 'border-top-color:'.$border_color.';';
//$borderstyle .='height:'; //text color for btm border
$before='<span class="ult_link_top ult_btn9_link_top " style="'.esc_attr($borderstyle).'"></span>';
$after .='<span class="ult_link_btm ult_btn9_link_btm" style="'.esc_attr($borderstyle).'"></span>';
}
else if($link_hover_style=='Style_10'){ //style10
$class .='ult_cl_link_10';
//$id .='ult_cl_link_10';//
if($title_font_size!=''){
//$colorstyle .='font-size:'.$title_font_size.'px;';
}
$borderstyle .='background:'.$border_color.';';
$borderstyle .='height:'.$border_size.'px;';
$span_style .= 'background:'.$background_color.';';
if($border_style!=''){
$span_style .= 'border-top:'.$border_size.'px '.$border_style.' '.$border_color.';';
}
$span_style1='';
$span_style1 .= 'background:'.$bghovercolor.';';
}
else if($link_hover_style=='Style_11'){
//style11
$style11_css_class='';
$style11_css_class=$css_class;
$css_class='';
$class .='ult_cl_link_11';
//$id .='ult_cl_link_11';//
$span_style .='background:'.$background_color.';';
$span_style1='';
$span_style1 .= 'background:'.$bghovercolor.';';
$span_style1 .= 'color:'.$text_hovercolor.';';
//$span_style1 .= $secondtitle_style;
//padding
$ult_style2css=$css_class;
$css_class='';
$domain = strstr($css, 'padding');
$domain=(explode("}",$domain));
$ult_style11css=$domain[0];
$before='<span class="ult_link_top ult_btn11_link_top " style="'.esc_attr($span_style1).';'.esc_attr($ult_style11css).'">'.$text.'</span>';
}
//echo $bghovercolor;
//$text=ucfirst($text);
$text=$text;
if($link_hover_style=='Style_2'){
$ult_style2css=$css_class;
$css_class='';
}
$output='';
if($link_hover_style!='Style_10'){
$output .='<span id="'.esc_attr($creative_link_id).'" class="ult_main_cl '.esc_attr($is_vc_49_plus).' '.esc_attr($el_class).' '.esc_attr($style11_css_class).'" >
<span class="'.esc_attr($class).' ult_crlink" >
<a '.$creative_link_data_list.' '. Ultimate_VC_Addons::uavc_link_init($url, $target, $alt_text, $rel ).' class="ult_colorlink ult-responsive '.esc_attr($css_class) .'" style="'.esc_attr($colorstyle).' " '.$data_link.'>
'.$before.'
<span data-hover="'.esc_attr($text).'" style="'.esc_attr($title_style).';'.esc_attr($span_style).';'.esc_attr($ult_style11css).'" class="ult_btn10_span '.esc_attr($ult_style2css).' ">'.$text.'</span>
'.$after.'
</a>
</span>
</span>';
}
else if($link_hover_style=='Style_10'){
$output .='<span id="'.esc_attr($creative_link_id).'" class=" ult_main_cl '.esc_attr($el_class).'" >
<span class="'.esc_attr($class).' ult_crlink" id="'.esc_attr($id).'">
<a '.$creative_link_data_list.' '. Ultimate_VC_Addons::uavc_link_init($url, $target, $alt_text, $rel ).' class="ult_colorlink ult-responsive " style="'.esc_attr($colorstyle).' " '.$data_link.'>
<span class="ult_btn10_span '.esc_attr($css_class) .'" style="'.esc_attr($span_style).'" data-color="'.esc_attr($border_color).'" data-bhover="'.esc_attr($bghovercolor).'" data-bstyle="'.esc_attr($border_style).'">
<span class="ult_link_btm ult_btn10_link_top" style="'.esc_attr($span_style1).'">
<span style="'.esc_attr($title_style).';color:'.esc_attr($text_hovercolor).'" class="style10-span">'.$text.'</span>
</span>
<span style="'.esc_attr($title_style).';">'.$text.'</span>
</span>
</a>
</span>
</span>';
}
if($text!=''){
$is_preset = false; // Preset setting array display
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
}
//return $output;
}
function ultimate_createlink()
{
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Creative Link"),
"base" => "ult_createlink",
"icon"=>"uvc_creative_link",
"category" => __("Ultimate VC Addons","ultimate_vc"),
"description" => __("Add a custom link.","ultimate_vc"),
"params" => array(
// Play with icon selector
array(
"type" => "textfield",
"class" => "",
"admin_label" => true,
"heading" => __("Title", "ultimate_vc"),
"param_name" => "title",
"value" => "",
//"description" => __("Ran out of options? Need more styles? Write your own CSS and mention the class name here.", "ultimate_vc"),
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Link ","ultimate_vc"),
"param_name" => "btn_link",
"value" => "",
"description" => __("Add a custom link or select existing page. You can remove existing link as well.","ultimate_vc"),
//"group" => "Title Setting",
),
/*---typography-------*/
array(
"type" => "ult_param_heading",
"param_name" => "bt1typo-setting",
"text" => __("Typography", "ultimate"),
"value" => "",
"class" => "",
"group" => "Typography ",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Title Font Family", "ultimate_vc"),
"param_name" => "font_family",
"description" => __("Select the font of your choice. ","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-google-font-manager' target='_blank' rel='noopener'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography ",
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "heading_style",
"group" => "Typography ",
),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "title_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography ",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "title_line_ht",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography ",
),
/*-----------general------------*/
array(
"type" => "dropdown",
"class" => "",
"admin_label" => true,
"heading" => __("Link Style", "ultimate_vc"),
"param_name" => "link_hover_style",
"value" => array(
"None"=> "",
"Style 1"=> "Style_1",
"Style 2" => "Style_2",
"Style 3" => "Style_3",
"Style 4"=> "Style_4",
"Style 5" => "Style_5",
"Style 6" => "Style_6",
/*"Style 7" => "Style_7",*/
"Style 7" => "Style_8",
"Style 8" => "Style_9",
"Style 9" => "Style_10",
"Style 10" => "Style_11",
),
"description" => __("Select the Hover style for Link.","ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"param_name" => "button1bg_settng",
"text" => __("Color Settings", "ultimate_vc"),
"value" => "",
"class" => "",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Link Color", "ultimate_vc"),
"param_name" => "text_color",
"value" => "#333333",
"description" => __("Select text color for Link.", "ultimate_vc"),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Link Hover Color", "ultimate_vc"),
"param_name" => "text_hovercolor",
"value" => "#333333",
"description" => __("Select text hover color for Link.", "ultimate_vc"),
//"dependency" => Array("element" => "link_hover_style","not_empty" => true),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Link Background Color", "ultimate_vc"),
"param_name" => "background_color",
"value" => "#ffffff",
"description" => __("Select Background Color for link.", "ultimate_vc"),
//"group" => "Title Setting",
"dependency" => Array("element" => "link_hover_style","value" => array("Style_2","Style_10","Style_11")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Link Background Hover Color", "ultimate_vc"),
"param_name" => "bghovercolor",
"value" => "",
"description" => __("Select background hover color for link.", "ultimate_vc"),
"dependency" => Array("element" => "link_hover_style","value" => array("Style_2","Style_10","Style_11")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Border Style", "ultimate_vc"),
"param_name" => "border_style",
"value" => array(
/*"None"=> " ",*/
"Solid"=> "solid",
"Dashed" => "dashed",
"Dotted" => "dotted",
"Double" => "double",
"Inset" => "inset",
"Outset" => "outset",
),
"description" => __("Select the border style for link.","ultimate_vc"),
"dependency" => Array("element" => "link_hover_style","value" => array("Style_3","Style_4","Style_5","Style_7","Style_8","Style_9","Style_10")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Link Border Color", "ultimate_vc"),
"param_name" => "border_color",
"value" => "#333333",
"description" => __("Select border color for link.", "ultimate_vc"),
//"dependency" => Array("element" => "border_style", "not_empty" => true),
"dependency" => Array("element" => "border_style", "value" => array("solid","dashed","dotted","double","inset","outset")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Link Border HoverColor", "ultimate_vc"),
"param_name" => "border_hovercolor",
"value" => "#333333",
"description" => __("Select border hover color for link.", "ultimate_vc"),
"dependency" => Array(
"element"=>"link_hover_style","value" => array("Style_8"),
/*"element" => "border_style", "not_empty" => true*/ ),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Link Border Width", "ultimate_vc"),
"param_name" => "border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
//"dependency" => Array("element" => "border_style", "not_empty" => true),
"dependency" => Array("element" => "border_style", "value" => array("solid","dashed","dotted","double","inset","outset")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Link Dot Color", "ultimate_vc"),
"param_name" => "dot_color",
"value" => "#333333",
"description" => __("Select color for dots.", "ultimate_vc"),
"dependency" => Array("element"=>"link_hover_style","value" => array("Style_6")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Link Alignment", "ultimate_vc"),
"param_name" => "text_style",
"value" => array(
"Center"=> " ",
"Left"=> "left",
"Right" => "right",
),
"description" => __("Select the text align for link.","ultimate_vc"),
//"group" => "Typography ",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Custom CSS Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Ran out of options? Need more styles? Write your own CSS and mention the class name here.", "ultimate_vc"),
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
),
)
);
}
}
}
}
if(class_exists('AIO_creative_link'))
{
$AIO_creative_link = new AIO_creative_link;
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ult_createlink' ) ) {
class WPBakeryShortCode_ult_createlink extends WPBakeryShortCode {
}
}
@@ -0,0 +1,456 @@
<?php
/*
* Add-on Name: Icons Block for WPBakery Page Builder
*/
if(!class_exists('Ultimate_List_Icon'))
{
class Ultimate_List_Icon
{
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'list_icon_init'));
}
add_shortcode('ultimate_icon_list',array($this,'ultimate_icon_list_shortcode'));
add_shortcode('ultimate_icon_list_item',array($this,'icon_list_item_shortcode'));
}
function list_icon_init()
{
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("List Icon","ultimate_vc"),
"base" => "ultimate_icon_list",
"class" => "ultimate_icon_list",
"icon" => "ultimate_icon_list",
"category" => "Ultimate VC Addons",
"description" => __("Add a set of multiple icons and give some custom style.","ultimate_vc"),
"as_parent" => array('only' => 'ultimate_icon_list_item'),
"content_element" => true,
"show_settings_on_create" => true,
"js_view" => 'VcColumnView',
//"is_container" => true,
"params" => array(
// Play with icon selector
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => '',
"min" => 0,
"max" => 200,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
//"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Space after Icon", "ultimate_vc"),
"param_name" => "icon_margin",
"value" => '',
"min" => 0,
"max" => 100,
"suffix" => "px",
"description" => __("How much distance would you like in two icons?", "ultimate_vc"),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class","ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Write your own CSS and mention the class name here.", "ultimate_vc"),
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_icon_list',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)
)
);
vc_map(
array(
"name" => __("List Icon Item","ultimate_vc"),
"base" => "ultimate_icon_list_item",
"class" => "icon_list_item",
"icon" => "icon_list_item",
"category" => "Ultimate VC Addons",
"description" => __("Add a list of icons with some content and give some custom style.","ultimate_vc"),
"as_child" => array('only' => 'ultimate_icon_list'),
"show_settings_on_create" => true,
"is_container" => false,
"params" => array(
// Play with icon selector
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use an existing font icon or upload a custom image.", "ultimate_vc")
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "#333333",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "#ffffff",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "textarea_html",
"class" => "",
"heading" => __("List content", "ultimate_vc"),
"param_name" => "content",
"value" => "",
"description" => __("Enter the list content here.", "ultimate_vc"),
"edit_field_class" => "ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param",
"group"=> "List Content",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Custom CSS Class", "smile"),
"param_name" => "el_class",
"value" => "",
"description" => __("Ran out of options? Need more styles? Write your own CSS and mention the class name here.", "ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"param_name" => "title_text_typography",
"heading" => __("List content settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "content_font_family",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "content_font_style",
"value" => "",
"group" => "Typography"
),
// array(
// "type" => "number",
// "param_name" => "content_font_size",
// "heading" => __("Font size","ultimate_vc"),
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "param_name" => "content_line_ht",
// "heading" => __("Line Height","ultimate_vc"),
// "value" => "",
// "suffix" => "px",
// "group" => "Typography",
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "content_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "content_line_ht",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"param_name" => "content_font_color",
"heading" => __("Color","ultimate_vc"),
"group" => "Typography"
),
),
)
);
}
}
// Shortcode handler function for list Icon
function ultimate_icon_list_shortcode($atts,$content = null)
{
global $vc_list_icon_size, $vc_list_icon_margin;
$el_class = '';
extract(shortcode_atts(array(
"icon_size" => "32",
"icon_margin" => "5",
"el_class" => "",
"css_icon_list" => "",
),$atts));
$css_icon_list = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_icon_list, ' ' ), "ultimate_icon_list", $atts );
$css_icon_list = esc_attr( $css_icon_list );
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
$vc_list_icon_size = $icon_size;
$vc_list_icon_margin = $icon_margin;
// enqueue js
//wp_enqueue_script('aio-tooltip',plugins_url('../assets/min-js/',__FILE__).'tooltip.min.js',array('jquery'));
$output = '<div class="uavc-list-icon uavc-list-icon-wrapper '.esc_attr($is_vc_49_plus).' '.esc_attr($el_class).' '.esc_attr($css_icon_list).' '.esc_attr($css_icon_list).'">';
$output .= '<ul class="uavc-list">';
$output .= do_shortcode($content);
$output .= '</ul>';
$output .= '</div>';
return $output;
}
function icon_list_item_shortcode($atts, $content = null){
$icon_type = $icon_img = $img_width = $icon = $icon_color = $icon_color_bg = $icon_size = $icon_style = $icon_border_style = $icon_border_radius = $icon_color_border = $icon_border_size = $icon_border_spacing = $icon_link = $el_class = $icon_animation = $tooltip_disp = $tooltip_text = $icon_margin = '';
$content_font_family = $content_font_style = $content_font_size = $content_line_ht = $content_font_color = $css_icon_list = '';
extract(shortcode_atts( array(
'icon_type' => 'selector',
'icon'=> '',
'icon_img' => '',
'icon_color' => '#333333',
'icon_style' => 'none',
'icon_color_bg' => '#ffffff',
'icon_color_border' => '#333333',
'icon_border_style' => '',
'icon_border_size' => '1',
'icon_border_radius' => '500',
'icon_border_spacing' => '50',
"icon_size" => "",
"icon_margin" => "",
'el_class'=>'',
'content_font_family' => '',
'content_font_style' => '',
'content_font_size' => '',
'content_font_color' => '',
'content_line_ht' => '',
'content_font_size' => '',
),$atts));
global $vc_list_icon_size, $vc_list_icon_margin;
if(empty($icon_size))
$icon_size = $vc_list_icon_size;
if(empty($icon_margin))
$icon_margin = $vc_list_icon_margin;
if($icon_animation !== 'none')
{
$css_trans = 'data-animation="'.esc_attr($icon_animation).'" data-animation-delay="03"';
}
$output = $style = $link_sufix = $link_prefix = $target = $content_style = $href = $icon_align_style = '';
if($icon_margin !== '') {
if ( is_rtl() ) {
$style .= 'margin-left:'.$icon_margin.'px;';
} else {
$style .= 'margin-right:'.$icon_margin.'px;';
}
}
if($content_font_family != ''){
$apply_font_family = get_ultimate_font_family($content_font_family);
if($apply_font_family)
$content_style .= 'font-family:\''.$apply_font_family.'\';';
}
if($content_font_style != ''){
$content_style .= get_ultimate_font_style($content_font_style);
}
if($content_font_color !='')
$content_style .= 'color:'.$content_font_color.';';
// if($content_font_size != '')
// $content_style .= 'font-size:'.$content_font_size.'px;';
// if($content_line_ht)
// $content_style .='line-height:'.$content_line_ht.'px;';
if(is_numeric($content_font_size)){
$content_font_size = 'desktop:'.$content_font_size.'px;';
}
if(is_numeric($content_line_ht)){
$content_line_ht = 'desktop:'.$content_line_ht.'px;';
}
$list_icon_id = 'list-icon-wrap-'.rand(1000, 9999);
$list_icon_args = array(
'target' => '#'.$list_icon_id.' .uavc-list-desc', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $content_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $content_line_ht
),
);
$list_icon_data_list = get_ultimate_vc_responsive_media_css($list_icon_args);
$icon_animation = $icon_link = '';
$output .= '<div class="uavc-list-content" id="'.esc_attr($list_icon_id).'">';
if($icon !== "" || $icon_img !== ''){
if($icon_type == 'custom'){
$icon_style = 'none';
}
$main_icon = do_shortcode('[just_icon icon_type="'.esc_attr($icon_type).'" icon="'.esc_attr($icon).'" icon_img="'.esc_attr($icon_img).'" img_width="'.esc_attr($icon_size).'" icon_size="'.esc_attr($icon_size).'" icon_color="'.esc_attr($icon_color).'" icon_style="'.esc_attr($icon_style).'" icon_color_bg="'.esc_attr($icon_color_bg).'" icon_color_border="'.esc_attr($icon_color_border).'" icon_border_style="'.esc_attr($icon_border_style).'" icon_border_size="'.esc_attr($icon_border_size).'" icon_border_radius="'.esc_attr($icon_border_radius).'" icon_border_spacing="'.esc_attr($icon_border_spacing).'" icon_link="'.esc_attr($icon_link).'" icon_animation="'.esc_attr($icon_animation).'"]');
$output .= "\n".'<div class="uavc-list-icon '.esc_attr($el_class).' '.esc_attr($css_icon_list).'" '.$css_trans.' style="'.esc_attr($style).'">';
$output .= $main_icon;
$output .= "\n".'</div>';
}
$output .= '<span '.$list_icon_data_list.' class="uavc-list-desc ult-responsive" style="'.esc_attr($content_style).'">'.do_shortcode($content).'</span>';
$output .= '</div>';
$output = '<li>'.$output.'</li>';
return $output;
}
}
}
if(class_exists('Ultimate_List_Icon'))
{
$Ultimate_List_Icon = new Ultimate_List_Icon;
}
//Extend WPBakeryShortCodesContainer class to inherit all required functionality
if ( class_exists( 'WPBakeryShortCodesContainer' ) && !class_exists( 'WPBakeryShortCode_ultimate_icon_list' ) ) {
class WPBakeryShortCode_ultimate_icon_list extends WPBakeryShortCodesContainer {
}
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ultimate_icon_list_item' ) ) {
class WPBakeryShortCode_ultimate_icon_list_item extends WPBakeryShortCode {
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,728 @@
<?php
/*
* Add-on Name: Pricing Tables for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists("Ultimate_Pricing_Table")){
class Ultimate_Pricing_Table{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action("init",array($this,"ultimate_pricing_init"));
}
add_shortcode("ultimate_pricing",array($this,"ultimate_pricing_shortcode"));
add_action( 'wp_enqueue_scripts', array( $this, 'price_table_assets' ), 1 );
}
function price_table_assets() {
Ultimate_VC_Addons::ultimate_register_style( 'ultimate-pricing', 'pricing' );
}
function ultimate_pricing_init(){
if(function_exists("vc_map")){
vc_map(
array(
"name" => __("Price Box","ultimate_vc"),
"base" => "ultimate_pricing",
"class" => "vc_ultimate_pricing",
"icon" => "vc_ultimate_pricing",
"category" => "Ultimate VC Addons",
"description" => __("Create nice looking pricing tables.","ultimate_vc"),
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Select Design Style", "ultimate_vc"),
"param_name" => "design_style",
"value" => array(
__("Design 01","ultimate_vc") => "design01",
__("Design 02","ultimate_vc") => "design02",
__("Design 03","ultimate_vc") => "design03",
__("Design 04","ultimate_vc") => "design04",
__("Design 05","ultimate_vc") => "design05",
__("Design 06","ultimate_vc") => "design06",
),
"description" => __("Select Pricing table design you would like to use", "ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Select Color Scheme", "ultimate_vc"),
"param_name" => "color_scheme",
"value" => array(
__("Black","ultimate_vc") => "black",
__("Red","ultimate_vc") => "red",
__("Blue","ultimate_vc") => "blue",
__("Yellow","ultimate_vc") => "yellow",
__("Green","ultimate_vc") => "green",
__("Gray","ultimate_vc") => "gray",
__("Design Your Own","ultimate_vc") => "custom",
),
"description" => __("Which color scheme would like to use?", "ultimate_vc")
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Main background Color", "ultimate_vc"),
"param_name" => "color_bg_main",
"value" => "",
"description" => __("Select normal background color.", "ultimate_vc"),
"dependency" => Array("element" => "color_scheme","value" => array("custom")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Main text Color", "ultimate_vc"),
"param_name" => "color_txt_main",
"value" => "",
"description" => __("Select normal background color.", "ultimate_vc"),
"dependency" => Array("element" => "color_scheme","value" => array("custom")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Highlight background Color", "ultimate_vc"),
"param_name" => "color_bg_highlight",
"value" => "",
"description" => __("Select highlight background color.", "ultimate_vc"),
"dependency" => Array("element" => "color_scheme","value" => array("custom")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Highlight text Color", "ultimate_vc"),
"param_name" => "color_txt_highlight",
"value" => "",
"description" => __("Select highlight background color.", "ultimate_vc"),
"dependency" => Array("element" => "color_scheme","value" => array("custom")),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Package Name / Title", "ultimate_vc"),
"param_name" => "package_heading",
"admin_label" => true,
"value" => "",
"description" => __("Enter the package name or table heading", "ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Package Name / Title Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h3",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H3", "ultimate_vc"),
'edit_field_class' => 'ult-param-padding-remove vc_col-sm-4',
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Sub Heading", "ultimate_vc"),
"param_name" => "package_sub_heading",
"value" => "",
"description" => __("Enter short description for this package", "ultimate_vc"),
'edit_field_class' => 'vc_col-sm-8',
),
array(
"type" => "dropdown",
"heading" => __("Sub Heading Tag","ultimate_vc"),
"param_name" => "sub_heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h5",
__("H1","ultimate_vc") => "h1",
__("H2","ultimate_vc") => "h2",
__("H3","ultimate_vc") => "h3",
__("H4","ultimate_vc") => "h4",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H5", "ultimate_vc"),
'edit_field_class' => 'ult-param-padding-remove vc_col-sm-4',
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Package Price", "ultimate_vc"),
"param_name" => "package_price",
"value" => "",
"description" => __("Enter the price for this package. e.g. $157", "ultimate_vc"),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Price Unit", "ultimate_vc"),
"param_name" => "package_unit",
"value" => "",
"description" => __("Enter the price unit for this package. e.g. per month", "ultimate_vc"),
),
array(
"type" => "textarea_html",
"class" => "",
"heading" => __("Features", "ultimate_vc"),
"param_name" => "content",
"value" => "",
"description" => __("Create the features list using un-ordered list elements.", "ultimate_vc"),
"edit_field_class" => "ult_hide_editor_fullscreen vc_col-xs-12 vc_column wpb_el_type_textarea_html vc_wrapper-param-type-textarea_html vc_shortcode-param",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Button Text", "ultimate_vc"),
"param_name" => "package_btn_text",
"value" => "",
"description" => __("Enter call to action button text", "ultimate_vc"),
),
array(
"type" => "vc_link",
"class" => "",
"heading" => __("Button Link", "smile"),
"param_name" => "package_link",
"value" => "",
"description" => __("Select / enter the link for call to action button", "ultimate_vc"),
),
array(
"type" => "checkbox",
"class" => "",
"heading" => "",
"param_name" => "package_featured",
"value" => array("Make this pricing box as featured" => "enable"),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Minimum Height For Price Box", "ultimate_vc"),
"param_name" => "min_ht",
"min" => "",
"suffix" => "px",
"description" => __("Adjust height of your price box.", "ultimate_vc")
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "js_composer"),
"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.", "ultimate_vc")
),
/* typoraphy - package */
array(
"type" => "ult_param_heading",
"text" => __("Package Name/Title Settings","ultimate_vc"),
"param_name" => "package_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "package_name_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "package_name_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "package_name_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "package_name_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "package_name_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "package_name_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "package_name_font_color",
"value" => "",
"group" => "Typography"
),
/* typoraphy - sub heading */
array(
"type" => "ult_param_heading",
"text" => __("Sub-Heading Settings","ultimate_vc"),
"param_name" => "subheading_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "subheading_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "subheading_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "subheading_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "subheading_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "subheading_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "subheading_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "subheading_font_color",
"value" => "",
"group" => "Typography"
),
/* typoraphy - price */
array(
"type" => "ult_param_heading",
"text" => __("Price Settings","ultimate_vc"),
"param_name" => "price_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "price_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "price_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "price_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "price_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "price_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "price_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "price_font_color",
"value" => "",
"group" => "Typography"
),
/* typoraphy - price unit*/
array(
"type" => "ult_param_heading",
"text" => __("Price Unit Settings","ultimate_vc"),
"param_name" => "price_unit_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "smile"),
"param_name" => "price_unit_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "price_unit_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "price_unit_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "price_unit_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "price_unit_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "price_unit_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "price_unit_font_color",
"value" => "",
"group" => "Typography"
),
/* typoraphy - feature*/
array(
"type" => "ult_param_heading",
"text" => __("Features Settings","ultimate_vc"),
"param_name" => "features_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "features_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "features_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "features_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "features_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "features_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "features_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "features_font_color",
"value" => "",
"group" => "Typography"
),
/* typoraphy - button */
array(
"type" => "ult_param_heading",
"text" => __("Button Settings","ultimate_vc"),
"param_name" => "button_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "button_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "button_font_style",
"group" => "Typography"
),
// array(
// "type" => "number",
// "class" => "font-size",
// "heading" => __("Font Size", "ultimate_vc"),
// "param_name" => "button_font_size",
// "min" => 10,
// "suffix" => "px",
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Line Height", "ultimate_vc"),
// "param_name" => "button_line_height",
// "value" => "",
// "suffix" => "px",
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "button_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "button_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "button_font_color",
"value" => "",
"group" => "Typography"
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_price_box',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)// params
));// vc_map
}
}
function ultimate_pricing_shortcode($atts,$content = null){
$design_style = '';
extract(shortcode_atts(array(
"design_style" => "design01",
),$atts));
$output = '';
require_once(__ULTIMATE_ROOT__.'/templates/pricing/pricing-'.$design_style.'.php');
$design_func = 'ult_price_generate_'.$design_style;
$output .= $design_func($atts,$content);
$is_preset = false; //Display settings for Preset
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
}
} // class Ultimate_Pricing_Table
new Ultimate_Pricing_Table;
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ultimate_pricing' ) ) {
class WPBakeryShortCode_ultimate_pricing extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,814 @@
<?php
/*
* Module - Range Slider
*/
if( !class_exists( "Ultimate_Range_Slider" ) ){
/**
* Ultimate_Range_Slider Class
*/
class Ultimate_Range_Slider
{
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action( 'init', array($this, 'init_range_slider') );
}
add_shortcode( 'ult_range_slider',array( $this,'ult_range_slider_shortcode' ) );
add_action( "wp_enqueue_scripts", array( $this, "range_slider_scripts" ), 1 );
}
function ult_range_slider_shortcode( $atts, $content=null )
{
$slider_color = "";//$slider_active_color = $dragger_color = "";
$title_box_color = $title_border = $title_box = $title_box_width = $title_box_height = $title_padding = "";
$el_class = "";
//$slider_steps =
$slider_bar_size = "";//$dragger_size = "";
$slider_data = "";
$title_font = $title_font_size = $title_line_height = $title_color = $title_font_style = '';
$desc_font = $desc_font_size = $desc_line_height = $desc_color = $desc_font_style = '';
$desc_width = $desc_padding = $desc_margin = $adaptive_height = '';//$desc_min_height = '';
extract( shortcode_atts( array(
'slider_color' => '',
//'slider_active_color' => '',
//'dragger_color' => '',
'title_box_color' => '',
'title_border' => 'border-style:solid;|border-width:2px;border-radius:0px;|border-color:#30eae9;',
'title_box' => '',
'title_box_width' => '',
'title_box_height' => '',
'title_padding' => '',
'el_class' => '',
//'slider_steps' => '',
'slider_data' => '',
'slider_bar_size' => '',
//'dragger_size' => '',
'title_font' => '',
'title_font_size' => '',
'title_line_height' => '',
'title_color' => '',
'title_font_style'=> '',
'desc_font'=> '',
'desc_font_size'=> '',
'desc_line_height' => '',
'desc_color' => '',
'desc_font_style'=> '',
'desc_width' => '',
'adaptive_height' => '',
// 'desc_min_height' => '',
'desc_padding' => '',
'desc_margin' => '',
), $atts ) );
$steps_count = 0;
$title_count = 1;
$desc_count = 1;
$output = '';
//slider color setting setting
$slider_color_data = '';
$slider_color_data .= $slider_color != ''? " data-slider_color = '".esc_attr($slider_color)."'" : '';
//$slider_color_data .= $slider_active_color != ''? " data-slider_active_color = '".$slider_active_color."'" : '' ;
//$slider_color_data .= $dragger_color != '' ? " data-dragger_color = '".$dragger_color."'" : '';
// Title box style
$title_box_data = $title_box_color != '' ? "data-title-background = ".esc_attr($title_box_color)." " : '';
$title_box_data .= $title_box != '' ? " data-title-box = ".esc_attr($title_box)." " : " data-title-box = auto ";
$title_style = " style = '"; //title box style var
$arrow_style = "";
$none_style = "ult-tooltip-border ult-arrow";
//echo $title_border;
if (strpos($title_border,'none') !== false) {
$none_style = "";
}
else{
$arrow_style = " data-arrow = '";
if (strpos($title_border,'border-width:0px') !== false) {
$none_style = "";
}
$temp_array = array();
$temp_border = str_replace( '|', '', $title_border );
$title_style .= $temp_border;
$title_style .= $title_box_color == '' ? '' : "background:".$title_box_color."; ";
$temp_array = explode(";", $temp_border);
if( is_array( $temp_array ) ){
foreach ($temp_array as $key => $value) {
if ( strpos($value,'border-width:') !== false ) {
$value = str_replace( 'border-width:', '', $value );
$value = str_replace( 'px', '', $value );
$value = $value + 7;
$arrow_style .= " border-width:".$value."px; ";
$arrow_style .= "margin-left:-".$value."px; ";
}elseif( strpos($value,'border-color:') !== false ) {
$value = str_replace( 'border-color', 'border-top-color', $value );
$value = $value."; ";
$arrow_style .= $value;
}
}
}
$arrow_style .= "'";
}
$title_style .= $title_padding !== '' ? ' '.$title_padding.';' : '';
//title box custom width
$center_class = '';
$title_box_width_t = $title_box_height_t = $slider_padding = '';
if( $title_box == 'custom' ){
$center_class = ' ult-tooltip-center';
$title_box_width_t = $title_box_width !== '' ? $title_box_width : '115';
$title_box_height_t = $title_box_height !== '' ? $title_box_height : '115';
$title_style .= ' width:'.$title_box_width_t.'px;';
$title_style .= ' height:'.$title_box_height_t.'px;';
//apply this time padding to slider for tooltip adjustment
$slider_padding = ' style = "padding:'.$title_box_height_t.'px '.(($title_box_width_t/2)+10).'px 35px;"';
}
//slider size data
$slider_bar_size = $slider_bar_size != '' ? ' '.$slider_bar_size.'px;' : '';
$slider_size_data = $slider_bar_size != '' ? ' data-slider_size = "'.esc_attr($slider_bar_size).'px"' : '';
//$slider_size_data = $dragger_size != '' ? ' data-dragger_size = "'.esc_attr($dragger_size).'px"' : '';
//title data
$slider_data = json_decode( urldecode( $slider_data ), true );
//min max value data
if( isset( $slider_data ) ) {
foreach ( $slider_data as $slider_datas ){
$steps_count = $steps_count + 1;
}
}
$steps_data = ' data-slider_steps = "'.esc_attr( $steps_count).'"';
//////////////////////////typography data
//title
//$title_style = " style = '";
if ( $title_font !== '' ) {
$title_font_family = function_exists( "get_ultimate_font_family" ) ? get_ultimate_font_family( $title_font ) : '' ;
$title_style .= 'font-family:'. $title_font_family . ';';
}
if ( $title_font_style !== '') {
$title_style .= $title_font_style;
}
$micro = rand(0000,9999);
$id = uniqid('ultimate-range-slider'.$micro);
$uid = 'urs-'.rand(0000,9999);
// FIX: set old font size before implementing responsive param
if(is_numeric($title_font_size)) { $title_font_size = 'desktop:'.$title_font_size.'px;'; }
if(is_numeric($title_line_height)) { $title_line_height = 'desktop:'.$title_line_height.'px;'; }
// responsive {main} heading styles
$args = array(
'target' => '#'.$id.' .ult-content',
'media_sizes' => array(
'font-size' => $title_font_size,
'line-height' => $title_line_height,
),
);
$title_responsive = get_ultimate_vc_responsive_media_css($args);
//$title_style .= $title_font_size !== '' ? 'font-size:'.$title_font_size.'px;' : '';
//$title_style .= $title_line_height !== '' ? 'line-height:'.$title_line_height.'px;' : '';
$title_style .= $title_color !== '' ? 'color:'.$title_color.';' : '';
$title_style .= "'";
$desc_style = " style = '";
if ( $desc_font !== '' ) {
$desc_font_family = function_exists( "get_ultimate_font_family" ) ? get_ultimate_font_family( $desc_font ) : '' ;
$desc_style .= 'font-family:'. $desc_font_family . ';';
}
if ( $desc_font_style !== '') {
$desc_style .= $desc_font_style;
}
if(is_numeric($desc_font_size)) { $desc_font_size = 'desktop:'.$desc_font_size.'px;'; }
if(is_numeric($desc_line_height)) { $desc_line_height = 'desktop:'.$desc_line_height.'px;'; }
// responsive {main} heading styles
$args = array(
'target' => '#'.$id.' .ult-description',
'media_sizes' => array(
'font-size' => $desc_font_size,
'line-height' => $desc_line_height,
),
);
$desc_responsive = get_ultimate_vc_responsive_media_css($args);
//$desc_style .= $desc_font_size !== '' ? 'font-size:'.$desc_font_size.'px;' : '';
//$desc_style .= $desc_line_height !== '' ? 'line-height:'.$desc_line_height.'px;' : '';
$desc_style .= $desc_color !== '' ? 'color:'.$desc_color.';' : '';
//$desc_style .= "'";
//////////design data
//$desc_style = 'style = "';
$desc_style .= $desc_padding !== '' ? ' '.$desc_padding.';' : '';
$desc_style .= $desc_margin !== '' ? ' '.$desc_margin.';' : '';
$desc_style .= $desc_width !== '' ? ' width:'.$desc_width.'px;' : '';
//$desc_style .= $desc_min_height !== '' ? ' min-height:'.$desc_min_height.'px;' : '';
$desc_style .= "'";
$desc_data = $adaptive_height !== '' ? ' data-adaptive_height = '.esc_attr($adaptive_height).' ' : '';
/////////////////////////////////////////////////////////////////////////typogrphy data end/////////
$output .= '<div id="'.esc_attr($id).'" class="ult-rs-wrapper"><div id="ult-range-slider " '.$slider_padding.' class="ult-rslider-container ult-responsive '.esc_attr($el_class).'" '.$steps_data.$slider_color_data.$slider_size_data.$arrow_style.$title_box_data.$desc_data.' '.$title_responsive.'>';
if( isset( $slider_data ) ) {
foreach ( $slider_data as $slider_datas ){
if ( isset( $slider_datas["slider_title"] ) ){
//$output .= '<div class = "ult-tooltip ult-title'.$title_count.'" ><div class = "ult-tooltip-inner"'.$title_style.'>'.$slider_datas["slider_title"]; " '.$main_heading_responsive
//$output .= '</div></div>';
$output .= '<div class = "ult-tooltip '.esc_attr($none_style).' ult-title'.esc_attr($title_count).'" '.$title_style.'><span class="ult-content '.esc_attr($center_class).'">'.$slider_datas["slider_title"];
$output .= '</span></div>';
//$output .= '</span><span class="ult-arrow" ></span></div>';
}
$title_count = $title_count + 1;
}
}
$output .= '<div class = "ult-rslider" style = "width:'.esc_attr($slider_bar_size).'" ></div>';
//echo $title_border;
$output .= '</div>';
//description data
if( isset( $slider_data ) ) {
$output .= '<div class="ult-desc-wrap ult-responsive "'.$desc_responsive.'>';
foreach ( $slider_data as $slider_datas ){
if ( isset( $slider_datas["slider_desc"] ) ){
$output .= '<div class = "ult-description ult-desc'.esc_attr($desc_count).'"'.$desc_style.' >'.$slider_datas["slider_desc"].'</div>';
}
$desc_count = $desc_count + 1;
}
$output .= '</div>';
}
$output .= '</div>'; //wrapper div close
return $output;
}
function init_range_slider()
{
if ( function_exists( "vc_map" ) ) {
vc_map(
array(
"name" => __("Range Slider", "ultimate_vc"),
"base" => "ult_range_slider",
"icon" => "vc_icon_range_slider",
"class" => "",
"content_element" => true,
"controls" => "full",
"category" => "Ultimate VC Addons",
"description" => __("Create creative range sliders.","ultimate_vc"),
"params" => array(
array(
"type" => "text",
"param_name" => "title_typography",
"heading" => __( "<h4>Slider Content</h4>", "ultimate_vc" ),
"value" => "",
//"group" => "Slider Setting",
"edit_field_class" => "ult-param-heading-wrapper vc_column vc_col-sm-12",
),
//title and description for slider step
array(
"type" => "param_group",
"heading" => __( "Slider Text Setting", "ultimate_vc" ),
"param_name" => "slider_data",
"description" => __("Add content here steps will generate based on content", "ultimate_vc"),
"value" => urlencode( json_encode ( array(
array(
"slider_title" => "",
"slider_desc" => "",
)
) ) ),
"params" => array(
array(
"type" => "textfield",
"heading" => __("Slider Title","ultimate_vc"),
"param_name" => "slider_title",
"description" =>"",
"admin_label" => true
),
array(
"type" => "textarea",
"heading" => __("Slider Description","ultimate_vc"),
"param_name" => "slider_desc",
"value" => "",
"description" => "",
),
),
//"group" => "Slider Setting",
),
//slider setting
array(
"type" => "text",
"param_name" => "title_typography",
"heading" => __( "<h4>Slider Bar Color</h4>", "ultimate_vc" ),
"value" => "",
"edit_field_class" => "ult-param-heading-wrapper vc_column vc_col-sm-12",
),
// SLider BAr Setting
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Slider Bar Color","ultimate_vc"),
"param_name" => "slider_color",
"value" => "#3BF7D1",
"description" => "",
//"group" => "General",
),
/*array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Slider Bar Active Color","ultimate_vc"),
"param_name" => "slider_active_color",
"value" => "",
"description" => "",
//"group" => "General",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Slider Dragger Color","ultimate_vc"),
"param_name" => "dragger_color",
"value" => "",
"description" => "",
//"group" => "General",
),*/
array(
"type" => "text",
"param_name" => "title_typography",
"heading" => __( "<h4>Slider Bar Width</h4>", "ultimate_vc" ),
"value" => "",
//"group" => "Slider Setting",
"edit_field_class" => "ult-param-heading-wrapper vc_column vc_col-sm-12",
),
array(
"type" => "number",
"class" => "",
"heading" => __( "Slider Width", "ultimate_vc" ),
"param_name" => "slider_bar_size",
"value" => "",
"suffix" => "px",
"description" => __( "If title box text or width is too long then slider width will reduce according to title box width", "ultimate_vc" ),
//"group" => "Slider Setting",
),
array(
"type" => "text",
"param_name" => "title_typography",
"heading" => __( "<h4>Extra Class</h4>", "ultimate_vc" ),
"value" => "",
"edit_field_class" => "ult-param-heading-wrapper vc_column vc_col-sm-12",
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc")
),
/* slider bar*/
/*array(
"type" => "number",
"class" => "",
"heading" => __( "Dragger Size", "ultimate_vc" ),
"param_name" => "dragger_size",
"value" => "",
"suffix" => "px",
"description" => __( "", "ultimate_vc" ),
"group" => "Slider Setting",
),*/
//Title Box
//Title Setting
array(
"type" => "text",
"param_name" => "title_typography",
"heading" => __( "<h4>Title Box</h4>", "ultimate_vc" ),
"value" => "",
"edit_field_class" => "ult-param-heading-wrapper vc_column vc_col-sm-12",
"group" => "Title Box",
),
//Title Color
array(
"type" => "colorpicker",
"class" => "",
"heading" => __( "Title Color", "ultimate_vc" ),
"param_name" => "title_color",
"value" => "#444444",
"description" => "",
"group" => "Title Box"
),
// Title Box Color
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color","ultimate_vc"),
"param_name" => "title_box_color",
"value" => "#fff",
"description" => "",
"group" => "Title Box",
),
array(
"type" => "ultimate_border",
"heading" => __("Title Box Border","ultimate_vc"),
"param_name" => "title_border",
"unit" => "px",
"value" => "border-style:solid;|border-width:2px;border-radius:0px;|border-color:#30eae9;", // [required] px,em,%,all Default all
"group" => "Title Box",
"positions" => array(
__("Top","ultimate_vc") => "",
__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
__("Left","ultimate_vc") => ""
),
//"enable_radius" => false, // Enable border-radius. default true
"radius" => array(
__("Top Left","ultimate_vc") => "", // use 'Top Left'
__("Top Right","ultimate_vc") => "", // use 'Top Right'
__("Bottom Right","ultimate_vc") => "", // use 'Bottom Right'
__("Bottom Left","ultimate_vc") => "" // use 'Bottom Left'
),
//"label_color" => __("Border Color","ultimate_vc"), // label for 'border color' default 'Border Color'
//"label_radius" => __("Border Radius","ultimate_vc"), // label for 'radius' default 'Border Redius'
//"label_border" => "Border Style", // label for 'style' default 'Border Style'
),
//spacing
array(
"type" => "ultimate_spacing",
"heading" => __("Title Box Padding", "ultimate_vc"),
"param_name" => "title_padding",
"mode" => "padding", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
__("Top","ultimate_vc") => "15",
__("Right","ultimate_vc") => "15",
__("Bottom","ultimate_vc") => "15",
__("Left","ultimate_vc") => "15"
),
"group" => "Title Box",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Title Box Size", "ultimate_vc" ),
"param_name" => "title_box",
"value" => array(
'Auto' => 'auto',
'Custom' => 'custom'
),
"description" => __( "Set Title Box Size", "ultimate_vc" ),
"group" => "Title Box",
),
//width
array(
"type" => "number",
"class" => "",
"heading" => __( "Width", "ultimate_vc" ),
"param_name" => "title_box_width",
"value" => "115",
"suffix" => "px",
"description" => __( "Ex: 20px", "ultimate_vc" ),
"dependency" => array(
"element" => "title_box",
"value" => "custom"
),
"group" => "Title Box",
),
//height
array(
"type" => "number",
"class" => "",
"heading" => __( "Height", "ultimate_vc" ),
"param_name" => "title_box_height",
"value" => "115",
"suffix" => "px",
"description" => __( "Ex: 20px ", "ultimate_vc" ),
"dependency" => array(
"element" => "title_box",
"value" => "custom"
),
"group" => "Title Box",
),
//Description
array(
"type" => "text",
"param_name" => "title_typography",
"heading" => __( "<h4>Description Design Setting</h4>", "ultimate_vc" ),
"value" => "",
"group" => "Description",
"edit_field_class" => "ult-param-heading-wrapper vc_column vc_col-sm-12",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __( "Description Color", "ultimate_vc" ),
"param_name" => "desc_color",
"value" => "#444",
"description" => "",
"group" => "Description"
),
array(
"type" => "number",
"param_name" => "desc_width",
"heading" => __( "Width", "ultimate_vc" ),
"value" => "",
"suffix" => "px",
"group" => "Description",
),
/*array(
"type" => "number",
"param_name" => "desc_min_height",
"heading" => __( "Minimum Heigth", "ultimate_vc" ),
"value" => "",
"suffix" => "px",
"group" => "Description",
),*/
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Adaptive Height", "ultimate_vc"),
"param_name" => "adaptive_height",
// "admin_label" => true,
"value" => "",
"options" => array(
"on" => array(
"label" => __("Turn on Adaptive Height","ultimate_vc"),
"on" => "Yes",
"off" => "No",
),
),
"description" => __("If you have different height of descriptions. It will automatically adapt the maximum height. ", "smile"),
"dependency" => "",
"group" => "Description",
),
//spacing
array(
"type" => "ultimate_spacing",
"heading" => __("Padding", "ultimate_vc"),
"param_name" => "desc_padding",
"mode" => "padding", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
__("Top","ultimate_vc") => "35",
__("Right","ultimate_vc") => "35",
__("Bottom","ultimate_vc") => "35",
__("Left","ultimate_vc") => "35"
),
"group" => "Description",
),
//spacing
array(
"type" => "ultimate_spacing",
"heading" => __("Margin", "ultimate_vc"),
"param_name" => "desc_margin",
"mode" => "margin", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
__("Top","ultimate_vc") => "",
//__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
//__("Left","ultimate_vc") => ""
),
"group" => "Description",
),
//TYpography
//Title Typography
array(
"type" => "text",
"param_name" => "title_typography",
"heading" => __( "<h4>For Title</h4>", "ultimate_vc" ),
"value" => "",
"group" => "Typography",
"edit_field_class" => "ult-param-heading-wrapper vc_column vc_col-sm-12",
),
array(
"type" => "ultimate_google_fonts",
"heading" => __( "Font Family", "ultimate_vc" ),
"param_name" => "title_font",
"value" => "",
"description" => __("Click and select font of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-google-font-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __( "Font Style", "ultimate_vc" ),
"param_name" => "title_font_style",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "title_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '16',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
/*array(
"type" => "number",
"param_name" => "title_font_size",
"heading" => __( "Font size", "ultimate_vc" ),
"value" => "16",
"suffix" => "px",
"group" => "Typography"
),*/
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "title_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
/*array(
"type" => "number",
"param_name" => "title_line_height",
"heading" => __( "Line Height", "ultimate_vc" ),
"value" => "22",
"suffix" => "px",
"group" => "Typography"
),*/
//Description Typography
array(
"type" => "text",
"param_name" => "title_typography",
"heading" => __( "<h4>For Description</h4>", "ultimate_vc" ),
"value" => "",
"group" => "Typography",
"edit_field_class" => "ult-param-heading-wrapper vc_column vc_col-sm-12",
),
array(
"type" => "ultimate_google_fonts",
"heading" => __( "Font Family", "ultimate_vc" ),
"param_name" => "desc_font",
"value" => "",
"description" => __("Click and select font of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-google-font-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __( "Font Style", "ultimate_vc" ),
"param_name" => "desc_font_style",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "desc_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '16',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "desc_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography"
),
/*array(
"type" => "number",
"param_name" => "desc_font_size",
"heading" => __( "Font Size", "ultimate_vc" ),
"value" => "22",
"suffix" => "px",
"group" => "Typography"
),*/
/*array(
"type" => "number",
"param_name" => "desc_line_height",
"heading" => __( "Line Height", "ultimate_vc" ),
"value" => "33",
"suffix" => "px",
"group" => "Typography"
),*/
),
)
); //vc_map() end
} //vc_map function check
} // init_range_slider() end
function range_slider_scripts() {
Ultimate_VC_Addons::ultimate_register_style( 'ult_range_slider_css', 'range-slider' );
Ultimate_VC_Addons::ultimate_register_script( 'ult_range_slider_js', 'range-slider', false, array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-slider'), ULTIMATE_VERSION, true );
Ultimate_VC_Addons::ultimate_register_script( 'ult_ui_touch_punch', 'range-slider-touch-punch', false, array('jquery', 'jquery-ui-widget', 'jquery-ui-mouse' ), ULTIMATE_VERSION, true );
//jquery.ui.labeledslider
Ultimate_VC_Addons::ultimate_register_script( 'ult_range_tick', 'jquery-ui-labeledslider', false, array('jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-slider'), ULTIMATE_VERSION, false );
}
}
new Ultimate_Range_Slider;
if ( class_exists( "WPBakeryShortCode" ) && !class_exists( "WPBakeryShortCode_ult_range_slider" ) ) {
class WPBakeryShortCode_ult_range_slider extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,468 @@
<?php
/*
* Add-on Name: Ultimate Ribbon
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists("Ultimate_Ribbons")){
class Ultimate_Ribbons{
//static $add_plugin_script;
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action("init",array($this,"ultimate_ribbons_module_init"));
}
add_shortcode("ultimate_ribbon",array($this,"ultimate_ribbons_module_shortcode"));
add_action("wp_enqueue_scripts", array($this, "register_ribbons_module_assets"),1);
}//end-of-constructor
function register_ribbons_module_assets(){
Ultimate_VC_Addons::ultimate_register_style( 'ultimate-ribbons-style', 'ribbon_module' );
}//end-of-register-style-script-function
//Init function for Ribbon module
function ultimate_ribbons_module_init(){
if(function_exists("vc_map")){
vc_map(
array(
"name" => __("Ribbon","ultimate_vc"),
"base" => "ultimate_ribbon",
"class" => "vc_ultimate_ribbon",
"icon" => "vc_ultimate_ribbon",
"category" => "Ultimate VC Addons",
"description" => __("Design awesome Ribbon styles","ultimate_vc"),
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __("Ribbon Message", "ultimate_vc"),
"admin_label" => TRUE,
"param_name" => "ribbon_msg",
"value" => "SPECIAL OFFER",
"group" => "Layout",
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Left Icon ","ultimate_vc"),
"param_name" => "left_icon",
"value" => "",
"group" => "Layout",
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Right Icon ","ultimate_vc"),
"param_name" => "right_icon",
"value" => "",
"group" => "Layout",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Hide Ribbon Wings", "ultimate_vc"),
"param_name" => "ribbon_wings",
"value" =>
array(
__("None","ultimate_vc") => "none",
__("Small Devices","ultimate_vc") => "small",
__("Medium & Small Devices","ultimate_vc") => "medium",
),
"description" => "To hide Ribbon Wings on Small or Medium device use this option.",
"group" => "Layout",
),
array(
"type" => "ult_param_heading",
"text" => __("Style","ultimate_vc"),
"param_name" => "style_option",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper top-margin vc_column vc_col-sm-12',
"group" => "Layout",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Ribbon Width", "ultimate_vc"),
"param_name" => "ribbon_width",
"value" =>
array(
__("Auto","ultimate_vc") => "auto",
__("Full","ultimate_vc") => "full",
__("Custom","ultimate_vc") => "custom",
),
"group" => "Layout",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Custom Width", "ultimate_vc"),
"param_name" => "custom_width",
"value" => "",
"suffix" => "px",
"dependency"=> Array("element" => "ribbon_width", "value" => array("custom")),
"group" => "Layout",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Alignment", "ultimate_vc"),
"param_name" => "ribbon_alignment",
"value" =>
array(
__("Center","ultimate_vc") => "center",
__("Left","ultimate_vc") => "left",
__("Right","ultimate_vc") => "right",
),
"group" => "Layout",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Stitching", "ultimate_vc"),
"param_name" => "ribbon_stitching",
"value" =>
array(
__("Yes","ultimate_vc") => "yes",
__("No","ultimate_vc") => "no",
),
"description" => "To give Stitch effect on Ribbon.",
"group" => "Layout",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Shadow", "ultimate_vc"),
"param_name" => "rib_shadow",
"value" =>
array(
__("Yes","ultimate_vc") => "yes",
__("No","ultimate_vc") => "no",
),
"group" => "Layout",
),
array(
"type" => "ult_param_heading",
"text" => __("Ribbon Colors","ultimate_vc"),
"param_name" => "ribbon_option",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper top-margin vc_column vc_col-sm-12',
"group" => "Layout",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Ribbon Color", "ultimate_vc"),
"param_name" => "ribbon_color",
"value"=> "",
"group" => "Layout",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Icon Color", "ultimate_vc"),
"param_name" => "icon_color",
"value"=> "",
"group" => "Layout",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Ribbon Fold Color", "ultimate_vc"),
"param_name" => "rib_fold_color",
"value"=> "",
"group" => "Layout",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Ribbon Wings Color", "ultimate_vc"),
"param_name" => "rib_wing_color",
"value"=> "",
"group" => "Layout",
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc"),
"group" => "Layout",
),
array(
"type" => "ult_param_heading",
"text" => __("Ribbon Text Settings","ultimate_vc"),
"param_name" => "ribbon_text_typograpy",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
"group" => "Typography",
),
array(
"type" => "dropdown",
"heading" => __("Tag","ultimate_vc"),
"param_name" => "heading_tag",
"value" => array(
__("Default","ultimate_vc") => "h3",
__("H1","ultimate_vc") => "h1",
__("H3","ultimate_vc") => "h2",
__("H4","ultimate_vc") => "h4",
__("H5","ultimate_vc") => "h5",
__("H6","ultimate_vc") => "h6",
__("Div","ultimate_vc") => "div",
__("p","ultimate_vc") => "p",
__("span","ultimate_vc") => "span",
),
"description" => __("Default is H3", "ultimate_vc"),
"group" => "Typography",
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "ribbon_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography",
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "ribbon_style",
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "main_ribbon_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "font-size",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "main_ribbon_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "ribbon_text_color",
"value" => "",
"group" => "Typography"
),
array(
"type" => "dropdown",
"heading" => __("Transform","ultimate_vc"),
"param_name" => "ribbontext_trans",
"value" => array(
__("Default","ultimate_vc") => "unset",
__("UPPERCASE","ultimate_vc") => "uppercase",
__("lowercase","ultimate_vc") => "lowercase",
__("Capitalize","ultimate_vc") => "capitalize",
),
"group" => "Typography",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Letter Spacing", "ultimate_vc"),
"param_name" => "letter_space",
"value" => "",
"min" => 1,
"max" => 15,
"suffix" => "px",
"group" => "Typography",
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_ribbon_design',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
)
)
);
}
}//End of INit function
function ultimate_ribbons_module_shortcode($atts, $content = null){
$ribbon_msg = $left_icon = $right_icon = $ribbon_stitching = $ribbon_width = $ribbon_alignment = $custom_width = $rib_width = $rib_align = $rib_shadow = $ribbon_color = $icon_color = $rib_wing_color = $rib_left_color = $rib_right_color = $ribbon_style_inline = $rib_fold_color = $main_ribbon_font_size = $main_ribbon_line_height = $main_ribbon_responsive = $main_ribbon_style_inline = $ribbontext_trans = $ribbont_trans = $letter_space = $ribbon_spacer = $ribbon_wings = $el_class = $ribbon_design_style_css = $ribc_width = $heading_tag = $rib_media = $output = "";
extract(shortcode_atts(array(
"ribbon_msg" => "SPECIAL OFFER",
"left_icon" => "",
"right_icon" => "",
"ribbon_stitching" => "yes",
"ribbon_width" => "auto",
"ribbon_alignment" => "center",
"custom_width" => "",
"rib_shadow" => "yes",
"ribbon_color" => "",
"icon_color" => "",
"rib_wing_color" => "",
"ribbon_font_family" => "",
"ribbon_style" => "",
"rib_fold_color" => "",
"main_ribbon_font_size" => "",
"main_ribbon_line_height" => "",
"ribbon_text_color" => "",
"ribbontext_trans" => "unset",
"letter_space" => "",
"ribbon_wings" => "none",
"el_class" => "",
"css_ribbon_design" => "",
"heading_tag" => "",
),$atts));
$vc_version = (defined('WPB_VC_VERSION')) ? WPB_VC_VERSION : 0;
$is_vc_49_plus = (version_compare(4.9, $vc_version, '<=')) ? 'ult-adjust-bottom-margin' : '';
//Default Design Editor
$ribbon_design_style_css = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_ribbon_design, ' ' ), "ultimate_ribbons", $atts );
$ribbon_design_style_css = esc_attr( $ribbon_design_style_css );
$micro = rand(0000,9999);
$id = uniqid('ultimate-ribbon-'.$micro);
/*
* Style option for Ribbon Module
*
*/
if($heading_tag == '')
$heading_tag = 'h3';
if($ribbon_alignment != '')
{
$rib_align = 'text-align:'.esc_attr($ribbon_alignment).';';
}
if($ribbon_width != '')
{
if($ribbon_width == 'auto')
{
$rib_width = 'auto';
}
else if($ribbon_width == 'full')
{
$rib_width .= 'full';
}
else if($ribbon_width = 'custom')
{
$rib_width .= 'custom';
$ribc_width = 'width:calc('.esc_attr($custom_width).'px - 7em)';
}
}
if($ribbon_wings != 'none')
{
$rib_media = 'media-width';
}
/*
* Color option for Ribbon Module
*
*/
if($ribbon_color != '')
{
$ribbon_color = 'background:'.esc_attr($ribbon_color).';';
}
if($icon_color != '')
{
$icon_color = 'color:'.esc_attr($icon_color).';';
}
if($rib_wing_color != '')
{
$rib_left_color = 'border-top-color:'.esc_attr($rib_wing_color).';';
$rib_left_color .= 'border-bottom-color:'.esc_attr($rib_wing_color).';';
$rib_left_color .= 'border-right-color:'.esc_attr($rib_wing_color).';';
$rib_right_color = 'border-top-color:'.esc_attr($rib_wing_color).';';
$rib_right_color .= 'border-bottom-color:'.esc_attr($rib_wing_color).';';
$rib_right_color .= 'border-left-color:'.esc_attr($rib_wing_color).';';
}
if($rib_fold_color != '')
{
$output .= '<style>
.'.esc_attr( $id ).' .ult-ribbon-text:before, .'.esc_attr( $id ).' .ult-ribbon-text:after {
border-top-color: '.esc_attr($rib_fold_color).';
border-right-color: transparent;
border-bottom-color: transparent;
border-left-color: transparent;
}
</style>';
}
/* ---- main heading styles ---- */
if($ribbon_font_family != '')
{
$mrfont_family = get_ultimate_font_family($ribbon_font_family);
if($mrfont_family)
$ribbon_style_inline .= 'font-family:\''.$mrfont_family.'\';';
}
// main ribbon font style
$ribbon_style_inline .= get_ultimate_font_style($ribbon_style);
// FIX: set old font size before implementing responsive param
if(is_numeric($main_ribbon_font_size)) { $main_ribbon_font_size = 'desktop:'.$main_ribbon_font_size.'px;'; }
if(is_numeric($main_ribbon_line_height)) { $main_ribbon_line_height = 'desktop:'.$main_ribbon_line_height.'px;'; }
// responsive {main} ribbon styles
$args = array(
'target' => '.'.$id. ' .ult-ribbon-text-title',
'media_sizes' => array(
'font-size' => $main_ribbon_font_size,
'line-height' => $main_ribbon_line_height,
),
);
$main_ribbon_responsive = get_ultimate_vc_responsive_media_css($args);
//attach font color if set
if($ribbon_text_color != '')
$main_ribbon_style_inline .= 'color:'.$ribbon_text_color.';';
//Text -Transform Property for Ribbon Text
if($ribbontext_trans != '')
{
$ribbont_trans = 'text-transform: '.$ribbontext_trans.';';
}
//Letter spacing for Ribbon Text
if($letter_space !== '')
$ribbon_spacer = 'letter-spacing:'.$letter_space.'px';
$output .= '<div id="'.esc_attr( $id ).'" class="ultr-ribbon '.esc_attr($ribbon_design_style_css).' '.esc_attr( $is_vc_49_plus ).' '.esc_attr( $id ).' '.esc_attr( $el_class ).'">';
$output .= '<div class="ult-ribbon-wrap" style= "'.esc_attr($rib_align).'">
<'.$heading_tag.' class="ult-ribbon '.esc_attr($rib_width).' '.esc_attr($rib_media).'" style="'.esc_attr($ribc_width).'">
<span class="ult-left-ribb '.esc_attr($ribbon_wings).' '.esc_attr($rib_shadow).'" style= "'.esc_attr($rib_left_color).'"><i class="'.$left_icon.'" style="'.esc_attr($icon_color).'"></i></span>
<span class="ult-ribbon-text '.esc_attr($ribbon_wings).'" style= "'.esc_attr($ribbon_color).'">';
if ( $ribbon_stitching == 'yes' ) {
$output .= '<div class="ult-ribbon-stitches-top"></div>'; }
$output .= '<span class="ult-ribbon-text-title ult-responsive" '.$main_ribbon_responsive.' style="'.esc_attr($ribbon_style_inline ).' '.esc_attr($main_ribbon_style_inline).' '.esc_attr($ribbont_trans).' '.esc_attr($ribbon_spacer).'">'.esc_attr($ribbon_msg).'</span>';
if ( $ribbon_stitching == 'yes' ) {
$output .= '<div class="ult-ribbon-stitches-bottom"></div>';}
$output .='</span>';
$output .= '<span class="ult-right-ribb '.esc_attr($ribbon_wings).' '.esc_attr($rib_shadow).'" style= "'.esc_attr($rib_right_color).'"><i class="'.esc_attr($right_icon).'" style="'.esc_attr($icon_color).'"></i></span>
</'.$heading_tag.'>
</div>';
$output .= '</div>';
return $output;
}
}//End of class
new Ultimate_Ribbons;
if(class_exists('WPBakeryShortCode') && !class_exists('WPBakeryShortCode_ultimate_ribbon'))
{
class WPBakeryShortCode_ultimate_ribbon extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,119 @@
<?php
/*
* Add-on Name: Adjustable Spacer for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists("Ultimate_Spacer")){
class Ultimate_Spacer{
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action("init",array($this,"ultimate_spacer_init"));
}
add_shortcode("ultimate_spacer",array($this,"ultimate_spacer_shortcode"));
}
function ultimate_spacer_init(){
if(function_exists("vc_map")){
vc_map(
array(
"name" => __("Spacer / Gap","ultimate_vc"),
"base" => "ultimate_spacer",
"class" => "vc_ultimate_spacer",
"icon" => "vc_ultimate_spacer",
"category" => "Ultimate VC Addons",
"description" => __("Adjust space between components.","ultimate_vc"),
"params" => array(
array(
"type" => "number",
"class" => "",
"heading" => __("<i class='dashicons dashicons-desktop'></i> Desktop", "ultimate_vc"),
"param_name" => "height",
"admin_label" => true,
"value" => 10,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("Enter value in pixels", "ultimate_vc"),
//"edit_field_class" => "vc_col-sm-4 vc_column"
),
array(
"type" => "number",
"class" => "",
"heading" => __("<i class='dashicons dashicons-tablet' style='transform: rotate(90deg);'></i> Tabs", "ultimate_vc"),
"param_name" => "height_on_tabs",
"admin_label" => true,
"value" => '',
"min" => 1,
"max" => 500,
"suffix" => "px",
//"description" => __("Enter value in pixels", "ultimate_vc"),
"edit_field_class" => "vc_col-sm-3 vc_column"
),
array(
"type" => "number",
"class" => "",
"heading" => __("<i class='dashicons dashicons-tablet'></i> Tabs", "ultimate_vc"),
"param_name" => "height_on_tabs_portrait",
"admin_label" => true,
"value" => '',
"min" => 1,
"max" => 500,
"suffix" => "px",
//"description" => __("Enter value in pixels", "ultimate_vc"),
"edit_field_class" => "vc_col-sm-3 vc_column"
),
array(
"type" => "number",
"class" => "",
"heading" => __("<i class='dashicons dashicons-smartphone' style='transform: rotate(90deg);'></i> Mobile", "ultimate_vc"),
"param_name" => "height_on_mob_landscape",
"admin_label" => true,
"value" => '',
"min" => 1,
"max" => 500,
"suffix" => "px",
//"description" => __("Enter value in pixels", "ultimate_vc"),
"edit_field_class" => "vc_col-sm-3 vc_column"
),
array(
"type" => "number",
"class" => "",
"heading" => __("<i class='dashicons dashicons-smartphone'></i> Mobile", "ultimate_vc"),
"param_name" => "height_on_mob",
"admin_label" => true,
"value" => '',
"min" => 1,
"max" => 500,
"suffix" => "px",
//"description" => __("Enter value in pixels", "ultimate_vc"),
"edit_field_class" => "vc_col-sm-3 vc_column"
),
)
)
);
}
}
function ultimate_spacer_shortcode($atts){
//wp_enqueue_script('ultimate-custom');
$height = $output = $height_on_tabs = $height_on_mob = '';
extract(shortcode_atts(array(
"height" => "",
"height_on_tabs" => "",
"height_on_tabs_portrait" => "",
"height_on_mob" => "",
"height_on_mob_landscape" => ""
),$atts));
if($height_on_mob == "" && $height_on_tabs == "")
$height_on_mob = $height_on_tabs = $height;
$style = 'clear:both;';
$style .= 'display:block;';
$uid = uniqid();
$output .= '<div class="ult-spacer spacer-'.esc_attr($uid).'" data-id="'.esc_attr($uid).'" data-height="'.esc_attr($height).'" data-height-mobile="'.esc_attr($height_on_mob).'" data-height-tab="'.esc_attr($height_on_tabs).'" data-height-tab-portrait="'.esc_attr($height_on_tabs_portrait).'" data-height-mobile-landscape="'.esc_attr($height_on_mob_landscape).'" style="'.esc_attr($style).'"></div>';
return $output;
}
} // end class
new Ultimate_Spacer;
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ultimate_spacer' ) ) {
class WPBakeryShortCode_ultimate_spacer extends WPBakeryShortCode {
}
}
}
@@ -0,0 +1,816 @@
<?php
/*
* Add-on Name: Stats Counter for WPBakery Page Builder
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('AIO_Stats_Counter'))
{
class AIO_Stats_Counter
{
// constructor
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'counter_init'));
}
add_action("wp_enqueue_scripts", array($this, "register_counter_assets"),1);
add_shortcode('stat_counter',array($this,'counter_shortcode'));
}
function register_counter_assets()
{
Ultimate_VC_Addons::ultimate_register_script( 'ult-stats-counter-js', 'countUp', false, array( 'jquery' ), ULTIMATE_VERSION, false );
Ultimate_VC_Addons::ultimate_register_style( 'ult-stats-counter-style', 'stats-counter' );
}
// initialize the mapping function
function counter_init()
{
if(function_exists('vc_map'))
{
// map with visual
vc_map(
array(
"name" => __("Counter","ultimate_vc"),
"base" => "stat_counter",
"class" => "vc_stats_counter",
"icon" => "vc_icon_stats",
"category" => "Ultimate VC Addons",
"description" => __("Your milestones, achievements, etc.","ultimate_vc"),
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
__("Font Icon Manager","ultimate_vc") => "selector",
__("Custom Image Icon","ultimate_vc") => "custom",
),
"description" => __("Use an existing font icon or upload a custom image.", "ultimate_vc")
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "attach_image",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "img_width",
"value" => 48,
"min" => 16,
"max" => 512,
"suffix" => "px",
"description" => __("Provide image width", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "#333333",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
//"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "#ffffff",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc") => "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 0,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Animation","ultimate_vc"),
"param_name" => "icon_animation",
"value" => array(
__("No Animation","ultimate_vc") => "",
__("Swing","ultimate_vc") => "swing",
__("Pulse","ultimate_vc") => "pulse",
__("Fade In","ultimate_vc") => "fadeIn",
__("Fade In Up","ultimate_vc") => "fadeInUp",
__("Fade In Down","ultimate_vc") => "fadeInDown",
__("Fade In Left","ultimate_vc") => "fadeInLeft",
__("Fade In Right","ultimate_vc") => "fadeInRight",
__("Fade In Up Long","ultimate_vc") => "fadeInUpBig",
__("Fade In Down Long","ultimate_vc") => "fadeInDownBig",
__("Fade In Left Long","ultimate_vc") => "fadeInLeftBig",
__("Fade In Right Long","ultimate_vc") => "fadeInRightBig",
__("Slide In Down","ultimate_vc") => "slideInDown",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Bounce In","ultimate_vc") => "bounceIn",
__("Bounce In Up","ultimate_vc") => "bounceInUp",
__("Bounce In Down","ultimate_vc") => "bounceInDown",
__("Bounce In Left","ultimate_vc") => "bounceInLeft",
__("Bounce In Right","ultimate_vc") => "bounceInRight",
__("Rotate In","ultimate_vc") => "rotateIn",
__("Light Speed In","ultimate_vc") => "lightSpeedIn",
__("Roll In","ultimate_vc") => "rollIn",
),
"description" => __("Like CSS3 Animations? We have several options for you!","ultimate_vc")
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Position", "ultimate_vc"),
"param_name" => "icon_position",
"value" => array(
__('Top','ultimate_vc') => 'top',
__('Right','ultimate_vc') => 'right',
__('Left','ultimate_vc') => 'left',
),
"description" => __("Enter Position of Icon", "ultimate_vc")
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Counter Title ", "ultimate_vc"),
"param_name" => "counter_title",
"admin_label" => true,
"value" => "",
"description" => __("Enter title for stats counter block", "ultimate_vc")
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Counter Value", "ultimate_vc"),
"param_name" => "counter_value",
"value" => "1250",
"description" => __("Enter number for counter without any special character. You may enter a decimal number. Eg 12.76", "ultimate_vc")
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Thousands Separator", "ultimate_vc"),
"param_name" => "counter_sep",
"value" => ",",
"description" => __("Enter character for thousanda separator. e.g. ',' will separate 125000 into 125,000", "ultimate_vc")
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Replace Decimal Point With", "ultimate_vc"),
"param_name" => "counter_decimal",
"value" => ".",
"description" => __("Did you enter a decimal number (Eg - 12.76) The decimal point '.' will be replaced with value that you will enter above.", "ultimate_vc"),
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Counter Value Prefix", "ultimate_vc"),
"param_name" => "counter_prefix",
"value" => "",
"description" => __("Enter prefix for counter value", "ultimate_vc")
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Counter Value Suffix", "ultimate_vc"),
"param_name" => "counter_suffix",
"value" => "",
"description" => __("Enter suffix for counter value", "ultimate_vc")
),
array(
"type" => "number",
"class" => "",
"heading" => __("Counter rolling time", "ultimate_vc"),
"param_name" => "speed",
"value" => 3,
"min" => 1,
"max" => 10,
"suffix" => "seconds",
"description" => __("How many seconds the counter should roll?", "ultimate_vc")
),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Title Font Size", "ultimate_vc"),
// "param_name" => "font_size_title",
// "value" => 18,
// "min" => 10,
// "max" => 72,
// "suffix" => "px",
// "description" => __("Enter value in pixels.", "ultimate_vc")
// ),
// array(
// "type" => "number",
// "class" => "",
// "heading" => __("Counter Font Size", "ultimate_vc"),
// "param_name" => "font_size_counter",
// "value" => 28,
// "min" => 12,
// "max" => 72,
// "suffix" => "px",
// "description" => __("Enter value in pixels.", "ultimate_vc"),
// ),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Extra Class", "ultimate_vc"),
"param_name" => "el_class",
"value" => "",
"description" => __("Add extra class name that will be applied to the icon process, and you can use this class for your customizations.", "ultimate_vc"),
),
array(
"type" => "ult_param_heading",
"param_name" => "title_text_typography",
"heading" => __("Counter Title settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "title_font",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "title_font_style",
"value" => "",
"group" => "Typography"
),
// array(
// "type" => "number",
// "param_name" => "title_font_size",
// "heading" => __("Font size","ultimate_vc"),
// "value" => "",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "param_name" => "title_font_line_height",
// "heading" => __("Font Line Height","ultimate_vc"),
// "value" => "",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "title_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "title_font_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "counter_color_txt",
"value" => "",
"description" => __("Select text color for counter title.", "ultimate_vc"),
'group' => "Typography"
),
array(
"type" => "ult_param_heading",
"param_name" => "desc_text_typography",
"heading" => __("Counter Value settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "desc_font",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "desc_font_style",
"value" => "",
"group" => "Typography"
),
// array(
// "type" => "number",
// "param_name" => "desc_font_size",
// "heading" => __("Font size","ultimate_vc"),
// "value" => "",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography"
// ),
// array(
// "type" => "number",
// "param_name" => "desc_font_line_height",
// "heading" => __("Font Line Height","ultimate_vc"),
// "value" => "",
// "suffix" => "px",
// "min" => 10,
// "group" => "Typography"
// ),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "desc_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "desc_font_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"param_name" => "desc_font_color",
"heading" => __("Color","ultimate_vc"),
"description" => __("Select text color for counter digits.", "ultimate_vc"),
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"param_name" => "suf_pref_typography",
"heading" => __("Counter suffix-prefix Value settings","ultimate_vc"),
"value" => "",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family","ultimate_vc"),
"param_name" => "suf_pref_font",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style","ultimate_vc"),
"param_name" => "suf_pref_font_style",
"value" => "",
"group" => "Typography"
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Font size", 'ultimate_vc'),
"param_name" => "suf_pref_font_size",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "ultimate_responsive",
"class" => "",
"heading" => __("Line Height", 'ultimate_vc'),
"param_name" => "suf_pref_line_height",
"unit" => "px",
"media" => array(
"Desktop" => '',
"Tablet" => '',
"Tablet Portrait" => '',
"Mobile Landscape" => '',
"Mobile" => '',
),
"group" => "Typography",
),
array(
"type" => "colorpicker",
"param_name" => "suf_pref_font_color",
"heading" => __("Color","ultimate_vc"),
"description" => __("Select text color for counter prefix and suffix.", "ultimate_vc"),
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"text" => "<span style='display: block;'><a href='http://bsf.io/t23kn' target='_blank' rel='noopener'>".__("Watch Video Tutorial","ultimate_vc")." &nbsp; <span class='dashicons dashicons-video-alt3' style='font-size:30px;vertical-align: middle;color: #e52d27;'></span></a></span>",
"param_name" => "notification",
'edit_field_class' => 'ult-param-important-wrapper ult-dashicon ult-align-right ult-bold-font ult-blue-font vc_column vc_col-sm-12',
),
array(
'type' => 'css_editor',
'heading' => __( 'Css', 'ultimate_vc' ),
'param_name' => 'css_stat_counter',
'group' => __( 'Design ', 'ultimate_vc' ),
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border creative_link_css_editor',
),
),
)
);
}
}
// Shortcode handler function for stats counter
function counter_shortcode($atts)
{
// enqueue js
//wp_enqueue_script('ultimate-appear');
//wp_enqueue_script('ultimate-custom');
//wp_enqueue_script('front-js',plugins_url('../assets/min-js/countUp.min.js',__FILE__));
$icon_type = $icon_img = $img_width = $icon = $icon_color = $icon_color_bg = $icon_size = $icon_style = $icon_border_style = $icon_border_radius = $icon_color_border = $icon_border_size = $icon_border_spacing = $icon_link = $el_class = $icon_animation = $counter_title = $counter_value = $icon_position = $counter_style = $font_size_title = $font_size_counter = $counter_font = $title_font = $speed = $counter_sep = $counter_suffix = $counter_prefix = $counter_decimal = $counter_color_txt = $desc_font_line_height = $title_font_line_height = '';
$title_font = $title_font_style = $title_font_size = $title_font_color = $desc_font = $desc_font_style = $desc_font_size = $desc_font_color = $suf_pref_typography = $suf_pref_font = $suf_pref_font_style = $suf_pref_font_color = $suf_pref_font_size = $suf_pref_line_height = '';
extract(shortcode_atts( array(
'icon_type' => 'selector',
'icon' => '',
'icon_img' => '',
'img_width' => '48',
'icon_size' => '32',
'icon_color' => '#333333',
'icon_style' => 'none',
'icon_color_bg' => '#ffffff',
'icon_color_border' => '#333333',
'icon_border_style' => '',
'icon_border_size' => '1',
'icon_border_radius' => '500',
'icon_border_spacing' => '50',
'icon_link' => '',
'icon_animation' => '',
'counter_title' => '',
'counter_value' => '1250',
'counter_sep' => ',',
'counter_suffix' => '',
'counter_prefix' => '',
'counter_decimal' => '.',
'icon_position'=>'top',
'counter_style'=>'',
'speed'=>'3',
'font_size_title' => '18',
'font_size_counter' => '28',
'counter_color_txt' => '',
'title_font' => '',
'title_font_style' => '',
'title_font_size' => '',
'title_font_line_height'=> '',
'desc_font' => '',
'desc_font_style' => '',
'desc_font_size' => '',
'desc_font_color' => '',
'desc_font_line_height'=> '',
'el_class'=>'',
'suf_pref_font' =>'',
'suf_pref_font_color' =>'',
'suf_pref_font_size' =>'',
'suf_pref_line_height' =>'',
'suf_pref_font_style' =>'',
'css_stat_counter' => '',
),$atts));
$css_stat_counter = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $css_stat_counter, ' ' ), "stat_counter", $atts );
$css_stat_counter = esc_attr( $css_stat_counter );
$class = $style = $title_style = $desc_style = $suf_pref_style = '';
//$font_args = array();
$stats_icon = do_shortcode('[just_icon icon_type="'.esc_attr($icon_type).'" icon="'.esc_attr($icon).'" icon_img="'.esc_attr($icon_img).'" img_width="'.esc_attr($img_width).'" icon_size="'.esc_attr($icon_size).'" icon_color="'.esc_attr($icon_color).'" icon_style="'.esc_attr($icon_style).'" icon_color_bg="'.esc_attr($icon_color_bg).'" icon_color_border="'.esc_attr($icon_color_border).'" icon_border_style="'.esc_attr($icon_border_style).'" icon_border_size="'.esc_attr($icon_border_size).'" icon_border_radius="'.esc_attr($icon_border_radius).'" icon_border_spacing="'.esc_attr($icon_border_spacing).'" icon_link="'.esc_attr($icon_link).'" icon_animation="'.esc_attr($icon_animation).'"]');
/* title */
if($title_font != '')
{
$font_family = get_ultimate_font_family($title_font);
$title_style .= 'font-family:\''.$font_family.'\';';
//array_push($font_args, $title_font);
}
if($title_font_style != '')
$title_style .= get_ultimate_font_style($title_font_style);
// if($title_font_size != '')
// $title_style .= 'font-size:'.$title_font_size.'px;';
// if($title_font_line_height != '')
// $title_style .= 'line-height:'.$title_font_line_height.'px;';
//Responsive param
if($title_font_size != ''){
$font_size_title ='';
}
if(is_numeric($title_font_size)){
$title_font_size = 'desktop:'.$title_font_size.'px;';
}
if(is_numeric($title_font_line_height)){
$title_font_line_height = 'desktop:'.$title_font_line_height.'px;';
}
$counter_resp_id = "counter-responsv-wrap-".rand(1000,9999);
$stats_counter_args = array(
'target' => '#'.$counter_resp_id.' .stats-text', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $title_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $title_responsive_font_size holds responsive font sizes from user input.
'line-height' => $title_font_line_height
),
);
$stats_counter_data_list = get_ultimate_vc_responsive_media_css($stats_counter_args);
/* description */
if($desc_font != '')
{
$font_family = get_ultimate_font_family($desc_font);
$desc_style .= 'font-family:\''.$font_family.'\';';
//array_push($font_args, $desc_font);
}
if($desc_font_style != '')
$desc_style .= get_ultimate_font_style($desc_font_style);
// if($desc_font_size != '')
// $desc_style .= 'font-size:'.$desc_font_size.'px;';
// if($desc_font_line_height != '')
// $desc_style .= 'line-height:'.$desc_font_line_height.'px;';
//Responsive param
if($desc_font_size !='' || $suf_pref_font_size !=''){
$font_size_counter ='';
}
if(is_numeric($desc_font_size)){
$desc_font_size = 'desktop:'.$desc_font_size.'px;';
}
if(is_numeric($desc_font_line_height)){
$desc_font_line_height = 'desktop:'.$desc_font_line_height.'px;';
}
$stats_counter_val_args = array(
'target' => '#'.$counter_resp_id.' .stats-number', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $desc_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $desc_responsive_font_size holds responsive font sizes from user input.
'line-height' => $desc_font_line_height
),
);
$stats_counter_val_data_list = get_ultimate_vc_responsive_media_css($stats_counter_val_args);
if($desc_font_color != '')
$desc_style .= 'color:'.$desc_font_color.';';
//enquque_ultimate_google_fonts($font_args);
if($counter_color_txt !== ''){
$counter_color = 'color:'.$counter_color_txt.';';
} else {
$counter_color = '';
}
if($icon_color != '')
$style.='color:'.$icon_color.';';
if($icon_animation !== 'none')
{
$css_trans = 'data-animation="'.esc_attr($icon_animation).'" data-animation-delay="03"';
}
if($font_size_counter !== '')
$counter_font = 'font-size:'.$font_size_counter.'px;';
$title_font = 'font-size:'.$font_size_title.'px;';
// Responsive param
if($suf_pref_font != '')
{
$font_family = get_ultimate_font_family($suf_pref_font);
$suf_pref_style .= 'font-family:\''.$font_family.'\';';
//array_push($font_args, $title_font);
}
if($suf_pref_font_style != '')
$suf_pref_style .= get_ultimate_font_style($suf_pref_font_style);
// $suf_pref_style .= 'font-size:'.$suf_pref_font_size.'px;';
// $suf_pref_style .='line-height:'.$suf_pref_line_height.'px;';
// Responsive param
if(is_numeric($suf_pref_font_size)){
$suf_pref_font_size = 'desktop:'.$suf_pref_font_size.'px;';
}
if(is_numeric($suf_pref_line_height)){
$suf_pref_line_height = 'desktop:'.$suf_pref_line_height.'px;';
}
$stats_counter_sufpref_args = array(
'target' => '#'.$counter_resp_id.' .mycust', // set targeted element e.g. unique class/id etc.
'media_sizes' => array(
'font-size' => $suf_pref_font_size, // set 'css property' & 'ultimate_responsive' sizes. Here $desc_responsive_font_size holds responsive font sizes from user input.
'line-height' => $suf_pref_line_height
),
);
$stats_counter_sufpref_data_list = get_ultimate_vc_responsive_media_css($stats_counter_sufpref_args);
$suf_pref_style .= 'color:'.$suf_pref_font_color;
if($counter_style !=''){
$class = $counter_style;
if(strpos($counter_style, 'no_bg')){
$style.= "border:2px solid ".$counter_icon_bg_color.';';
}
elseif(strpos($counter_style, 'with_bg')){
if($counter_icon_bg_color != '')
$style.='background:'.$counter_icon_bg_color.';';
}
}
if($el_class != '')
$class.= ' '.$el_class;
$ic_position = 'stats-'.$icon_position;
$ic_class = 'aio-icon-'.$icon_position;
$output = '<div class="stats-block '.esc_attr($ic_position).' '.esc_attr($class).' '.esc_attr($css_stat_counter).'">';
//$output .= '<div class="stats-icon" style="'.$style.'">
// <i class="'.$stats_icon.'"></i>
// </div>';
$id = 'counter_'.uniqid(rand());
if($counter_sep == ""){
$counter_sep = 'none';
}
if($counter_decimal == ""){
$counter_decimal = 'none';
}
if($icon_position !== "right")
$output .= '<div class="'.esc_attr($ic_class).'">'.$stats_icon.'</div>';
$output .= '<div class="stats-desc" id="'.esc_attr($counter_resp_id).'">';
if($counter_prefix !== ''){
$output .= '<div class="counter_prefix mycust ult-responsive" '.$stats_counter_sufpref_data_list.' style="'.esc_attr($counter_font).' '.esc_attr($suf_pref_style).'">'.$counter_prefix.'</div>';
}
$output .= '<div id="'.esc_attr($id).'" data-id="'.esc_attr($id).'" '.$stats_counter_val_data_list.' class="stats-number ult-responsive" style="'.esc_attr($counter_font).' '.esc_attr($counter_color).' '.esc_attr($desc_style).'" data-speed="'.esc_attr($speed).'" data-counter-value="'.esc_attr($counter_value).'" data-separator="'.esc_attr($counter_sep).'" data-decimal="'.esc_attr($counter_decimal).'">0</div>';
if($counter_suffix !== ''){
$output .= '<div class="counter_suffix mycust ult-responsive" '.$stats_counter_sufpref_data_list.' style="'.esc_attr($counter_font).' '.esc_attr($suf_pref_style).'">'.$counter_suffix.'</div>';
}
$output .= '<div id="'.$counter_resp_id.'" '.$stats_counter_data_list.' class="stats-text ult-responsive" style="'.esc_attr($title_font).' '.esc_attr($counter_color).' '.esc_attr($title_style).'">'.$counter_title.'</div>';
$output .= '</div>';
if($icon_position == "right")
$output .= '<div class="'.esc_attr($ic_class).'">'.$stats_icon.'</div>';
$output .= '</div>';
$is_preset = false; //Display settings for Preset
if(isset($_GET['preset'])) {
$is_preset = true;
}
if($is_preset) {
$text = 'array ( ';
foreach ($atts as $key => $att) {
$text .= '<br/> \''.$key.'\' => \''.$att.'\',';
}
if($content != '') {
$text .= '<br/> \'content\' => \''.$content.'\',';
}
$text .= '<br/>)';
$output .= '<pre>';
$output .= $text;
$output .= '</pre>';
}
return $output;
}
}
}
if(class_exists('AIO_Stats_Counter'))
{
$AIO_Stats_Counter = new AIO_Stats_Counter;
}
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_stat_counter' ) ) {
class WPBakeryShortCode_stat_counter extends WPBakeryShortCode {
}
}
@@ -0,0 +1,427 @@
<?php
/*
* Module - Sticky Section
*/
if( !class_exists( 'Ultimate_Sticky_Section' ) ) {
/**
*
*/
class Ultimate_Sticky_Section
{
function __construct()
{
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action( 'init', array( $this, 'sticky_shortcode_mapper') );
}
add_shortcode( 'ult_sticky_section', array( $this, 'sticky_shortcode') );
add_action( 'wp_enqueue_scripts', array( $this, 'ult_sticky_section_scripts' ), 1 );
//add_action( 'wp_enqueue_scripts', array( $this , 'enqueue_style' ) );
} /* Contructor End*/
function sticky_shortcode( $atts, $content = null )
{
$el_class = '';
$sticky_gutter = $sticky_offset_class = '';
$sticky_width = $sticky_custom_width = '';
$stick_behaviour = '';
$sticky_position = $sticky_position_lr = $permanent_lr = '';
$btn_mobile = '';
extract( shortcode_atts( array(
"el_class" => "",
"sticky_gutter" => "",
"sticky_offset_class" => "",
"sticky_width" => "",
"sticky_custom_width" => "",
"stick_behaviour" => "",
"sticky_position" => "",
"sticky_position_lr" => "left",
"permanent_lr" => "",
"btn_mobile" => "",
"btn_support" => "",
), $atts ) );
$sticky_classes_data = array();
$sticky_gutter_class = " data-sticky_gutter_class= '";
$sticky_gutter_id = " data-sticky_gutter_id= '";
$class_flag = $id_flag = -1;
$stick_behaviour_data = "";
$left_right_postion = "";
$data_mobile = "";
$data_support = "";
if($btn_mobile == "enable"){
$data_mobile = " data-mobile='yes'";
}else{
$data_mobile = " data-mobile='no'";
}
if($btn_support == "enable"){
$data_support = " data-support='yes'";
}else{
$data_support = " data-support='no'";
}
//gutter classes explode
if( $sticky_offset_class != '' ){
//$sticky_class = " data-sticky_gutter_class= '";
if ( strpos( $sticky_offset_class, ',' ) !== false )
{
$sticky_classes_data = explode( ',', $sticky_offset_class ); //str_replace( ',', '', trim( $sticky_offset_class ) );
foreach($sticky_classes_data as $data) {
if ( strpos( $data, '.' ) !== false ) {
$class_flag = 0;
$sticky_gutter_class .= trim( $data );
$sticky_gutter_class .= " ";
}
elseif (strpos( $data, '#' ) !== false ) {
$id_flag = 0;
$sticky_gutter_id .= trim( $data );
$sticky_gutter_id .= " ";
}
}
// $sticky_gutter_class .= " '";
// $sticky_gutter_id .= " '";
//echo ( $sticky_classes[0] );
} //check ',' in string end if
else {
if ( strpos( $sticky_offset_class, '.' ) !== false ) {
$class_flag = 0;
$sticky_gutter_class .= trim( $sticky_offset_class );
}
elseif ( strpos( $sticky_offset_class, '#' ) !== false ) {
$id_flag = 0;
$sticky_gutter_id .= trim( $sticky_offset_class );
}
}//checked ',' in string end else
if ( $class_flag != 0 ) {
$sticky_gutter_class = "";
} else {
$sticky_gutter_class = rtrim( $sticky_gutter_class)."'";
}
if ( $id_flag != 0 ) {
$sticky_gutter_id = "";
} else {
$sticky_gutter_id = rtrim( $sticky_gutter_id )."'";
}
}//check sticky_offset_class end if
else{
$sticky_gutter_class = "";
$sticky_gutter_id = "";
} //check sticky_offset_class end else
//width data
if ( $sticky_width == 'customwidth' ) {
//$sticky_custom_width = " data-sticky_customwidth= '";
if ( $sticky_custom_width != '' ) {
if ( strpos( $sticky_custom_width, 'px' ) !== false || strpos( $sticky_custom_width, 'em' ) !== false || strpos( $sticky_custom_width, '%' ) !== false ) {
$sticky_custom_width .= " data-sticky_customwidth= '".esc_attr($sticky_custom_width);
} else {
$sticky_custom_width .= " data-sticky_customwidth= '".esc_attr($sticky_custom_width)."px";
}
} else {
$sticky_custom_width .= " data-sticky_customwidth= '60%";
}
$sticky_custom_width .= "'";
//$sticky_custom_width != '' ? " data-sticky_customwidth= '".$sticky_custom_width."px'" : " data-sticky_customwidth= '50px'" ;
}
//sticky bahviour
$stick_behaviour_data = $stick_behaviour != '' ? " data-stick_behaviour= '".esc_attr($stick_behaviour)."'" : " data-stick_behaviour= 'stick_with_scroll_row'" ;
//permanent data
if ( $stick_behaviour == 'stick_permanent') {
$left_right_postion = " data-lr_position= '".esc_attr($sticky_position_lr)."' ";
//$left_right_postion .=
if ( $permanent_lr != "" ) {
if ( strpos( $permanent_lr, 'px' ) !== false || strpos( $permanent_lr, 'em' ) !== false || strpos( $permanent_lr, '%' ) !== false ) {
$left_right_postion .= " data-lr_value= '".esc_attr($permanent_lr);
} else {
$left_right_postion .= " data-lr_value= '".esc_attr($permanent_lr)."px";
}
} else {
$left_right_postion .= "data-lr_value= '0";
}
//$permanent_lr != "" ? " data-lr_value= '".$permanent_lr."px" :"data-lr_value= '0";
$left_right_postion .= "'";
}
$custom_data = $sticky_gutter != '' ? " data-gutter= '".esc_attr($sticky_gutter)."'": '' ;
$custom_data .= $stick_behaviour_data ;
$custom_data .= $left_right_postion ;
$custom_data .= $sticky_gutter_class." ".$sticky_gutter_id;
$custom_data .= $sticky_width != '' ? " data-sticky_width= '".esc_attr($sticky_width)."'": '' ;
$custom_data .= $sticky_custom_width ;
$custom_data .= $sticky_position != '' ? " data-sticky_position= '".esc_attr($sticky_position)."'": " data-sticky_position= 'top'" ;
$custom_data .= $data_mobile;
$custom_data .= $data_support;
$output = '<div class="ult_row_spacer">';
$output .= '<div class="ult-sticky-anchor">';
$output .= '<div class="ult-sticky-section ult-sticky '.esc_attr($el_class).'" '.$custom_data.'>';
$output .= do_shortcode( $content );
$output .= '</div>';
$output .= '<div class="ult-space"></div>';
$output .= '</div></div>';
return $output;
}// end function sticky_shortcode
function sticky_shortcode_mapper()
{
if ( function_exists( 'vc_map' ) ) {
vc_map(
array(
"name" => __("Sticky Section", "ultimate_vc"),
"base" => "ult_sticky_section",
"icon" => "vc_icon_sticky_section",
"class" => "",
"as_parent" => array('except' => 'ult_sticky_section'),
"content_element" => true,
"controls" => "full",
"show_settings_on_create" => true,
"category" => "Ultimate VC Addons",
"description" => __("Make any elements sticky anywhere.",'ultimate_vc'),
"params" => array(
//gutter option
/*array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Gutter Space", "ultimate_vc" ),
"param_name" => "gutter",
"value" => array(
'Numerical Value' => 'num_value',
'Offset Container' => 'offset_container'
),
"description" => __( "Set top/bottom position of sticky section", "ultimate_vc" )
),*/
//// sticky behaviour
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Stick Behaviour", "ultimate_vc" ),
"param_name" => "stick_behaviour",
"value" => array(
'Stick with Row' => 'stick_with_scroll_row',
'Stick with Window' => 'stick_with_scroll',
'Stick Permanent' => 'stick_permanent'
),
"description" => __( "Set behaviour of sticky section", "ultimate_vc" )
),
//sticky offset class
/*array(
"type" => "textfield",
"class" => "",
"heading" => __( "Offset Container", "ultimate_vc" ),
"param_name" => "sticky_offset_class",
"value" => "",
"description" => __( "Do you already have a fixed horizontal header on the page? Add Class name or Id.<br>Ex: .class1, .class2, #ID1 ", "ultimate_vc" ),
),*/
//sticky section width
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Sticky Section Width", "ultimate_vc" ),
"param_name" => "sticky_width",
"value" => array(
'Default' => '',
'Full Width' => 'fullwidth',
'Custom Width' => 'customwidth'
),
"description" => __( "Set the width of container", "ultimate_vc" ),
"dependency" => array(
"element" => "stick_behaviour",
"value" => array( 'stick_with_scroll', 'stick_permanent' )
)
),
//sticy section custom width
array(
"type" => "textfield",
"heading" => __("Custom Width", "ultimate_vc"),
"param_name" => "sticky_custom_width",
"description" => __("Ex : 20px, 20%, 20em", "ultimate_vc"),
"dependency" => array(
"element" => "sticky_width",
"value" => "customwidth"
)
),
//sticky section position
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Sticky Section Postion Top / Bottom", "ultimate_vc" ),
"param_name" => "sticky_position",
"value" => array(
'Top' => '',
'Bottom' => 'bottom'
),
"description" => __( "Set the postion of container", "ultimate_vc" ),
"dependency" => array(
"element" => "stick_behaviour",
"value" => array( 'stick_permanent' )
)
),
//permanent position
array(
"type" => "dropdown",
"class" => "",
"heading" => __( "Sticky Section Postion Left / Right", "ultimate_vc" ),
"param_name" => "sticky_position_lr",
"value" => array(
'Left' => 'left',
'Right' => 'right'
),
"description" => __( "Default is Left : 0px ", "ultimate_vc" ),
"dependency" => array(
"element" => "stick_behaviour",
"value" => "stick_permanent"
)
),
array(
"type" => "textfield",
"heading" => __( "Value", "ultimate_vc" ),
"param_name" => "permanent_lr",
"description" => __("Ex : 20px, 20%, 20em", "ultimate_vc"),
"dependency" => array(
"element" => "sticky_position_lr",
"value" => array( "left", "right")
)
),
//num value
array(
"type" => "number",
"heading" => __("Gutter Space", "ultimate_vc"),
"param_name" => "sticky_gutter",
"suffix" => "px",
"description" => __("Ex : 20", "ultimate_vc"),
),
/*array(
"type" => "number",
"heading" => __("Postion From Right", "ultimate_vc"),
"param_name" => "permanent_right",
"description" => __("Ex : 20px, 20%, 20em", "ultimate_vc"),
"dependency" => array(
"element" => "stick_behaviour",
"value" => "stick_permanent"
)
),*/
/*array(
"type" => "ultimate_spacing",
"heading" => __("Postion", "ultimate_vc"),
"param_name" => "position",
"mode" => "padding", // margin/padding
"unit" => "px", // [required] px,em,%,all Default all
"positions" => array( // Also set 'defaults'
__("Top","ultimate_vc") => "",
__("Right","ultimate_vc") => "",
__("Bottom","ultimate_vc") => "",
__("Left","ultimate_vc") => ""
),
"dependency" => array(
"element" => "stick_behaviour",
"value" => "stick_permanent"
)
),*/
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Enable on Mobile", "ultimate_vc"),
"param_name" => "btn_mobile",
"value" => "",
"options" => array(
"enable" => array(
"label" => "",
"on" => "Yes",
"off" => "No",
)
),
"description" => __("Enable Sticky Element on Smartphone.", "ultimate_vc"),
"dependency" => Array("element" => "stick_behaviour", "value" => array( 'stick_with_scroll_row', 'stick_with_scroll','stick_permanent' )),
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Enable support", "ultimate_vc"),
"param_name" => "btn_support",
"value" => "",
"options" => array(
"enable" => array(
"label" => "",
"on" => "Yes",
"off" => "No",
)
),
"description" => __("Enable this incase Sticky Element not working.", "ultimate_vc"),
"dependency" => Array("element" => "stick_behaviour", "value" => array( 'stick_with_scroll' )),
),
array(
"type" => "textfield",
"heading" => __("Extra class name", "ultimate_vc"),
"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.", "ultimate_vc")
),
),
"js_view" => 'VcColumnView'
)
);//end vc_map
}//end vc_map checker
}//end function sticky_shotcode_mapper
//Add Script
function ult_sticky_section_scripts() {
Ultimate_VC_Addons::ultimate_register_script( 'ult_sticky_js', 'fixto', false, array( 'jquery' ), ULTIMATE_VERSION, true );
Ultimate_VC_Addons::ultimate_register_script( 'ult_sticky_section_js', 'sticky-section', false, array('ult_sticky_js'), ULTIMATE_VERSION, true );
Ultimate_VC_Addons::ultimate_register_style( 'ult_sticky_section_css', 'sticky-section' );
}//ult_sticky_section_class
}//end class Ultimate_Sticky_Section
// Instantiate the class
new Ultimate_Sticky_Section;
if ( class_exists( 'WPBakeryShortCodesContainer' ) && !class_exists( 'WPBakeryShortCode_ult_sticky_section' ) ) {
class WPBakeryShortCode_ult_sticky_section extends WPBakeryShortCodesContainer {
}
}
}
@@ -0,0 +1,773 @@
<?php
/*
* Add-on Name: Swatch Book for WPBakery Page Builder
* Add-on URI: http://.brainstormforce.com/demos/ultimate/swatch-book
*/
if(!class_exists('Ultimate_Swatch_Book')){
class Ultimate_Swatch_Book{
var $swatch_trans_bg_img;
var $swatch_width;
var $swatch_height;
function __construct(){
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action( 'init', array($this, 'swatch_book_init'));
}
add_action("wp_enqueue_scripts", array($this, "register_swatch_assets"),1);
if(function_exists('vc_is_inline')){
if(!vc_is_inline()){
add_shortcode( 'swatch_container', array($this, 'swatch_container' ) );
add_shortcode( 'swatch_item', array($this, 'swatch_item' ) );
}
} else {
add_shortcode( 'swatch_container', array($this, 'swatch_container' ) );
add_shortcode( 'swatch_item', array($this, 'swatch_item' ) );
}
}
function register_swatch_assets()
{
Ultimate_VC_Addons::ultimate_register_script( 'swatchbook-js', 'swatchbook', false, array( 'jquery' ), ULTIMATE_VERSION, false );
Ultimate_VC_Addons::ultimate_register_style( 'swatchbook-css', 'swatchbook' );
}
function swatch_book_init(){
if(function_exists('vc_map'))
{
vc_map(
array(
"name" => __("Swatch Book","ultimate_vc"),
"base" => "swatch_container",
"class" => "vc_swatch_container",
"icon" => "vc_swatch_container",
"category" => "Ultimate VC Addons",
"deprecated" => "3.13.5",
"as_parent" => array('only' => 'swatch_item'),
"description" => __("Interactive swatch strips.","ultimate_vc"),
"content_element" => true,
"show_settings_on_create" => true,
"js_view" => 'VcColumnView',
//"is_container" => true,
"params" => array(
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Swatch Book Style", "ultimate_vc"),
"param_name" => "swatch_style",
"value" => array(
__("Style 1","ultimate_vc") => "style-1",
__("Style 2","ultimate_vc") => "style-2",
__("Style 3","ultimate_vc") => "style-3",
__("Style 4","ultimate_vc") => "style-4",
__("Style 5","ultimate_vc") => "style-5",
__("Custom Style","ultimate_vc") => "custom",
),
//"description" => __("","smile"),
"group" => "Initial Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Index of Center Strip", "ultimate_vc"),
"param_name" => "swatch_index_center",
"value" => 1,
"min" => 1,
"max" => 100,
"suffix" => "",
"description" => __("The index of the “centered” item, the one that will have an angle of 0 degrees when the swatch book is opened", "ultimate_vc"),
"dependency" => Array("element" => "swatch_style", "value" => "custom"),
"group" => "Initial Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Space Between Two Swatches", "ultimate_vc"),
"param_name" => "swatch_space_degree",
"value" => 1,
"min" => 1,
"max" => 1000,
"suffix" => "",
"description" => __("The space between the items (in degrees)", "ultimate_vc"),
"dependency" => Array("element" => "swatch_style", "value" => "custom"),
"group" => "Initial Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Transition Speed", "ultimate_vc"),
"param_name" => "swatch_trans_speed",
"value" => 500,
"min" => 1,
"max" => 10000,
"suffix" => "ms",
"description" => __("The speed and transition timing functions", "ultimate_vc"),
"dependency" => Array("element" => "swatch_style", "value" => "custom"),
"group" => "Initial Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Distance From Open Item To Its Next Sibling", "ultimate_vc"),
"param_name" => "swatch_distance_sibling",
"value" => 1,
"min" => 1,
"max" => 10000,
"suffix" => "",
"description" => __("Distance From Opened item’s next siblings (neighbor : 4)", "ultimate_vc"),
"dependency" => Array("element" => "swatch_style", "value" => "custom"),
"group" => "Initial Settings",
),
array(
"type" => "ult_switch",
"class" => "",
"heading" => __("Swatch book will be initially closed", "ultimate_vc"),
"param_name" => "swatch_init_closed",
"value" => "",
"options" => array(
"closed" => array(
"label" => "",
"on" => __("Yes","ultimate_vc"),
"off" => __("No","ultimate_vc"),
)
),
//"description" => "",
"dependency" => Array("element" => "swatch_style", "value" => "custom"),
"group" => "Initial Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Index of the item that will be opened initially", "ultimate_vc"),
"param_name" => "swatch_open_at",
"value" => 1,
"min" => 1,
"max" => 100,
"suffix" => "",
//"description" => __("", "smile"),
"dependency" => Array("element" => "swatch_style", "value" => "custom"),
"group" => "Initial Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Width", "ultimate_vc"),
"param_name" => "swatch_width",
"value" => 130,
"min" => 100,
"max" => 1000,
"suffix" => "",
//"description" => __("", "smile"),
"group" => "Initial Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Height", "ultimate_vc"),
"param_name" => "swatch_height",
"value" => 400,
"min" => 100,
"max" => 1000,
"suffix" => "",
//"description" => __("", "smile"),
"group" => "Initial Settings",
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Background Transparent Pattern", "ultimate_vc"),
"param_name" => "swatch_trans_bg_img",
"value" => "",
//"description" => "",
"group" => "Initial Settings",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Main Strip Title Text", "ultimate_vc"),
"param_name" => "swatch_main_strip_text",
"value" => "",
"description" => "",
"group" => "Initial Settings",
),
array(
"type" => "textfield",
"class" => "",
"heading" => __("Main Strip Highlight Text", "ultimate_vc"),
"param_name" => "swatch_main_strip_highlight_text",
"value" => "",
//"description" => "",
"group" => "Initial Settings",
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "main_strip_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Advanced Settings",
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "main_strip_font_style",
"group" => "Advanced Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Main Strip Title Font Size", "ultimate_vc"),
"param_name" => "swatch_main_strip_font_size",
"value" => 16,
"min" => 1,
"max" => 72,
"suffix" => "px",
//"description" => __("", "smile"),
"group" => "Advanced Settings",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Main Strip Title Font Style", "ultimate_vc"),
"param_name" => "swatch_main_strip_font_style",
"value" => array(
__("Normal","ultimate_vc") => "normal",
__("Bold","ultimate_vc") => "bold",
__("Italic","ultimate_vc") => "italic",
),
//"description" => __("", "smile"),
"group" => "Advanced Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Main Strip Title Color:", "ultimate_vc"),
"param_name" => "swatch_main_strip_color",
"value" => "",
"description" => "",
"group" => "Advanced Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Main Strip Title Background Color:", "ultimate_vc"),
"param_name" => "swatch_main_strip_bg_color",
"value" => "",
//"description" => "",
"group" => "Advanced Settings",
),
array(
"type" => "number",
"class" => "",
"heading" => __("Main Strip Title Highlight Font Size", "ultimate_vc"),
"param_name" => "swatch_main_strip_highlight_font_size",
"value" => 16,
"min" => 1,
"max" => 72,
"suffix" => "px",
//"description" => __("", "smile"),
"group" => "Advanced Settings",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Main Strip Title Highlight Font Weight", "ultimate_vc"),
"param_name" => "swatch_main_strip_highlight_font_weight",
"value" => array(
__("Normal","ultimate_vc") => "normal",
__("Bold","ultimate_vc") => "bold",
__("Italic","ultimate_vc") => "italic",
),
//"description" => __("", "smile"),
"group" => "Advanced Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Main Strip Title Highlight Color", "ultimate_vc"),
"param_name" => "swatch_main_strip_highlight_color",
"value" => "",
//"description" => "",
"group" => "Advanced Settings",
),
)
)
); // vc_map
vc_map(
array(
"name" => __("Swatch Book Item", "ultimate_vc"),
"base" => "swatch_item",
"class" => "vc_swatch_item",
"icon" => "vc_swatch_item",
"content_element" => true,
"as_child" => array('only' => 'swatch_container'),
"is_container" => false,
"params" => array(
array(
"type" => "textfield",
"class" => "",
"heading" => __("Strip Title Text", "ultimate_vc"),
"param_name" => "swatch_strip_text",
"value" => "",
//"description" => "",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon to display:", "ultimate_vc"),
"param_name" => "icon_type",
"value" => array(
"Font Icon Manager" => "selector",
"Custom Image Icon" => "custom",
),
"description" => __("Use an existing font icon or upload a custom image.", "ultimate_vc")
),
array(
"type" => "icon_manager",
"class" => "",
"heading" => __("Select Icon ","ultimate_vc"),
"param_name" => "icon",
"value" => "",
"description" => __("Click and select icon of your choice. If you can't find the one that suits for your purpose","ultimate_vc").", ".__("you can","ultimate_vc")." <a href='admin.php?page=bsf-font-icon-manager' target='_blank' rel='noopener'>".__("add new here","ultimate_vc")."</a>.",
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "ult_img_single",
"class" => "",
"heading" => __("Upload Image Icon:", "ultimate_vc"),
"param_name" => "icon_img",
"value" => "",
"description" => __("Upload the custom image icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Image Width", "ultimate_vc"),
"param_name" => "img_width",
"value" => 48,
"min" => 16,
"max" => 512,
"suffix" => "px",
"description" => __("Provide image width", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("custom")),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Size of Icon", "ultimate_vc"),
"param_name" => "icon_size",
"value" => 32,
"min" => 12,
"max" => 72,
"suffix" => "px",
"description" => __("How big would you like it?", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Color", "ultimate_vc"),
"param_name" => "icon_color",
"value" => "#333333",
"description" => __("Give it a nice paint!", "ultimate_vc"),
"dependency" => Array("element" => "icon_type","value" => array("selector")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Style", "ultimate_vc"),
"param_name" => "icon_style",
"value" => array(
__("Simple","ultimate_vc") => "none",
__("Circle Background","ultimate_vc") => "circle",
__("Square Background","ultimate_vc") => "square",
__("Design your own","ultimate_vc") => "advanced",
),
"description" => __("We have given three quick preset if you are in a hurry. Otherwise, create your own with various options.", "ultimate_vc"),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Background Color", "ultimate_vc"),
"param_name" => "icon_color_bg",
"value" => "#ffffff",
"description" => __("Select background color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("circle","square","advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Icon Border Style", "ultimate_vc"),
"param_name" => "icon_border_style",
"value" => array(
__("None","ultimate_vc") => "",
__("Solid","ultimate_vc")=> "solid",
__("Dashed","ultimate_vc") => "dashed",
__("Dotted","ultimate_vc") => "dotted",
__("Double","ultimate_vc") => "double",
__("Inset","ultimate_vc") => "inset",
__("Outset","ultimate_vc") => "outset",
),
"description" => __("Select the border style for icon.","ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Border Color", "ultimate_vc"),
"param_name" => "icon_color_border",
"value" => "#333333",
"description" => __("Select border color for icon.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Width", "ultimate_vc"),
"param_name" => "icon_border_size",
"value" => 1,
"min" => 1,
"max" => 10,
"suffix" => "px",
"description" => __("Thickness of the border.", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Border Radius", "ultimate_vc"),
"param_name" => "icon_border_radius",
"value" => 500,
"min" => 1,
"max" => 500,
"suffix" => "px",
"description" => __("0 pixel value will create a square border. As you increase the value, the shape convert in circle slowly. (e.g 500 pixels).", "ultimate_vc"),
"dependency" => Array("element" => "icon_border_style", "not_empty" => true),
),
array(
"type" => "number",
"class" => "",
"heading" => __("Background Size", "ultimate_vc"),
"param_name" => "icon_border_spacing",
"value" => 50,
"min" => 30,
"max" => 500,
"suffix" => "px",
"description" => __("Spacing from center of the icon till the boundary of border / background", "ultimate_vc"),
"dependency" => Array("element" => "icon_style", "value" => array("advanced")),
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Animation","ultimate_vc"),
"param_name" => "icon_animation",
"value" => array(
__("No Animation","ultimate_vc") => "",
__("Swing","ultimate_vc") => "swing",
__("Pulse","ultimate_vc") => "pulse",
__("Fade In","ultimate_vc") => "fadeIn",
__("Fade In Up","ultimate_vc") => "fadeInUp",
__("Fade In Down","ultimate_vc") => "fadeInDown",
__("Fade In Left","ultimate_vc") => "fadeInLeft",
__("Fade In Right","ultimate_vc") => "fadeInRight",
__("Fade In Up Long","ultimate_vc") => "fadeInUpBig",
__("Fade In Down Long","ultimate_vc") => "fadeInDownBig",
__("Fade In Left Long","ultimate_vc") => "fadeInLeftBig",
__("Fade In Right Long","ultimate_vc") => "fadeInRightBig",
__("Slide In Down","ultimate_vc") => "slideInDown",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Slide In Left","ultimate_vc") => "slideInLeft",
__("Bounce In","ultimate_vc") => "bounceIn",
__("Bounce In Up","ultimate_vc") => "bounceInUp",
__("Bounce In Down","ultimate_vc") => "bounceInDown",
__("Bounce In Left","ultimate_vc") => "bounceInLeft",
__("Bounce In Right","ultimate_vc") => "bounceInRight",
__("Rotate In","ultimate_vc") => "rotateIn",
__("Light Speed In","ultimate_vc") => "lightSpeedIn",
__("Roll In","ultimate_vc") => "rollIn",
),
"description" => __("Like CSS3 Animations? We have several options for you!","ultimate_vc")
),
array(
"type" => "number",
"class" => "",
"heading" => __("Strip Title Font Size", "ultimate_vc"),
"param_name" => "swatch_strip_font_size",
"value" => 16,
"min" => 1,
"max" => 72,
"suffix" => "px",
//"description" => __("", "smile"),
"group" => "Advanced Settings",
),
array(
"type" => "dropdown",
"class" => "",
"heading" => __("Strip Title Font Weight", "ultimate_vc"),
"param_name" => "swatch_strip_font_weight",
"value" => array(
__("Normal","ultimate_vc") => "normal",
__("Bold","ultimate_vc") => "bold",
__("Italic","ultimate_vc") => "italic",
),
//"description" => __("", "smile"),
"group" => "Advanced Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Strip Title Color:", "ultimate_vc"),
"param_name" => "swatch_strip_font_color",
"value" => "",
"description" => "",
"group" => "Advanced Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Strip Title Background Color:", "ultimate_vc"),
"param_name" => "swatch_strip_title_bg_color",
"value" => "",
//"description" => "",
"group" => "Advanced Settings",
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Strip Background Color:", "ultimate_vc"),
"param_name" => "swatch_strip_bg_color",
"value" => "",
//"description" => "",
"group" => "Advanced Settings",
),
)
)
); // vc_map
}
}
function swatch_container($atts,$content=null){
$swatch_style = $swatch_index_center = $swatch_space_degree = $swatch_trans_speed = $swatch_distance_sibling = $swatch_init_closed = $swatch_open_at
= $swatch_width = $swatch_height = $swatch_trans_bg_img = $swatch_main_strip_text = $swatch_main_strip_highlight_text = $swatch_main_strip_font_size = $swatch_main_strip_font_style = $swatch_main_strip_color = $swatch_main_strip_highlight_font_size = $swatch_main_strip_highlight_font_weight = $swatch_main_strip_highlight_color = $swatch_main_strip_bg_color = $main_strip_font_family = $main_strip_font_style = '';
extract(shortcode_atts(array(
'swatch_style' => 'style-1',
'swatch_index_center' => '1',
'swatch_space_degree' => '1',
'swatch_trans_speed' => '500',
'swatch_distance_sibling' => '1',
'swatch_init_closed' => 'on',
'swatch_open_at' => '1',
'swatch_width' => '130',
'swatch_height' => '400',
'swatch_trans_bg_img' => '',
'swatch_main_strip_text' => '',
'swatch_main_strip_highlight_text' => '',
'swatch_main_strip_font_size' => '16',
'swatch_main_strip_font_style' => 'normal',
'swatch_main_strip_color' => '',
'swatch_main_strip_highlight_font_size' => '16',
'swatch_main_strip_highlight_font_weight' => 'normal',
'swatch_main_strip_highlight_color' => '',
'swatch_main_strip_bg_color' => '',
'main_strip_font_family' => '',
'main_strip_font_style' => '',
),$atts));
$output = $img = $style = $highlight_style = $main_style = '';
$uid = uniqid();
if($swatch_trans_bg_img !== ''){
// $img = wp_get_attachment_image_src( $swatch_trans_bg_img, 'large');
// $img = $img[0];
$img = apply_filters('ult_get_img_single', $swatch_trans_bg_img, 'url');
$this->swatch_trans_bg_img = $swatch_trans_bg_img;
$style .= 'background-image: url('.esc_url($img).');';
}
if($swatch_width !== ''){
$style .= 'width:'.$swatch_width.'px;';
$this->swatch_width = $swatch_width;
}
if($swatch_height !== ''){
$style .= 'height:'.$swatch_height.'px;';
$this->swatch_height = $swatch_height;
}
if($swatch_main_strip_highlight_font_size !== ''){
$highlight_style .= 'font-size:'.$swatch_main_strip_highlight_font_size.'px;';
}
if($swatch_main_strip_highlight_font_weight !== ''){
$highlight_style .= 'font-weight:'.$swatch_main_strip_highlight_font_weight.';';
}
if($swatch_main_strip_highlight_color !== ''){
$highlight_style .= 'color:'.$swatch_main_strip_highlight_color.';';
}
if($main_strip_font_family != '')
{
$mhfont_family = get_ultimate_font_family($main_strip_font_family);
$main_style .= 'font-family:\''.$mhfont_family.'\';';
}
$main_style .= get_ultimate_font_style($main_strip_font_style);
if($swatch_main_strip_font_size !== ''){
$main_style .= 'font-size:'.$swatch_main_strip_font_size.'px;';
}
if($swatch_main_strip_font_style !== ''){
$main_style .= 'font-weight:'.$swatch_main_strip_font_style.';';
}
if($swatch_main_strip_color !== ''){
$main_style .= 'color:'.$swatch_main_strip_color.';';
}
if($swatch_main_strip_bg_color !== ''){
$main_style .= 'background:'.$swatch_main_strip_bg_color.';';
}
$output .= '<div id="ulsb-container-'.esc_attr($uid).'" class="ulsb-container ulsb-'.esc_attr($swatch_style).'" style="width:'.esc_attr($swatch_width).'px; height:'.esc_attr($swatch_height).'px;">';
$output .= do_shortcode($content);
$output .= '<div class="ulsb-strip highlight-strip" style="'.esc_attr($style).'">';
$output .= '<h4 class="strip_main_text" style="'.esc_attr($main_style).'"><span>'.$swatch_main_strip_text.'</span></h4>';
$output .= '<h5 class="strip_highlight_text" style="'.esc_attr($highlight_style).'"><span>'.$swatch_main_strip_highlight_text.'</span></h5>';
$output .= '</div>';
$output .= '</div>';
$output .= '<script type="text/javascript">
jQuery(function() {';
if($swatch_style == 'style-1'){
$output .= 'jQuery( "#ulsb-container-'.esc_attr($uid).'" ).swatchbook();';
}
if($swatch_style == 'style-2'){
$output .= 'jQuery( "#ulsb-container-'.esc_attr($uid).'" ).swatchbook( {
angleInc : -10,
proximity : -45,
neighbor : -4,
closeIdx : 11
} );';
}
if($swatch_style == 'style-3'){
$output .= 'jQuery( "#ulsb-container-'.esc_attr($uid).'" ).swatchbook( {
angleInc : 15,
neighbor : 15,
initclosed : true,
closeIdx : 11
} );';
}
if($swatch_style == 'style-4'){
$output .= 'jQuery( "#ulsb-container-'.esc_attr($uid).'" ).swatchbook( {
speed : 500,
easing : "ease-out",
center : 7,
angleInc : 14,
proximity : 40,
neighbor : 2
} );';
}
if($swatch_style == 'style-5'){
$output .= 'jQuery( "#ulsb-container-'.esc_attr($uid).'" ).swatchbook( { openAt : 0 } );';
}
if($swatch_style == 'custom'){
$swatch_options = '';
if($swatch_trans_speed !== '')
$swatch_options .= 'speed : '.esc_attr($swatch_trans_speed).',';
if($swatch_index_center !== '')
$swatch_options .= 'center : '.esc_attr($swatch_index_center).',';
if($swatch_space_degree !== '')
$swatch_options .= 'angleInc : '.esc_attr($swatch_space_degree).',';
if($swatch_distance_sibling !== '')
$swatch_options .= 'neighbor : '.esc_attr($swatch_distance_sibling).',';
if($swatch_open_at !== '')
$swatch_options .= 'openAt : '.esc_attr($swatch_open_at).',';
if($swatch_init_closed === 'on')
$swatch_init_closed = 'true';
else
$swatch_init_closed = 'false';
$swatch_options .= 'closeIdx : '.esc_attr($swatch_init_closed).',';
$output .= 'jQuery( "#ulsb-container-'.esc_attr($uid).'" ).swatchbook( {
'.$swatch_options.'
easing : "ease-out",
proximity : 40,
} );';
}
$output .= '});';
$output .= 'jQuery(document).ready(function(e) {
var ult_strip = jQuery(".highlight-strip");
ult_strip.each(function(index, element) {
var strip_main_text = jQuery(this).children(".strip_main_text").outerHeight();
var height = '.esc_attr($swatch_height).'-strip_main_text;
jQuery(this).children(".strip_highlight_text").css("height",height);
});
});';
$output .= '</script>';
return $output;
}
function swatch_item($atts,$content=null){
$icon_type = $icon_img = $img_width = $icon = $icon_color = $icon_color_bg = $icon_size = $icon_style = $icon_border_style = $icon_border_radius = $icon_color_border = $icon_border_size = $icon_border_spacing = $el_class = $icon_animation = $swatch_strip_font_size = $swatch_strip_font_weight = $swatch_strip_font_color = $swatch_strip_bg_color = $swatch_strip_title_bg_color = '';
extract(shortcode_atts(array(
'swatch_strip_text' => '',
'icon_type' => '',
'icon' => '',
'icon_img' => '',
'img_width' => '',
'icon_size' => '',
'icon_color' => '',
'icon_style' => '',
'icon_color_bg' => '',
'icon_color_border' => '',
'icon_border_style' => '',
'icon_border_size' => '',
'icon_border_radius' => '',
'icon_border_spacing' => '',
'icon_animation' => '',
'swatch_strip_font_size' => '',
'swatch_strip_font_weight' => '',
'swatch_strip_font_color' => '',
'swatch_strip_bg_color' => '',
'swatch_strip_title_bg_color' => '',
'el_class' => '',
),$atts));
$output = '';
$box_icon = do_shortcode('[just_icon icon_type="'.esc_attr($icon_type).'" icon="'.esc_attr($icon).'" icon_img="'.esc_attr($icon_img).'" img_width="'.esc_attr($img_width).'" icon_size="'.esc_attr($icon_size).'" icon_color="'.esc_attr($icon_color).'" icon_style="'.esc_attr($icon_style).'" icon_color_bg="'.esc_attr($icon_color_bg).'" icon_color_border="'.esc_attr($icon_color_border).'" icon_border_style="'.esc_attr($icon_border_style).'" icon_border_size="'.esc_attr($icon_border_size).'" icon_border_radius="'.esc_attr($icon_border_radius).'" icon_border_spacing="'.esc_attr($icon_border_spacing).'" icon_animation="'.esc_attr($icon_animation).'"]');
$style = '';
if($this->swatch_trans_bg_img !== ''){
// $img = wp_get_attachment_image_src( $this->swatch_trans_bg_img, 'large');
// $img = $img[0];
$img = apply_filters('ult_get_img_single', $this->swatch_trans_bg_img, 'url');
$style .= 'background-image: url('.esc_url($img).');';
}
if($swatch_strip_bg_color !== ''){
$style .= 'background-color: '.esc_attr($swatch_strip_bg_color).';';
}
if($this->swatch_width !== ''){
$style .= 'width:'.esc_attr($this->swatch_width).'px;';
}
if($this->swatch_height!== ''){
$style .= 'height:'.esc_attr($this->swatch_height).'px;';
}
$output .= '<div class="ulsb-strip '.esc_attr($el_class).'" style="'.esc_attr($style).'">';
$output .= '<span class="ulsb-icon">'.$box_icon.'</span>';
$output .= '<h4 style="color:'.esc_attr($swatch_strip_font_color).'; background:'.esc_attr($swatch_strip_title_bg_color).'; font-size:'.esc_attr($swatch_strip_font_size).'px; font-style: '.esc_attr($swatch_strip_font_weight).';"><span>'.$swatch_strip_text.'</span></h4>';
$output .= '</div>';
return $output;
}
}
}
global $Ultimate_Swatch_Book;
$Ultimate_Swatch_Book = new Ultimate_Swatch_Book;
if(class_exists('WPBakeryShortCodesContainer'))
{
if(!class_exists('WPBakeryShortCode_swatch_container'))
{
class WPBakeryShortCode_swatch_container extends WPBakeryShortCodesContainer {
function content( $atts, $content = null ) {
global $Ultimate_Swatch_Book;
return $Ultimate_Swatch_Book->swatch_container($atts, $content);
}
}
}
if(!class_exists('WPBakeryShortCode_swatch_item'))
{
class WPBakeryShortCode_swatch_item extends WPBakeryShortCode {
function content( $atts, $content = null ) {
global $Ultimate_Swatch_Book;
return $Ultimate_Swatch_Book->swatch_item($atts, $content);
}
}
}
}
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,366 @@
<?php
/*
* Add-on Name: Ultimate Video Banner
* Add-on URI: http://dev.brainstormforce.com
*/
if(!class_exists('Ultimate_Video_Banner')) {
class Ultimate_Video_Banner {
function __construct() {
if ( Ultimate_VC_Addons::$uavc_editor_enable ) {
add_action('init',array($this,'ultimate_video_banner_init'));
}
add_shortcode('ultimate_video_banner',array($this,'ultimate_video_banner_shortcode'));
add_action("wp_enqueue_scripts", array($this, "register_video_banner_assets"),1);
}
function register_video_banner_assets() {
Ultimate_VC_Addons::ultimate_register_style( 'ultimate-video-banner-style', 'video-banner' );
Ultimate_VC_Addons::ultimate_register_script( 'ultimate-video-banner-script', 'video-banner', false, array( 'jquery' ), ULTIMATE_VERSION, false );
}
function ultimate_video_banner_init() {
if(function_exists('vc_map')) {
vc_map(
array(
'name' => __('Video Banner','ultimate_vc'),
'base' => 'ultimate_video_banner',
'icon' => 'vc_ultimate_video_banner',
'category' => 'Ultimate VC Addons',
'description' => __('Show your video in ease.','ultimate_vc'),
'deprecated' => '3.13.5',
'params' => array(
array(
'type' => 'textfield',
'heading' => __('Link to the video in MP4 Format','ultimate_vc'),
'param_name' => 'video_banner_mp4_link',
),
array(
'type' => 'textfield',
'heading' => __('Link to the video in WebM / Ogg Format','ultimate_vc'),
'param_name' => 'video_banner_webm_ogg_link',
'description' => __('IE, Chrome & Safari','ultimate_vc').' <a href="http://www.w3schools.com/html/html5_video.asp" target="_blank" rel="noopener">'.__('support','ultimate_vc').'</a> '.__('MP4 format, while Firefox & Opera prefer WebM / Ogg formats.','ultimate_vc').' '.__('You can upload the video through','ultimate_vc').' <a href="'.home_url().'/wp-admin/media-new.php" target="_blank" rel="noopener">'.__('WordPress Media Library','ultimate_vc').'</a>.',
),
array(
'type' => 'ult_img_single',
'heading' => __('Placeholder','ultimate_vc'),
'param_name' => 'video_banner_placeholder',
),
array(
'type' => 'dropdown',
'heading' => __('Effect','ultimate_vc'),
'param_name' => 'video_banner_effect',
'value' => array(
__('Style 1','ultimate_vc') => 'ult-vdo-effect-style1',
__('Style 2','ultimate_vc') => 'ult-vdo-effect-style2',
__('Style 3','ultimate_vc') => 'ult-vdo-effect-style3',
__('Style 4','ultimate_vc') => 'ult-vdo-effect-style4',
__('Style 5','ultimate_vc') => 'ult-vdo-effect-style5',
__('Style 6','ultimate_vc') => 'ult-vdo-effect-style6',
__('Style 7','ultimate_vc') => 'ult-vdo-effect-style7',
//__('Style 8','ultimate_vc') => 'ult-vdo-effect-style10',
//__('Style 9','ultimate_vc') => 'ult-vdo-effect-style10',
//__('Style 10','ultimate_vc') => 'ult-vdo-effect-style10'
)
),
array(
'type' => 'textfield',
'heading' => __('Title','ultimate_vc'),
'param_name' => 'video_banner_title',
'group' => 'Content'
),
array(
'type' => 'textarea',
'heading' => __('Content','ultimate_vc'),
'param_name' => 'video_banner_content',
'group' => 'Content'
),
array(
"type" => "ult_param_heading",
"text" => __("Title Settings","ultimate_vc"),
"param_name" => "title_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper no-top-margin vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "title_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "title_font_style",
"group" => "Typography"
),
array(
"type" => "number",
"class" => "font-size",
"heading" => __("Font Size", "ultimate_vc"),
"param_name" => "title_font_size",
"min" => 10,
"suffix" => "px",
"group" => "Typography"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "title_color",
"value" => "",
"group" => "Typography"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Line Height", "ultimate_vc"),
"param_name" => "title_line_height",
"value" => "",
"suffix" => "px",
"group" => "Typography"
),
array(
"type" => "ult_param_heading",
"text" => __("Desciption Settings","ultimate_vc"),
"param_name" => "desc_typograpy",
"group" => "Typography",
"class" => "ult-param-heading",
'edit_field_class' => 'ult-param-heading-wrapper vc_column vc_col-sm-12',
),
array(
"type" => "ultimate_google_fonts",
"heading" => __("Font Family", "ultimate_vc"),
"param_name" => "desc_font_family",
"description" => __("Select the font of your choice.","ultimate_vc")." ".__("You can","ultimate_vc")." <a target='_blank' rel='noopener' href='".admin_url('admin.php?page=bsf-google-font-manager')."'>".__("add new in the collection here","ultimate_vc")."</a>.",
"group" => "Typography"
),
array(
"type" => "ultimate_google_fonts_style",
"heading" => __("Font Style", "ultimate_vc"),
"param_name" => "desc_font_style",
"group" => "Typography"
),
array(
"type" => "number",
"class" => "font-size",
"heading" => __("Font Size", "ultimate_vc"),
"param_name" => "desc_font_size",
"min" => 10,
"suffix" => "px",
"group" => "Typography"
),
array(
"type" => "colorpicker",
"class" => "",
"heading" => __("Font Color", "ultimate_vc"),
"param_name" => "desc_color",
"value" => "",
"group" => "Typography"
),
array(
"type" => "number",
"class" => "",
"heading" => __("Line Height", "ultimate_vc"),
"param_name" => "desc_line_height",
"value" => "",
"suffix" => "px",
"group" => "Typography"
),
array(
'type' => 'ultimate_responsive',
'heading' => __('Banner Size','ultimate_vc'),
'param_name' => 'video_banner_size',
'unit' => 'px',
'media' => array(
'Desktop' => '',
'Tablet' => '',
'Tablet Portrait' => '',
'Mobile Landscape' => '',
'Mobile' => '',
),
'group' => 'Design'
),
array(
'type' => 'colorpicker',
'heading' => __('Overlay Color','ultimate_vc'),
'param_name' => 'video_banner_overlay_color',
'group' => 'Design'
),
array(
'type' => 'colorpicker',
'heading' => __('Overlay Hover Color','ultimate_vc'),
'param_name' => 'video_banner_overlay_hover_color',
'group' => 'Design'
),
array(
'type' => 'css_editor',
'heading' => __('CSS','ultimate_vc'),
'param_name' => 'video_banner_vc_css',
'edit_field_class' => 'vc_col-sm-12 vc_column no-vc-background no-vc-border video_banner_css_editor',
'group' => 'Design'
),
array(
'type' => 'number',
'heading' => __('Start Time','ultimate_vc'),
'param_name' => 'video_banner_start_time',
'suffix' => 'in seconds',
'group' => 'Advanced Settings'
),
array(
'type' => 'checkbox',
'heading' => __('Mute','ultimate_vc'),
'param_name' => 'video_banner_mute',
'value' => array(
__('Enable','ultimate_vc') => 'muted'
),
'group' => 'Advanced Settings'
)
)
)
);
}
}
function ultimate_video_banner_shortcode($atts, $content = null) {
extract(
shortcode_atts(
array(
'video_banner_mp4_link' => '',
'video_banner_webm_ogg_link' => '',
'video_banner_effect' => 'ult-vdo-effect-style1',
'video_banner_placeholder' => '',
'video_banner_title' => '',
'video_banner_content' => '',
'title_font_family' => '',
'title_font_style' => '',
'title_font_size' => '',
'title_color' => '',
'title_line_height' => '',
'desc_font_family' => '',
'desc_font_style' => '',
'desc_font_size' => '',
'desc_color' => '',
'desc_line_height' => '',
'video_banner_size' => '',
'video_banner_overlay_color' => '',
'video_banner_overlay_hover_color' => '',
'video_banner_vc_css' => '',
'video_banner_start_time' => '0',
'video_banner_mute' => '',
),$atts
)
);
$output = $placeholder = $placeholder_css = $vc_css_class = '';
$vc_css_class = apply_filters( VC_SHORTCODE_CUSTOM_CSS_FILTER_TAG, vc_shortcode_custom_css_class( $video_banner_vc_css, ' ' ), 'ultimate_video_banner', $atts );
$video_id = 'ult-video-banner-'.uniqid(rand());
$args = array(
'target' => '#'.$video_id,
'media_sizes' => array(
'width' => $video_banner_size,
),
);
$banner_height_responsive_data = get_ultimate_vc_responsive_media_css($args);
if(preg_match('/^#[a-f0-9]{6}$/i', $video_banner_overlay_color)) //hex color is valid
{
$video_banner_overlay_color = hex2rgbUltParallax($video_banner_overlay_color, $opacity = 0.8);
}
if(preg_match('/^#[a-f0-9]{6}$/i', $video_banner_overlay_hover_color)) //hex color is valid
{
$video_banner_overlay_hover_color = hex2rgbUltParallax($video_banner_overlay_hover_color, $opacity = 0.4);
}
/* ---- main heading styles ---- */
$title_style_inline = '';
if($title_font_family != '')
{
$title_font_family = get_ultimate_font_family($title_font_family);
if($title_font_family)
$title_style_inline .= 'font-family:\''.$title_font_family.'\';';
}
// main heading font style
$title_style_inline .= get_ultimate_font_style($title_font_style);
//attach font size if set
if($title_font_size != '')
$title_style_inline .= 'font-size:'.$title_font_size.'px;';
//attach font color if set
if($title_color != '')
$title_style_inline .= 'color:'.$title_color.';';
//line height
if($title_line_height != '')
$title_style_inline .= 'line-height:'.$title_line_height.'px;';
/* ---- description styles ---- */
$desc_style_inline = '';
if($desc_font_family != '')
{
$desc_font_family = get_ultimate_font_family($desc_font_family);
if($desc_font_family)
$desc_style_inline .= 'font-family:\''.$desc_font_family.'\';';
}
// desc font style
$desc_style_inline .= get_ultimate_font_style($desc_font_style);
//attach font size if set
if($desc_font_size != '')
$desc_style_inline .= 'font-size:'.$desc_font_size.'px;';
//attach font color if set
if($desc_color != '')
$desc_style_inline .= 'color:'.$desc_color.';';
//line height
if($desc_line_height != '')
$desc_style_inline .= 'line-height:'.$desc_line_height.'px;';
if($video_banner_placeholder != '')
{
$img_info = apply_filters('ult_get_img_single', $video_banner_placeholder, 'url', 'full');
$placeholder = $img_info;
$placeholder_css = 'background-image:url('.esc_url( $placeholder ).');';
}
$output = '<div id="'.esc_attr($video_id).'" class="'.esc_attr($vc_css_class).' ult-video-banner ult-vdo-effect '.esc_attr($video_banner_effect).' utl-video-banner-item ult-responsive" '.$banner_height_responsive_data.' data-current-time="'.esc_attr($video_banner_start_time).'" data-placeholder="'.esc_attr($placeholder).'" style="'.esc_attr($placeholder_css).'">';
if($video_banner_mp4_link != '' || $video_banner_webm_ogg_link != '') :
$output .= '<video autoplay loop '.$video_banner_mute.' poster="'.esc_attr($placeholder).'">';
if($video_banner_mp4_link != '')
$output .= '<source src="'.esc_attr($video_banner_mp4_link).'" type="video/mp4">';
if($video_banner_webm_ogg_link != '') :
$ext = pathinfo($video_banner_webm_ogg_link);
if($ext['extension'] == 'webm')
$type = 'webm';
else
$type = 'ogg';
$output .= '<source src="'.esc_url($video_banner_webm_ogg_link).'" type="video/'.esc_attr($type).'">';
endif;
$output.= __('Your browser does not support the video tag.','ultimate_vc');
$output .= '</video>';
endif;
if($video_banner_title != '' || $content != '') :
$output .= '<div class="ult-video-banner-desc">';
if($video_banner_title != '') :
$output .= '<h2 class="ult-video-banner-title" style="'.esc_attr($title_style_inline).'">'.__($video_banner_title, 'ultimate_vc').'</h2>';
endif;
if($video_banner_content != '') :
$output .= '<div class="ult-video-banner-content" style="'.esc_attr($desc_style_inline).'">'.__($video_banner_content, 'ultimate_vc').'</div>';
endif;
$output .= '</div>';
endif;
$output .= '<div class="ult-video-banner-overlay" data-overlay="'.esc_attr($video_banner_overlay_color).'" data-overlay-hover="'.esc_attr($video_banner_overlay_hover_color).'"></div>';
$output .= '</div>';
return $output;
}
}
}
$Ultimate_Video_Banner = new Ultimate_Video_Banner;
if ( class_exists( 'WPBakeryShortCode' ) && !class_exists( 'WPBakeryShortCode_ultimate_video_banner' ) ) {
class WPBakeryShortCode_ultimate_video_banner extends WPBakeryShortCode {
}
}
?>
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,26 @@
<div class="vc_controls<?php echo !empty($extended_css) ? ' '.esc_attr($extended_css) : '' ?>">
<div class="vc_controls-<?php echo $position ?>">
<a class="vc_element-name">
<span class="vc_btn-content"><?php echo __( $name, 'js_composer' ); ?></span>
</a>
<?php foreach($controls as $control): ?>
<?php if($control === 'add'): ?>
<a class="vc_control-btn vc_control-btn-prepend vc_edit" href="#"
title="<?php printf( __( 'Prepend to %s', 'js_composer' ), $name ) ?>"><span
class="vc_btn-content"><span class="icon"></span></span></a>
<?php elseif($control === 'edit'): ?>
<a class="vc_control-btn vc_control-btn-edit" href="#"
title="<?php printf( __( 'Edit %s', 'js_composer' ), $name ) ?>"><span
class="vc_btn-content"><span class="icon"></span></span></a>
<?php elseif($control === 'clone'): ?>
<a class="vc_control-btn vc_control-btn-clone" href="#"
title="<?php printf( __( 'Clone %s', 'js_composer' ), $name ) ?>"><span
class="vc_btn-content"><span class="icon"></span></span></a>
<?php elseif($control === 'delete'): ?>
<a class="vc_control-btn vc_control-btn-delete" href="#"
title="<?php printf( __( 'Delete %s', 'js_composer' ), $name ) ?>"><span
class="vc_btn-content"><span class="icon"></span></span></a>
<?php endif; ?>
<?php endforeach; ?>
</div>
</div>