| @@ -2,185 +2,117 @@ | ||
| 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: 3.7.0 | |
| 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 | 11 | */ |
| 12 | -function osc_ebs_plugin_exists( $prevent ) { | |
| 13 | - return 'ebs'; | |
| 14 | -} | |
| 15 | -$checkplugin=apply_filters('osc_ebs_pro_plugin_exists',false); | |
| 16 | -if(isset($checkplugin) && $checkplugin=='ebsp'): | |
| 17 | - add_action('admin_notices', 'ebs_showAdminMessages'); | |
| 18 | 12 | |
| 19 | - function ebs_showMessage($message, $errormsg = false) | |
| 20 | - { | |
| 21 | - if ($errormsg) { | |
| 22 | - echo '<div id="message" class="error ebs_notification">'; | |
| 23 | - } | |
| 24 | - else { | |
| 25 | - echo '<div id="message" class="update-nag ebs_notification">'; | |
| 26 | - } | |
| 27 | - echo '<p><strong>' . $message . '</strong></p></div>'; | |
| 28 | - } | |
| 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'); | |
| 17 | + if(!apply_filters('plugin_oscitas_theme_check',false)){ | |
| 29 | 18 | |
| 30 | - function ebs_showAdminMessages() | |
| 31 | - { | |
| 32 | - ebs_showMessage("Easy Bootstrap Shortcode Pro activated, deactivate Easy Bootstrap Shortcode free version", false); | |
| 19 | + add_action('wp_enqueue_scripts', 'osc_add_frontend_ebs_scripts'); | |
| 20 | + add_action('admin_menu', 'osc_ebs_add_admin_menu'); | |
| 33 | 21 | } |
| 34 | -else: | |
| 35 | - add_filter( 'osc_ebs_plugin_exists', 'osc_ebs_plugin_exists' ); | |
| 36 | - define('EBS_PLUGIN_URL',plugins_url('/',__FILE__)); | |
| 37 | - define('EBS_JS_CDN','http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js'); | |
| 38 | - define('EBS_RESPOND_CDN','http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.min.js'); | |
| 39 | - add_action('admin_init','check_ebsp_status'); | |
| 40 | - function check_ebsp_status(){ | |
| 41 | - $file = basename( __FILE__ ); | |
| 42 | - $folder = basename( dirname( __FILE__ ) ); | |
| 43 | - $hook = "after_plugin_row_{$folder}/{$file}"; | |
| 44 | - add_action( $hook, 'ebsp_register_licence_key'); | |
| 45 | - } | |
| 46 | - function ebsp_register_licence_key( $plugin_name ) | |
| 22 | +} | |
| 47 | 23 | |
| 48 | - { | |
| 49 | - $ebsprefix='ebsp'; | |
| 50 | - $plugin_name='easy-bootstrap-shortcode-pro/osc_bootstrap_shortcode.php '; | |
| 51 | - 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',$ebsprefix) . '</div></td>'; | |
| 52 | - } | |
| 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'); | |
| 53 | 29 | |
| 54 | - add_action('admin_enqueue_scripts', 'osc_add_admin_ebs_scripts'); | |
| 55 | - add_action('admin_menu', 'osc_ebs_add_admin_menu'); | |
| 56 | - add_action('wp_enqueue_scripts', 'osc_add_dynamic_css',100); | |
| 57 | - add_filter('mce_external_plugins', 'osc_editor_enable_mce'); | |
| 58 | - if(!apply_filters('plugin_oscitas_theme_check',false)){ | |
| 59 | - add_action('wp_enqueue_scripts', 'osc_add_frontend_ebs_scripts',-100); | |
| 60 | - } | |
| 30 | +function osc_ebs_activate_plugin() { | |
| 31 | + $isSet=apply_filters('ebs_custom_option',false); | |
| 32 | + if (!$isSet) { | |
| 61 | 33 | |
| 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); | |
| 62 | 40 | |
| 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 ); | |
| 43 | + } | |
| 63 | 44 | |
| 64 | - register_activation_hook(__FILE__, 'osc_ebs_activate_plugin'); | |
| 65 | - register_deactivation_hook(__FILE__, 'osc_ebs_deactivate_plugin'); | |
| 66 | - | |
| 67 | - | |
| 68 | - function osc_ebs_activate_plugin() { | |
| 69 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 70 | - if (!$isSet) { | |
| 71 | - | |
| 72 | - // 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 | |
| 73 | - update_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 74 | - update_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', EBS_JS_CDN ); | |
| 75 | - update_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', EBS_RESPOND_CDN ); | |
| 76 | - // 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 | |
| 77 | - update_option('EBS_BOOTSTRAP_RESPOND_LOCATION',2); | |
| 78 | - | |
| 79 | - // EBS_BOOTSTRAP_CSS_LOCATION '1' - for plugin file, '2' - don't user EBS files but use from other plugin or theme | |
| 80 | - update_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 81 | - update_option( 'EBS_EDITOR_OPT','icon'); | |
| 82 | - update_option( 'EBS_EDITOR_OPT','icon'); | |
| 83 | - if(get_option('EBS_CUSTOM_CSS')==''){ | |
| 84 | - update_option( 'EBS_CUSTOM_CSS',''); | |
| 85 | - } | |
| 86 | - } | |
| 87 | - | |
| 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 ); | |
| 88 | 51 | } |
| 89 | - function osc_ebs_settings_link( $links ) { | |
| 90 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 91 | - if (!$isSet) { | |
| 92 | - $settings_link = '<a href="admin.php?page=ebs/ebs-settings.php">Settings</a>'; | |
| 93 | - array_push( $links, $settings_link ); | |
| 94 | - } | |
| 95 | - return $links; | |
| 96 | - } | |
| 52 | + return $links; | |
| 53 | +} | |
| 97 | 54 | |
| 98 | - add_filter( "plugin_action_links_".plugin_basename( __FILE__ ), 'osc_ebs_settings_link' ); | |
| 55 | +add_filter( "plugin_action_links_".plugin_basename( __FILE__ ), 'osc_ebs_settings_link' ); | |
| 99 | 56 | |
| 100 | - function osc_ebs_deactivate_plugin() { | |
| 101 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 102 | - if (!$isSet) { | |
| 103 | - delete_option( 'EBS_BOOTSTRAP_JS_LOCATION' ); | |
| 104 | - delete_option( 'EBS_BOOTSTRAP_JS_CDN_PATH' ); | |
| 105 | - delete_option( 'EBS_BOOTSTRAP_CSS_LOCATION'); | |
| 106 | - delete_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION' ); | |
| 107 | - delete_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH' ); | |
| 108 | - delete_option('EBS_EDITOR_OPT'); | |
| 109 | - } | |
| 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' ); | |
| 110 | 65 | } |
| 66 | +} | |
| 111 | 67 | |
| 112 | - function osc_ebs_add_admin_menu() { | |
| 113 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 114 | - if (!$isSet) { | |
| 115 | - add_menu_page('EBS Settings', ' EBS Settings', 'manage_options', 'ebs/ebs-settings.php', 'osc_ebs_setting_page', plugins_url('/images/icon.png', __FILE__)); | |
| 116 | - } | |
| 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__)); | |
| 117 | 72 | } |
| 73 | +} | |
| 118 | 74 | |
| 119 | - function osc_ebs_setting_page() { | |
| 120 | - if (isset($_POST['ebs_submit'])) { | |
| 121 | - update_option( 'EBS_BOOTSTRAP_JS_LOCATION', isset($_POST['b_js'])?$_POST['b_js']:1 ); | |
| 122 | - update_option( 'EBS_BOOTSTRAP_JS_CDN_PATH',isset($_POST['cdn_path'])? $_POST['cdn_path']:EBS_JS_CDN ); | |
| 123 | - update_option( 'EBS_BOOTSTRAP_CSS_LOCATION', isset($_POST['b_css'])?$_POST['b_css']:1 ); | |
| 124 | - update_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', isset($_POST['respond_js'])?$_POST['respond_js']:2 ); | |
| 125 | - update_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', isset($_POST['respond_cdn_path'])?$_POST['respond_cdn_path']:EBS_RESPOND_CDN ); | |
| 126 | - update_option( 'EBS_EDITOR_OPT', isset($_POST['ebsp_editor_opt'])?$_POST['ebsp_editor_opt']:'icon' ); | |
| 127 | - update_option( 'EBS_CUSTOM_CSS', isset($_POST['ebs_custom_css'])?$_POST['ebs_custom_css']:'' ); | |
| 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'] ); | |
| 128 | 82 | |
| 129 | - $_SESSION['ebs_dynamic_css'] =$_POST['ebs_custom_css']; | |
| 130 | - $js =isset($_POST['b_js'])?$_POST['b_js']:1; | |
| 131 | - $cdn = isset($_POST['cdn_path'])? $_POST['cdn_path']:EBS_JS_CDN; | |
| 132 | - $css = isset($_POST['b_css'])?$_POST['b_css']:1; | |
| 133 | - $respond = isset($_POST['respond_js'])?$_POST['respond_js']:2; | |
| 134 | - $respondcdn = isset($_POST['respond_cdn_path'])?$_POST['respond_cdn_path']:EBS_RESPOND_CDN; | |
| 135 | - $ebsp_editor_opt=isset($_POST['ebsp_editor_opt'])?$_POST['ebsp_editor_opt']:'icon' ; | |
| 136 | - $ebs_custom_css=isset($_POST['ebs_custom_css'])?$_POST['ebs_custom_css']:'' ; | |
| 137 | 83 | |
| 138 | - } else { | |
| 139 | - $js = get_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 140 | - $cdn = get_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', EBS_JS_CDN ); | |
| 141 | - $css = get_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 142 | - $respond = get_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', 2 ); | |
| 143 | - $respondcdn = get_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', EBS_RESPOND_CDN ); | |
| 144 | - $ebsp_editor_opt=get_option('EBS_EDITOR_OPT','icon'); | |
| 145 | - $ebs_custom_css=get_option('EBS_CUSTOM_CSS',''); | |
| 146 | - } | |
| 147 | - include 'ebs_settings.php'; | |
| 148 | - } | |
| 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']; | |
| 149 | 89 | |
| 150 | - add_action('admin_head', 'osc_ebs_ajax_ul'); | |
| 151 | - function osc_ebs_ajax_ul(){ | |
| 152 | - $ebsp_editor_opt=get_option('EBS_EDITOR_OPT','icon'); | |
| 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 | +} | |
| 153 | 100 | |
| 154 | - ?> | |
| 155 | - <script type="text/javascript"> | |
| 156 | - var ebs_ajaxurl = '<?php echo admin_url('admin-ajax.php'); ?>'; | |
| 157 | - var ebs_url='<?php echo EBS_PLUGIN_URL;?>'; | |
| 158 | - var ebs_editor_opt='<?php echo $ebsp_editor_opt; ?>' | |
| 159 | - | |
| 160 | - </script> | |
| 161 | - <?php | |
| 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__)); | |
| 162 | 107 | } |
| 163 | -// add_submenu_page('optine | |
| 164 | - function osc_add_admin_ebs_scripts() { | |
| 165 | - global $pagenow; | |
| 166 | - $screen = get_current_screen(); | |
| 167 | - if ($screen->id == 'toplevel_page_ebs/ebs-settings') { | |
| 168 | - wp_enqueue_style('ebs-setting', plugins_url('/styles/ebs-setting.min.css', __FILE__)); | |
| 169 | - } | |
| 170 | - wp_enqueue_script('ebs-main', plugins_url('/js/ebs_main.js', __FILE__)); | |
| 171 | - | |
| 172 | - } | |
| 173 | - | |
| 174 | - function osc_editor_enable_mce(){ | |
| 108 | + if ('post-new.php' == $pagenow || 'post.php' == $pagenow) { | |
| 175 | 109 | wp_enqueue_script('jquery'); |
| 176 | 110 | wp_enqueue_style('thickbox'); |
| 177 | 111 | wp_enqueue_script('media-upload'); |
| 178 | 112 | wp_enqueue_script('thickbox'); |
| 179 | - wp_enqueue_style('wp-color-picker'); | |
| 180 | - wp_enqueue_script('wp-color-picker'); | |
| 181 | - wp_enqueue_script('jquery-ui-slider'); | |
| 182 | - 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__)); | |
| 183 | 115 | if (!apply_filters('ebs_bootstrap_icon_css_url',false)) { |
| 184 | 116 | wp_enqueue_style('bootstrap-icon', plugins_url('/styles/bootstrap-icon.min.css', __FILE__)); |
| 185 | 117 | } else{ |
| 186 | 118 | wp_enqueue_style('bootstrap-icon', apply_filters('ebs_bootstrap_icon_css_url',false)); |
| @@ -185,92 +117,96 @@ | ||
| 185 | 117 | } else{ |
| 186 | 118 | wp_enqueue_style('bootstrap-icon', apply_filters('ebs_bootstrap_icon_css_url',false)); |
| 187 | 119 | } |
| 188 | 120 | if (!apply_filters('ebs_custom_bootstrap_admin_css',false)) { |
| 189 | - wp_enqueue_style('ebs_bootstrap_admin', plugins_url('/styles/bootstrap_admin.min.css', __FILE__)); | |
| 121 | + wp_enqueue_style('bootstrap_admin', plugins_url('/styles/bootstrap_admin.min.css', __FILE__)); | |
| 190 | 122 | } |
| 123 | + } | |
| 124 | +}*/ | |
| 191 | 125 | |
| 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__)); | |
| 192 | 132 | } |
| 133 | +} | |
| 193 | 134 | |
| 194 | - function osc_add_dynamic_css(){ | |
| 195 | - $_SESSION['ebs_dynamic_css'] = get_option('EBS_CUSTOM_CSS',''); | |
| 196 | - wp_enqueue_style('ebs_dynamic_css', plugins_url('/styles/ebs_dynamic_css.php', __FILE__)); | |
| 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)); | |
| 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 | + } | |
| 197 | 150 | |
| 198 | - } | |
| 199 | - function osc_add_frontend_ebs_scripts() { | |
| 200 | - wp_enqueue_script('jquery'); | |
| 201 | - $isSet=apply_filters('ebs_custom_option',false); | |
| 202 | - if (!$isSet) { | |
| 203 | - $js = get_option( 'EBS_BOOTSTRAP_JS_LOCATION', 1 ); | |
| 204 | - $respond = get_option( 'EBS_BOOTSTRAP_RESPOND_LOCATION', 2 ); | |
| 205 | - $cdn = get_option( 'EBS_BOOTSTRAP_JS_CDN_PATH', EBS_JS_CDN ); | |
| 206 | - $respondcdn = get_option( 'EBS_BOOTSTRAP_RESPOND_CDN_PATH', EBS_RESPOND_CDN ); | |
| 207 | - $css = get_option( 'EBS_BOOTSTRAP_CSS_LOCATION', 1 ); | |
| 151 | +} | |
| 152 | +add_filter('mce_external_plugins', 'osc_editor_enable_mce'); | |
| 208 | 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 | + | |
| 209 | 164 | // http://cdnjs.cloudflare.com/ajax/libs/respond.js/1.3.0/respond.min.js |
| 210 | 165 | |
| 211 | 166 | |
| 212 | - if ($js == 1) { | |
| 213 | - if (!apply_filters('ebs_bootstrap_js_url',false)) { | |
| 214 | - wp_enqueue_script('bootstrap', plugins_url('/js/bootstrap.min.js', __FILE__)); | |
| 215 | - } else{ | |
| 216 | - wp_enqueue_script('bootstrap', apply_filters('ebs_bootstrap_js_url',false)); | |
| 217 | - } | |
| 218 | - } elseif ($js == 3) { | |
| 219 | - if (!apply_filters('ebs_bootstrap_js_cdn',false)) { | |
| 220 | - wp_enqueue_script('bootstrap', $cdn); | |
| 221 | - } else{ | |
| 222 | - wp_enqueue_script('bootstrap', apply_filters('ebs_bootstrap_js_cdn',false)); | |
| 223 | - } | |
| 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)); | |
| 224 | 200 | } |
| 225 | - if(preg_match('/(?i)msie [1-8]/',$_SERVER['HTTP_USER_AGENT'])){ | |
| 226 | - if ($respond == 1) { | |
| 227 | - if (!apply_filters('ebs_bootstrap_respond_url',false)) { | |
| 228 | - wp_enqueue_script('bootstrap_respond', plugins_url('/js/respond.min.js', __FILE__)); | |
| 229 | - } else{ | |
| 230 | - wp_enqueue_script('bootstrap_respond', apply_filters('ebs_bootstrap_respond_url',false)); | |
| 231 | - } | |
| 232 | - } elseif ($respond == 3) { | |
| 233 | - if (!apply_filters('ebs_bootstrap_respond_cdn',false)) { | |
| 234 | - wp_enqueue_script('bootstrap_respond', $respondcdn); | |
| 235 | - } else{ | |
| 236 | - wp_enqueue_script('bootstrap_respond', apply_filters('ebs_bootstrap_respond_cdn',false)); | |
| 237 | - } | |
| 238 | - } | |
| 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)); | |
| 239 | 206 | } |
| 240 | - if ($css == 1) { | |
| 241 | - if (!apply_filters('ebs_bootstrap_css_url',false)) { | |
| 242 | - wp_enqueue_style('bootstrap', plugins_url('/styles/bootstrap.min.css', __FILE__)); | |
| 243 | - } else { | |
| 244 | - wp_enqueue_style('bootstrap', apply_filters('ebs_bootstrap_css_url',false)); | |
| 245 | - } | |
| 246 | - } | |
| 247 | - elseif($css==3){ | |
| 248 | - if (!apply_filters('ebs_no_bootstrap_theme_css_url',false)) { | |
| 249 | - wp_enqueue_style('bootstrap', plugins_url('/styles/bootstrap-oscitas.css', __FILE__)); | |
| 250 | - } else { | |
| 251 | - wp_enqueue_style('bootstrap', apply_filters('ebs_no_bootstrap_theme_css_url',false)); | |
| 252 | - } | |
| 253 | - | |
| 254 | - } | |
| 255 | - else { | |
| 256 | - if (!apply_filters('ebs_bootstrap_icon_css_url',false)) { | |
| 257 | - //wp_enqueue_style('bootstrap-icon', plugins_url('/styles/bootstrap-icon.min.css', __FILE__)); | |
| 258 | - } else{ | |
| 259 | - wp_enqueue_style('bootstrap-icon', apply_filters('ebs_bootstrap_icon_css_url',false)); | |
| 260 | - } | |
| 261 | - } | |
| 262 | 207 | } |
| 263 | 208 | } |
| 209 | +} | |
| 264 | 210 | |
| 265 | 211 | // Shortcodes |
| 266 | - | |
| 267 | - add_action('init','ebs_session_start'); | |
| 268 | - function ebs_session_start() { | |
| 269 | - if(!session_id()){ | |
| 270 | - @session_start(); | |
| 271 | - } | |
| 272 | - } | |
| 273 | - | |
| 274 | - include('shortcode/functions.php'); | |
| 275 | - include('lib/widget.php'); | |
| 276 | -endif; | |
| 212 | +include('shortcode/functions.php'); | |