PluginProbe
Booking Calendar / 11.9.1
Booking Calendar v11.9.1
11.9.1 11.9 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 All 206 releases
booking / includes / booking_modes_v3 / modes / appointment.php

appointment.php in Booking Calendar 11.9.1, at includes/booking_modes_v3/modes/appointment.php

425 lines 15.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Appointment Booking Modes V3 declaration.
4 *
5 * This side-effect-free declaration contains presentation references only. It
6 * registers no hooks, loads no domain controller, and performs no mutation.
7 *
8 * @package Booking Calendar
9 * @since 11.8.0
10 */
11
12 if ( ! defined( 'ABSPATH' ) ) {
13 exit;
14 }
15
16 /**
17 * Return the Appointment mode definition consumed by the allow-listed V3 loader.
18 *
19 * @return array<string,mixed> Validated Booking Modes V3 declaration.
20 */
21 $wpbc_mode_definition = array(
22 'id' => 'appointment',
23 'label' => 'Appointments',
24 'description' => 'Appointment administration.',
25 'default_route' => array( 'page' => 'wpbc', 'tab' => 'vm_booking_listing' ),
26 'quickstart_id' => 'appointment',
27
28 // Only references used below; all other pages and subtabs keep their own definitions.
29 'pages' => array(
30 // Bookings. booking/includes/page-bookings/bookings__page.php:33.
31 'bookings' => array(
32 'route' => array( 'page' => 'wpbc', 'tab' => 'vm_booking_listing' ),
33 'page_options' => array(
34 'is_show_top_path' => true,
35 'top_path_title' => 'Appointments',
36 'is_show_top_navigation' => true,
37 ),
38 'horizontal_menu' => array(
39 'visible' => true,
40 'title' => 'Appointments',
41 'show_on_pages' => array( 'bookings', 'calendar', 'timeline', 'add_appointment' ),
42 ),
43 ),
44 // Timeline View. booking/core/admin/page-timeline.php:31.
45 // Horizontal-only link: hidden separately in sidebar_menu; no independent native slug.
46 'calendar' => array(
47 'route' => array( 'page' => 'wpbc', 'tab' => 'vm_calendar' ),
48 'page_options' => array(
49 'is_show_top_path' => true,
50 'top_path_title' => 'Calendar',
51 'is_show_top_navigation' => true,
52 ),
53 'horizontal_menu' => array(
54 'visible' => true,
55 'title' => 'Calendar',
56 'show_on_pages' => array( 'bookings', 'calendar', 'add_appointment' ),
57 ),
58 ),
59 // New isolated Timeline shell. The legacy Calendar route above remains unchanged.
60 'timeline' => array(
61 'route' => array( 'page' => 'wpbc', 'tab' => 'timeline' ),
62 'page_options' => array(
63 'is_show_top_path' => false,
64 'top_path_title' => 'Timeline',
65 'is_show_top_navigation' => true,
66 ),
67 'horizontal_menu' => array(
68 'visible' => true,
69 'title' => 'Timeline',
70 'show_on_pages' => array( 'timeline' ),
71 ),
72 ),
73 // Add booking. booking/includes/page-add-booking/add_booking__page.php:174.
74 'add_booking' => array(
75 'route' => array( 'page' => 'wpbc', 'tab' => 'add-booking' ),
76 'horizontal_menu' => array(
77 'visible' => false,
78 ),
79 ),
80 // Add Appointment. booking/includes/page-add-appointment/add_appointment__page.php:178.
81 'add_appointment' => array(
82 'route' => array( 'page' => 'wpbc', 'tab' => 'add-appointment' ),
83 'page_options' => array(
84 'is_show_top_path' => true,
85 'top_path_title' => 'Add Appointment',
86 'is_show_top_navigation' => true,
87 ),
88 'horizontal_menu' => array(
89 'visible' => true,
90 'title' => 'Add Appointment',
91 'show_on_pages' => array( 'bookings', 'calendar', 'timeline', 'add_appointment' ),
92 ),
93 ),
94 // Services. booking/includes/page-appointment-services/appointment_services__page.php:475.
95 'services' => array(
96 'route' => array( 'page' => 'wpbc-services', 'tab' => 'appointment_services' ),
97 ),
98 // Resources. booking/includes/page-catalog-booking-resources/booking-resources-catalog-page.php:504.
99 'resources' => array(
100 'route' => array( 'page' => 'wpbc-resources', 'tab' => 'resources' ),
101 'page_options' => array(
102 'top_path_title' => 'Providers',
103 ),
104 ),
105 // Capacity Rules. booking/includes/page-resource-capacity/page-resource-capacity.php:209.
106 'capacity_rules' => array(
107 'route' => array( 'page' => 'wpbc-resources', 'tab' => 'capacity' ),
108 ),
109 // Search Availability. booking-calendar-com/inc/_bl/search/page-searchable.php:52.
110 'searchable_resources' => array(
111 'route' => array( 'page' => 'wpbc-resources', 'tab' => 'searchable_resources' ),
112 'page_options' => array(
113 'top_path_title' => 'Searchable Providers',
114 ),
115 ),
116 // Searchable Resources leaf used by the flattened Search Availability sidebar group.
117 'searchable_resources_options' => array(
118 'route' => array( 'page' => 'wpbc-resources', 'tab' => 'searchable_resources', 'subtab' => 'searchable_resources_options' ),
119 ),
120 // Block Dates. booking/includes/page-availability/availability__page.php:37.
121 'block_dates' => array(
122 'route' => array( 'page' => 'wpbc-availability', 'tab' => 'availability' ),
123 ),
124 // Block Times. booking/includes/page-availability-timeslots/availability_timeslots__page.php:525.
125 'block_times' => array(
126 'route' => array( 'page' => 'wpbc-availability', 'tab' => 'time_slots_availability' ),
127 ),
128 // Schedule & Rules. booking/includes/page-availability/availability__page.php:424.
129 'schedule_rules' => array(
130 'route' => array( 'page' => 'wpbc-availability', 'tab' => 'general_availability' ),
131 ),
132 // Seasonal Availability. booking-calendar-com/inc/_bm/admin/page-availability.php:49.
133 'seasonal_availability' => array(
134 'route' => array( 'page' => 'wpbc-availability', 'tab' => 'season_availability' ),
135 ),
136 // Seasons. booking-calendar-com/inc/_bm/admin/page-seasons.php:61.
137 // Legacy route: use only while its existing controller registers this tab.
138 'legacy_availability_seasons' => array(
139 'route' => array( 'page' => 'wpbc-availability', 'tab' => 'filter' ),
140 ),
141 // Prices. booking-calendar-com/inc/_bm/admin/page-costs_flexible.php:58.
142 'prices' => array(
143 'route' => array( 'page' => 'wpbc-prices', 'tab' => 'cost' ),
144 ),
145 // Form Options Costs. booking-calendar-com/inc/_bm/admin/page-cost-advanced.php:38.
146 'form_options_costs' => array(
147 'route' => array( 'page' => 'wpbc-prices', 'tab' => 'cost_advanced' ),
148 ),
149 // Discount Coupons. booking-calendar-com/inc/_bl/admin/page-coupons.php:40.
150 'coupons' => array(
151 'route' => array( 'page' => 'wpbc-prices', 'tab' => 'coupons' ),
152 ),
153 // Payment Setup. booking-calendar-com/inc/gateways/page-gateways.php:572.
154 'payment_setup' => array(
155 'route' => array( 'page' => 'wpbc-prices', 'tab' => 'payment' ),
156 ),
157 // Payment Description is an in-page anchor, not a standalone administration screen.
158 'payment_description' => array(
159 'route' => array( 'page' => 'wpbc-prices', 'tab' => 'payment', 'subtab' => 'payment_description' ),
160 ),
161 // Seasons. booking-calendar-com/inc/_bm/admin/page-seasons.php:61.
162 // Legacy route: use only while its existing controller registers this tab.
163 'legacy_price_seasons' => array(
164 'route' => array( 'page' => 'wpbc-prices', 'tab' => 'filter' ),
165 ),
166 // Seasons. booking-calendar-com/inc/_bm/includes/page-catalog-seasons/seasons-catalog-page.php:703.
167 'seasons' => array(
168 'route' => array( 'page' => 'wpbc-seasons', 'tab' => 'seasons' ),
169 ),
170 // Dashboard. booking/core/admin/page-settings.php:103.
171 'general_settings' => array(
172 'route' => array( 'page' => 'wpbc-settings', 'tab' => 'general' ),
173 ),
174 // Search Availability form and results settings.
175 'search_settings' => array(
176 'route' => array( 'page' => 'wpbc-settings', 'tab' => 'search' ),
177 ),
178 'search_form_layout' => array(
179 'route' => array( 'page' => 'wpbc-settings', 'tab' => 'search', 'subtab' => 'search_form' ),
180 ),
181 'search_results_layout' => array(
182 'route' => array( 'page' => 'wpbc-settings', 'tab' => 'search', 'subtab' => 'search_results' ),
183 ),
184 'search_options' => array(
185 'route' => array( 'page' => 'wpbc-settings', 'tab' => 'search', 'subtab' => 'search_options' ),
186 ),
187 // Forms Builder. booking/includes/page-form-builder/builder-form-page.php:52.
188 // Promoted to a standalone sidebar link. The original Settings route stays unchanged.
189 'booking_form' => array(
190 'route' => array( 'page' => 'wpbc-settings', 'tab' => 'builder_booking_form' ),
191 ),
192 // MultiUser settings. The source controller remains responsible for super-admin access.
193 'multiuser_settings' => array(
194 'route' => array( 'page' => 'wpbc-settings', 'tab' => 'users' ),
195 ),
196 // Production Setup Wizard.
197 'setup' => array(
198 'route' => array( 'page' => 'wpbc-setup' ),
199 ),
200 // Log Off. booking-calendar-com/inc/_mu/admin/page-log_off.php:31.
201 // MultiUser impersonation exit. Preserve domain behavior; never preload this route.
202 'log_off' => array(
203 'route' => array( 'page' => 'wpbc-log-off', 'tab' => 'upgrade' ),
204 ),
205 ),
206
207 // Native WordPress entries. editions is an exact list; omission retains domain availability.
208 'wordpress_menu' => array(
209 'wpbc' => array(
210 'page_id' => 'bookings',
211 'title' => 'Appointments',
212 ),
213 'wpbc-new' => array(
214 'page_id' => 'add_appointment',
215 'title' => '+ Add Appointment',
216 ),
217 'wpbc-services' => array( 'page_id' => 'services' ),
218 'wpbc-resources' => array(
219 'page_id' => 'resources',
220 'title' => 'Providers',
221 ),
222 'wpbc-availability' => array( 'page_id' => 'block_dates' ),
223 'wpbc-seasons' => array(
224 'page_id' => 'seasons',
225 'editions' => array( 'business_medium', 'business_large', 'multiuser' ),
226 ),
227 'wpbc-prices' => array(
228 'page_id' => 'prices',
229 'title' => 'Pricing & Payments',
230 'editions' => array( 'business_medium', 'business_large', 'multiuser' ),
231 ),
232 'wpbc-settings' => array( 'page_id' => 'general_settings' ),
233 'wpbc-setup' => array( 'page_id' => 'setup' ),
234 'wpbc-log-off' => array(
235 'page_id' => 'log_off',
236 'editions' => array( 'multiuser' ),
237 ),
238 ),
239
240 // White WPBC sidebar. Unlisted tabs inherit; edition-excluded entries never return via fallback.
241 'sidebar_menu' => array(
242 'wpbc' => array(
243 'title' => 'Appointments',
244 'items' => array(
245 'bookings' => array(
246 'page_id' => 'bookings',
247 'title' => 'Appointments',
248 ),
249 'calendar' => array(
250 'page_id' => 'calendar',
251 'title' => 'Calendar',
252 'visible' => false,
253 ),
254 'add_appointment' => array(
255 'page_id' => 'add_appointment',
256 'title' => 'Add Appointment',
257 ),
258 'add_booking' => array(
259 'page_id' => 'add_booking',
260 'title' => 'Add Booking',
261 'visible' => false,
262 ),
263 ),
264 ),
265 'wpbc-services' => array(
266 'title' => 'Services',
267 'items' => array(
268 'services' => array(
269 'page_id' => 'services',
270 'title' => 'Services',
271 ),
272 ),
273 ),
274 'wpbc-resources' => array(
275 'title' => 'Providers',
276 'items' => array(
277 'resources' => array(
278 'page_id' => 'resources',
279 'title' => 'Providers',
280 ),
281 ),
282 ),
283 'wpbc-availability' => array(
284 'title' => 'Availability',
285 'items' => array(
286 'block_times' => array(
287 'page_id' => 'block_times',
288 'title' => 'Block Times',
289 ),
290 'schedule_rules' => array(
291 'page_id' => 'schedule_rules',
292 'title' => 'Schedule & Rules',
293 ),
294 'block_dates' => array(
295 'page_id' => 'block_dates',
296 'title' => 'Block Dates',
297 ),
298 'seasonal_availability' => array(
299 'page_id' => 'seasonal_availability',
300 'title' => 'Seasonal Availability',
301 'editions' => array( 'business_medium', 'business_large', 'multiuser' ),
302 ),
303 'legacy_availability_seasons' => array(
304 'page_id' => 'legacy_availability_seasons',
305 'editions' => array( 'business_medium', 'business_large', 'multiuser' ),
306 ),
307 ),
308 ),
309 'wpbc-seasons' => array(
310 'title' => 'Seasons',
311 'page_id' => 'seasons',
312 'editions' => array( 'business_medium', 'business_large', 'multiuser' ),
313 ),
314 'wpbc-prices' => array(
315 'title' => 'Pricing & Payments',
316 'items' => array(
317 'prices' => array(
318 'page_id' => 'prices',
319 'title' => 'Prices',
320 ),
321 'form_options_costs' => array(
322 'page_id' => 'form_options_costs',
323 'title' => 'Pricing Rules',
324 ),
325 'coupons' => array(
326 'page_id' => 'coupons',
327 'editions' => array( 'business_large', 'multiuser' ),
328 ),
329 'legacy_price_seasons' => array( 'page_id' => 'legacy_price_seasons' ),
330 'payment' => array(
331 'page_id' => 'payment_setup',
332 'items' => array(
333 'payment_description' => array(
334 'page_id' => 'payment_description',
335 'visible' => false,
336 ),
337 ),
338 ),
339 ),
340 'editions' => array( 'business_medium', 'business_large', 'multiuser' ),
341 ),
342 'booking_form' => array(
343 'page_id' => 'booking_form',
344 'title' => 'Booking Forms',
345 ),
346 'wpbc-settings' => array(
347 'title' => 'Settings',
348 'expanded' => 'when_active',
349 'items' => array(
350 'capacity_rules' => array( 'page_id' => 'capacity_rules' ),
351 ),
352 // Search Availability and MultiUser settings are explicitly reserved below; other Settings pages inherit.
353 ),
354 'wpbc-search-availability' => array(
355 'title' => 'Search Availability',
356 'expanded' => 'when_active',
357 'items' => array(
358 'searchable_resources_parent' => array(
359 'page_id' => 'searchable_resources',
360 'visible' => false,
361 ),
362 'search_settings_parent' => array(
363 'page_id' => 'search_settings',
364 'visible' => false,
365 ),
366 'searchable_resources' => array(
367 'page_id' => 'searchable_resources_options',
368 'title' => 'Searchable Resources',
369 ),
370 'search_form_layout' => array(
371 'page_id' => 'search_form_layout',
372 'title' => 'Search Form Layout',
373 ),
374 'search_results_layout' => array(
375 'page_id' => 'search_results_layout',
376 'title' => 'Search Results Layout',
377 ),
378 'search_options' => array(
379 'page_id' => 'search_options',
380 'title' => 'Search Options',
381 ),
382 ),
383 'editions' => array( 'business_large', 'multiuser' ),
384 ),
385 'wpbc-multiuser-settings' => array(
386 'page_id' => 'multiuser_settings',
387 'title' => 'MultiUser Settings',
388 'expanded' => 'when_active',
389 'editions' => array( 'multiuser' ),
390 ),
391 'wpbc-setup' => array(
392 'title' => 'Setup',
393 'items' => array(
394 'setup' => array( 'page_id' => 'setup' ),
395 ),
396 'visible' => false,
397 ),
398 'log_off' => array(
399 'page_id' => 'log_off',
400 'visible' => false,
401 'editions' => array( 'multiuser' ),
402 ),
403 ),
404 );
405
406 if ( ! defined( 'WPBC_ENABLE_12_0_TIMELINE' ) || true !== WPBC_ENABLE_12_0_TIMELINE ) {
407 // Preserve the legacy Calendar page while pruning only the new Timeline host.
408 unset( $wpbc_mode_definition['pages']['timeline'] );
409
410 foreach ( $wpbc_mode_definition['pages'] as $page_id => $page_definition ) {
411 if (
412 empty( $page_definition['horizontal_menu']['show_on_pages'] )
413 || ! is_array( $page_definition['horizontal_menu']['show_on_pages'] )
414 ) {
415 continue;
416 }
417
418 $wpbc_mode_definition['pages'][ $page_id ]['horizontal_menu']['show_on_pages'] = array_values(
419 array_diff( $page_definition['horizontal_menu']['show_on_pages'], array( 'timeline' ) )
420 );
421 }
422 }
423
424 return $wpbc_mode_definition;
425