PluginProbe
Visual Slider / trunk
Visual Slider vtrunk
visual-slider / layer / box.php

box.php in Visual Slider trunk, at layer/box.php

266 lines 7.5 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 /*****************************************************************************************************************************************************
6 ******************************************************************************************************************************************************
7
8 Slider Text Options
9
10 */////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
11 if (is_admin()){
12 if ( !function_exists ( "vs_box_options" )){
13 add_filter('vs_layer_element_options', 'vs_box_options');
14 function vs_box_options( $element ) {
15 $option = array();
16
17
18
19
20
21 $item = array(
22 'name' => __('Box','visual-slider'),
23 'id' => 'box',
24 'img' => VISUALSLIDER_DIR .'admin/assets/image/layer_box.png'
25
26 );
27
28 $default = array( 'width' =>'100', 'height' =>'100');
29
30 include VISUALSLIDER_PATH . 'layer/mini/position_size.php';
31
32
33
34 /***********************************boxed************************************************************************************/
35 $option[]= array(
36 "name" => __('Hover','visual-slider'),
37 "id" => "box_effects",
38 "group" => __('Box Style','visual-slider'),
39 "type" => "hover",
40 "options" => array(
41 'normal' => __('NORMAL','visual-slider'),
42 'hover' => __('HOVER','visual-slider'),
43 ),
44 );
45
46
47
48
49
50
51
52
53 $option[]= array(
54 "name" => __('Box Background','visual-slider'),
55 "id" => "box_background",
56 "group" => __('Box Style','visual-slider'),
57 "fold" => array(
58 'normal' => 'box_effects',
59 ) ,
60 "default" => array('first'=>"rgb(2, 159, 253)"),
61 "type" => "multi_options",
62
63 "options" => array(
64 array( "id" => "first",
65 "type" => "color_rgba",
66 ),
67 array( "id" => "second",
68 "type" => "color_rgba",
69 ),
70 array(
71 "id" => "orientation",
72 "type" => "select",
73 "width" => "50px",
74 "options" => array(
75 "horizontal" => esc_html__('→','visual-slider'),
76 "vertical" => esc_html__('↓','visual-slider'),
77 "diagonal" => esc_html__('↘','visual-slider'),
78 "diagonal-bottom" => esc_html__('↗','visual-slider'),
79 "radial" => esc_html__('â—‹','visual-slider'),
80
81 ),
82 ),
83 ),
84
85
86 );
87
88
89 $option[]= array(
90 "name" => __('Box Border','visual-slider'),
91 "id" => "box_border",
92 "group" => __('Box Style','visual-slider'),
93 "type" => "multi_options",
94 "width" => "100%",
95 "fold" => array(
96 'normal' => 'box_effects',
97 ) ,
98 "options" => vs_multi_array_options('layer_border'),
99 );
100
101 $option[]= array(
102 "name" => __('Box Shadow','visual-slider'),
103 "id" => "box_shadow",
104 "group" => __('Box Style','visual-slider'),
105 "type" => "multi_options",
106 "width" => "100%",
107 "fold" => array(
108 'normal' => 'box_effects',
109 ) ,
110 "options" => vs_multi_array_options('layer_shadow'),
111 );
112
113
114
115
116
117 //******* hover***********/
118
119 $option[]= array(
120 "name" => __('Box Hover Background','visual-slider'),
121 "id" => "box_hover_background",
122 "group" => __('Box Shadow','visual-slider'),
123 "fold" => array(
124 'hover' => 'box_effects',
125 ) ,
126 "type" => "multi_options",
127
128 "options" => array(
129 array( "id" => "first",
130 "type" => "color_rgba",
131 ),
132 array( "id" => "second",
133 "type" => "color_rgba",
134 ),
135 array(
136 "id" => "orientation",
137 "type" => "select",
138 "width" => "50px",
139 "options" => array(
140 "horizontal" => esc_html__('→','visual-slider'),
141 "vertical" => esc_html__('↓','visual-slider'),
142 "diagonal" => esc_html__('↘','visual-slider'),
143 "diagonal-bottom" => esc_html__('↗','visual-slider'),
144 "radial" => esc_html__('â—‹','visual-slider'),
145
146 ),
147 ),
148 ),
149
150
151 );
152
153
154 $option[]= array(
155 "name" => __('Box Hover Border','visual-slider'),
156 "id" => "box_hover_border",
157 "group" => __('Box Style','visual-slider'),
158 "type" => "multi_options",
159 "width" => "100%",
160 "fold" => array(
161 'hover' => 'box_effects',
162 ) ,
163 "options" => vs_multi_array_options('layer_border'),
164 );
165
166 $option[]= array(
167 "name" => __('Box Hover Shadow','visual-slider'),
168 "id" => "box_hover_shadow",
169 "group" => __('Box Style','visual-slider'),
170 "type" => "multi_options",
171 "width" => "100%",
172 "fold" => array( 'hover' => 'box_effects') ,
173
174 "options" => vs_multi_array_options('layer_shadow'),
175 );
176
177 $option[]= array(
178 "name" => __('Box Radius','visual-slider'),
179 "id" => "box_radius",
180 "group" => __('Box Style','visual-slider'),
181 "type" => "multi_options",
182 "width" => "100%",
183 "options" => vs_multi_array_options('layer_radius'),
184 );
185
186
187
188
189 include VISUALSLIDER_PATH . 'layer/mini/effect.php';
190
191 $item['options']=$option;
192 $element[]=$item;
193 return $element;
194 }
195 }
196 }
197 /*****************************************************************************************************************************************************
198 ******************************************************************************************************************************************************
199
200 Slider Text Config
201
202 */////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
203 if ( !function_exists ( "vs_box_perview" )){
204 add_filter('vs_layer_perview_box', 'vs_box_perview');
205 function vs_box_perview( $value ) {
206 $option= $value['option'];
207 $key= $value['key'];
208
209 echo '<aside id="vs_perview_layer_'.esc_attr($key).'" class="vs_draggable vs-layer-item " data-key="'.esc_attr($key).'" >';
210 echo '<div class="vs-box">';
211 echo '</div>';
212
213 echo '<div class="vs-layer-style"> </div>';
214 echo '</aside>';
215
216 }
217 }
218
219
220 if ( !function_exists ( "vs_box_config" )){
221 add_filter('vs_layer_box', 'vs_box_config');
222 function vs_box_config( $value ) {
223 $option= $value['option'];
224 $key= $value['key'];
225 $global_key= $value['global_key'];
226 $slide_key= $value['slide_key'];
227
228
229
230 echo '<aside class="vs-layer-'.esc_attr($key).' vs-layer-item '.esc_attr(vs_layer_effect_class($option)).'" >';
231
232
233 echo '<div class="vs-box " >';
234 echo '</div>';
235
236
237
238
239
240 $css=vs_layer_position( $option);
241
242
243 $css.= vs_slider_var_gradient_background_color( 'box',$option,'box_background');
244 $css.= vs_slider_var_gradient_background_color( 'box-hv',$option,'box_hover_background');
245 $css.= vs_slider_var_border( 'box',$option,'box_border');
246 $css.= vs_slider_var_border( 'box-hv',$option,'box_hover_border');
247 $css.= vs_slider_var_shadow( 'box',$option,'box_shadow');
248 $css.= vs_slider_var_shadow( 'box-hv',$option,'box_hover_shadow');
249 $css.= vs_slider_var_radius( 'box',$option,'box_radius');
250
251 $css.=vs_layer_effect( $option);
252 $item='';
253 if(!empty($global_key)){
254 $item.='.vs-global-'.$global_key.' ';
255 }
256 if(!empty($slide_key)){
257 $item.='.vs-slide-'.$slide_key.' ';
258 }
259 if(!empty($key)){
260 $item.='.vs-layer-'.$key.' ';
261 }
262 echo '<style>'.wp_kses(vs_slider_item_css( $css, $item),vs_kses()).'</style>';
263
264 echo '</aside>';
265 }
266 }