PluginProbe
Visual Slider / trunk
Visual Slider vtrunk
visual-slider / admin / includes / perview-global.php

perview-global.php in Visual Slider trunk, at admin/includes/perview-global.php

159 lines 5.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly.
4 }
5 if ( !function_exists ( "vs_perview_global_warp" )){
6 function vs_perview_global_warp(){
7 ?>
8 <div class="vs_perview_global vs_perview_desktop vs_perview">
9 <div class="vs_perview_heading" >
10 <div class="vs_perview_heading_change vs_perview_heading_item">
11 <label for="#vs_perview_change"><?php echo esc_html__('View Changes','visual-slider');?></label>
12
13
14 </div>
15
16 <div class="vs_perview_heading_desktop vs_perview_heading_item">
17 <label for="#vs_perview_desktop_width"><?php echo esc_html__('View on Desktop','visual-slider');?></label>
18
19 <select id="vs_perview_desktop_width" name="vs_perview_desktop_width">
20 <option value="100%"><?php echo esc_html('100%');?></option>
21 <option value="1920px"><?php echo esc_html('1920px');?></option>
22 <option value="1680px"><?php echo esc_html('1680px');?></option>
23 <option value="1440px"><?php echo esc_html('1440px');?></option>
24 <option value="1366px"><?php echo esc_html('1366px');?></option>
25 <option value="1280px"><?php echo esc_html('1280px');?></option>
26 <option value="1040px"><?php echo esc_html('1040px');?></option>
27 </select>
28 </div>
29
30
31 <div class="vs_perview_heading_tablet vs_perview_heading_item">
32 <label for="#vs_perview_tablet_width"><?php echo esc_html__('View on Tablet','visual-slider');?></label>
33 <select id="vs_perview_tablet_width" name="vs_perview_tablet_width">
34 <option value="1024px"><?php echo esc_html('1024px');?></option>
35 <option value="991px"><?php echo esc_html('991px');?></option>
36 <option value="800px"><?php echo esc_html('800px');?></option>
37 <option value="751px"><?php echo esc_html('751px');?></option>
38 </select>
39 </div>
40
41
42
43 <div class="vs_perview_heading_mobile vs_perview_heading_item">
44 <label for="#vs_perview_mobile_width"><?php echo esc_html__('View on Mobile','visual-slider');?></label>
45 <select id="vs_perview_mobile_width" name="vs_perview_mobile_width" value="480px">
46 <option value="750px"><?php echo esc_html('750px');?></option>
47 <option value="680px"><?php echo esc_html('680px');?></option>
48 <option value="640px"><?php echo esc_html('640px');?></option>
49 <option value="520px"><?php echo esc_html('520px');?></option>
50 <option value="480px"><?php echo esc_html('480px');?></option>
51 <option value="320px"><?php echo esc_html('320px');?></option>
52 </select>
53 </div>
54
55 <div class="vs_perview_heading_full_screen vs_perview_heading_item">
56 <div class="vs_perview_full_screen_mode"><?php echo esc_html__('View in Full Screen','visual-slider');?></div>
57 <div class="vs_perview_full_screen_close"><?php echo esc_html__('Close Full Screen','visual-slider');?></div>
58
59 </div>
60
61
62 </div>
63
64 <div class="vs_perview_global_scroll" >
65 <div class="vs_perview_global_content " >
66
67 <?php vs_perview_global(true);?>
68 </div>
69 </div>
70 </div>
71
72 <?php
73 }
74 }
75
76 if ( !function_exists ( "vs_perview_global" )){
77 add_action('wp_ajax_vs_perview_global', 'vs_perview_global');
78
79 function vs_perview_global($none_ajax='') {
80 if(empty($none_ajax)){
81
82 if ( ! isset( $_POST['_wpnonce'] ) ||
83 ! wp_verify_nonce(sanitize_text_field(wp_unslash( $_POST['_wpnonce'])), 'vs_slider_nonce' ) )
84 return;
85 $post_id =!empty($_POST['post_id'])? absint(wp_unslash($_POST['post_id'])): absint(get_the_ID());
86 if (!current_user_can('edit_post', $post_id) && !current_user_can('manage_options')){
87 return;
88 }
89 }
90
91 if(!empty($_POST['vs_setting_json']) && empty($none_ajax)){
92 $setting_json = wp_kses(wp_unslash(filter_input(INPUT_POST, 'vs_setting_json', FILTER_UNSAFE_RAW)),[]);
93 }else{
94 $setting_json = get_post_meta(absint(get_the_ID()), 'vs_setting_json', true);
95 }
96 $setting= vs_options_array_row($setting_json,'st');
97
98
99 if(!empty($_POST['vs_slide'])&& empty($none_ajax)){
100 $slide_json = wp_kses(wp_unslash(filter_input(INPUT_POST, 'vs_slide', FILTER_UNSAFE_RAW)),vs_kses());
101
102 }else{
103 $slide_json = get_post_meta(absint(get_the_ID()), 'vs_slide', true);
104
105 }
106 $slide= vs_options_array_row($slide_json,'sl');
107 echo '<div class="vs_perview_global_config">';
108
109 vs_global_config(1,$setting,$slide);
110 vs_perview_icon_fonts();
111
112 echo '</div>';
113 if(empty($none_ajax)){
114 die('');
115 }
116 }
117 }
118 if ( !function_exists ( "vs_perview_icon_fonts" )){
119 function vs_perview_icon_fonts() {
120 echo'<div class="vs-icon-fons">';
121 $var='';
122
123 $array =array(
124 'fontawesome',
125 'flaticonarrow',
126 'flaticonmultimedia',
127 'flaticonbusiness',
128 'flaticonoffice',
129 'flaticoninterface',
130 'flaticonessentialset',
131 'flaticontechsupport',
132 'flaticontech',
133 'flaticonstrategy',
134 'flaticonhipster',
135 'flaticonfashion',
136 'flaticonwebdesign',
137 'flaticontravel',
138 'flaticonnetwork',
139 'metrizeicon',
140 'typcn'
141 );
142 global $vs_fonticon_style;
143
144 foreach($array as $font){
145 if(!empty($vs_fonticon_style[$font])){
146
147 $link='link';
148 $media='media="all"';
149 echo '<'.esc_attr($link).' rel="'.esc_attr('stylesheet').'" id="vs_'.esc_attr($font).'-css" href="' .esc_url(VISUALSLIDER_DIR."assets/css/fonts/".$font.".css?ver=".$var) . '" '.esc_attr('media').'="all" />';
150
151
152 }
153 }
154
155 echo'</div>';
156
157 //die();
158 }
159 }