| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly. |
| 4 |
} |
| 5 |
include_once VISUALSLIDER_PATH . 'admin/setting-options.php'; |
| 6 |
include_once VISUALSLIDER_PATH . 'admin/slide-options.php'; |
| 7 |
|
| 8 |
include_once VISUALSLIDER_PATH . 'admin/includes/metabox.php'; |
| 9 |
|
| 10 |
include_once VISUALSLIDER_PATH . 'admin/includes/options-functions.php'; |
| 11 |
include_once VISUALSLIDER_PATH . 'admin/includes/setting.php'; |
| 12 |
include_once VISUALSLIDER_PATH . 'admin/includes/slide.php'; |
| 13 |
include_once VISUALSLIDER_PATH . 'admin/includes/layer.php'; |
| 14 |
include_once VISUALSLIDER_PATH . 'admin/includes/template.php'; |
| 15 |
include_once VISUALSLIDER_PATH . 'admin/includes/perview-global.php'; |
| 16 |
include_once VISUALSLIDER_PATH . 'admin/includes/perview-slide.php'; |
| 17 |
include_once VISUALSLIDER_PATH . 'admin/includes/perview-glider-css.php'; |
| 18 |
include_once VISUALSLIDER_PATH . 'admin/includes/perview-glider-tablet-css.php'; |
| 19 |
include_once VISUALSLIDER_PATH . 'admin/includes/perview-glider-mobile-css.php'; |
| 20 |
include_once VISUALSLIDER_PATH . 'admin/custom-css.php'; |
| 21 |
include_once VISUALSLIDER_PATH . 'admin/slider-array.php'; |
| 22 |
|
| 23 |
include_once VISUALSLIDER_PATH . 'admin/fonts/fa-icon.php'; |
| 24 |
include_once VISUALSLIDER_PATH . 'admin/fonts/flaticon.php'; |
| 25 |
include_once VISUALSLIDER_PATH . 'admin/fonts/flaticon_thin.php'; |
| 26 |
include_once VISUALSLIDER_PATH . 'admin/fonts/metrizeicon.php'; |
| 27 |
include_once VISUALSLIDER_PATH . 'admin/fonts/typcn.php'; |
| 28 |
include_once VISUALSLIDER_PATH . 'admin/fonts/googlefont.php'; |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
if( ! function_exists( 'vs_admin_shortcode' ) ) { |
| 33 |
add_action('admin_enqueue_scripts', 'vs_admin_shortcode'); |
| 34 |
function vs_admin_shortcode($hook) { |
| 35 |
$var ='1.0'; |
| 36 |
wp_enqueue_style( 'vs_glider',VISUALSLIDER_DIR .'assets/css/glider.css',array(),$var,false); |
| 37 |
|
| 38 |
wp_enqueue_style( 'vs_slider',VISUALSLIDER_DIR .'assets/css/slider.css',array(),$var,false); |
| 39 |
wp_enqueue_style( 'vs_layer',VISUALSLIDER_DIR .'assets/css/layer.css',array(),$var,false); |
| 40 |
|
| 41 |
wp_enqueue_script( 'vs_slider', VISUALSLIDER_DIR .'assets/js/slider.js',array('jquery'),$var ,false); |
| 42 |
wp_enqueue_script( 'vs_script', VISUALSLIDER_DIR .'assets/js/script.js' ,array('jquery'),$var,false); |
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
} |
| 47 |
} |
| 48 |
|
| 49 |
|
| 50 |
if( ! function_exists( 'vs_admin_enqueue' ) ) { |
| 51 |
add_action('admin_enqueue_scripts', 'vs_admin_enqueue'); |
| 52 |
function vs_admin_enqueue($hook) { |
| 53 |
$var ='1.0'; |
| 54 |
|
| 55 |
global $pagenow; |
| 56 |
if ( is_admin() && in_array( $pagenow, array( 'post-new.php', 'post.php') )&& get_post_type() == 'visualslider') { |
| 57 |
|
| 58 |
wp_enqueue_style('vs_fontawesome',VISUALSLIDER_DIR. 'assets/css/fonts/fontawesome.css','',$var,false); |
| 59 |
wp_enqueue_style('vs_admin_style',VISUALSLIDER_DIR. 'admin/assets/css/admin-style.css',array(),$var,false); |
| 60 |
wp_enqueue_style('vs_admin_options',VISUALSLIDER_DIR. 'admin/assets/css/admin-options.css',array(),$var,false); |
| 61 |
wp_enqueue_style('vs_admin_layer',VISUALSLIDER_DIR. 'admin/assets/css/admin-layer.css',array(),$var,false); |
| 62 |
wp_enqueue_style('vs_admin_setting',VISUALSLIDER_DIR. 'admin/assets/css/admin-setting.css',array(),$var,false); |
| 63 |
wp_enqueue_style('vs_admin_perview',VISUALSLIDER_DIR. 'admin/assets/css/admin-perview.css',array(),$var,false); |
| 64 |
wp_enqueue_style('vs_admin_iconpicker',VISUALSLIDER_DIR. 'admin/assets/css/admin-iconpicker.css',array(),$var,false); |
| 65 |
wp_enqueue_style( 'vs_admin_template',VISUALSLIDER_DIR .'admin/assets/css/admin-template.css',array(),$var,false); |
| 66 |
|
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
$rtl = array('rtl'=>is_rtl()?'true':'false'); |
| 71 |
|
| 72 |
|
| 73 |
wp_enqueue_style( 'vs_fontfamily',VISUALSLIDER_DIR .'assets/css/fontfamily.css',array(),$var,false); |
| 74 |
|
| 75 |
|
| 76 |
|
| 77 |
wp_enqueue_script("jquery-ui-draggable"); |
| 78 |
wp_enqueue_script('jquery-ui-slider'); |
| 79 |
|
| 80 |
global $post; |
| 81 |
$post_id=''; |
| 82 |
if(!empty( get_the_ID())){ |
| 83 |
$post_id = get_the_ID(); |
| 84 |
} |
| 85 |
if(!empty(get_post_type())){ |
| 86 |
$post_type =get_post_type(); |
| 87 |
} |
| 88 |
$array = array( |
| 89 |
'ajaxurl' => admin_url( 'admin-ajax.php'), |
| 90 |
'is_rtl' => is_rtl()?'true':false, |
| 91 |
'font_url' => VISUALSLIDER_DIR .'assets/fonts', |
| 92 |
'nonce' => wp_create_nonce( 'vs_slider_nonce' ), |
| 93 |
'post_id' => $post_id, |
| 94 |
'post_type' => $post_type, |
| 95 |
); |
| 96 |
|
| 97 |
wp_enqueue_style( 'rang_coloris',VISUALSLIDER_DIR .'admin/assets/css/coloris.css',array(),$var,false); |
| 98 |
wp_enqueue_script( 'rang_coloris', VISUALSLIDER_DIR .'admin/assets/js/coloris.js' ,array('jquery'),$var,false); |
| 99 |
wp_localize_script('rang_coloris', 'rang_coloris',array('rtl'=>is_rtl()?'true':'')); |
| 100 |
|
| 101 |
|
| 102 |
|
| 103 |
$script =array( |
| 104 |
'serializejson', |
| 105 |
'new-serializejson', |
| 106 |
'code', |
| 107 |
'var-custom-css', |
| 108 |
'fontfamily', |
| 109 |
'custom-css', |
| 110 |
'options', |
| 111 |
'layer', |
| 112 |
'slide', |
| 113 |
'admin', |
| 114 |
'template', |
| 115 |
'perview', |
| 116 |
'responsive' |
| 117 |
|
| 118 |
); |
| 119 |
|
| 120 |
foreach($script as $id){ |
| 121 |
wp_enqueue_script( 'vs_'.$id, VISUALSLIDER_DIR .'admin/assets/js/'.$id.'.js' ,array('jquery', 'jquery-ui-sortable','jquery-ui-draggable','jquery-ui-resizable'),$var,false); |
| 122 |
wp_localize_script( 'vs_'.$id, 'visualslider',$array); |
| 123 |
wp_enqueue_script( 'vs_'.$id); |
| 124 |
} |
| 125 |
|
| 126 |
|
| 127 |
wp_enqueue_media(); |
| 128 |
|
| 129 |
} |
| 130 |
|
| 131 |
|
| 132 |
} |
| 133 |
} |
| 134 |
if( ! function_exists( 'vs_shortcode_column' ) ) { |
| 135 |
add_filter('manage_visualslider_posts_columns', 'vs_shortcode_column', 5); |
| 136 |
function vs_shortcode_column($columns){ |
| 137 |
$columns['shortcode'] = __('Shortcode','visual-slider'); |
| 138 |
return $columns; |
| 139 |
} |
| 140 |
} |
| 141 |
if( ! function_exists( 'vs_shortcode_display_column' ) ) { |
| 142 |
add_action('manage_visualslider_posts_custom_column', 'vs_shortcode_display_column', 5, 2); |
| 143 |
function vs_shortcode_display_column($column_name, $post_id){ |
| 144 |
switch($column_name){ |
| 145 |
case 'shortcode': |
| 146 |
|
| 147 |
if (!empty($post_id)) { |
| 148 |
echo '<textarea style="height: 30px;width: 200px;resize: none;border-color: rgb(200, 198, 198) !important;color: #666 !important;text-align: right;direction: ltr;" id="vs_shortcode" name="vs_shortcode" readonly >[visualslider id="'.esc_attr($post_id).'"]</textarea>'; |
| 149 |
} |
| 150 |
break; |
| 151 |
} |
| 152 |
} |
| 153 |
} |
| 154 |
|
| 155 |
|