PluginProbe
Booking Calendar / 10.11
Booking Calendar v10.11
11.8.4 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 All 204 releases
booking / includes / ui_modal__shortcodes / sh_tpl_booking_select.php

sh_tpl_booking_select.php in Booking Calendar 10.11, at includes/ui_modal__shortcodes/sh_tpl_booking_select.php

423 lines 17.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @version 1.0
4 * @package Booking Calendar Shortcodes Config
5 * @subpackage Shortcodes Content
6 * @category Shortcodes
7 *
8 * @author wpdevelop
9 * @link https://wpbookingcalendar.com/
10 * @email info@wpbookingcalendar.com
11 *
12 * @modified 2024-02-17
13 */
14
15 if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly // FixIn: 9.9.0.15.
16
17 // =====================================================================================================================
18 // Shortcode [bookingselect ... ]
19 // =====================================================================================================================
20
21 /**
22 * Content of PopUp - for shortcode [booking ...]
23 *
24 * @return void
25 */
26 function wpbc_shortcode_config__content__bookingselect() {
27
28 $shortcode_name = 'bookingselect';
29
30 ?><div id="wpbc_sc_container__shortcode_<?php echo esc_attr( $shortcode_name ); ?>" class="wpbc_sc_container__shortcode wpbc_sc_container__shortcode_<?php echo esc_attr( $shortcode_name ); ?>"><?php
31
32 //--------------------------------------------------------------------------------------------------------------
33 // 'Upgrade to Pro' widget
34 //--------------------------------------------------------------------------------------------------------------
35 $upgrade_content_arr = wpbc_get_upgrade_widget( array(
36 'id' => 'widget_wpbc_dismiss__booking_select',
37 'dismiss_css_class' => '.wpbc_dismiss__booking_select',
38 'blured_in_versions' => array( 'free' ),
39 'feature_link' => array( 'title' => 'feature', 'relative_url' => 'overview/#booking-resources' ),
40 'upgrade_link' => array( 'title' => 'Upgrade to Pro', 'relative_url' => 'features/#bk_news_section' ),
41 'versions' => 'paid versions',
42 'css' => 'transform: translate(0) translateY(190px);'
43 ) );
44 // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
45 echo $upgrade_content_arr['content'];
46
47 //--------------------------------------------------------------------------------------------------------------
48 // Real Content
49 //--------------------------------------------------------------------------------------------------------------
50
51 ?><div class="wpbc_dismiss__booking_select <?php echo esc_attr( $upgrade_content_arr['maybe_blur_css_class'] ); ?>"><?php
52
53
54 wpbc_shortcode_config__bookingselect__top_tabs();
55
56 // 'General' --------------------------------------------------------------------------------------------------
57 ?><div class="wpbc_sc_container__shortcode_section wpbc_sc_container__shortcode_section__general"><?php
58
59 // Select 'Multiple' -- 'Booking Resource'
60 wpbc_shortcode_config_fields__select_multiple_resources( $shortcode_name . '_wpbc_multiple_resources', $shortcode_name );
61
62 ?>
63 <table class="form-table"><tbody><?php
64
65 // Select 'SELECTED' by default 'Booking Resource'
66 wpbc_shortcode_config_fields__select_selected_resource( $shortcode_name . '_wpbc_selected_resource', $shortcode_name );
67
68 // Label
69 wpbc_shortcode_config_fields__text_label( $shortcode_name . '_wpbc_text_label', $shortcode_name );
70
71 // Title
72 wpbc_shortcode_config_fields__text_first_option_title( $shortcode_name . '_wpbc_first_option_title', $shortcode_name );
73
74 ?></tbody></table>
75 </div><?php
76
77
78 // 'Options' --------------------------------------------------------------------------------------------------
79 ?><div class="wpbc_sc_container__shortcode_section wpbc_sc_container__shortcode_section__options">
80 <table class="form-table"><tbody><?php
81
82 // Custom form
83 wpbc_shortcode_config_fields__select_custom_form( $shortcode_name . '_wpbc_custom_form', $shortcode_name );
84
85 if ( class_exists( 'wpdev_bk_biz_m' ) ){
86 ?>
87 <tr><td></td><td>
88 <div class="wpbc-settings-notice notice-warning">
89 <span><?php
90 /* translators: 1: ... */
91 echo wp_kses_post( sprintf( __( 'If you choose the %s form, the system will load either the standard form or the default custom booking form (configured on the Resources page). Alternatively, selecting a specific custom booking form here will ensure that all booking resources use only the form you have chosen.', 'booking' ),
92 '<strong>\'Standard\'</strong>' ) ); ?></span>
93 </div>
94 </td></tr>
95 <?php
96 }
97
98 // Number of Months
99 wpbc_shortcode_config_fields__select_nummonths( $shortcode_name . '_wpbc_nummonths', $shortcode_name );
100
101 // Calendar Size
102 wpbc_shortcode_config_fields__calendar_size( $shortcode_name . '_wpbc_size', $shortcode_name );
103
104 ?></tbody></table>
105 </div><?php
106
107 // 'Conditional Days Selection' --------------------------------------------------------------------------------
108 ?><div class="wpbc_sc_container__shortcode_section wpbc_sc_container__shortcode_section__conditions"><?php
109
110 wpbc_shortcode_config_fields__dates_conditions_toolbar(); // TOOLBAR
111
112 ?><div class="wpbc_sc_container__shortcode_subsection wpbc_sc_container__shortcode_subsection__weekdays_conditions">
113 <?php
114 wpbc_shortcode_config_fields__weekdays_conditions( $shortcode_name . 'wpbc_select_day_weekday', $shortcode_name );
115 ?>
116 </div><?php
117
118 ?><div class="wpbc_sc_container__shortcode_subsection wpbc_sc_container__shortcode_subsection__seasons_conditions">
119 <?php
120 wpbc_shortcode_config_fields__season_conditions( $shortcode_name . 'wpbc_select_day_season', $shortcode_name );
121 ?>
122 </div><?php
123
124 ?><div class="wpbc_sc_container__shortcode_subsection wpbc_sc_container__shortcode_subsection__startseason_conditions">
125 <?php
126 wpbc_shortcode_config_fields__season_start_day_conditions( $shortcode_name . 'wpbc_start_day_season', $shortcode_name )
127 ?>
128 </div><?php
129
130 ?><div class="wpbc_sc_container__shortcode_subsection wpbc_sc_container__shortcode_subsection__dates_conditions">
131 <?php
132 wpbc_shortcode_config_fields__fordate_conditions( $shortcode_name . 'wpbc_select_day_fordate', $shortcode_name );
133 ?>
134 </div><?php
135
136 ?></div><?php
137
138 // 'AGGREGATE' -------------------------------------------------------------------------------------------------
139 ?><div class="wpbc_sc_container__shortcode_section wpbc_sc_container__shortcode_section__aggregate"><?php
140
141 wpbc_shortcode_config_fields__aggregate( $shortcode_name . '_wpbc_aggregate', $shortcode_name );
142
143 ?></div><?php
144
145 // 'START MONTH' -----------------------------------------------------------------------------------------------
146 ?><div class="wpbc_sc_container__shortcode_section wpbc_sc_container__shortcode_section__other"><?php
147 ?><table class="form-table"><tbody><?php
148 wpbc_shortcode_config_fields__start_month( $shortcode_name . '_wpbc_startmonth', $shortcode_name );
149 ?></tbody></table><?php
150 ?></div><?php
151
152
153
154 ?>
155 <div class="wpbc_shortcode_config_content_toolbar__next_prior">
156 <a href="javascript:void(0)" onclick="javascript:wpbc_shortcode_config_content_toolbar__next_prior(this,'prior');" class="button">
157 <span class="in-button-text">&lsaquo;</span>
158 </a>
159 <a href="javascript:void(0)" onclick="javascript:wpbc_shortcode_config_content_toolbar__next_prior(this,'next');" class="button">
160 <span class="in-button-text">&rsaquo;</span>
161 </a>
162 </div>
163 <?php
164
165 ?></div><?php
166 ?></div><?php
167
168 wpbc_clear_div();
169 }
170
171
172
173 /**
174 * Top Tabs for shortcode [booking ...]
175 * @return void
176 */
177 function wpbc_shortcode_config__bookingselect__top_tabs(){
178
179 $shortcode_name = 'bookingselect';
180
181 wpbc_bs_toolbar_tabs_html_container_start();
182
183 $js = "jQuery(this).parents( '.wpbc_sc_container__shortcode' ).find( '.nav-tab' ).removeClass('nav-tab-active');"
184 . "jQuery(this).addClass('nav-tab-active');"
185 . "jQuery('.nav-tab i.icon-white').removeClass('icon-white');"
186 . "jQuery('.nav-tab-active i').addClass('icon-white');"
187 . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section').hide();";
188
189 wpbc_bs_display_tab( array(
190 'title' => __('Resource Selection', 'booking')
191 , 'text_css' => 'line-height: 18px;vertical-align: text-top;'
192 // , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
193 , 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__general').show();"
194 , 'font_icon' => 'wpbc-bi-border-width NOwpbc-bi-card-checklist'
195 , 'default' => true
196 ) );
197 wpbc_bs_display_tab( array(
198 'title' => __('View Options', 'booking')
199 // , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
200 , 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__options').show();"
201 , 'font_icon' => 'wpbc_icn_adjust'
202 , 'default' => false
203 ) );
204 wpbc_bs_display_tab( array(
205 'title' => __('Conditional Days Selection', 'booking')
206 // , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
207 , 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__conditions').show();"
208 , 'font_icon' => 'wpbc-bi-calendar2-week'
209 , 'default' => false
210 , 'css_classes' => 'wpbc_dismiss__conditional_days'
211
212 ) );
213 wpbc_bs_display_tab( array(
214 'title' => __('Aggregate', 'booking')
215 // , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
216 , 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__aggregate').show();"
217 , 'font_icon' => 'wpbc-bi-calendar2-plus'
218 , 'default' => false
219 , 'css_classes' => 'wpbc_dismiss__booking_param_aggregate'
220 ) );
221 wpbc_bs_display_tab( array(
222 'title' => __('Advanced', 'booking')
223 // , 'hint' => array( 'title' => __('Manage bookings' ,'booking') , 'position' => 'top' )
224 , 'onclick' => $js . "jQuery('.wpbc_sc_container__shortcode_" . $shortcode_name . " .wpbc_sc_container__shortcode_section__other').show();"
225 , 'font_icon' => 'wpbc_icn_tune'
226 , 'default' => false
227
228 ) );
229
230 wpbc_bs_toolbar_tabs_html_container_end();
231 }
232
233
234
235 /**
236 * Shortcode Field: Select-box - "Booking Resource"
237 *
238 * @param $id
239 * @param $group_key
240 *
241 * @return void
242 */
243 function wpbc_shortcode_config_fields__select_selected_resource( $id , $group_key ){
244
245 $resources_list = array();
246
247 if ( class_exists( 'wpdev_bk_personal' ) ){
248
249 $resources_list_orig = wpbc_get_all_booking_resources_list();
250
251 $resources_list[0] = array( 'title' => ' - '.__('None', 'booking' ).' - ', 'attr' => array ( 'class' => 'wpbc_single_resource', 'style' => 'border-bottom:1px dashed #ddd;') );
252 foreach ($resources_list_orig as $res_id => $res_val) {
253 $resources_list[$res_id] = $res_val;
254 }
255
256 }
257 WPBC_Settings_API::field_select_row_static( $id
258 , array(
259 'type' => 'select'
260 , 'title' => __( 'Preselected resource', 'booking')
261 , 'description' => __( 'Choose the initially selected booking resource.', 'booking' )
262 , 'description_tag' => 'span'
263 , 'label' => ''
264 , 'multiple' => false
265 , 'group' => $group_key
266 , 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed'
267 , 'class' => ''
268 , 'css' => 'margin-right:10px;min-width:15em;'
269 , 'only_field' => false
270 , 'attr' => array()
271 , 'value' => ''
272 , 'options' => $resources_list
273 ) );
274
275 }
276
277 /**
278 * Shortcode Fields: AGGREGATE
279 *
280 * @param $id
281 * @param $group_key
282 *
283 * @return void
284 */
285 function wpbc_shortcode_config_fields__select_multiple_resources( $id , $group_key ){
286
287 if ( class_exists( 'wpdev_bk_personal' ) ){
288 $resources_list_orig = wpbc_get_all_booking_resources_list();
289 $resources_list = array();
290 $resources_list[0] = array( 'title' => __('All', 'booking' ), 'attr' => array ( 'class' => 'wpbc_single_resource', 'style' => 'border-bottom:1px dashed #ddd;') );
291 foreach ($resources_list_orig as $res_id => $res_val) {
292 $resources_list[$res_id] = $res_val;
293 }
294
295 ?>
296 <div class="clear"></div>
297 <div class="wpbc-settings-notice0 notice-info notice-header" style="font-size: 15px;font-weight: 600;margin: 15px 0 15px 15px;">
298 <label for="<?php echo esc_attr($id); ?>"><?php esc_html_e( 'Set Up Booking Resource(s)', 'booking' ); ?></label>
299 </div>
300
301 <div class="wpbc_shortcode_config__rules_container">
302 <div class="wpbc_shortcode_config__rules__params_section wpbc_aggregate">
303
304 <div class="wpbc_ajx_toolbar wpbc_no_background wpbc_buttons_row">
305 <div class="ui_container ui_container_mini">
306 <div class="ui_group">
307 <div class="ui_element wpdevelop"><?php
308
309 WPBC_Settings_API::field_select_row_static( $id //. '__aggregate'
310 , array(
311 'type' => 'select'
312 , 'title' => ''//__('Aggregate booking dates from other resources', 'booking')
313 , 'description' => ''//__( 'Select booking resources, for getting booking dates from them and set such dates as unavailable in destination calendar.', 'booking' )
314 , 'description_tag' => 'span'
315 , 'label' => ''
316 , 'multiple' => true
317 , 'group' => $group_key
318 , 'tr_class' => ''//$group_key . '_advanced_section'
319 , 'class' => 'wpbc_ui_control wpbc_ui_select'
320 , 'css' => 'margin-right:10px;height:12em;'
321 , 'only_field' => true
322 , 'attr' => array()
323 , 'value' => '0'
324 , 'options' => $resources_list
325 )
326 );
327 ?></div>
328 </div>
329 </div>
330 </div>
331 </div>
332 <div class="wpbc_shortcode_config__rules__help_section" style="margin-top: 8px;">
333 <div class="wpbc-settings-notice notice-info notice-list">
334 <ol>
335 <li> <?php esc_html_e( 'Configure the shortcode to show Timeline.', 'booking' ); ?>
336 </li>
337 <li>
338 <?php echo esc_html__( 'To set this up, choose all or multiple booking resources in the multi-select box.', 'booking' )
339 . '<br>'
340 . esc_html__( 'Hold down the Ctrl button to make multiple selections.', 'booking' );
341 ?>
342 </li>
343 <li>
344 <?php
345 /* translators: 1: ... */
346 echo wp_kses_post( sprintf( __( 'Refer to the FAQ for detailed information on %1$sshortcode configuration%2$s.', 'booking' )
347 , '<a href="https://wpbookingcalendar.com/faq/shortcode-timeline/" target="_blank">', '</a>'
348 ) );
349 ?>
350 </li>
351 </ol>
352 </div>
353 </div>
354 </div><?php
355
356 }
357 }
358
359 /**
360 * Shortcode Field: Label - text of label for the select box.
361 *
362 * @param $id
363 * @param $group_key
364 *
365 * @return void
366 */
367 function wpbc_shortcode_config_fields__text_label($id , $group_key ){
368
369 WPBC_Settings_API::field_text_row_static( $id
370 , array(
371 'type' => 'text'
372 , 'placeholder' => __( 'Example', 'booking' ). ': ' .__( 'Please select the resource:', 'booking' )
373 , 'title' => __('Label', 'booking')
374 , 'description' => __('The title displayed next to your select box.', 'booking')
375 , 'description_tag' => 'span'
376 , 'label' => ''
377 , 'class' => ''
378 , 'css' => 'width0:5em;'
379 , 'tr_class' => ''
380
381 , 'group' => $group_key
382 , 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed'
383 , 'only_field' => false
384 , 'attr' => array()
385 , 'value' => ''
386 )
387 );
388
389 }
390
391
392 /**
393 * Shortcode Field: Label - text of label for the select box.
394 *
395 * @param $id
396 * @param $group_key
397 *
398 * @return void
399 */
400 function wpbc_shortcode_config_fields__text_first_option_title($id , $group_key ){
401
402 WPBC_Settings_API::field_text_row_static( $id
403 , array(
404 'type' => 'text'
405 , 'placeholder' => __( 'Example', 'booking' ). ': ' . __( 'Please select', 'booking' )
406 , 'title' => __('Title for first option', 'booking')
407 , 'description' => __('The first option in the dropdown list.' ,'booking') . ' <span>' . esc_html__('Please leave it empty if you want to skip it.' ,'booking') . '</span>'
408
409 , 'description_tag' => 'span'
410 , 'label' => ''
411 , 'class' => ''
412 , 'css' => 'width0:5em;'
413 , 'tr_class' => ''
414
415 , 'group' => $group_key
416 , 'tr_class' => $group_key . '_standard_section wpbc_sub_settings_grayed'
417 , 'only_field' => false
418 , 'attr' => array()
419 , 'value' => ''
420 )
421 );
422
423 }