PluginProbe
Booking Calendar / 10.15.6
Booking Calendar v10.15.6
11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 10.11 10.11.2 All 203 releases
booking / core / wpbc-css.php

wpbc-css.php in Booking Calendar 10.15.6, at core/wpbc-css.php

262 lines 13.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php /**
2 * @version 1.0
3 * @package
4 * @category Core
5 * @author wpdevelop
6 *
7 * @web-site https://wpbookingcalendar.com/
8 * @email info@wpbookingcalendar.com
9 *
10 * @modified 2013.10.16
11 */
12
13 if ( ! defined( 'ABSPATH' ) ) {
14 exit; // Exit if accessed directly.
15 }
16
17 class WPBC_CSS extends WPBC_JS_CSS {
18
19 public function define() {
20
21 $this->setType( 'css' );
22
23 /**
24 * // Exmaples of usage Font Avesome: http://fontawesome.io/icons/
25 *
26 * $this->add( array(
27 * 'handle' => 'font-awesome',
28 * 'src' => WPBC_PLUGIN_URL . 'assets/libs/font-awesome-4.3.0/css/font-awesome.css' ,
29 * 'deps' => false,
30 * 'version' => '4.3.0',
31 * 'where_to_load' => array( 'admin' ),
32 * 'condition' => false
33 * ) );
34 *
35 * // Exmaples of usage Font Avesome 3.2.1 (benefits of this version - support IE7): http://fontawesome.io/3.2.1/examples/
36 * $this->add( array(
37 * 'handle' => 'font-awesome',
38 * 'src' => WPBC_PLUGIN_URL . '/assets/libs/font-awesome/css/font-awesome.css' ,
39 * 'deps' => false,
40 * 'version' => '3.2.1',
41 * 'where_to_load' => array( 'admin' ),
42 * 'condition' => false
43 * ) );
44 * $this->add( array(
45 * 'handle' => 'font-awesome-ie7',
46 * 'src' => WPBC_PLUGIN_URL . '/assets/libs/font-awesome/css/font-awesome-ie7.css' ,
47 * 'deps' => array('font-awesome'),
48 * 'version' => '3.2.1',
49 * 'where_to_load' => array( 'admin' ),
50 * 'condition' => 'IE 7' // CSS condition. Exmaple: <!--[if IE 7]>
51 * ) );
52 */
53 }
54
55
56 public function enqueue( $where_to_load ) {
57
58 wp_enqueue_style( 'wpdevelop-bts', wpbc_plugin_url( '/vendors/_custom/bootstrap-css/css/bootstrap.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.0.1.1.1.
59 wp_enqueue_style( 'wpdevelop-bts-theme', wpbc_plugin_url( '/vendors/_custom/bootstrap-css/css/bootstrap-theme.css' ), array(), WP_BK_VERSION_NUM );
60 wp_enqueue_style( 'wpbc-tippy-popover', wpbc_plugin_url( '/vendors/_custom/tippy.js/themes/wpbc-tippy-popover.css' ), array(), WP_BK_VERSION_NUM );
61 wp_enqueue_style( 'wpbc-tippy-times', wpbc_plugin_url( '/vendors/_custom/tippy.js/themes/wpbc-tippy-times.css' ), array(), WP_BK_VERSION_NUM );
62 wp_enqueue_style( 'wpbc-material-design-icons', wpbc_plugin_url( '/vendors/_custom/material-design-icons/material-design-icons.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.2.1.4.
63 wp_enqueue_style( 'wpbc-ui-both', wpbc_plugin_url( '/css/wpbc_ui_both.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 10.0.0.25.
64
65 if ( 'admin' === $where_to_load ) { // Admin CSS files.
66 wp_enqueue_style( 'wpbc-bootstrap-icons', wpbc_plugin_url( '/vendors/_custom/bootstrap-icons/bootstrap-icons.css' ), array(), WP_BK_VERSION_NUM ); // FixIn: 9.0.1.1.
67 wp_enqueue_style( 'wpbc-all-admin', wpbc_plugin_url( '/_dist/all/_out/wpbc_all_admin.min.css' ), array(), WP_BK_VERSION_NUM ); // Several concataned css files.
68 wp_enqueue_style( 'wpbc-admin-support', wpbc_plugin_url( '/core/any/css/admin-support.css' ), array(), WP_BK_VERSION_NUM);
69 wp_enqueue_style( 'wpbc-admin-menu', wpbc_plugin_url( '/core/any/css/admin-menu.css' ), array(), WP_BK_VERSION_NUM);
70 wp_enqueue_style( 'wpbc-admin-toolbar', wpbc_plugin_url( '/core/any/css/admin-toolbar.css' ), array(), WP_BK_VERSION_NUM);
71 wp_enqueue_style( 'wpbc-settings-page', wpbc_plugin_url( '/core/any/css/settings-page.css' ), array(), WP_BK_VERSION_NUM);
72 wp_enqueue_style( 'wpbc-admin-listing-table', wpbc_plugin_url( '/core/any/css/admin-listing-table.css' ), array(), WP_BK_VERSION_NUM);
73 wp_enqueue_style( 'wpbc-br-table', wpbc_plugin_url( '/core/any/css/admin-br-table.css' ), array(), WP_BK_VERSION_NUM);
74 wp_enqueue_style( 'wpbc-flex-table', wpbc_plugin_url( '/core/any/css/wpbc_flextable.css' ), array(), WP_BK_VERSION_NUM); // Flex: Booking resources Table // FixIn: 9.9.0.7.
75 wp_enqueue_style( 'wpbc-admin-modal-popups', wpbc_plugin_url( '/css/modal.css' ), array(), WP_BK_VERSION_NUM);
76 wp_enqueue_style( 'wpbc-admin-pages', wpbc_plugin_url( '/css/admin.css' ), array(), WP_BK_VERSION_NUM);
77 wp_enqueue_style( 'wpbc-admin-skin', wpbc_plugin_url( '/css/admin-skin.css' ), array( 'wpbc-admin-pages' ), WP_BK_VERSION_NUM ); // FixIn: 8.0.2.4.
78
79 $wpbc_inline_css = '';
80 if ( wpbc_mu__is_simulated_login_as_user() ) {
81 // Mark last item in menu as a button.
82 $wpbc_inline_css .= ' #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) a { font-weight: 600;background-color: #075c00;color: #fff;margin: 10px 10px 0;display: block;text-align: center;border-radius: 3px;transition: all .3s;box-shadow: none; } ';
83 $wpbc_inline_css .= ' #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) { margin-top: 10px;border-top: 1px solid #535454; } ';
84 } else {
85 // Horizontal Lines in Menu. // FixIn: 10.1.3.1.
86 $wpbc_inline_css .= ' #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-child(4) a { border-top: 1px solid #535454;padding-top: 10px;margin-top: 6px; } ';
87 $wpbc_inline_css .= ' #adminmenu #toplevel_page_wpbc .wp-submenu li:nth-last-child(1) a { border-top: 1px solid #535454;padding-top: 10px;margin-top: 6px; } ';
88 }
89 wp_add_inline_style( 'wpbc-admin-pages', $wpbc_inline_css );
90 }
91
92 $server_request_uri = ( ( isset( $_SERVER['REQUEST_URI'] ) ) ? sanitize_text_field( $_SERVER['REQUEST_URI'] ) : '' ); /* phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.MissingUnslash */ /* FixIn: sanitize_unslash */
93 if (
94 ( 'admin' !== $where_to_load ) ||
95 ( wpbc_is_new_booking_page() ) ||
96 ( wpbc_is_setup_wizard_page() ) ||
97 ( wpbc_is_settings_form_page() ) ||
98 ( wpbc_is_settings_color_themes_page() ) ||
99 ( ( wpbc_is_settings_page() ) && ( strpos( $server_request_uri, 'tab=payment' ) !== false ) )
100 ) {
101 wpbc_enqueue_styles__front_end();
102 }
103
104 wpbc_enqueue_styles__calendar();
105
106 do_action( 'wpbc_enqueue_css_files', $where_to_load );
107 }
108
109
110 public function remove_conflicts( $where_to_load ) {
111
112 // FixIn: 8.1.3.12.
113 if (
114 wpbc_is_bookings_page() ||
115 wpbc_is_new_booking_page() ||
116 wpbc_is_setup_wizard_page() ||
117 wpbc_is_settings_form_page() ||
118 wpbc_is_settings_color_themes_page() ||
119 wpbc_is_resources_page() ||
120 wpbc_is_settings_page()
121 ) {
122 if ( function_exists( 'wp_dequeue_style' ) ) {
123 /**
124 // wp_dequeue_style( 'cs-alert' );
125 // wp_dequeue_style( 'cs-framework' );
126 // wp_dequeue_style( 'cs-font-awesome' );
127 // wp_dequeue_style( 'icomoon' );
128 */
129 wp_dequeue_style( 'chosen' );
130 wp_dequeue_style( 'toolset-font-awesome-css' ); // Remove this script sitepress-multilingual-cms/res/css/font-awesome.min.css?ver=3.1.6, which is load by the "sitepress-multilingual-cms".
131 wp_dequeue_style( 'toolset-font-awesome' ); // FixIn: 5.4.5.8.
132 wp_dequeue_style( 'the7-fontello-css' );
133 wp_dequeue_style( 'dt-awsome-fonts-back-css' ); // FixIn: 8.2.1.10 fix conflict with https://the7.io/.
134 wp_dequeue_style( 'dt-awsome-fonts-css' );
135 wp_dequeue_style( 'dt-fontello-css' );
136 wp_dequeue_style( 'cs_icons_data_css_default' ); // FixIn: 8.1.3.12.
137 wp_dequeue_style( 'icons-style' ); // FixIn: 8.2.1.22.
138 wp_dequeue_style( 'fontawesome-style' ); // FixIn: 8.2.1.22.
139 wp_dequeue_style( 'bootstrap-style' ); // FixIn: 8.2.1.22.
140 wp_dequeue_style( 'bootstrap-theme-style' ); // FixIn: 8.2.1.22.
141 }
142 }
143 }
144 }
145
146
147 /**
148 * Integrate CSS files required for front-end side.
149 *
150 * @return void
151 */
152 function wpbc_enqueue_styles__front_end() {
153
154 // Client or Add New Booking page.
155 if ( ( 'On' === get_bk_option( 'booking_timeslot_picker' ) ) || ( wpbc_is_setup_wizard_page() || wpbc_is_builder_booking_form_page() ) ) { // FixIn: 8.7.11.10.
156 wp_enqueue_style( 'wpbc-time_picker', wpbc_plugin_url( '/css/wpbc_time-selector.css' ), array(), WP_BK_VERSION_NUM );
157
158 $time_picker_skin_path = wpbc_get_time_picker_skin_url();
159 if ( ! empty( $time_picker_skin_path ) ) {
160 wp_enqueue_style( 'wpbc-time_picker-skin', $time_picker_skin_path, array( 'wpbc-time_picker' ), WP_BK_VERSION_NUM );
161 }
162 }
163 wp_enqueue_style( 'wpbc-client-pages', wpbc_plugin_url( '/css/client.css' ), array(), WP_BK_VERSION_NUM );
164 wp_enqueue_style( 'wpbc-all-client', wpbc_plugin_url( '/_dist/all/_out/wpbc_all_client.css' ), array( 'wpbc-client-pages' ), WP_BK_VERSION_NUM ); // Several concataned css files.
165
166 }
167
168 function wpbc_enqueue_styles__calendar() {
169
170 wp_enqueue_style( 'wpbc-calendar', wpbc_plugin_url( '/css/calendar.css' ), array(), WP_BK_VERSION_NUM );
171
172 // Calendar Skins.
173 $calendar_skin_path = wpbc_get_calendar_skin_url();
174 if ( ! empty( $calendar_skin_path ) ) {
175 wp_enqueue_style( 'wpbc-calendar-skin', $calendar_skin_path, array(), WP_BK_VERSION_NUM );
176 }
177
178 }
179
180
181
182 /**
183 * Get URL to Calendar Skin ( CSS file )
184 *
185 * @return string - URL to calendar skin
186 */
187 function wpbc_get_calendar_skin_url() {
188
189 // -- Old 'inc' path -> Re-update // FixIn: 8.7.11.11.
190 $check_skin_path = get_bk_option( 'booking_skin' );
191 if ( false !== strpos( $check_skin_path, 'inc/skins/' ) ) {
192 $check_skin_path = str_replace( 'inc/skins/', 'css/skins/', $check_skin_path );
193 update_bk_option( 'booking_skin', $check_skin_path );
194 }
195 // -- Absolute Path - Remove // FixIn: 8.9.4.8.
196 if ( false !== strpos( $check_skin_path, WPBC_PLUGIN_DIR ) ) {
197 $check_skin_path = str_replace( WPBC_PLUGIN_DIR, '', $check_skin_path );
198 update_bk_option( 'booking_skin', $check_skin_path );
199 }
200
201
202 $calendar_skin_path = false;
203 // -----------------------------------------------------------------------------------------------------------------
204 // Check if this skin exist in Usual folder.
205 // -----------------------------------------------------------------------------------------------------------------
206 if ( file_exists( WPBC_PLUGIN_DIR . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_skin') ) ) ) {
207 $calendar_skin_path = WPBC_PLUGIN_URL . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_skin') );
208 }
209
210 // -----------------------------------------------------------------------------------------------------------------
211 // Check if skin exist in the Custom User folder at the http://example.com/wp-content/uploads/wpbc_skins/
212 // -----------------------------------------------------------------------------------------------------------------
213 $upload_dir = wp_upload_dir();
214 $custom_user_skin_folder = $upload_dir['basedir'];
215 $custom_user_skin_url = $upload_dir['baseurl'];
216
217 if ( file_exists( $custom_user_skin_folder . str_replace( array( WPBC_PLUGIN_URL , $custom_user_skin_url ), '', get_bk_option( 'booking_skin') ) ) ) {
218 $calendar_skin_path = $custom_user_skin_url . str_replace( array(WPBC_PLUGIN_URL, $custom_user_skin_url ), '', get_bk_option( 'booking_skin') );
219 }
220
221 // -----------------------------------------------------------------------------------------------------------------
222 // If still no file, then Default
223 // -----------------------------------------------------------------------------------------------------------------
224 if ( empty( $calendar_skin_path ) ) {
225 $calendar_skin_path = WPBC_PLUGIN_URL . '/css/skins/25_5__round_1.css';
226 }
227
228 return $calendar_skin_path;
229 }
230
231
232 /**
233 * Get URL of Time Picker Skin - checked by default of this skin exists.
234 *
235 * @return false|string
236 */
237 function wpbc_get_time_picker_skin_url() {
238
239 // Time_picker Skin.
240 $time_picker_skin_path = false;
241
242 // Just default value, if previously was not saved any options.
243 if ( empty( get_bk_option( 'booking_timeslot_picker_skin' ) ) ) {
244 update_bk_option( 'booking_timeslot_picker_skin', '/css/time_picker_skins/light__24_8.css' ); // FixIn: 10.4.0.1.
245 }
246
247 // Check if this skin exist in the plugin folder.
248 if ( file_exists( WPBC_PLUGIN_DIR . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_timeslot_picker_skin' ) ) ) ) {
249 $time_picker_skin_path = WPBC_PLUGIN_URL . str_replace( WPBC_PLUGIN_URL, '', get_bk_option( 'booking_timeslot_picker_skin' ) );
250 }
251
252 // Check if this skin exist in the Custom User folder at the http://example.com/wp-content/uploads/wpbc_skins/ .
253 $upload_dir = wp_upload_dir();
254 $custom_user_skin_folder = $upload_dir['basedir'];
255 $custom_user_skin_url = $upload_dir['baseurl'];
256 if ( file_exists( $custom_user_skin_folder . str_replace( array( WPBC_PLUGIN_URL, $custom_user_skin_url, ), '', get_bk_option( 'booking_timeslot_picker_skin' ) ) ) ) {
257 $time_picker_skin_path = $custom_user_skin_url . str_replace( array( WPBC_PLUGIN_URL, $custom_user_skin_url, ), '', get_bk_option( 'booking_timeslot_picker_skin' ) );
258 }
259
260 return $time_picker_skin_path;
261 }
262