| @@ -2,405 +2,211 @@ | ||
| 2 | 2 | |
| 3 | 3 | /* |
| 4 | 4 | Plugin Name: Easy Bootstrap Shortcode |
| 5 | 5 | Plugin URI: http://www.oscitasthemes.com |
| 6 | - Description: Add bootstrap 3.0.3 styles to your theme by wordpress editor shortcode buttons. | |
| 7 | - Version: 4.5.4 | |
| 6 | + Description: Add bootstrap 3.0 styles to your theme by wordpress editor shortcode buttons. | |
| 7 | + Version: 2.3.6 | |
| 8 | 8 | Author: oscitas |
| 9 | 9 | Author URI: http://www.oscitasthemes.com |
| 10 | 10 | License: Under the GPL v2 or later |
| 11 | - Text Domain: easy-bootstrap-shortcodes | |
| 12 | - Domain Path: /languages | |
| 13 | 11 | */ |
| 14 | 12 | |
| 15 | -/* | |
| 16 | - * function used to check whether ebs activated this check included in EBS Pro | |
| 17 | - */ | |
| 18 | -$_EBS_SESSION_STARTED = false; | |
| 19 | -function osc_ebs_plugin_exists( $prevent ) { | |
| 20 | - return 'ebs'; | |
| 21 | -} | |
| 22 | -$checkplugin=apply_filters('osc_ebs_pro_plugin_exists',false); | |
| 23 | -if(isset($checkplugin) && $checkplugin=='ebsp'): | |
| 24 | - add_action('admin_notices', 'ebs_showAdminMessages'); | |
| 25 | - | |
| 26 | - function ebs_showMessage($message, $errormsg = false) | |
| 27 | - { | |
| 28 | - if ($errormsg) { | |
| 29 | - echo '<div id="message" class="error ebs_notification">'; | |
| 30 | - } | |
| 31 | - else { | |
| 32 | - echo '<div id="message" class="update-nag ebs_notification">'; | |
| 33 | - } | |
| 34 | - echo '<p><strong>' . __($message, 'easy-bbotstrap-shoercodes') . '</strong></p></div>'; | |
| 35 | - } | |
| 36 | - | |
| 37 | - /* | |
| 38 | - * Show message when EBS and EBS pro both activated | |
| 39 | - */ | |
| 40 | - function ebs_showAdminMessages() | |
| 41 | - { | |
| 42 | - ebs_showMessage(__("Easy Bootstrap Shortcode Pro activated, deactivate Easy Bootstrap Shortcode free version", 'easy-bootstrap-shoercodes'), false); | |
| 43 | - } | |
| 44 | -else: | |
| 45 | - /* | |
| 46 | - Define Global variable and constants | |
| 47 | - */ | |
| 48 | - add_filter( 'osc_ebs_plugin_exists', 'osc_ebs_plugin_exists' ); | |
| 49 | - define('EBS_PLUGIN_URL',plugins_url('/',__FILE__)); | |
| 50 | - define('EBS_JS_CDN','http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js'); | |
| 51 | - define('EBS_RESPOND_CDN','http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.min.js'); | |
| 52 | - add_action('admin_init','check_ebsp_status'); | |
| 53 | - function check_ebsp_status(){ | |
| 54 | - $file = basename( __FILE__ ); | |
| 55 | - $folder = basename( dirname( __FILE__ ) ); | |
| 56 | - $hook = "after_plugin_row_{$folder}/{$file}"; | |
| 57 | - add_action( $hook, 'ebsp_register_licence_key'); | |
| 58 | - } | |
| 59 | - function ebsp_register_licence_key( $plugin_name ) | |
| 60 | - | |
| 61 | - { | |
| 62 | - $ebsprefix='ebsp'; | |
| 63 | - $plugin_name='easy-bootstrap-shortcode-pro/osc_bootstrap_shortcode.php '; | |
| 64 | - echo '</tr><tr class="plugin-update-tr"><td colspan="3" class="plugin-update"><div class="update-message">' . __('Easy Bootstrap Shortcode Pro also available, <a href="http://oscitasthemes.com/products/easy-bootstrap-shortcodes-pro/">click here</a> to purchase one now', 'easy-bootstrap-shoercodes') . '</div></td>'; | |
| 65 | - } | |
| 66 | - | |
| 67 | - add_action('admin_enqueue_scripts', 'osc_add_admin_ebs_scripts'); | |
| 68 | - add_action('admin_menu', 'osc_ebs_add_admin_menu'); | |
| 69 | - add_action('wp_enqueue_scripts', 'osc_add_dynamic_css',100); | |
| 70 | - add_filter('mce_external_plugins', 'osc_editor_enable_mce'); | |
| 71 | - /* | |
| 72 | - * Include bootstrap js and css file if activated theme is not an oscitas product | |
| 73 | - */ | |
| 13 | +add_action('init','is_oscitas_theme_exists'); | |
| 14 | +function is_oscitas_theme_exists(){ | |
| 15 | + global $oscitaschecktheme; | |
| 16 | + add_action('admin_enqueue_scripts', 'osc_add_admin_ebs_scripts'); | |
| 74 | 17 | if(!apply_filters('plugin_oscitas_theme_check',false)){ |
| 75 | - add_action('wp_enqueue_scripts', 'osc_add_frontend_ebs_scripts',-100); | |
| 76 | - } | |
| 77 | 18 | |
| 78 | - | |
| 79 | - | |
| 80 | - register_activation_hook(__FILE__, 'osc_ebs_activate_plugin'); | |
| 81 | - register_deactivation_hook(__FILE__, 'osc_ebs_deactivate_plugin'); | |
| 82 | - | |
| 83 | - /* | |
| 84 | - * Plugin activation hook set default plugin setting on activation | |
| 85 | - */ | |
| 86 | - function osc_ebs_activate_plugin() { | |
| 87 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 88 | - if (!$isSet) { | |
| 89 | - | |
| 90 | - // EBS_BOOTSTRAP_JS_LOCATION '1' - for plugin file, '2' - don't user EBS files but use from other plugin or theme, '3' - to user CDN path | |
| 91 | - update_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 92 | - update_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', EBS_JS_CDN ); | |
| 93 | - update_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', EBS_RESPOND_CDN ); | |
| 94 | - // EBS_BOOTSTRAP_RESPOND_LOCATION '1' - for plugin file, '2' - don't user EBS files but use from other plugin or theme, '3' - to user CDN path | |
| 95 | - update_option('EBS_BOOTSTRAP_RESPOND_LOCATION',2); | |
| 96 | - | |
| 97 | - // EBS_BOOTSTRAP_CSS_LOCATION '1' - for plugin file, '2' - don't user EBS files but use from other plugin or theme | |
| 98 | - update_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 99 | - update_option( 'EBS_EDITOR_OPT','icon'); | |
| 100 | - update_option( 'EBS_EDITOR_OPT','icon'); | |
| 101 | - if(get_option('EBS_SHORTCODE_PREFIX')==false){ | |
| 102 | - update_option( 'EBS_SHORTCODE_PREFIX', '' ); | |
| 103 | - } | |
| 104 | - update_option( 'EBS_INCLUDE_FA',1); | |
| 105 | - update_option( 'EBS_SESSION_CLOSE',0); | |
| 106 | - if(get_option('EBS_CUSTOM_CSS')==''){ | |
| 107 | - update_option( 'EBS_CUSTOM_CSS',''); | |
| 108 | - } | |
| 109 | - } | |
| 110 | - | |
| 19 | + add_action('wp_enqueue_scripts', 'osc_add_frontend_ebs_scripts'); | |
| 20 | + add_action('admin_menu', 'osc_ebs_add_admin_menu'); | |
| 111 | 21 | } |
| 22 | +} | |
| 112 | 23 | |
| 113 | - /* | |
| 114 | - * Plugin deactivation hook, delete option on deactivation | |
| 115 | - */ | |
| 116 | - function osc_ebs_deactivate_plugin() { | |
| 117 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 118 | - if (!$isSet) { | |
| 119 | - delete_option( 'EBS_BOOTSTRAP_JS_LOCATION' ); | |
| 120 | - delete_option( 'EBS_BOOTSTRAP_JS_CDN_PATH' ); | |
| 121 | - delete_option( 'EBS_BOOTSTRAP_CSS_LOCATION'); | |
| 122 | - delete_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION' ); | |
| 123 | - delete_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH' ); | |
| 124 | - delete_option('EBS_EDITOR_OPT'); | |
| 125 | - delete_option('EBS_INCLUDE_FA'); | |
| 126 | - delete_option('EBS_SESSION_CLOSE'); | |
| 127 | - } | |
| 128 | - } | |
| 24 | +register_activation_hook(__FILE__, 'osc_ebs_activate_plugin'); | |
| 25 | +register_deactivation_hook(__FILE__, 'osc_ebs_deactivate_plugin'); | |
| 26 | +//add_action('admin_enqueue_scripts', 'osc_add_admin_ebs_scripts'); | |
| 27 | +//add_action('wp_enqueue_scripts', 'osc_add_frontend_ebs_scripts'); | |
| 28 | +//add_action('admin_menu', 'osc_ebs_add_admin_menu'); | |
| 129 | 29 | |
| 130 | - /* | |
| 131 | - * Add plugin setting page on plugin listing page after activation | |
| 132 | - */ | |
| 133 | - function osc_ebs_settings_link( $links ) { | |
| 134 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 135 | - if (!$isSet) { | |
| 136 | - $settings_link = '<a href="admin.php?page=ebs/ebs-settings.php">'.__('Settings', 'easy-bootstrap-shoercodes').'</a>'; | |
| 137 | - array_push( $links, $settings_link ); | |
| 138 | - } | |
| 139 | - return $links; | |
| 140 | - } | |
| 30 | +function osc_ebs_activate_plugin() { | |
| 31 | + $isSet=apply_filters('ebs_custom_option',false); | |
| 32 | + if (!$isSet) { | |
| 141 | 33 | |
| 142 | - add_filter( "plugin_action_links_".plugin_basename( __FILE__ ), 'osc_ebs_settings_link' ); | |
| 34 | + // EBS_BOOTSTRAP_JS_LOCATION '1' - for plugin file, '2' - don't user EBS files but use from other plugin or theme, '3' - to user CDN path | |
| 35 | + update_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 36 | + update_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', 'http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js' ); | |
| 37 | + update_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', 'http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.min.js' ); | |
| 38 | + // EBS_BOOTSTRAP_RESPOND_LOCATION '1' - for plugin file, '2' - don't user EBS files but use from other plugin or theme, '3' - to user CDN path | |
| 39 | + update_option('EBS_BOOTSTRAP_RESPOND_LOCATION',2); | |
| 143 | 40 | |
| 144 | - /* | |
| 145 | - * Create EBS admin Menu | |
| 146 | - */ | |
| 147 | - function osc_ebs_add_admin_menu() { | |
| 148 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 149 | - if (!$isSet) { | |
| 150 | - add_menu_page(__('EBS Settings', 'easy-bootstrap-shoercodes'), __('EBS Settings', 'easy-bootstrap-shoercodes'), 'manage_options', 'ebs/ebs-settings.php', 'osc_ebs_setting_page', plugins_url('/images/icon.png', __FILE__)); | |
| 151 | - | |
| 152 | - $sub_page= add_submenu_page( 'ebs/ebs-settings.php',__('osCitas Offers', 'easy-bootstrap-shoercodes'), __('osCitas Offers', 'easy-bootstrap-shoercodes'), 'manage_options', 'ebs-pro-demo', 'osc_ebs_pro_demo_page' ); | |
| 153 | - add_action('admin_print_styles-' . $sub_page, 'ebsProDemoPage_register_admin_styles'); | |
| 154 | - } | |
| 41 | + // EBS_BOOTSTRAP_CSS_LOCATION '1' - for plugin file, '2' - don't user EBS files but use from other plugin or theme | |
| 42 | + update_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 155 | 43 | } |
| 156 | 44 | |
| 157 | - | |
| 158 | - /* | |
| 159 | - * Add EBS pto Demo page css | |
| 160 | - */ | |
| 161 | - function ebsProDemoPage_register_admin_styles(){ | |
| 162 | - wp_enqueue_style('ebs_pro_demo', EBS_PLUGIN_URL.'styles/ebs_pro_demo.css'); | |
| 45 | +} | |
| 46 | +function osc_ebs_settings_link( $links ) { | |
| 47 | + $isSet=apply_filters('ebs_custom_option',false); | |
| 48 | + if (!$isSet) { | |
| 49 | + $settings_link = '<a href="admin.php?page=ebs/ebs-settings.php">Settings</a>'; | |
| 50 | + array_push( $links, $settings_link ); | |
| 163 | 51 | } |
| 164 | - function osc_ebs_pro_demo_page(){ | |
| 165 | - include 'lib/ebspro-demo.php'; | |
| 166 | - } | |
| 52 | + return $links; | |
| 53 | +} | |
| 167 | 54 | |
| 168 | -/* | |
| 169 | - * Render EBS Setting Page & update EBS options | |
| 170 | - */ | |
| 171 | - function osc_ebs_setting_page() { | |
| 172 | - if (isset($_POST['ebs_submit'])) { | |
| 173 | - update_option( 'EBS_BOOTSTRAP_JS_LOCATION', isset($_POST['b_js'])?$_POST['b_js']:1 ); | |
| 174 | - update_option( 'EBS_BOOTSTRAP_JS_CDN_PATH',isset($_POST['cdn_path'])? $_POST['cdn_path']:EBS_JS_CDN ); | |
| 175 | - update_option( 'EBS_BOOTSTRAP_CSS_LOCATION', isset($_POST['b_css'])?$_POST['b_css']:1 ); | |
| 176 | - update_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', isset($_POST['respond_js'])?$_POST['respond_js']:2 ); | |
| 177 | - update_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', isset($_POST['respond_cdn_path'])?$_POST['respond_cdn_path']:EBS_RESPOND_CDN ); | |
| 178 | - update_option( 'EBS_EDITOR_OPT', isset($_POST['ebsp_editor_opt'])?$_POST['ebsp_editor_opt']:'icon' ); | |
| 179 | - update_option( 'EBS_CUSTOM_CSS', isset($_POST['ebs_custom_css'])?$_POST['ebs_custom_css']:'' ); | |
| 180 | - update_option( 'EBS_INCLUDE_FA', isset($_POST['fa_icon'])?$_POST['fa_icon']:'' ); | |
| 181 | - update_option( 'EBS_SESSION_CLOSE', isset($_POST['use_ebs_session_close']) | |
| 182 | - ?$_POST['use_ebs_session_close']:'0' ); | |
| 183 | - ebs_session_start(); | |
| 184 | - $_SESSION['ebs_dynamic_css'] =$_POST['ebs_custom_css']; | |
| 185 | - ebs_session_end(); | |
| 186 | - update_option( 'EBS_SHORTCODE_PREFIX', isset($_POST['shortcode_prefix'])?$_POST['shortcode_prefix']:'' ); | |
| 55 | +add_filter( "plugin_action_links_".plugin_basename( __FILE__ ), 'osc_ebs_settings_link' ); | |
| 187 | 56 | |
| 188 | - $fa_icon=isset($_POST['fa_icon'])?$_POST['fa_icon']:'' ; | |
| 189 | - $js =isset($_POST['b_js'])?$_POST['b_js']:1; | |
| 190 | - $cdn = isset($_POST['cdn_path'])? $_POST['cdn_path']:EBS_JS_CDN; | |
| 191 | - $css = isset($_POST['b_css'])?$_POST['b_css']:1; | |
| 192 | - $respond = isset($_POST['respond_js'])?$_POST['respond_js']:2; | |
| 193 | - $respondcdn = isset($_POST['respond_cdn_path'])?$_POST['respond_cdn_path']:EBS_RESPOND_CDN; | |
| 194 | - $ebsp_editor_opt=isset($_POST['ebsp_editor_opt'])?$_POST['ebsp_editor_opt']:'icon' ; | |
| 195 | - $ebs_custom_css=isset($_POST['ebs_custom_css'])?$_POST['ebs_custom_css']:'' ; | |
| 196 | - $shortcode_prefix = $_POST['shortcode_prefix']; | |
| 197 | - } else { | |
| 198 | - $js = get_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 199 | - $cdn = get_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', EBS_JS_CDN ); | |
| 200 | - $css = get_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 201 | - $respond = get_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', 2 ); | |
| 202 | - $respondcdn = get_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', EBS_RESPOND_CDN ); | |
| 203 | - $ebsp_editor_opt=get_option('EBS_EDITOR_OPT','icon'); | |
| 204 | - $ebs_custom_css=get_option('EBS_CUSTOM_CSS',''); | |
| 205 | - $shortcode_prefix=get_option('EBS_SHORTCODE_PREFIX',''); | |
| 206 | - $fa_icon=get_option('EBS_INCLUDE_FA',1); | |
| 207 | - $use_ebs_session_close=get_option('EBS_SESSION_CLOSE',0); | |
| 208 | - } | |
| 209 | - include 'ebs_settings.php'; | |
| 57 | +function osc_ebs_deactivate_plugin() { | |
| 58 | + $isSet=apply_filters('ebs_custom_option',false); | |
| 59 | + if (!$isSet) { | |
| 60 | + delete_option( 'EBS_BOOTSTRAP_JS_LOCATION' ); | |
| 61 | + delete_option( 'EBS_BOOTSTRAP_JS_CDN_PATH' ); | |
| 62 | + delete_option( 'EBS_BOOTSTRAP_CSS_LOCATION'); | |
| 63 | + delete_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION' ); | |
| 64 | + delete_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH' ); | |
| 210 | 65 | } |
| 66 | +} | |
| 211 | 67 | |
| 212 | - /* | |
| 213 | - * Define global JS variable for admin panel | |
| 214 | - */ | |
| 215 | - add_action('admin_head', 'osc_ebs_ajax_ul'); | |
| 216 | - function osc_ebs_ajax_ul(){ | |
| 217 | - $ebsp_editor_opt=get_option('EBS_EDITOR_OPT','icon'); | |
| 218 | - | |
| 219 | - ?> | |
| 220 | - <script type="text/javascript"> | |
| 221 | - var ebs_ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; | |
| 222 | - var ebs_url='<?php echo EBS_PLUGIN_URL;?>'; | |
| 223 | - var ebs_editor_opt='<?php echo $ebsp_editor_opt; ?>' | |
| 224 | - var ebs_dropdown_obj='<?php echo json_encode(ebs_shortcodes()); ?>'; | |
| 225 | - var ebs_dropdown_grp='<?php echo json_encode(ebs_groups()); ?>'; | |
| 226 | - | |
| 227 | - </script> | |
| 228 | - <?php | |
| 68 | +function osc_ebs_add_admin_menu() { | |
| 69 | + $isSet=apply_filters('ebs_custom_option',false); | |
| 70 | + if (!$isSet) { | |
| 71 | + add_menu_page('EBS Settings', ' EBS Settings', 'manage_options', 'ebs/ebs-settings.php', 'osc_ebs_setting_page', plugins_url('/images/icon.png', __FILE__)); | |
| 229 | 72 | } |
| 73 | +} | |
| 230 | 74 | |
| 231 | - /* | |
| 232 | - * Add css and scripts to admin panel | |
| 233 | - */ | |
| 234 | - function osc_add_admin_ebs_scripts() { | |
| 235 | - global $pagenow; | |
| 236 | - $fa_icon=get_option('EBS_INCLUDE_FA',1); | |
| 237 | - $use_ebs_session_close=get_option('EBS_SESSION_CLOSE',0); | |
| 238 | - $screen = get_current_screen(); | |
| 239 | - if ($screen->id == 'toplevel_page_ebs/ebs-settings') { | |
| 240 | - wp_enqueue_style('ebs-setting', plugins_url('/styles/ebs-setting.min.css', __FILE__)); | |
| 241 | - } | |
| 242 | - wp_enqueue_script('ebs-main', plugins_url('/js/ebs_main.js', __FILE__)); | |
| 243 | - $shortcode_prefix=get_option('EBS_SHORTCODE_PREFIX',''); | |
| 244 | - wp_localize_script( 'ebs-main', 'ebs', array( | |
| 245 | - 'font_awe'=>$fa_icon, | |
| 246 | - 'ebs_prefix'=>$shortcode_prefix | |
| 247 | - )); | |
| 75 | +function osc_ebs_setting_page() { | |
| 76 | + if (isset($_POST['ebs_submit'])) { | |
| 77 | + update_option( 'EBS_BOOTSTRAP_JS_LOCATION', $_POST['b_js'] ); | |
| 78 | + update_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', $_POST['cdn_path'] ); | |
| 79 | + update_option( 'EBS_BOOTSTRAP_CSS_LOCATION', $_POST['b_css'] ); | |
| 80 | + update_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', $_POST['b_js'] ); | |
| 81 | + update_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', $_POST['cdn_path'] ); | |
| 248 | 82 | |
| 249 | - } | |
| 250 | 83 | |
| 251 | - /* | |
| 252 | - * Add additional css to tinymce editor | |
| 253 | - */ | |
| 254 | - add_action('admin_print_styles','ebsp_tinymce_button_css'); | |
| 255 | - function ebsp_tinymce_button_css() { | |
| 84 | + $js = $_POST['b_js']; | |
| 85 | + $cdn = $_POST['cdn_path']; | |
| 86 | + $css = $_POST['b_css']; | |
| 87 | + $respond = $_POST['respond_js']; | |
| 88 | + $respondcdn = $_POST['respond_cdn_path']; | |
| 256 | 89 | |
| 257 | - wp_register_style('ebsp_tinymce_button_css', plugins_url('/styles/editor.css', __FILE__), array()); | |
| 90 | + } | |
| 91 | + else { | |
| 92 | + $js = get_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 93 | + $cdn = get_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', 'http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js' ); | |
| 94 | + $css = get_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 95 | + $respond = get_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', 2 ); | |
| 96 | + $respondcdn = get_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', 'http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.min.js' ); | |
| 97 | + } | |
| 98 | + include 'ebs_settings.php'; | |
| 99 | +} | |
| 258 | 100 | |
| 259 | - wp_enqueue_style('ebsp_tinymce_button_css'); | |
| 260 | - | |
| 261 | - | |
| 262 | - wp_enqueue_style('dashicons'); | |
| 263 | - | |
| 101 | +/* / add_submenu_page('optine | |
| 102 | +function osc_add_admin_ebs_scripts() { | |
| 103 | + global $pagenow; | |
| 104 | + $screen = get_current_screen(); | |
| 105 | + if ($screen->id == 'toplevel_page_ebs/ebs-settings') { | |
| 106 | + wp_enqueue_style('ebs-setting', plugins_url('/styles/ebs-setting.min.css', __FILE__)); | |
| 264 | 107 | } |
| 265 | -/* | |
| 266 | - * Add css to tinymce editor | |
| 267 | - */ | |
| 268 | - function osc_editor_enable_mce($plugin_array){ | |
| 269 | - $fa_icon=get_option('EBS_INCLUDE_FA',1); | |
| 270 | - $use_ebs_session_close=get_option('EBS_SESSION_CLOSE',0); | |
| 108 | + if ('post-new.php' == $pagenow || 'post.php' == $pagenow) { | |
| 271 | 109 | wp_enqueue_script('jquery'); |
| 272 | 110 | wp_enqueue_style('thickbox'); |
| 273 | 111 | wp_enqueue_script('media-upload'); |
| 274 | 112 | wp_enqueue_script('thickbox'); |
| 275 | - wp_enqueue_style('wp-color-picker'); | |
| 276 | - wp_enqueue_script('wp-color-picker'); | |
| 277 | - wp_enqueue_script('jquery-ui-slider'); | |
| 278 | -// wp_enqueue_script('jquery-ui-dialog'); | |
| 279 | -// wp_enqueue_style ( 'wp-jquery-ui-dialog'); | |
| 280 | - wp_enqueue_style('ebs-magnific-popup', plugins_url('/styles/magnific-popup.css', __FILE__)); wp_enqueue_script('ebs-magnific-popup', plugins_url('/js/magnific-popup.js', __FILE__)); | |
| 281 | - wp_enqueue_style('EBS_jquery-ui-slider-css', plugins_url('/styles/slider.css', __FILE__)); | |
| 113 | + wp_enqueue_script('jquery.fancybox', plugins_url('/js/jquery.fancybox.js', __FILE__)); | |
| 114 | + wp_enqueue_style('fancyboxcss', plugins_url('/styles/jquery.fancybox.css', __FILE__)); | |
| 282 | 115 | if (!apply_filters('ebs_bootstrap_icon_css_url',false)) { |
| 283 | 116 | wp_enqueue_style('bootstrap-icon', plugins_url('/styles/bootstrap-icon.min.css', __FILE__)); |
| 284 | 117 | } else{ |
| 285 | 118 | wp_enqueue_style('bootstrap-icon', apply_filters('ebs_bootstrap_icon_css_url',false)); |
| 286 | 119 | } |
| 287 | - | |
| 288 | 120 | if (!apply_filters('ebs_custom_bootstrap_admin_css',false)) { |
| 289 | - wp_enqueue_style('ebs_bootstrap_admin', plugins_url('/styles/bootstrap_admin.min.css', __FILE__)); | |
| 290 | - } if($fa_icon==1){ | |
| 291 | - wp_enqueue_style('bootstrap-fa-icon', plugins_url('/styles/font-awesome.min.css', __FILE__)); | |
| 121 | + wp_enqueue_style('bootstrap_admin', plugins_url('/styles/bootstrap_admin.min.css', __FILE__)); | |
| 292 | 122 | } |
| 293 | - return $plugin_array; | |
| 294 | 123 | } |
| 124 | +}*/ | |
| 295 | 125 | |
| 296 | - /* | |
| 297 | - * Add dynamic css to ebs frontend | |
| 298 | - */ | |
| 299 | - function osc_add_dynamic_css(){ | |
| 300 | - ebs_session_start(); | |
| 301 | - $_SESSION['ebs_dynamic_css'] = get_option('EBS_CUSTOM_CSS',''); | |
| 302 | - ebs_session_end(); | |
| 303 | - wp_enqueue_style('ebs_dynamic_css', plugins_url('/styles/ebs_dynamic_css.php', __FILE__)); | |
| 126 | +// add_submenu_page('optine | |
| 127 | +function osc_add_admin_ebs_scripts() { | |
| 128 | + global $pagenow; | |
| 129 | + $screen = get_current_screen(); | |
| 130 | + if ($screen->id == 'toplevel_page_ebs/ebs-settings') { | |
| 131 | + wp_enqueue_style('ebs-setting', plugins_url('/styles/ebs-setting.min.css', __FILE__)); | |
| 132 | + } | |
| 133 | +} | |
| 304 | 134 | |
| 135 | +function osc_editor_enable_mce(){ | |
| 136 | + wp_enqueue_script('jquery'); | |
| 137 | + wp_enqueue_style('thickbox'); | |
| 138 | + wp_enqueue_script('media-upload'); | |
| 139 | + wp_enqueue_script('thickbox'); | |
| 140 | + wp_enqueue_script('jquery.fancybox', plugins_url('/js/jquery.fancybox.js', __FILE__)); | |
| 141 | + wp_enqueue_style('fancyboxcss', plugins_url('/styles/jquery.fancybox.css', __FILE__)); | |
| 142 | + if (!apply_filters('ebs_bootstrap_icon_css_url',false)) { | |
| 143 | + wp_enqueue_style('bootstrap-icon', plugins_url('/styles/bootstrap-icon.min.css', __FILE__)); | |
| 144 | + } else{ | |
| 145 | + wp_enqueue_style('bootstrap-icon', apply_filters('ebs_bootstrap_icon_css_url',false)); | |
| 305 | 146 | } |
| 147 | + if (!apply_filters('ebs_custom_bootstrap_admin_css',false)) { | |
| 148 | + wp_enqueue_style('bootstrap_admin', plugins_url('/styles/bootstrap_admin.min.css', __FILE__)); | |
| 149 | + } | |
| 306 | 150 | |
| 307 | - /* | |
| 308 | - * Add bootstrap css and js to frontend if current theme is not an oscitas theme | |
| 309 | - */ | |
| 310 | - function osc_add_frontend_ebs_scripts() { | |
| 311 | - wp_enqueue_script('jquery'); | |
| 312 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 313 | - if (!$isSet) { | |
| 314 | - $js = get_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 315 | - $respond = get_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', 2 ); | |
| 316 | - $cdn = get_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', EBS_JS_CDN ); | |
| 317 | - $respondcdn = get_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', EBS_RESPOND_CDN ); | |
| 318 | - $css = get_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 319 | - $fa_icon=get_option('EBS_INCLUDE_FA',1); | |
| 320 | - $use_ebs_session_close=get_option('EBS_SESSION_CLOSE',0); | |
| 151 | +} | |
| 152 | +add_filter('mce_external_plugins', 'osc_editor_enable_mce'); | |
| 153 | + | |
| 154 | +function osc_add_frontend_ebs_scripts() { | |
| 155 | + wp_enqueue_script('jquery'); | |
| 156 | + $isSet=apply_filters('ebs_custom_option',false); | |
| 157 | + if (!$isSet) { | |
| 158 | + $js = get_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 159 | + $respond = get_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', 2 ); | |
| 160 | + $cdn = get_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', 'http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js' ); | |
| 161 | + $respondcdn = get_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', 'http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js' ); | |
| 162 | + $css = get_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 163 | + | |
| 321 | 164 | // http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.min.js |
| 322 | 165 | |
| 323 | - if ($js == 1) { | |
| 324 | - if (!apply_filters('ebs_bootstrap_js_url',false)) { | |
| 325 | - wp_enqueue_script('bootstrap', plugins_url('/js/bootstrap.min.js', __FILE__)); | |
| 326 | - } else{ | |
| 327 | - wp_enqueue_script('bootstrap', apply_filters('ebs_bootstrap_js_url',false)); | |
| 328 | - } | |
| 329 | - } elseif ($js == 3) { | |
| 330 | - if (!apply_filters('ebs_bootstrap_js_cdn',false)) { | |
| 331 | - wp_enqueue_script('bootstrap', $cdn); | |
| 332 | - } else{ | |
| 333 | - wp_enqueue_script('bootstrap', apply_filters('ebs_bootstrap_js_cdn',false)); | |
| 334 | - } | |
| 335 | - } | |
| 336 | - if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])){ | |
| 337 | - if ($respond == 1) { | |
| 338 | - if (!apply_filters('ebs_bootstrap_respond_url',false)) { | |
| 339 | - wp_enqueue_script('bootstrap_respond', plugins_url('/js/respond.min.js', __FILE__)); | |
| 340 | - } else{ | |
| 341 | - wp_enqueue_script('bootstrap_respond', apply_filters('ebs_bootstrap_respond_url',false)); | |
| 342 | - } | |
| 343 | - } elseif ($respond == 3) { | |
| 344 | - if (!apply_filters('ebs_bootstrap_respond_cdn',false)) { | |
| 345 | - wp_enqueue_script('bootstrap_respond', $respondcdn); | |
| 346 | - } else{ | |
| 347 | - wp_enqueue_script('bootstrap_respond', apply_filters('ebs_bootstrap_respond_cdn',false)); | |
| 348 | - } | |
| 349 | - } | |
| 350 | - } | |
| 351 | - if ($css == 1) { | |
| 352 | - if (!apply_filters('ebs_bootstrap_css_url',false)) { | |
| 353 | - wp_enqueue_style('bootstrap', plugins_url('/styles/bootstrap.min.css', __FILE__)); | |
| 354 | - } else { | |
| 355 | - wp_enqueue_style('bootstrap', apply_filters('ebs_bootstrap_css_url',false)); | |
| 356 | - } | |
| 357 | - } | |
| 358 | - elseif($css==3){ | |
| 359 | - if (!apply_filters('ebs_no_bootstrap_theme_css_url',false)) { | |
| 360 | - wp_enqueue_style('bootstrap', plugins_url('/styles/bootstrap-oscitas.css', __FILE__)); | |
| 361 | - } else { | |
| 362 | - wp_enqueue_style('bootstrap', apply_filters('ebs_no_bootstrap_theme_css_url',false)); | |
| 363 | - } | |
| 364 | 166 | |
| 167 | + if ($js == 1) { | |
| 168 | + if (!apply_filters('ebs_bootstrap_js_url',false)) { | |
| 169 | + wp_enqueue_script('bootstrap', plugins_url('/js/bootstrap.min.js', __FILE__)); | |
| 170 | + } else{ | |
| 171 | + wp_enqueue_script('bootstrap', apply_filters('ebs_bootstrap_js_url',false)); | |
| 172 | + } | |
| 173 | + } elseif ($js == 3) { | |
| 174 | + if (!apply_filters('ebs_bootstrap_js_cdn',false)) { | |
| 175 | + wp_enqueue_script('bootstrap', $cdn); | |
| 176 | + } else{ | |
| 177 | + wp_enqueue_script('bootstrap', apply_filters('ebs_bootstrap_js_cdn',false)); | |
| 178 | + } | |
| 179 | + } | |
| 180 | + if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])){ | |
| 181 | + if ($respond == 1) { | |
| 182 | + if (!apply_filters('ebs_bootstrap_respond_url',false)) { | |
| 183 | + wp_enqueue_script('bootstrap_respond', plugins_url('/js/respond.min.js', __FILE__)); | |
| 184 | + } else{ | |
| 185 | + wp_enqueue_script('bootstrap_respond', apply_filters('ebs_bootstrap_respond_url',false)); | |
| 186 | + } | |
| 187 | + } elseif ($respond == 3) { | |
| 188 | + if (!apply_filters('ebs_bootstrap_respond_cdn',false)) { | |
| 189 | + wp_enqueue_script('bootstrap_respond', $respondcdn); | |
| 190 | + } else{ | |
| 191 | + wp_enqueue_script('bootstrap_respond', apply_filters('ebs_bootstrap_respond_cdn',false)); | |
| 192 | + } | |
| 193 | + } | |
| 194 | + } | |
| 195 | + if ($css == 1) { | |
| 196 | + if (!apply_filters('ebs_bootstrap_css_url',false)) { | |
| 197 | + wp_enqueue_style('bootstrap', plugins_url('/styles/bootstrap.min.css', __FILE__)); | |
| 198 | + } else { | |
| 199 | + wp_enqueue_style('bootstrap', apply_filters('ebs_bootstrap_css_url',false)); | |
| 365 | 200 | } |
| 366 | - else { | |
| 367 | - if (!apply_filters('ebs_bootstrap_icon_css_url',false)) { | |
| 368 | - //wp_enqueue_style('bootstrap-icon', plugins_url('/styles/bootstrap-icon.min.css', __FILE__)); | |
| 369 | - } else{ | |
| 370 | - wp_enqueue_style('bootstrap-icon', apply_filters('ebs_bootstrap_icon_css_url',false)); | |
| 371 | - } | |
| 201 | + } else { | |
| 202 | + if (!apply_filters('ebs_bootstrap_icon_css_url',false)) { | |
| 203 | + //wp_enqueue_style('bootstrap-icon', plugins_url('/styles/bootstrap-icon.min.css', __FILE__)); | |
| 204 | + } else{ | |
| 205 | + wp_enqueue_style('bootstrap-icon', apply_filters('ebs_bootstrap_icon_css_url',false)); | |
| 372 | 206 | } |
| 373 | - if($fa_icon==1){ | |
| 374 | - if(!apply_filters('ebs_bootstrap_fa_icon_include_from_theme_or_plugin',false)){ | |
| 375 | - if (!apply_filters('ebs_bootstrap_fa_icon_frontend_css_url',false)) { | |
| 376 | - wp_enqueue_style('bootstrap-fa-icon', plugins_url('/styles/font-awesome.min.css', __FILE__)); | |
| 377 | - } else{ | |
| 378 | - wp_enqueue_style('bootstrap-fa-icon', apply_filters('ebs_bootstrap_fa_icon_frontend_css_url',false)); | |
| 379 | - } | |
| 380 | - } | |
| 381 | - } | |
| 382 | 207 | } |
| 383 | 208 | } |
| 209 | +} | |
| 384 | 210 | |
| 385 | 211 | // Shortcodes |
| 386 | - | |
| 387 | - add_action('init','ebs_session_start'); | |
| 388 | - function ebs_session_start() { | |
| 389 | - global $_EBS_SESSION_STARTED; | |
| 390 | - if(!session_id()){ | |
| 391 | - @session_start(); | |
| 392 | - $_EBS_SESSION_STARTED = true; | |
| 393 | - } | |
| 394 | - } | |
| 395 | - | |
| 396 | - function ebs_session_end() { | |
| 397 | - global $_EBS_SESSION_STARTED; | |
| 398 | - if ($_EBS_SESSION_STARTED && get_option('EBS_SESSION_CLOSE',0)) { | |
| 399 | - @session_write_close(); | |
| 400 | - $_EBS_SESSION_STARTED = false; | |
| 401 | - } | |
| 402 | - } | |
| 403 | - | |
| 404 | - include('shortcode/functions.php'); | |
| 405 | - include('lib/widget.php'); | |
| 406 | -endif; | |
| 212 | +include('shortcode/functions.php'); | |