| 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_icon_options" )){ |
| 13 |
add_filter('vs_layer_element_options', 'vs_icon_options'); |
| 14 |
function vs_icon_options( $element ) { |
| 15 |
$option = array(); |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
$item = array( |
| 22 |
'name' => __('Icon','visual-slider'), |
| 23 |
'id' => 'icon', |
| 24 |
'img' => VISUALSLIDER_DIR .'admin/assets/image/layer_icon.png' |
| 25 |
|
| 26 |
); |
| 27 |
|
| 28 |
include VISUALSLIDER_PATH . 'layer/mini/position_size.php'; |
| 29 |
|
| 30 |
|
| 31 |
$option[]= array( |
| 32 |
"name" => __('Icon','visual-slider'), |
| 33 |
"default" => 'fa-star', |
| 34 |
"id" => "icon", |
| 35 |
"group" => __('Content','visual-slider'), |
| 36 |
|
| 37 |
"type" => "icon", |
| 38 |
); |
| 39 |
|
| 40 |
|
| 41 |
$option[]= array( |
| 42 |
"name" => __('Link','visual-slider'), |
| 43 |
"id" => "icon_link", |
| 44 |
"type" => "text", |
| 45 |
"width" => "100%", |
| 46 |
"warp_width" => "100%", |
| 47 |
|
| 48 |
"placeholder" => "http://", |
| 49 |
"group" => __('Content','visual-slider'), |
| 50 |
); |
| 51 |
|
| 52 |
$option[] = array( |
| 53 |
"name" => __('Open in a new window','visual-slider'), |
| 54 |
"id" => "icon_widows", |
| 55 |
"type" => "checkbox", |
| 56 |
"group" => __('Content','visual-slider'), |
| 57 |
); |
| 58 |
|
| 59 |
|
| 60 |
|
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
$option[]= array( |
| 66 |
"responsive" => "desktop", |
| 67 |
"name" => __('Alignment','visual-slider'), |
| 68 |
"id" => "icon_align", |
| 69 |
"type" => "radio_image", |
| 70 |
"default" => 'center', |
| 71 |
"group" => __('Content','visual-slider'), |
| 72 |
"options" => array( |
| 73 |
'left' => VISUALSLIDER_DIR.'admin/assets/image/'.vs_rtl_has('left').'.jpg', |
| 74 |
'center' => VISUALSLIDER_DIR.'admin/assets/image/center.jpg', |
| 75 |
'right' => VISUALSLIDER_DIR.'admin/assets/image/'.vs_rtl_has('right').'.jpg', |
| 76 |
), |
| 77 |
|
| 78 |
); |
| 79 |
|
| 80 |
if(!empty(wp_unslash(filter_input( INPUT_POST, 'vs_tablet', FILTER_VALIDATE_BOOLEAN )))){ |
| 81 |
$option[]= array( |
| 82 |
"responsive" => "tablet", |
| 83 |
"name" => __('Responsive on Tablet','visual-slider'), |
| 84 |
"group" => __('Align','visual-slider'), |
| 85 |
"id" => "tablet_icon_align_heading", |
| 86 |
"type" => "heading", |
| 87 |
); |
| 88 |
|
| 89 |
$option[]= array( |
| 90 |
"responsive" => "tablet", |
| 91 |
|
| 92 |
"name" => __('Alignment on Tablet','visual-slider'), |
| 93 |
"id" => "tablet_icon_align", |
| 94 |
"type" => "radio_image", |
| 95 |
"default" => '', |
| 96 |
"group" => __('Content','visual-slider'), |
| 97 |
"options" => array( |
| 98 |
'' => VISUALSLIDER_DIR.'admin/assets/image/none.jpg', |
| 99 |
'left' => VISUALSLIDER_DIR.'admin/assets/image/'.vs_rtl_has('left').'.jpg', |
| 100 |
'center' => VISUALSLIDER_DIR.'admin/assets/image/center.jpg', |
| 101 |
'right' => VISUALSLIDER_DIR.'admin/assets/image/'.vs_rtl_has('right').'.jpg', |
| 102 |
), |
| 103 |
|
| 104 |
); |
| 105 |
|
| 106 |
|
| 107 |
|
| 108 |
} |
| 109 |
if(!empty(wp_unslash(filter_input( INPUT_POST, 'vs_mobile', FILTER_VALIDATE_BOOLEAN )))){ |
| 110 |
|
| 111 |
|
| 112 |
|
| 113 |
$option[]= array( |
| 114 |
"responsive" => "mobile", |
| 115 |
"name" => __('Responsive on Tablet','visual-slider'), |
| 116 |
"group" => __('Content','visual-slider'), |
| 117 |
"id" => "tablet_icon_align_heading", |
| 118 |
"type" => "heading", |
| 119 |
); |
| 120 |
|
| 121 |
$option[]= array( |
| 122 |
"responsive" => "mobile", |
| 123 |
"name" => __('Alignment on Tablet','visual-slider'), |
| 124 |
"id" => "mobile_icon_align", |
| 125 |
"type" => "radio_image", |
| 126 |
"default" => '', |
| 127 |
"group" => __('Content','visual-slider'), |
| 128 |
"options" => array( |
| 129 |
'' => VISUALSLIDER_DIR.'admin/assets/image/none.jpg', |
| 130 |
'left' => VISUALSLIDER_DIR.'admin/assets/image/'.vs_rtl_has('right').'.jpg', |
| 131 |
'center' => VISUALSLIDER_DIR.'admin/assets/image/center.jpg', |
| 132 |
'right' => VISUALSLIDER_DIR.'admin/assets/image/'.vs_rtl_has('left').'.jpg', |
| 133 |
), |
| 134 |
|
| 135 |
); |
| 136 |
|
| 137 |
|
| 138 |
} |
| 139 |
|
| 140 |
$option[]= array( |
| 141 |
"name" => __('Hover','visual-slider'), |
| 142 |
"id" => "icon_effects", |
| 143 |
"group" => __('Content','visual-slider'), |
| 144 |
"type" => "hover", |
| 145 |
"options" => array( |
| 146 |
'normal' => __('NORMAL','visual-slider'), |
| 147 |
'hover' => __('HOVER','visual-slider'), |
| 148 |
), |
| 149 |
); |
| 150 |
|
| 151 |
|
| 152 |
$option[]= array( |
| 153 |
"name" => __('Icon Color','visual-slider'), |
| 154 |
"id" => "icon_color", |
| 155 |
"fold" => array( |
| 156 |
'normal' => 'icon_effects', |
| 157 |
) , |
| 158 |
"group" => __('Style','visual-slider'), |
| 159 |
"type" => "multi_options", |
| 160 |
"options" => array( |
| 161 |
array( |
| 162 |
"id" => "first", |
| 163 |
"type" => "color_rgba", |
| 164 |
), |
| 165 |
), |
| 166 |
); |
| 167 |
|
| 168 |
$option[]= array( |
| 169 |
"name" => __('Icon Hover Color','visual-slider'), |
| 170 |
"id" => "icon_hover_color", |
| 171 |
"fold" => array( |
| 172 |
'hover' => 'icon_effects', |
| 173 |
) , |
| 174 |
"group" => __('Style','visual-slider'), |
| 175 |
"type" => "multi_options", |
| 176 |
"options" => array( |
| 177 |
array( |
| 178 |
"id" => "first", |
| 179 |
"type" => "color_rgba", |
| 180 |
), |
| 181 |
), |
| 182 |
); |
| 183 |
|
| 184 |
$option[]= array( |
| 185 |
"name" => __('Icon Shadow','visual-slider'), |
| 186 |
"id" => "icon_shadow", |
| 187 |
"fold" => array( |
| 188 |
'normal' => 'icon_effects', |
| 189 |
) , |
| 190 |
"group" => __('Style','visual-slider'), |
| 191 |
"type" => "multi_options", |
| 192 |
"options" => vs_multi_array_options('text_shadow'), |
| 193 |
|
| 194 |
); |
| 195 |
|
| 196 |
|
| 197 |
$option[]= array( |
| 198 |
"name" => __('Icon Hover Shadow','visual-slider'), |
| 199 |
"id" => "icon_hover_shadow", |
| 200 |
"fold" => array( |
| 201 |
'hover' => 'icon_effects', |
| 202 |
) , |
| 203 |
"group" => __('Style','visual-slider'), |
| 204 |
"type" => "multi_options", |
| 205 |
|
| 206 |
"options" => vs_multi_array_options('text_shadow'), |
| 207 |
|
| 208 |
); |
| 209 |
|
| 210 |
$option[]= array( |
| 211 |
"responsive" => "desktop", |
| 212 |
"name" => __('Icon Size','visual-slider'), |
| 213 |
"id" => "icon_font_size", |
| 214 |
"group" => __('Style','visual-slider'), |
| 215 |
"type" => "number", |
| 216 |
"unit" => "px", |
| 217 |
"max" => "200", |
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
); |
| 222 |
|
| 223 |
|
| 224 |
if(!empty(wp_unslash(filter_input( INPUT_POST, 'vs_tablet', FILTER_VALIDATE_BOOLEAN )))){ |
| 225 |
$option[]= array( |
| 226 |
"responsive" => "tablet", |
| 227 |
"name" => __('Responsive on Tablet','visual-slider'), |
| 228 |
"group" => __('Style','visual-slider'), |
| 229 |
"id" => "tablet_typography_heading", |
| 230 |
"type" => "heading", |
| 231 |
); |
| 232 |
$option[]= array( |
| 233 |
"responsive" => "tablet", |
| 234 |
|
| 235 |
"name" => __('Text Size on Tablet','visual-slider'), |
| 236 |
"id" => "tablet_icon_font_size", |
| 237 |
"group" => __('Style','visual-slider'), |
| 238 |
"type" => "number", |
| 239 |
"unit" => "px", |
| 240 |
"max" => "200", |
| 241 |
|
| 242 |
|
| 243 |
|
| 244 |
); |
| 245 |
|
| 246 |
|
| 247 |
|
| 248 |
} |
| 249 |
|
| 250 |
if(!empty(wp_unslash(filter_input( INPUT_POST, 'vs_mobile', FILTER_VALIDATE_BOOLEAN )))){ |
| 251 |
$option[]= array( |
| 252 |
"responsive" => "mobile", |
| 253 |
|
| 254 |
"name" => __('Responsive on Mobile','visual-slider'), |
| 255 |
"group" => __('Style','visual-slider'), |
| 256 |
"id" => "mobile_typography_heading", |
| 257 |
"type" => "heading", |
| 258 |
); |
| 259 |
$option[]= array( |
| 260 |
"responsive" => "mobile", |
| 261 |
|
| 262 |
"name" => __('Text Size on Mobile','visual-slider'), |
| 263 |
"id" => "mobile_icon_font_size", |
| 264 |
"group" => __('Style','visual-slider'), |
| 265 |
"type" => "number", |
| 266 |
"unit" => "px", |
| 267 |
"max" => "200", |
| 268 |
|
| 269 |
|
| 270 |
|
| 271 |
); |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
|
| 276 |
} |
| 277 |
/***********************************boxed************************************************************************************/ |
| 278 |
$boxed='icon'; |
| 279 |
|
| 280 |
include VISUALSLIDER_PATH . 'layer/mini/boxed.php'; |
| 281 |
|
| 282 |
include VISUALSLIDER_PATH . 'layer/mini/effect.php'; |
| 283 |
|
| 284 |
$item['options']=$option; |
| 285 |
$element[]=$item; |
| 286 |
return $element; |
| 287 |
} |
| 288 |
} |
| 289 |
} |
| 290 |
/***************************************************************************************************************************************************** |
| 291 |
****************************************************************************************************************************************************** |
| 292 |
|
| 293 |
Slider Text Config |
| 294 |
|
| 295 |
*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
| 296 |
if ( !function_exists ( "vs_icon_perview" )){ |
| 297 |
add_filter('vs_layer_perview_icon', 'vs_icon_perview'); |
| 298 |
function vs_icon_perview( $value ) { |
| 299 |
$option= $value['option']; |
| 300 |
$key= $value['key']; |
| 301 |
|
| 302 |
|
| 303 |
////////////////////////////////////////////////////////////OUTPUT//////////////////////////////////////////////////////////////////////////////////////// |
| 304 |
|
| 305 |
echo '<aside id="vs_perview_layer_'.esc_attr($key).'" class="vs_draggable vs-layer-item vs-layer-center" data-key="'.esc_attr($key).'" >'; |
| 306 |
echo '<div class="vs-icon vs-layer-content" >'; |
| 307 |
echo '</div>'; |
| 308 |
|
| 309 |
|
| 310 |
echo '<div class="vs-layer-style"> </div>'; |
| 311 |
|
| 312 |
echo '</aside>'; |
| 313 |
} |
| 314 |
} |
| 315 |
|
| 316 |
if ( !function_exists ( "vs_icon_config" )){ |
| 317 |
add_filter('vs_layer_icon', 'vs_icon_config'); |
| 318 |
function vs_icon_config( $value ) { |
| 319 |
$option= $value['option']; |
| 320 |
$key= $value['key']; |
| 321 |
$global_key= $value['global_key']; |
| 322 |
$slide_key= $value['slide_key']; |
| 323 |
|
| 324 |
$icon_boxed = !empty($option['icon_boxed'])?'vs-icon-'.$option['icon_boxed']:'vs-icon-none'; |
| 325 |
|
| 326 |
|
| 327 |
//text Css |
| 328 |
echo '<aside class="vs-layer-'.esc_attr($key).' vs-layer-item '.esc_attr(vs_layer_effect_class($option)).'" >'; |
| 329 |
|
| 330 |
|
| 331 |
echo '<div class="vs-icon '.esc_attr($icon_boxed).' vs-layer-content ">'; |
| 332 |
if(!empty($option['icon_link'])){ |
| 333 |
$target = !empty($option['icon_widows']) ? 'target="_blank"' : ''; |
| 334 |
echo wp_kses('<a href="'.$option['icon_link'].'" '.$target.' >',vs_kses()); |
| 335 |
} |
| 336 |
if(!empty($option['icon'])){ |
| 337 |
vs_icon_fontfamily($option['icon']); |
| 338 |
echo '<i class="'.esc_attr($option['icon']).'"></i>'; |
| 339 |
} |
| 340 |
|
| 341 |
if(!empty($option['icon_link'])){ |
| 342 |
echo '</a>'; |
| 343 |
} |
| 344 |
echo '</div>'; |
| 345 |
|
| 346 |
$css=vs_layer_position( $option); |
| 347 |
|
| 348 |
$css.= vs_slider_var( 'icn-ag',$option,'icon_align' ); |
| 349 |
$css.= vs_slider_var_align( 'tab-icn-ag',$option,'tablet_icon_align' ); |
| 350 |
$css.= vs_slider_var_align( 'mob-icn-ag',$option,'mobile_icon_align' ); |
| 351 |
$css.= vs_slider_var_2( 'icn-cr',$option,'icon_color','first'); |
| 352 |
$css.= vs_slider_var_2( 'icn-hv-cr',$option,'icon_hover_color','first'); |
| 353 |
$css.= vs_slider_var_text_shadow( 'icn',$option,'icon_shadow'); |
| 354 |
$css.= vs_slider_var_text_shadow( 'icn-hv',$option,'icon_hover_shadow','first'); |
| 355 |
$css.=vs_slider_var_unit( 'icn-fn-sz',$option,'icon_font_size','px'); |
| 356 |
$css.=vs_slider_var_unit( 'tab-icn-fn-sz',$option,'tablet_icon_font_size','px'); |
| 357 |
$css.=vs_slider_var_unit( 'mob-icn-fn-sz',$option,'mobile_icon_font_size','px'); |
| 358 |
|
| 359 |
$boxed = !empty($option['icon_boxed'])?$option['icon_boxed']:'none'; |
| 360 |
if($boxed=='boxed'){ |
| 361 |
$css.=vs_slider_var_padding( 'icn-box-pd',$option,'icon_boxed_padding'); |
| 362 |
$css.= vs_slider_var_gradient_background_color( 'icn-box',$option,'icon_boxed_background'); |
| 363 |
$css.= vs_slider_var_gradient_background_color( 'icn-box-hv',$option,'icon_boxed_hover_background'); |
| 364 |
$css.= vs_slider_var_border( 'icn-box',$option,'icon_boxed_border'); |
| 365 |
$css.= vs_slider_var_border( 'icn-box-hv',$option,'icon_boxed_hover_border'); |
| 366 |
$css.= vs_slider_var_shadow( 'icn-box',$option,'icon_boxed_shadow'); |
| 367 |
$css.= vs_slider_var_shadow( 'icn-box-hv',$option,'icon_boxed_hover_shadow'); |
| 368 |
$css.= vs_slider_var_radius( 'icn-box',$option,'icon_boxed_radius'); |
| 369 |
} |
| 370 |
|
| 371 |
$css.=vs_layer_effect( $option); |
| 372 |
|
| 373 |
$item=''; |
| 374 |
if(!empty($global_key)){ |
| 375 |
$item.='.vs-global-'.$global_key.' '; |
| 376 |
} |
| 377 |
if(!empty($slide_key)){ |
| 378 |
$item.='.vs-slide-'.$slide_key.' '; |
| 379 |
} |
| 380 |
if(!empty($key)){ |
| 381 |
$item.='.vs-layer-'.$key.' '; |
| 382 |
} |
| 383 |
echo '<style>'.wp_kses(vs_slider_item_css( $css,$item),vs_kses()).'</style>'; |
| 384 |
|
| 385 |
|
| 386 |
|
| 387 |
echo '</aside>'; |
| 388 |
|
| 389 |
|
| 390 |
} |
| 391 |
} |