PluginProbe
Borderless – Addons and Templates for Elementor / 1.0.1
Borderless – Addons and Templates for Elementor v1.0.1
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 All 78 releases
borderless / modules / wpbakery / paramns / icon-manager-param.php

icon-manager-param.php in Borderless – Addons and Templates for Elementor 1.0.1, at modules/wpbakery/paramns/icon-manager-param.php

122 lines 3.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if(!class_exists('Icon_Manager_Param'))
3 {
4 class Icon_Manager_Param
5 {
6 function __construct()
7 {
8
9 $GLOBALS['pid']=0;
10 $id=null;
11 $pcnt=null;
12 if(defined('WPB_VC_VERSION') && version_compare(WPB_VC_VERSION, 4.8) >= 0) {
13 if(function_exists('vc_add_shortcode_param'))
14 {
15 vc_add_shortcode_param('iconmanager', array($this,'iconmanager'));
16 }
17 }
18 else {
19 if(function_exists('add_shortcode_param'))
20 {
21 add_shortcode_param('iconmanager', array($this,'iconmanager'));
22 }
23 }
24 }
25
26 function iconmanager($settings, $value)
27 {
28 $GLOBALS['pid'] = $GLOBALS['pid'] + 1;
29 $pcnt=$GLOBALS['pid'];
30
31 $BORDERLESS_IPM = new BORDERLESS_IPM;
32 $font_manager = $BORDERLESS_IPM->get_font_manager($pcnt);
33 $dependency = '';
34
35 $params = parse_url($_SERVER['HTTP_REFERER']);
36 $vc_is_inline = false;
37 if(isset($params['query'])){
38 parse_str($params['query'],$params);
39 $vc_is_inline = isset($params['vc_action']) ? true : false;
40 }
41
42 $output = '<div class="my_param_block">'
43 .'<input name="'.esc_attr($settings['param_name']).'"
44 class="wpb_txt_icon_value wpb_vc_param_value wpb-textinput '.esc_attr($settings['param_name']).'
45 '.esc_attr($settings['type']).'_field" type="hidden"
46
47 value="'.esc_attr($value).'" ' . $dependency . ' id="'.esc_attr($pcnt).'"/>'
48 .'</div>';
49 if($vc_is_inline){
50 $output .= '<script type="text/javascript">
51 var val=jQuery("#'.esc_attr($pcnt).'").val();
52 //alert("yes");
53 var val=jQuery("#'.esc_attr($pcnt).'").val();
54 var pmid="'.esc_attr($pcnt).'";
55 var pmid="'.esc_attr($pcnt).'";
56 var val=jQuery("#'.esc_attr($pcnt).'").val();
57 if(val==""){
58 val="none";
59 }
60 if(val=="icon_color="){
61 val="none";
62 }
63
64 jQuery(".preview-icon-'.esc_attr($pcnt).'").html("<i class="+val+"></i>");
65
66 jQuery(".icon-list-'.esc_attr($pcnt).' li[data-icons=\'"+ val+"\']").addClass("selected");
67
68 jQuery(".icons-list li").click(function() {
69
70 var id=jQuery(this).attr("id");
71 //alert(id);
72 jQuery(this).attr("class","selected").siblings().removeAttr("class");
73 var icon = jQuery(this).attr("data-icons");
74
75 jQuery("#"+id).val(icon);
76 jQuery(".preview-icon-"+id).html("<i class=\'"+icon+"\'></i>");
77 });
78
79 </script>';
80 } else {
81
82
83 $output .= '<script type="text/javascript">
84
85
86 jQuery(document).ready(function(){
87 var pmid="'.esc_attr($pcnt).'";
88 var val=jQuery("#'.esc_attr($pcnt).'").val();
89 if(val==""){
90 val="none";
91 }
92 if(val=="icon_color="){
93 val="none";
94 }
95
96 jQuery(".preview-icon-'.esc_attr($pcnt).'").html("<i class="+val+"></i>");
97
98 jQuery(".icon-list-'.esc_attr($pcnt).' li[data-icons=\'"+ val+"\']").addClass("selected");
99 });
100 jQuery(".icons-list li").click(function() {
101 var id=jQuery(this).attr("id");
102 //alert(id);
103 jQuery(this).attr("class","selected").siblings().removeAttr("class");
104 var icon = jQuery(this).attr("data-icons");
105
106 jQuery("#"+id).val(icon);
107 jQuery(".preview-icon-"+id).html("<i class=\'"+icon+"\'></i>");
108 });
109 </script>';
110 }
111 $output .= '<div class="icon-manager-section" data-old-icon-value="'.esc_attr($pcnt).'">'.$font_manager.'</div>';
112 return $output;
113 }
114
115 }
116 }
117
118 if(class_exists('Icon_Manager_Param'))
119 {
120 $Icon_Manager_Param = new Icon_Manager_Param();
121 }
122