| @@ -1,4 +1,4 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | 3 | * Hybrid++ Bootstrap: collect packs, localize schemas, print pack templates. |
| 4 | 4 | * |
| @@ -120,12 +120,63 @@ | ||
| 120 | 120 | wp_enqueue_script( 'wpbc-bfb_modal__apply_template', wpbc_plugin_url( '/includes/page-form-builder/admin-page-tpl/_out/modal__form_apply_template.js' ), array( 'wpbc-bfb_builder', 'wpbc-bfb_modal__form_templates' ), WP_BK_VERSION_NUM, $in_footer ); |
| 121 | 121 | |
| 122 | 122 | // Form Settings. |
| 123 | 123 | // // FixIn: 2026-01-24 wp_enqueue_script( 'wpbc-bfb-so', wpbc_plugin_url( '/includes/page-form-builder/settings-options/_out/bfb-so.js' ), array( 'jquery', 'wp-util', 'wpbc-save-load-option' ), WP_BK_VERSION_NUM, $in_footer ); |
| 124 | - wp_enqueue_script( 'wpbc-bfb-form_settings', wpbc_plugin_url( '/includes/page-form-builder/form-settings/_out/settings.js' ), array( 'jquery', 'wp-util', 'wpbc-save-load-option' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 125 | - wp_enqueue_script( 'wpbc-bfb-global_save_behavior', wpbc_plugin_url( '/includes/page-form-builder/form-settings/_out/global_save_behavior.js' ), array( 'wpbc-bfb-form_settings' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 126 | - wp_enqueue_script( 'wpbc-bfb-form_settings_effects', wpbc_plugin_url( '/includes/page-form-builder/form-settings/_out/settings_effects.js' ), array( 'wpbc-bfb-form_settings' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 127 | - // wp_localize_script( 'wpbc-bfb-form_settings', 'wpbc_bfb_settings_vars', array( 'plugin_url' => wpbc_plugin_url( '' ), ) ); | |
| 124 | + wp_enqueue_script( 'wpbc-bfb-form_settings', wpbc_plugin_url( '/includes/page-form-builder/form-settings/_out/settings.js' ), array( 'jquery', 'wp-util', 'wpbc-save-load-option', 'coloris' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 125 | + wp_enqueue_script( 'wpbc-bfb-global_save_behavior', wpbc_plugin_url( '/includes/page-form-builder/form-settings/_out/global_save_behavior.js' ), array( 'wpbc-bfb-form_settings' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 126 | + wp_enqueue_script( 'wpbc-bfb-form_settings_effects', wpbc_plugin_url( '/includes/page-form-builder/form-settings/_out/settings_effects.js' ), array( 'wpbc-bfb-form_settings' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 127 | + $wpbc_bfb_form_style = wpbc_bfb_settings__get_current_form_style(); | |
| 128 | + $wpbc_bfb_form_style_preset = wpbc_bfb_settings__get_form_style_preset( $wpbc_bfb_form_style ); | |
| 129 | + $wpbc_bfb_custom_form_style = wpbc_bfb_settings__get_custom_form_style_options(); | |
| 130 | + $wpbc_bfb_form_accent = wpbc_bfb_settings__get_form_accent_options(); | |
| 131 | + $wpbc_bfb_style_options = array_merge( $wpbc_bfb_custom_form_style, $wpbc_bfb_form_accent ); | |
| 132 | + $wpbc_bfb_form_style_vars = wpbc_bfb_settings__get_form_style_css_vars( $wpbc_bfb_form_style, $wpbc_bfb_style_options ); | |
| 133 | + $wpbc_bfb_container_style = isset( $wpbc_bfb_form_style_preset['container_style'] ) ? (string) $wpbc_bfb_form_style_preset['container_style'] : 'bordered'; | |
| 134 | + $wpbc_bfb_theme_class = isset( $wpbc_bfb_form_style_preset['theme_class'] ) ? (string) $wpbc_bfb_form_style_preset['theme_class'] : ''; | |
| 135 | + $wpbc_bfb_legacy_appearance = array( | |
| 136 | + 'booking_form_theme' => $wpbc_bfb_theme_class, | |
| 137 | + 'booking_form_container_style' => $wpbc_bfb_container_style, | |
| 138 | + 'booking_form_background_color' => isset( $wpbc_bfb_form_style_vars['--wpbc-bfb-form-background'] ) ? $wpbc_bfb_form_style_vars['--wpbc-bfb-form-background'] : '#ffffff', | |
| 139 | + 'booking_form_border_color' => isset( $wpbc_bfb_form_style_vars['--wpbc-bfb-form-border-color'] ) ? $wpbc_bfb_form_style_vars['--wpbc-bfb-form-border-color'] : '#cccccc', | |
| 140 | + 'booking_form_border_width' => isset( $wpbc_bfb_form_style_vars['--wpbc-bfb-form-border-width'] ) ? $wpbc_bfb_form_style_vars['--wpbc-bfb-form-border-width'] : '1px', | |
| 141 | + 'booking_form_border_radius' => isset( $wpbc_bfb_form_style_vars['--wpbc-bfb-form-border-radius'] ) ? $wpbc_bfb_form_style_vars['--wpbc-bfb-form-border-radius'] : '2px', | |
| 142 | + 'booking_form_padding' => isset( $wpbc_bfb_form_style_vars['--wpbc-bfb-form-padding'] ) ? $wpbc_bfb_form_style_vars['--wpbc-bfb-form-padding'] : '10px 30px', | |
| 143 | + 'booking_form_text_color' => isset( $wpbc_bfb_form_style_vars['--wpbc_form-label-color'] ) ? $wpbc_bfb_form_style_vars['--wpbc_form-label-color'] : '', | |
| 144 | + 'booking_form_field_background_color' => isset( $wpbc_bfb_form_style_vars['--wpbc_form-field-background-color'] ) ? $wpbc_bfb_form_style_vars['--wpbc_form-field-background-color'] : '', | |
| 145 | + 'booking_form_field_text_color' => isset( $wpbc_bfb_form_style_vars['--wpbc_form-field-text-color'] ) ? $wpbc_bfb_form_style_vars['--wpbc_form-field-text-color'] : '', | |
| 146 | + 'booking_form_field_border_color' => isset( $wpbc_bfb_form_style_vars['--wpbc_form-field-border-color'] ) ? $wpbc_bfb_form_style_vars['--wpbc_form-field-border-color'] : '', | |
| 147 | + ); | |
| 148 | + wp_localize_script( | |
| 149 | + 'wpbc-bfb-form_settings', | |
| 150 | + 'wpbc_bfb_settings_vars', | |
| 151 | + array( | |
| 152 | + 'global_form_style' => array_merge( | |
| 153 | + array( | |
| 154 | + 'booking_form_style' => $wpbc_bfb_form_style, | |
| 155 | + 'theme_class' => $wpbc_bfb_theme_class, | |
| 156 | + 'container_style' => $wpbc_bfb_container_style, | |
| 157 | + 'css_vars' => $wpbc_bfb_form_style_vars, | |
| 158 | + ), | |
| 159 | + $wpbc_bfb_style_options | |
| 160 | + ), | |
| 161 | + 'form_style_options' => wpbc_bfb_settings__get_form_style_options(), | |
| 162 | + 'form_style_presets' => wpbc_bfb_settings__get_form_style_presets(), | |
| 163 | + 'form_style_css_var_names' => wpbc_bfb_settings__get_form_style_css_var_names(), | |
| 164 | + 'form_style_option_keys' => wpbc_bfb_settings__get_form_json_style_option_keys(), | |
| 165 | + 'custom_form_style_defaults' => wpbc_bfb_settings__get_default_custom_form_style_options(), | |
| 166 | + 'form_accent_defaults' => wpbc_bfb_settings__get_default_form_accent_options(), | |
| 167 | + 'global_appearance' => $wpbc_bfb_legacy_appearance, | |
| 168 | + 'i18n' => array( | |
| 169 | + 'accent_enable_first' => __( 'Enable Custom accent color first.', 'booking' ), | |
| 170 | + 'accent_applied_one' => __( 'Accent applied to one form element. Save Form to keep the change.', 'booking' ), | |
| 171 | + 'accent_applied_many' => __( 'Accent applied to %d form elements. Save Form to keep the changes.', 'booking' ), | |
| 172 | + 'accent_already_applied' => __( 'All supported form elements already have the current accent color.', 'booking' ), | |
| 173 | + 'accent_no_elements' => __( 'No accent-capable form elements were found.', 'booking' ), | |
| 174 | + 'accent_applied_announcement' => __( 'Form accent applied.', 'booking' ), | |
| 175 | + 'accent_time_picker_automatic' => __( 'Time slots now use Automatic — Match Booking Form.', 'booking' ), | |
| 176 | + ), | |
| 177 | + ) | |
| 178 | + ); | |
| 128 | 179 | |
| 129 | 180 | // Form Details. |
| 130 | 181 | wp_enqueue_script( 'wpbc-bfb-form_details_ui', wpbc_plugin_url( '/includes/page-form-builder/form-details/_out/current-form-details-ui.js' ), array( 'wpbc-bfb-form_settings' ), WP_BK_VERSION_NUM, $in_footer ); |
| 131 | 182 | wp_enqueue_script( 'wpbc-bfb-form_details_save_delete', wpbc_plugin_url( '/includes/page-form-builder/form-details/_out/current-form-details-save_delete.js' ), array( 'wpbc-bfb-form_settings' ), WP_BK_VERSION_NUM, $in_footer ); |
| @@ -138,11 +189,10 @@ | ||
| 138 | 189 | wp_enqueue_script( 'wpbc-bfb_save_load_ajax', wpbc_plugin_url( '/includes/page-form-builder/ajax/_out/bfb-ajax.js' ), array( 'wpbc-bfb_builder' ), WP_BK_VERSION_NUM, $in_footer ); |
| 139 | 190 | |
| 140 | 191 | // --- Exporter --- |
| 141 | 192 | wp_enqueue_script( 'wpbc-bfb_exporter', wpbc_plugin_url( '/includes/page-form-builder/_out/export/builder-exporter.js' ), array( 'wpbc-bfb_builder' ), WP_BK_VERSION_NUM, $in_footer ); |
| 142 | - if ( WPBC_BFB_DEBUG ) { | |
| 143 | - wp_enqueue_script( 'wpbc-bfb_debug_ui', wpbc_plugin_url( '/includes/page-form-builder/_out/export/debug-ui.js' ), array( 'wpbc-bfb_exporter' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 144 | - } | |
| 193 | + wp_enqueue_script( 'wpbc-bfb_debug_ui', wpbc_plugin_url( '/includes/page-form-builder/_out/export/debug-ui.js' ), array( 'wpbc-bfb_exporter' ), WP_BK_VERSION_NUM, $in_footer ); | |
| 194 | + | |
| 145 | 195 | |
| 146 | 196 | |
| 147 | 197 | // -- Templates (optional tools) -- |
| 148 | 198 | wp_enqueue_script( 'wpbc-bfb_form_templates', wpbc_plugin_url( '/includes/page-form-builder/_out/form_templates.js' ), array( 'wpbc-bfb_builder' ), WP_BK_VERSION_NUM, $in_footer ); |