function modal_shortcode($atts, $content = null) { $row_setting = ''; // enqueue js wp_enqueue_script('ultimate-appear'); if (get_option('ultimate_row')) { $row_setting = get_option('ultimate_row'); } if ($row_setting == "enable") { wp_enqueue_script('ultimate-row-bg', plugins_url('../assets/js/', __FILE__) . 'ultimate_bg.js'); } wp_enqueue_script('ultimate-custom'); // enqueue css wp_enqueue_style('ultimate-animate'); wp_enqueue_style('ultimate-style'); wp_enqueue_script('ultimate-modernizr', plugins_url('../assets/js/', __FILE__) . 'modernizr.custom.js', '1.0', array('jquery')); wp_enqueue_script('ultimate-classie', plugins_url('../assets/js/', __FILE__) . 'classie.js', '1.0', array('jquery')); wp_enqueue_script('ultimate-snap-svg', plugins_url('../assets/js/', __FILE__) . 'snap.svg-min.js', '1.0', array('jquery')); wp_enqueue_script('ultimate-frongloop', plugins_url('../assets/js/', __FILE__) . 'froogaloop2.min.js', '1.0', array('jquery'), true); wp_enqueue_script('ultimate-modal', plugins_url('../assets/js/', __FILE__) . 'modal.js', '1.0', array('jquery'), true); wp_enqueue_style('ultimate-modal', plugins_url('../assets/css/', __FILE__) . 'modal.css'); $icon = $modal_on = $modal_contain = $btn_size = $btn_bg_color = $btn_txt_color = $btn_text = $read_text = $txt_color = $modal_title = $modal_size = $el_class = $modal_style = $icon_type = $icon_img = $btn_img = $overlay_bg_color = $overlay_bg_opacity = $modal_on_align = $content_bg_color = $content_text_color = $header_bg_color = $header_text_color = $modal_border_style = $modal_border_width = $modal_border_color = $modal_border_radius = ''; extract(shortcode_atts(array('icon_type' => '', 'icon' => '', 'icon_img' => '', 'modal_on' => '', 'modal_contain' => '', 'onload_delay' => '', 'btn_size' => '', 'overlay_bg_color' => '', 'overlay_bg_opacity' => '80', 'btn_bg_color' => '', 'btn_txt_color' => '', 'btn_text' => '', 'read_text' => '', 'txt_color' => '', 'btn_img' => '', 'modal_title' => '', 'modal_size' => '', 'modal_style' => '', 'content_bg_color' => '', 'content_text_color' => '', 'header_bg_color' => '', 'header_text_color' => '', 'modal_on_align' => '', 'modal_border_style' => '', 'modal_border_width' => '', 'modal_border_color' => '', 'modal_border_radius' => '', 'el_class' => ''), $atts, 'ultimate_modal')); $html = $style = $box_icon = $modal_class = $modal_data_class = $uniq = $overlay_bg = $content_style = $header_style = $border_style = ''; if ($modal_on == "ult-button") { $modal_on = "button"; } // Create style for content background color if ($content_bg_color !== '') { $content_style .= 'background:' . $content_bg_color . ';'; } // Create style for content text color if ($content_text_color !== '') { $content_style .= 'color:' . $content_text_color . ';'; } // Create style for header background color if ($header_bg_color !== '') { $header_style .= 'background:' . $header_bg_color . ';'; } // Create style for header text color if ($header_text_color !== '') { $header_style .= 'color:' . $header_text_color . ';'; } if ($modal_border_style !== '') { $border_style .= 'border-style:' . $modal_border_style . ';'; $border_style .= 'border-width:' . $modal_border_width . 'px;'; $border_style .= 'border-radius:' . $modal_border_radius . 'px;'; $border_style .= 'border-color:' . $modal_border_color . ';'; $header_style .= 'border-color:' . $modal_border_color . ';'; } $overlay_bg_opacity = $overlay_bg_opacity / 100; if ($overlay_bg_color !== '') { $overlay_bg = ultimate_hex2rgb($overlay_bg_color, $overlay_bg_opacity); if ($modal_style != 'overlay-show-cornershape' && $modal_style != 'overlay-show-genie' && $modal_style != 'overlay-show-boxes') { $overlay_bg = 'background:' . $overlay_bg . ';'; } else { if ($modal_style != 'overlay-show-boxes') { $overlay_bg = 'fill:' . $overlay_bg . ';'; } else { $overlay_bg = 'fill:' . ultimate_hex2rgb($overlay_bg_color) . ';'; } } } $uniq = uniqid(); if ($icon_type == 'custom') { $ico_img = wp_get_attachment_image_src($icon_img, 'large'); $box_icon = '<div class="modal-icon"><img src="' . $ico_img[0] . '" class="ult-modal-inside-img"></div>'; } elseif ($icon_type == 'selector') { if ($icon !== '') { $box_icon = '<div class="modal-icon"><i class="' . $icon . '"></i></div>'; } } if ($modal_style != 'overlay-show-cornershape' && $modal_style != 'overlay-show-genie' && $modal_style != 'overlay-show-boxes') { $modal_class = 'overlay-show'; $modal_data_class = 'data-overlay-class="' . $modal_style . '"'; } else { $modal_class = $modal_style; $modal_data_class = ''; } if ($modal_on == "button") { if ($btn_bg_color !== '') { $style .= 'background:' . $btn_bg_color . ';'; $style .= 'border-color:' . $btn_bg_color . ';'; } if ($btn_txt_color !== '') { $style .= 'color:' . $btn_txt_color . ';'; } $html .= '<button style="' . $style . '" data-class-id="content-' . $uniq . '" class="btn btn-primary btn-' . $btn_size . ' ' . $modal_class . ' ult-align-' . $modal_on_align . '" ' . $modal_data_class . '>' . $btn_text . '</button>'; } elseif ($modal_on == "image") { if ($btn_img !== '') { $img = wp_get_attachment_image_src($btn_img, 'large'); $html .= '<img src="' . $img[0] . '" data-class-id="content-' . $uniq . '" class="ult-modal-img ' . $modal_class . ' ult-align-' . $modal_on_align . '" ' . $modal_data_class . '/>'; } } elseif ($modal_on == "onload") { $html .= '<div data-class-id="content-' . $uniq . '" class="ult-onload ' . $modal_class . ' " ' . $modal_data_class . ' data-onload-delay="' . $onload_delay . '"></div>'; } else { if ($txt_color !== '') { $style .= 'color:' . $txt_color . ';'; $style .= 'cursor:pointer;'; } $html .= '<span style="' . $style . '" data-class-id="content-' . $uniq . '" class="' . $modal_class . ' ult-align-' . $modal_on_align . '" ' . $modal_data_class . '>' . $read_text . '</span>'; } if ($modal_style == 'overlay-show-cornershape') { $html .= "\n" . '<div class="ult-overlay overlay-cornershape content-' . $uniq . ' ' . $el_class . '" style="display:none" data-class="content-' . $uniq . '" data-path-to="m 0,0 1439.999975,0 0,805.99999 -1439.999975,0 z">'; $html .= "\n\t" . '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1440 806" preserveAspectRatio="none"> <path class="overlay-path" d="m 0,0 1439.999975,0 0,805.99999 0,-805.99999 z" style="' . $overlay_bg . '"/> </svg>'; } elseif ($modal_style == 'overlay-show-genie') { $html .= "\n" . '<div class="ult-overlay overlay-genie content-' . $uniq . ' ' . $el_class . '" style="display:none" data-class="content-' . $uniq . '" data-steps="m 701.56545,809.01175 35.16718,0 0,19.68384 -35.16718,0 z;m 698.9986,728.03569 41.23353,0 -3.41953,77.8735 -34.98557,0 z;m 687.08153,513.78234 53.1506,0 C 738.0505,683.9161 737.86917,503.34193 737.27015,806 l -35.90067,0 c -7.82727,-276.34892 -2.06916,-72.79261 -14.28795,-292.21766 z;m 403.87105,257.94772 566.31246,2.93091 C 923.38284,513.78233 738.73561,372.23931 737.27015,806 l -35.90067,0 C 701.32034,404.49318 455.17312,480.07689 403.87105,257.94772 z;M 51.871052,165.94772 1362.1835,168.87863 C 1171.3828,653.78233 738.73561,372.23931 737.27015,806 l -35.90067,0 C 701.32034,404.49318 31.173122,513.78234 51.871052,165.94772 z;m 52,26 1364,4 c -12.8007,666.9037 -273.2644,483.78234 -322.7299,776 l -633.90062,0 C 359.32034,432.49318 -6.6979288,733.83462 52,26 z;m 0,0 1439.999975,0 0,805.99999 -1439.999975,0 z">'; $html .= "\n\t" . '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1440 806" preserveAspectRatio="none"> <path class="overlay-path" d="m 701.56545,809.01175 35.16718,0 0,19.68384 -35.16718,0 z" style="' . $overlay_bg . '"/> </svg>'; } elseif ($modal_style == 'overlay-show-boxes') { $html .= "\n" . '<div class="ult-overlay overlay-boxes content-' . $uniq . ' ' . $el_class . '" style="display:none" data-class="content-' . $uniq . '">'; $html .= "\n\t" . '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="101%" viewBox="0 0 1440 806" preserveAspectRatio="none">'; $html .= "\n\t\t" . '<path d="m0.005959,200.364029l207.551124,0l0,204.342453l-207.551124,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m0.005959,400.45401l207.551124,0l0,204.342499l-207.551124,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m0.005959,600.544067l207.551124,0l0,204.342468l-207.551124,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m205.752151,-0.36l207.551163,0l0,204.342437l-207.551163,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m204.744629,200.364029l207.551147,0l0,204.342453l-207.551147,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m204.744629,400.45401l207.551147,0l0,204.342499l-207.551147,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m204.744629,600.544067l207.551147,0l0,204.342468l-207.551147,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m410.416046,-0.36l207.551117,0l0,204.342437l-207.551117,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m410.416046,200.364029l207.551117,0l0,204.342453l-207.551117,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m410.416046,400.45401l207.551117,0l0,204.342499l-207.551117,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m410.416046,600.544067l207.551117,0l0,204.342468l-207.551117,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m616.087402,-0.36l207.551086,0l0,204.342437l-207.551086,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m616.087402,200.364029l207.551086,0l0,204.342453l-207.551086,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m616.087402,400.45401l207.551086,0l0,204.342499l-207.551086,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m616.087402,600.544067l207.551086,0l0,204.342468l-207.551086,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m821.748718,-0.36l207.550964,0l0,204.342437l-207.550964,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m821.748718,200.364029l207.550964,0l0,204.342453l-207.550964,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m821.748718,400.45401l207.550964,0l0,204.342499l-207.550964,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m821.748718,600.544067l207.550964,0l0,204.342468l-207.550964,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1027.203979,-0.36l207.550903,0l0,204.342437l-207.550903,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1027.203979,200.364029l207.550903,0l0,204.342453l-207.550903,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1027.203979,400.45401l207.550903,0l0,204.342499l-207.550903,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1027.203979,600.544067l207.550903,0l0,204.342468l-207.550903,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1232.659302,-0.36l207.551147,0l0,204.342437l-207.551147,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1232.659302,200.364029l207.551147,0l0,204.342453l-207.551147,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1232.659302,400.45401l207.551147,0l0,204.342499l-207.551147,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1232.659302,600.544067l207.551147,0l0,204.342468l-207.551147,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m-0.791443,-0.360001l207.551163,0l0,204.342438l-207.551163,0l0,-204.342438z" style="' . $overlay_bg . '"/>'; $html .= "\n\t" . '</svg>'; } else { $html .= "\n" . '<div class="ult-overlay content-' . $uniq . ' ' . $el_class . '" data-class="content-' . $uniq . '" id="button-click-overlay" style="' . $overlay_bg . ' display:none;">'; } $html .= "\n\t" . '<div class="ult_modal ult-fade ult-' . $modal_size . '">'; $html .= "\n\t\t" . '<div class="ult_modal-content" style="' . $border_style . '">'; if ($modal_title !== '') { $html .= "\n\t\t\t" . '<div class="ult_modal-header" style="' . $header_style . '">'; $html .= "\n\t\t\t\t" . $box_icon . '<h3 class="ult_modal-title">' . $modal_title . '</h3>'; $html .= "\n\t\t\t" . '</div>'; } $html .= "\n\t\t\t" . '<div class="ult_modal-body ' . $modal_contain . '" style="' . $content_style . '">'; $html .= "\n\t\t\t" . do_shortcode($content); $html .= "\n\t\t\t" . '</div>'; $html .= "\n\t" . '</div>'; $html .= "\n\t" . '</div>'; $html .= "\n\t" . '<div class="ult-overlay-close">Close</div>'; $html .= "\n" . '</div>'; return $html; }
function modal_shortcode($atts, $content = null) { $row_setting = ''; // enqueue js $icon = $modal_on = $modal_contain = $btn_size = $btn_bg_color = $btn_txt_color = $btn_text = $read_text = $txt_color = $modal_title = $modal_size = $el_class = $modal_style = $icon_type = $icon_img = $btn_img = $overlay_bg_color = $overlay_bg_opacity = $modal_on_align = $content_bg_color = $content_text_color = $header_bg_color = $header_text_color = $modal_border_style = $modal_border_width = $modal_border_color = $modal_border_radius = ''; $header_font = $header_font_style = $header_font_size = $header_line_height = $content_font = $content_font_style = $content_font_size = $content_line_height = $trigger_typography = $trigger_text_font = $trigger_text_font_style = $trigger_text_font_size = $trigger_text_line_height = $button_text_font = $button_text_font_style = $button_text_font_size = $button_text_line_height = ''; extract(shortcode_atts(array('icon_type' => 'none', 'icon' => '', 'icon_img' => '', 'modal_on' => 'ult-button', 'modal_on_selector' => '', 'modal_contain' => 'ult-html', 'onload_delay' => '2', 'init_extra_class' => '', 'btn_size' => 'sm', 'overlay_bg_color' => '#333333', 'overlay_bg_opacity' => '80', 'btn_bg_color' => '#333333', 'btn_txt_color' => '#FFFFFF', 'btn_text' => '', 'read_text' => '', 'txt_color' => '#f60f60', 'btn_img' => '', 'modal_title' => '', 'modal_size' => 'small', 'modal_style' => 'overlay-cornerbottomleft', 'content_bg_color' => '', 'content_text_color' => '', 'header_bg_color' => '', 'header_text_color' => '#333333', 'modal_on_align' => 'center', 'modal_border_style' => 'solid', 'modal_border_width' => '2', 'modal_border_color' => '#333333', 'modal_border_radius' => '0', 'el_class' => '', 'header_typography' => '', 'header_font' => '', 'header_font_style' => '', 'header_font_size' => '', 'header_line_height' => '', 'content_font' => '', 'content_font_style' => '', 'content_font_size' => '', 'content_line_height' => '', 'trigger_text_font' => '', 'trigger_text_font_style' => '', 'trigger_text_font_size' => '', 'trigger_text_line_height' => '', 'button_text_font' => '', 'button_text_font_style' => '', 'button_text_font_size' => '', 'button_text_line_height' => ''), $atts, 'ultimate_modal')); $vc_version = defined('WPB_VC_VERSION') ? WPB_VC_VERSION : 0; $is_vc_49_plus = version_compare(4.9, $vc_version, '<=') ? 'ult-adjust-bottom-margin' : ''; $html = $style = $box_icon = $modal_class = $modal_data_class = $uniq = $overlay_bg = $trigger_text_style = $content_style = $header_style = $border_style = $button_text_style = ''; if ($modal_on == "ult-button") { $modal_on = "button"; } // Create style for content background color if ($content_bg_color !== '') { $content_style .= 'background:' . $content_bg_color . ';'; } // Create style for content text color if ($content_text_color !== '') { $content_style .= 'color:' . $content_text_color . ';'; } if ($content_font != '') { $font_family = get_ultimate_font_family($content_font); if ($font_family != '') { $content_style .= 'font-family:\'' . $font_family . '\';'; } } if ($content_font_style != '') { $content_style .= get_ultimate_font_style($content_font_style); } // if($content_font_size != '') // $content_style .= 'font-size:'.$content_font_size.'px;'; // if($content_line_height != '') // $content_style .= 'line-height:'.$content_line_height.'px;'; //Responsive param if (is_numeric($content_font_size)) { $content_font_size = 'desktop:' . $content_font_size . 'px;'; } if (is_numeric($content_line_height)) { $content_line_height = 'desktop:' . $content_line_height . 'px;'; } $modal_uid = 'ult-modal-wrap-' . rand(00, 9999); $modal_content_args = array('target' => '#' . $modal_uid . ' .ult_modal-body', 'media_sizes' => array('font-size' => $content_font_size, 'line-height' => $content_line_height)); $madal_content_data_list = get_ultimate_vc_responsive_media_css($modal_content_args); // Create style for header background color if ($header_bg_color !== '') { $header_style .= 'background:' . $header_bg_color . ';'; } // Create style for header text color if ($header_text_color !== '') { $header_style .= 'color:' . $header_text_color . ';'; } if ($header_font != '') { $font_family = get_ultimate_font_family($header_font); if ($font_family != '') { $header_style .= 'font-family:\'' . $font_family . '\';'; } } if ($header_font_style != '') { $header_style .= get_ultimate_font_style($header_font_style); } //Responsive param if (is_numeric($header_font_size)) { $header_font_size = 'desktop:' . $header_font_size . 'px;'; } if (is_numeric($header_line_height)) { $header_line_height = 'desktop:' . $header_line_height . 'px;'; } $modal_heading_args = array('target' => '#' . $modal_uid . ' .ult_modal-title', 'media_sizes' => array('font-size' => $header_font_size, 'line-height' => $header_line_height)); $madal_heading_data_list = get_ultimate_vc_responsive_media_css($modal_heading_args); if ($trigger_text_font != '') { $font_family = get_ultimate_font_family($trigger_text_font); if ($font_family != '') { $trigger_text_style .= 'font-family:\'' . $font_family . '\';'; } } if ($trigger_text_font_style != '') { $trigger_text_style .= get_ultimate_font_style($trigger_text_font_style); } // Responsive param if (is_numeric($trigger_text_font_size)) { $trigger_text_font_size = 'desktop:' . $trigger_text_font_size . 'px;'; } if (is_numeric($trigger_text_line_height)) { $trigger_text_line_height = 'desktop:' . $trigger_text_line_height . 'px;'; } $modal_trgs_id = 'modal-trg-txt-wrap-' . rand(1000, 9999); $modal_trg_args = array('target' => '#' . $modal_trgs_id . ' .mycust', 'media_sizes' => array('font-size' => $trigger_text_font_size, 'line-height' => $trigger_text_line_height)); $madal_trg_data_list = get_ultimate_vc_responsive_media_css($modal_trg_args); if ($button_text_font != '') { $font_family = get_ultimate_font_family($button_text_font); if ($font_family != '') { $button_text_style .= 'font-family:\'' . $font_family . '\';'; } } if ($button_text_font_style != '') { $button_text_style .= get_ultimate_font_style($button_text_font_style); } //Responsive param if (is_numeric($button_text_font_size)) { $button_text_font_size = 'desktop:' . $button_text_font_size . 'px;'; } if (is_numeric($button_text_line_height)) { $button_text_line_height = 'desktop:' . $button_text_line_height . 'px;'; } $button_trg_args = array('target' => '#' . $modal_trgs_id . ' .btn-modal', 'media_sizes' => array('font-size' => $button_text_font_size, 'line-height' => $button_text_line_height)); $button_trg_data_list = get_ultimate_vc_responsive_media_css($button_trg_args); if ($modal_border_style !== '') { $border_style .= 'border-style:' . $modal_border_style . ';'; $border_style .= 'border-width:' . $modal_border_width . 'px;'; $border_style .= 'border-radius:' . $modal_border_radius . 'px;'; $border_style .= 'border-color:' . $modal_border_color . ';'; $header_style .= 'border-color:' . $modal_border_color . ';'; } $overlay_bg_opacity = $overlay_bg_opacity / 100; if ($overlay_bg_color !== '') { if (strlen($overlay_bg_color) <= 7) { $overlay_bg = ultimate_hex2rgb($overlay_bg_color, $overlay_bg_opacity); } else { $overlay_bg = $overlay_bg_color; } if ($modal_style != 'overlay-show-cornershape' && $modal_style != 'overlay-show-genie' && $modal_style != 'overlay-show-boxes') { $overlay_bg = 'background:' . $overlay_bg . ';'; } else { $overlay_bg = 'fill:' . $overlay_bg . ';'; } } $uniq = uniqid(); if ($icon_type == 'custom') { //$ico_img = wp_get_attachment_image_src( $icon_img, 'large'); $ico_img = apply_filters('ult_get_img_single', $icon_img, 'url'); $box_icon = '<div class="modal-icon"><img src="' . $ico_img . '" class="ult-modal-inside-img"></div>'; } elseif ($icon_type == 'selector') { if ($icon !== '') { $box_icon = '<div class="modal-icon"><i class="' . $icon . '"></i></div>'; } } if ($modal_style != 'overlay-show-cornershape' && $modal_style != 'overlay-show-genie' && $modal_style != 'overlay-show-boxes') { $modal_class = 'overlay-show'; $modal_data_class = 'data-overlay-class="' . $modal_style . '"'; } else { $modal_class = $modal_style; $modal_data_class = ''; } $html .= '<div id="' . $modal_trgs_id . '" class="ult-modal-input-wrapper ' . $is_vc_49_plus . '">'; if ($modal_on == "button") { if ($btn_bg_color !== '') { $style .= 'background:' . $btn_bg_color . ';'; $style .= 'border-color:' . $btn_bg_color . ';'; } if ($btn_txt_color !== '') { $style .= 'color:' . $btn_txt_color . ';'; } if ($el_class != '') { $modal_class .= ' ' . $el_class . '-button '; } $html .= '<button ' . $button_trg_data_list . ' style="' . $style . ' ' . $button_text_style . '" data-class-id="content-' . $uniq . '" class="btn-modal ult-responsive btn-primary btn-modal-' . $btn_size . ' ' . $modal_class . ' ' . $init_extra_class . ' ult-align-' . $modal_on_align . '" ' . $modal_data_class . '>' . $btn_text . '</button>'; } elseif ($modal_on == "image") { if ($btn_img !== '') { if ($el_class != '') { $modal_class .= ' ' . $el_class . '-image '; } // $img = wp_get_attachment_image_src( $btn_img, 'large'); $img = apply_filters('ult_get_img_single', $btn_img, 'url'); $html .= '<img src="' . $img . '" data-class-id="content-' . $uniq . '" class="ult-modal-img ' . $init_extra_class . ' ' . $modal_class . ' ult-align-' . $modal_on_align . ' ult-modal-image-' . $el_class . '" ' . $modal_data_class . '/>'; } } elseif ($modal_on == "onload") { $html .= '<div data-class-id="content-' . $uniq . '" class="ult-onload ' . $modal_class . ' " ' . $modal_data_class . ' data-onload-delay="' . $onload_delay . '"></div>'; } elseif ($modal_on == "custom-selector") { $html .= '<script type="text/javascript"> (function($){ $(document).ready(function(){ var selector = "' . $modal_on_selector . '"; $(selector).addClass("custom-ult-modal ' . $modal_class . '"); $(selector).attr("data-class-id", "content-' . $uniq . '"); $(selector).attr("data-overlay-class", "' . $modal_style . '"); }); })(jQuery); </script>'; } else { if ($txt_color !== '') { $style .= 'color:' . $txt_color . ';'; $style .= 'cursor:pointer;'; } if ($el_class != '') { $modal_class .= ' ' . $el_class . '-link '; } $html .= '<span ' . $madal_trg_data_list . ' style="' . $style . ' ' . $trigger_text_style . '" data-class-id="content-' . $uniq . '" class="' . $modal_class . ' ult-responsive mycust ult-align-' . $modal_on_align . '" ' . $modal_data_class . '>' . $read_text . '</span>'; } $html .= '</div>'; if ($modal_style == 'overlay-show-cornershape') { $html .= "\n" . '<div class="ult-overlay overlay-cornershape content-' . $uniq . ' ' . $el_class . '" style="display:none" data-class="content-' . $uniq . '" data-path-to="m 0,0 1439.999975,0 0,805.99999 -1439.999975,0 z">'; $html .= "\n\t" . '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1440 806" preserveAspectRatio="none"> <path class="overlay-path" d="m 0,0 1439.999975,0 0,805.99999 0,-805.99999 z" style="' . $overlay_bg . '"/> </svg>'; } elseif ($modal_style == 'overlay-show-genie') { $html .= "\n" . '<div class="ult-overlay overlay-genie content-' . $uniq . ' ' . $el_class . '" style="display:none" data-class="content-' . $uniq . '" data-steps="m 701.56545,809.01175 35.16718,0 0,19.68384 -35.16718,0 z;m 698.9986,728.03569 41.23353,0 -3.41953,77.8735 -34.98557,0 z;m 687.08153,513.78234 53.1506,0 C 738.0505,683.9161 737.86917,503.34193 737.27015,806 l -35.90067,0 c -7.82727,-276.34892 -2.06916,-72.79261 -14.28795,-292.21766 z;m 403.87105,257.94772 566.31246,2.93091 C 923.38284,513.78233 738.73561,372.23931 737.27015,806 l -35.90067,0 C 701.32034,404.49318 455.17312,480.07689 403.87105,257.94772 z;M 51.871052,165.94772 1362.1835,168.87863 C 1171.3828,653.78233 738.73561,372.23931 737.27015,806 l -35.90067,0 C 701.32034,404.49318 31.173122,513.78234 51.871052,165.94772 z;m 52,26 1364,4 c -12.8007,666.9037 -273.2644,483.78234 -322.7299,776 l -633.90062,0 C 359.32034,432.49318 -6.6979288,733.83462 52,26 z;m 0,0 1439.999975,0 0,805.99999 -1439.999975,0 z">'; $html .= "\n\t" . '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 1440 806" preserveAspectRatio="none"> <path class="overlay-path" d="m 701.56545,809.01175 35.16718,0 0,19.68384 -35.16718,0 z" style="' . $overlay_bg . '"/> </svg>'; } elseif ($modal_style == 'overlay-show-boxes') { $html .= "\n" . '<div class="ult-overlay overlay-boxes content-' . $uniq . ' ' . $el_class . '" style="display:none" data-class="content-' . $uniq . '">'; $html .= "\n\t" . '<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="101%" viewBox="0 0 1440 806" preserveAspectRatio="none">'; $html .= "\n\t\t" . '<path d="m0.005959,200.364029l207.551124,0l0,204.342453l-207.551124,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m0.005959,400.45401l207.551124,0l0,204.342499l-207.551124,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m0.005959,600.544067l207.551124,0l0,204.342468l-207.551124,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m205.752151,-0.36l207.551163,0l0,204.342437l-207.551163,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m204.744629,200.364029l207.551147,0l0,204.342453l-207.551147,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m204.744629,400.45401l207.551147,0l0,204.342499l-207.551147,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m204.744629,600.544067l207.551147,0l0,204.342468l-207.551147,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m410.416046,-0.36l207.551117,0l0,204.342437l-207.551117,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m410.416046,200.364029l207.551117,0l0,204.342453l-207.551117,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m410.416046,400.45401l207.551117,0l0,204.342499l-207.551117,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m410.416046,600.544067l207.551117,0l0,204.342468l-207.551117,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m616.087402,-0.36l207.551086,0l0,204.342437l-207.551086,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m616.087402,200.364029l207.551086,0l0,204.342453l-207.551086,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m616.087402,400.45401l207.551086,0l0,204.342499l-207.551086,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m616.087402,600.544067l207.551086,0l0,204.342468l-207.551086,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m821.748718,-0.36l207.550964,0l0,204.342437l-207.550964,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m821.748718,200.364029l207.550964,0l0,204.342453l-207.550964,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m821.748718,400.45401l207.550964,0l0,204.342499l-207.550964,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m821.748718,600.544067l207.550964,0l0,204.342468l-207.550964,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1027.203979,-0.36l207.550903,0l0,204.342437l-207.550903,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1027.203979,200.364029l207.550903,0l0,204.342453l-207.550903,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1027.203979,400.45401l207.550903,0l0,204.342499l-207.550903,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1027.203979,600.544067l207.550903,0l0,204.342468l-207.550903,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1232.659302,-0.36l207.551147,0l0,204.342437l-207.551147,0l0,-204.342437z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1232.659302,200.364029l207.551147,0l0,204.342453l-207.551147,0l0,-204.342453z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1232.659302,400.45401l207.551147,0l0,204.342499l-207.551147,0l0,-204.342499z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m1232.659302,600.544067l207.551147,0l0,204.342468l-207.551147,0l0,-204.342468z" style="' . $overlay_bg . '"/>'; $html .= "\n\t\t" . '<path d="m-0.791443,-0.360001l207.551163,0l0,204.342438l-207.551163,0l0,-204.342438z" style="' . $overlay_bg . '"/>'; $html .= "\n\t" . '</svg>'; } else { $html .= "\n" . '<div class="ult-overlay content-' . $uniq . ' ' . $el_class . '" data-class="content-' . $uniq . '" id="button-click-overlay" style="' . $overlay_bg . ' display:none;">'; } $html .= "\n\t" . '<div class="ult_modal ult-fade ult-' . $modal_size . '">'; $html .= "\n\t\t" . '<div id="' . $modal_uid . '" class="ult_modal-content ult-hide" style="' . $border_style . '">'; if ($modal_title !== '') { $html .= "\n\t\t\t" . '<div class="ult_modal-header" style="' . $header_style . '">'; $html .= "\n\t\t\t\t" . $box_icon . '<h3 ' . $madal_heading_data_list . ' class="ult_modal-title ult-responsive">' . $modal_title . '</h3>'; $html .= "\n\t\t\t" . '</div>'; } $html .= "\n\t\t\t" . '<div ' . $madal_content_data_list . ' class="ult_modal-body ult-responsive ' . $modal_contain . '" style="' . $content_style . '">'; $html .= "\n\t\t\t" . do_shortcode($content); $html .= "\n\t\t\t" . '</div>'; $html .= "\n\t" . '</div>'; $html .= "\n\t" . '</div>'; $html .= "\n\t" . '<div class="ult-overlay-close">Close</div>'; $html .= "\n" . '</div>'; return $html; }
function info_circle($atts, $content = null) { // enqueue js wp_enqueue_script('ultimate-appear'); wp_enqueue_script('ultimate-custom'); // enqueue css wp_enqueue_style('ultimate-animate'); wp_enqueue_style('ultimate-style'); wp_enqueue_script('info-circle', plugins_url('../assets/js/', __FILE__) . 'info-circle.js'); wp_enqueue_style('info-circle', plugins_url('../assets/css/', __FILE__) . 'info-circle.css'); wp_enqueue_script('info-circle-ui-effect', plugins_url('../assets/js/', __FILE__) . 'jquery.ui.effect.js'); $edge_radius = $eg_padding = $circle_type = $icon_position = $eg_br_width = $eg_br_style = $eg_border_color = $cn_br_style = $highlight_style = ''; $icon_size = $cn_br_width = $cn_border_color = $icon_diversion = $icon_show = $content_bg = $content_color = $el_class = ''; $icon_launch = $icon_launch_duration = $icon_launch_delay = ''; extract(shortcode_atts(array('edge_radius' => '', 'circle_type' => '', 'icon_position' => '', 'focus_on' => '', 'eg_br_width' => '', 'eg_br_style' => '', 'eg_border_color' => '', 'cn_br_style' => '', 'cn_br_width' => '', 'cn_border_color' => '', 'highlight_style' => '', 'icon_size' => '', 'eg_padding' => '', 'icon_diversion' => '', 'icon_show' => '', 'content_icon_size' => '', 'content_color' => '', 'content_bg' => '', 'responsive' => '', 'auto_slide' => '', 'auto_slide_duration' => '', 'icon_launch' => '', 'icon_launch_duration' => '', 'icon_launch_delay' => '', 'el_class' => ''), $atts)); $style = $style1 = $style3 = $ex_class = ''; if ($eg_br_style != 'none' && $eg_br_width != '' && $eg_border_color != '') { $style .= 'border:' . $eg_br_width . 'px ' . $eg_br_style . ' ' . $eg_border_color . ';'; } if ($cn_br_style != 'none' && $cn_br_width != '' && $cn_border_color != '') { $style1 .= 'border:' . $cn_br_width . 'px ' . $cn_br_style . ' ' . $cn_border_color . ';'; } //$style .='border-style:'.$eg_br_style.';'; $style1 .= 'background-color:' . $content_bg . ';color:' . $content_color . ';'; $style1 .= 'width:' . $eg_padding . '%;height:' . $eg_padding . '%;margin:' . (100 - $eg_padding) / 2 . '%;'; if ($el_class != '') { $ex_class = $el_class; } if ($responsive == 'on') { $ex_class .= ' info-circle-responsive'; } if ($icon_show == 'show') { $content_icon_size = $content_icon_size; } else { $content_icon_size = ''; } if ($edge_radius != '') { $style .= 'width:' . $edge_radius . '%;'; } $style .= 'opacity:0;'; if ($circle_type == '') { $circle_type = 'info-c-full-br'; } $output = '<div class="info-circle-wrapper ' . $ex_class . '">'; $output .= '<div class="' . $circle_type . '" style=\'' . $style . '\' data-divert="' . $icon_diversion . '" data-info-circle-angle="' . $icon_position . '" data-responsive-circle="' . $responsive . '" data-launch="' . $icon_launch . '" data-launch-duration="' . $icon_launch_duration . '" data-launch-delay="' . $icon_launch_delay . '" data-slide-true="' . $auto_slide . '" data-slide-duration="' . $auto_slide_duration . '" data-icon-size="' . $icon_size . '" data-icon-show="' . $icon_show . '" data-icon-show-size="' . $content_icon_size . '" data-highlight-style="' . $highlight_style . '" data-focus-on="' . $focus_on . '">'; $output .= '<div class="icon-circle-list">'; //$content = str_replace('[info_circle_item', '[info_circle_item icon_size="'.$icon_size.'"', $content); $output .= do_shortcode($content); if ($icon_position != 'full') { $output .= '<div class="info-circle-icons suffix-remove"></div>'; } $output .= '</div>'; $output .= '<div class="info-c-full" style="' . $style1 . '"><div class="info-c-full-wrap"></div>'; $output .= '</div>'; $output .= '</div>'; if ($responsive == 'on') { $output .= '<div class="smile_icon_list_wrap " data-content_bg="' . ultimate_hex2rgb($content_bg, 0.8) . '" data-content_color="' . $content_color . '"> <ul class="smile_icon_list left circle with_bg"> <li class="icon_list_item" style="font-size:' . $icon_size * 3 . 'px;"> <div class="icon_list_icon" style="font-size:' . $icon_size . 'px;"> <i class="smt-pencil"></i> </div> <div class="icon_description"> <h3></h3> <p></p> </div> <div class="icon_list_connector" style="border-style:' . $eg_br_style . ';border-color:' . $eg_border_color . '"> </div> </li> </ul> </div>'; } $output .= '</div>'; return $output; }