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